ITK
4.6.0
Insight Segmentation and Registration Toolkit
|
#include <itkSTLMeshIO.h>
This class defines how to read and write STL file format.
Definition at line 38 of file itkSTLMeshIO.h.
Classes | |
struct | PointCompare |
class | TripletType |
Public Member Functions | |
virtual bool | CanReadFile (const char *FileNameToRead) |
virtual bool | CanWriteFile (const char *FileNameToWrite) |
virtual ::itk::LightObject::Pointer | CreateAnother (void) const |
virtual const char * | GetNameOfClass () const |
virtual bool | GetUpdateCells () const |
virtual bool | GetUpdatePoints () const |
virtual void | Read () |
virtual void | ReadCells (void *buffer) |
virtual void | ReadMeshInformation () |
virtual void | ReadPoints (void *buffer) |
virtual void | Write () |
virtual void | WriteCells (void *buffer) |
virtual void | WriteMeshInformation () |
virtual void | WritePoints (void *buffer) |
virtual void | ReadPointData (void *) |
virtual void | ReadCellData (void *) |
virtual void | WritePointData (void *) |
virtual void | WriteCellData (void *) |
Public Member Functions inherited from itk::MeshIOBase | |
std::string | GetByteOrderAsString (ByteOrder) const |
unsigned int | GetComponentSize (IOComponentType componentType) const |
std::string | GetComponentTypeAsString (IOComponentType) const |
std::string | GetFileTypeAsString (FileType) const |
std::string | GetPixelTypeAsString (IOPixelType) const |
const ArrayOfExtensionsType & | GetSupportedReadExtensions () const |
const ArrayOfExtensionsType & | GetSupportedWriteExtensions () const |
void | SetByteOrderToBigEndian () |
void | SetByteOrderToLittleEndian () |
void | SetFileTypeToASCII () |
void | SetFileTypeToBinary () |
template<typename T > | |
void | SetPixelType (const T &, bool UsePointPixel=true) |
template<typename T > | |
void | SetPixelType (const RGBPixel< T > &, bool UsePointPixel=true) |
template<typename T > | |
void | SetPixelType (const RGBAPixel< T > &, bool UsePointPixel=true) |
template<typename T , unsigned int VLength> | |
void | SetPixelType (const Vector< T, VLength > &, bool UsePointPixel=true) |
template<typename T , unsigned int VLength> | |
void | SetPixelType (const CovariantVector< T, VLength > &, bool UsePointPixel=true) |
template<typename T , unsigned int VLength> | |
void | SetPixelType (const FixedArray< T, VLength > &, bool UsePointPixel=true) |
template<typename T , unsigned int VLength> | |
void | SetPixelType (const SymmetricSecondRankTensor< T, VLength >, bool UsePointPixel=true) |
template<typename T > | |
void | SetPixelType (const DiffusionTensor3D< T > &, bool UsePointPixel=true) |
template<typename T , unsigned int NR, unsigned int NC> | |
void | SetPixelType (const Matrix< T, NR, NC > &, bool UsePointPixel=true) |
template<typename T > | |
void | SetPixelType (const std::complex< T > &, bool UsePointPixel=true) |
template<typename T > | |
void | SetPixelType (const Array< T > &array, bool UsePointPixel=true) |
template<typename T > | |
void | SetPixelType (const VariableLengthVector< T > &vector, bool UsePointPixel=true) |
template<typename T > | |
void | SetPixelType (const VariableSizeMatrix< T > &matrix, bool UsePointPixel=true) |
virtual void | SetFileName (const char *_arg) |
virtual const char * | GetFileName () const |
virtual void | SetPointPixelType (const IOPixelType _arg) |
virtual IOPixelType | GetPointPixelType () const |
virtual void | SetCellPixelType (const IOPixelType _arg) |
virtual IOPixelType | GetCellPixelType () const |
virtual void | SetPointComponentType (const IOComponentType _arg) |
virtual IOComponentType | GetPointComponentType () const |
virtual void | SetCellComponentType (const IOComponentType _arg) |
virtual IOComponentType | GetCellComponentType () const |
virtual void | SetPointPixelComponentType (const IOComponentType _arg) |
virtual IOComponentType | GetPointPixelComponentType () const |
virtual void | SetCellPixelComponentType (const IOComponentType _arg) |
virtual IOComponentType | GetCellPixelComponentType () const |
virtual void | SetNumberOfPointPixelComponents (unsigned int _arg) |
virtual unsigned int | GetNumberOfPointPixelComponents () const |
virtual void | SetNumberOfCellPixelComponents (unsigned int _arg) |
virtual unsigned int | GetNumberOfCellPixelComponents () const |
virtual void | SetPointDimension (unsigned int _arg) |
virtual unsigned int | GetPointDimension () const |
virtual void | SetNumberOfPoints (SizeValueType _arg) |
virtual SizeValueType | GetNumberOfPoints () const |
virtual void | SetNumberOfCells (SizeValueType _arg) |
virtual SizeValueType | GetNumberOfCells () const |
virtual void | SetNumberOfPointPixels (SizeValueType _arg) |
virtual SizeValueType | GetNumberOfPointPixels () const |
virtual void | SetNumberOfCellPixels (SizeValueType _arg) |
virtual SizeValueType | GetNumberOfCellPixels () const |
virtual void | SetCellBufferSize (SizeValueType _arg) |
virtual SizeValueType | GetCellBufferSize () const |
virtual void | SetUpdatePoints (bool _arg) |
virtual void | SetUpdateCells (bool _arg) |
virtual void | SetUpdatePointData (bool _arg) |
virtual bool | GetUpdatePointData () const |
virtual void | SetUpdateCellData (bool _arg) |
virtual bool | GetUpdateCellData () const |
virtual void | SetFileType (const FileType _arg) |
virtual FileType | GetFileType () const |
virtual void | SetByteOrder (const ByteOrder _arg) |
virtual ByteOrder | GetByteOrder () const |
virtual void | SetUseCompression (bool _arg) |
virtual bool | GetUseCompression () const |
virtual void | UseCompressionOn () |
virtual void | UseCompressionOff () |
Public Member Functions inherited from itk::LightProcessObject | |
virtual void | AbortGenerateDataOff () |
virtual void | AbortGenerateDataOn () |
virtual const bool & | GetAbortGenerateData () const |
virtual void | SetAbortGenerateData (bool _arg) |
virtual void | UpdateOutputData () |
void | UpdateProgress (float amount) |
virtual void | SetProgress (float _arg) |
virtual const float & | GetProgress () const |
Public Member Functions inherited from itk::Object | |
unsigned long | AddObserver (const EventObject &event, Command *) |
unsigned long | AddObserver (const EventObject &event, Command *) const |
virtual void | DebugOff () const |
virtual void | DebugOn () const |
Command * | GetCommand (unsigned long tag) |
bool | GetDebug () const |
MetaDataDictionary & | GetMetaDataDictionary (void) |
const MetaDataDictionary & | GetMetaDataDictionary (void) const |
virtual ModifiedTimeType | GetMTime () const |
virtual const TimeStamp & | GetTimeStamp () const |
bool | HasObserver (const EventObject &event) const |
void | InvokeEvent (const EventObject &) |
void | InvokeEvent (const EventObject &) const |
virtual void | Modified () const |
virtual void | Register () const ITK_OVERRIDE |
void | RemoveAllObservers () |
void | RemoveObserver (unsigned long tag) |
void | SetDebug (bool debugFlag) const |
void | SetMetaDataDictionary (const MetaDataDictionary &rhs) |
virtual void | SetReferenceCount (int) ITK_OVERRIDE |
virtual void | UnRegister () const ITK_OVERRIDE |
virtual void | SetObjectName (std::string _arg) |
virtual const std::string & | GetObjectName () const |
Public Member Functions inherited from itk::LightObject | |
virtual void | Delete () |
virtual int | GetReferenceCount () const |
itkCloneMacro (Self) | |
void | Print (std::ostream &os, Indent indent=0) const |
Static Public Member Functions | |
static Pointer | New () |
Static Public Member Functions inherited from itk::LightProcessObject | |
static Pointer | New () |
Static Public Member Functions inherited from itk::Object | |
static bool | GetGlobalWarningDisplay () |
static void | GlobalWarningDisplayOff () |
static void | GlobalWarningDisplayOn () |
static Pointer | New () |
static void | SetGlobalWarningDisplay (bool flag) |
Static Public Member Functions inherited from itk::LightObject | |
static void | BreakOnError () |
static Pointer | New () |
Protected Member Functions | |
void | PrintSelf (std::ostream &os, Indent indent) const |
STLMeshIO () | |
template<typename TPointsBuffer > | |
void | WritePointsTyped (const TPointsBuffer *const buffer) |
virtual | ~STLMeshIO () |
Protected Member Functions inherited from itk::MeshIOBase | |
void | AddSupportedReadExtension (const char *extension) |
void | AddSupportedWriteExtension (const char *extension) |
MeshIOBase () | |
template<typename T > | |
void | ReadBufferAsBinary (T *buffer, std::ifstream &inputFile, SizeValueType numberOfComponents) |
virtual | ~MeshIOBase () |
template<typename T > | |
void | ReadBufferAsAscii (T *buffer, std::ifstream &inputFile, SizeValueType numberOfComponents) |
template<typename T > | |
void | WriteBufferAsAscii (T *buffer, std::ofstream &outputFile, SizeValueType numberOfLines, SizeValueType numberOfComponents) |
template<typename TOutput , typename TInput > | |
void | WriteBufferAsBinary (TInput *buffer, std::ofstream &outputFile, SizeValueType numberOfComponents) |
template<typename TInput , typename TOutput > | |
void | ReadCellsBuffer (TInput *input, TOutput *output) |
template<typename TInput , typename TOutput > | |
void | ReadCellsBuffer (TInput *input, TOutput *output, MeshIOBase::CellGeometryType type) |
template<typename TInput , typename TOutput > | |
void | WriteCellsBuffer (TInput *input, TOutput *output, CellGeometryType cellType, unsigned int numberOfPoints, SizeValueType numberOfCells) |
template<typename TInput , typename TOutput > | |
void | WriteCellsBuffer (TInput *input, TOutput *output, CellGeometryType cellType, SizeValueType numberOfCells) |
Protected Member Functions inherited from itk::LightProcessObject | |
virtual void | GenerateData () |
LightProcessObject () | |
~LightProcessObject () | |
Protected Member Functions inherited from itk::Object | |
Object () | |
bool | PrintObservers (std::ostream &os, Indent indent) const |
virtual void | SetTimeStamp (const TimeStamp &time) |
virtual | ~Object () |
Protected Member Functions inherited from itk::LightObject | |
virtual LightObject::Pointer | InternalClone () const |
LightObject () | |
virtual void | PrintHeader (std::ostream &os, Indent indent) const |
virtual void | PrintTrailer (std::ostream &os, Indent indent) const |
virtual | ~LightObject () |
Private Types | |
typedef std::vector< TripletType > | CellsVectorType |
typedef CovariantVector < PointValueType, 3 > | NormalType |
typedef std::vector< PointType > | PointContainerType |
typedef std::map< PointType, IdentifierType, PointCompare > | PointsMapType |
typedef Point< PointValueType, 3 > | PointType |
typedef float | PointValueType |
typedef Vector< PointValueType, 3 > | VectorType |
Private Member Functions | |
void | InsertPointIntoSet (const PointType &point) |
void | operator= (const Self &) |
STLMeshIO (const Self &) | |
void | WriteInt32AsBinary (int32_t value) |
void | WriteInt16AsBinary (int16_t value) |
void | WriteNormalAsBinary (const NormalType &normal) |
void | WritePointAsBinary (const PointType &point) |
void | ReadMeshInternalFromAscii () |
void | ReadMeshInternalFromBinary () |
void | ReadInt32AsBinary (int32_t &value) |
void | ReadInt16AsBinary (int16_t &value) |
void | ReadNormalAsBinary (NormalType &normal) |
void | ReadPointAsBinary (PointType &point) |
void | ReadStringFromAscii (const std::string &keyword) |
void | ReadPointAsAscii (PointType &point) |
bool | CheckStringFromAscii (const std::string &expected) |
virtual void | WriteCellsAsAscii (void *buffer) |
virtual void | WriteCellsAsBinary (void *buffer) |
Private Attributes | |
CellsVectorType | m_CellsVector |
std::string | m_InputLine |
unsigned int | m_InputLineNumber |
std::ifstream | m_InputStream |
IdentifierType | m_LatestPointId |
std::ofstream | m_OutputStream |
unsigned int | m_PointInTriangleCounter |
PointContainerType | m_Points |
PointsMapType | m_PointsMap |
TripletType | m_TrianglePointIds |
Additional Inherited Members | |
Protected Types inherited from itk::LightObject | |
typedef int | InternalReferenceCountType |
Protected Attributes inherited from itk::MeshIOBase | |
ByteOrder | m_ByteOrder |
SizeValueType | m_CellBufferSize |
IOComponentType | m_CellComponentType |
IOComponentType | m_CellPixelComponentType |
IOPixelType | m_CellPixelType |
std::string | m_FileName |
FileType | m_FileType |
unsigned int | m_NumberOfCellPixelComponents |
SizeValueType | m_NumberOfCellPixels |
SizeValueType | m_NumberOfCells |
unsigned int | m_NumberOfPointPixelComponents |
SizeValueType | m_NumberOfPointPixels |
SizeValueType | m_NumberOfPoints |
IOComponentType | m_PointComponentType |
unsigned int | m_PointDimension |
IOComponentType | m_PointPixelComponentType |
IOPixelType | m_PointPixelType |
bool | m_UpdateCellData |
bool | m_UpdateCells |
bool | m_UpdatePointData |
bool | m_UpdatePoints |
bool | m_UseCompression |
Protected Attributes inherited from itk::LightObject | |
InternalReferenceCountType | m_ReferenceCount |
SimpleFastMutexLock | m_ReferenceCountLock |
|
private |
Definition at line 265 of file itkSTLMeshIO.h.
typedef SmartPointer< const Self > itk::STLMeshIO::ConstPointer |
Definition at line 45 of file itkSTLMeshIO.h.
|
private |
Definition at line 185 of file itkSTLMeshIO.h.
|
private |
Definition at line 187 of file itkSTLMeshIO.h.
typedef SmartPointer< Self > itk::STLMeshIO::Pointer |
Definition at line 44 of file itkSTLMeshIO.h.
|
private |
Definition at line 246 of file itkSTLMeshIO.h.
|
private |
Definition at line 183 of file itkSTLMeshIO.h.
|
private |
Definition at line 181 of file itkSTLMeshIO.h.
typedef STLMeshIO itk::STLMeshIO::Self |
Standard "Self" typedef.
Definition at line 42 of file itkSTLMeshIO.h.
typedef MeshIOBase itk::STLMeshIO::Superclass |
Definition at line 43 of file itkSTLMeshIO.h.
|
private |
Definition at line 184 of file itkSTLMeshIO.h.
|
protected |
|
inlineprotectedvirtual |
Definition at line 136 of file itkSTLMeshIO.h.
|
private |
|
virtual |
--—— This part of the interfaces deals with reading data. –— Determine if the file can be read with this MeshIO implementation.
FileNameToRead | The name of the file to test for reading. |
Implements itk::MeshIOBase.
|
virtual |
Determine if the file can be written with this MeshIO implementation.
FileNameToWrite | The name of the file to test for writing. |
Implements itk::MeshIOBase.
|
private |
Helper functions to read elements from ASCII files.
|
virtual |
Create an object from an instance, potentially deferring to a factory. This method allows you to create an instance of an object that is exactly the same type as the referring object. This is useful in cases where an object has been cast back to a base class.
Reimplemented from itk::LightProcessObject.
|
virtual |
Run-time type information (and related methods).
Reimplemented from itk::MeshIOBase.
|
virtual |
Indicates whether ReadCells() should be called.
Reimplemented from itk::MeshIOBase.
|
virtual |
Indicates whether ReadPoints() should be called.
Reimplemented from itk::MeshIOBase.
|
private |
Functions to create set of points and disambiguate them.
|
static |
Method for creation through the object factory.
|
private |
|
protectedvirtual |
Methods invoked by Print() to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.
Reimplemented from itk::MeshIOBase.
|
virtual |
Read the content of the file into a Mesh.
|
inlinevirtual |
STL files do not carry information in points or cells. Therefore the following two methods are implemented as null operations.
Implements itk::MeshIOBase.
Definition at line 84 of file itkSTLMeshIO.h.
|
virtual |
Stores the cell data into the memory buffer provided.
Implements itk::MeshIOBase.
|
private |
Helper functions to read elements from binary file
|
private |
Helper functions to read elements from binary file
|
virtual |
Set the spacing and dimension information for the set filename.
Implements itk::MeshIOBase.
|
private |
Helper functions to read elements from ASCII and BINARY files.
|
private |
Helper functions to read elements from ASCII and BINARY files.
|
private |
Helper functions to read elements from binary file
|
private |
Helper functions to read elements from ASCII files.
|
private |
Helper functions to read elements from binary file
|
inlinevirtual |
STL files do not carry information in points or cells. Therefore the following two methods are implemented as null operations.
Implements itk::MeshIOBase.
Definition at line 83 of file itkSTLMeshIO.h.
|
virtual |
Stores the point data into the memory buffer provided.
Implements itk::MeshIOBase.
|
private |
Helper functions to read elements from ASCII files.
|
virtual |
Write the content of the Mesh into an STL file.
Implements itk::MeshIOBase.
|
inlinevirtual |
STL files do not carry information in points or cells. Therefore the following two methods are implemented as null operations.
Implements itk::MeshIOBase.
Definition at line 131 of file itkSTLMeshIO.h.
|
virtual |
The WriteCells() method does most of the work. It writes out every triangle in the mesh. For every triangle, it writes out its normal, followed by the coordinates of its three vertices.
A typical cell looks as follows in an ASCII STL file
facet normal 0.357406 0.862856 0.357406 outer loop vertex 0 1 0 vertex 0 0.707107 0.707107 vertex 0.707107 0.707107 0 endloop endfacet
Implements itk::MeshIOBase.
|
privatevirtual |
Helper function to write cells as ASCII or BINARY.
|
privatevirtual |
Helper function to write cells as ASCII or BINARY.
|
private |
Helper functions to write elements to binary file
|
private |
Helper functions to write elements to binary file
|
virtual |
Write header of the STL file
Implements itk::MeshIOBase.
|
private |
Helper functions to write elements to binary file
|
private |
Helper functions to write elements to binary file
|
inlinevirtual |
STL files do not carry information in points or cells. Therefore the following two methods are implemented as null operations.
Implements itk::MeshIOBase.
Definition at line 130 of file itkSTLMeshIO.h.
|
virtual |
The STL format stores point coordinates repeatedly as part of every triangle. Therefore point coordinates are writen as part of the WriteCells() method, and not as an independent operation. Consequently, this method only performs an internal copy of the Point coordinates data, than then is used in the WriteCells() method.
Implements itk::MeshIOBase.
|
inlineprotected |
Templated version of write points method, that is aware of the specific type used to represent the point coordinates.
Definition at line 143 of file itkSTLMeshIO.h.
References itk::Math::pi.
|
private |
Definition at line 266 of file itkSTLMeshIO.h.
|
private |
Definition at line 179 of file itkSTLMeshIO.h.
|
private |
Definition at line 224 of file itkSTLMeshIO.h.
|
private |
Definition at line 177 of file itkSTLMeshIO.h.
|
private |
Definition at line 251 of file itkSTLMeshIO.h.
|
private |
Definition at line 176 of file itkSTLMeshIO.h.
|
private |
Definition at line 263 of file itkSTLMeshIO.h.
|
private |
Definition at line 222 of file itkSTLMeshIO.h.
|
private |
Definition at line 248 of file itkSTLMeshIO.h.
|
private |
Definition at line 262 of file itkSTLMeshIO.h.