19 #ifndef itkOBJMeshIO_h
20 #define itkOBJMeshIO_h
21 #include "ITKIOMeshExport.h"
59 virtual bool CanReadFile(
const char *FileNameToRead) ITK_OVERRIDE;
62 virtual void ReadMeshInformation() ITK_OVERRIDE;
65 virtual
void ReadPoints(
void *buffer) ITK_OVERRIDE;
67 virtual
void ReadCells(
void *buffer) ITK_OVERRIDE;
69 virtual
void ReadPointData(
void *buffer) ITK_OVERRIDE;
71 virtual
void ReadCellData(
void *buffer) ITK_OVERRIDE;
80 virtual
bool CanWriteFile(const
char *FileNameToWrite) ITK_OVERRIDE;
83 virtual
void WriteMeshInformation() ITK_OVERRIDE;
87 virtual
void WritePoints(
void *buffer) ITK_OVERRIDE;
89 virtual
void WriteCells(
void *buffer) ITK_OVERRIDE;
91 virtual
void WritePointData(
void *buffer) ITK_OVERRIDE;
93 virtual
void WriteCellData(
void *buffer) ITK_OVERRIDE;
95 virtual
void Write() ITK_OVERRIDE;
99 template< typename T >
100 void WritePoints(T *buffer, std::ofstream & outputFile)
106 for (
SizeValueType ii = 0; ii < this->m_NumberOfPoints; ii++ )
109 for (
unsigned int jj = 0; jj < this->m_PointDimension; jj++ )
111 outputFile << convert(buffer[index++]) <<
" ";
117 template<
typename T >
122 for (
SizeValueType ii = 0; ii < this->m_NumberOfCells; ii++ )
126 unsigned int numberOfCellPoints =
static_cast< unsigned int >( buffer[index++] );
128 for (
unsigned int jj = 0; jj < numberOfCellPoints; jj++ )
130 outputFile << buffer[index++] + 1 <<
" ";
137 template<
typename T >
144 for (
SizeValueType ii = 0; ii < this->m_NumberOfPointPixels; ii++ )
147 for (
unsigned int jj = 0; jj < this->m_PointDimension; jj++ )
149 outputFile << convert(buffer[index++]) <<
" ";
156 static bool SplitLine(
const std::string& line, std::string&
type, std::string& content);
162 virtual
void PrintSelf(std::ostream & os,
Indent indent) const ITK_OVERRIDE;
171 std::ifstream m_InputFile;
172 std::streampos m_PointsStartPosition;
void WritePointData(T *buffer, std::ofstream &outputFile)
Light weight base class for most itk classes.
void WriteCells(T *buffer, std::ofstream &outputFile)
*brief Mask an image with the negative of a mask **This class is templated over the types of the *input image type
This class defines how to read and write Object file format.
SmartPointer< Self > Pointer
IdentifierType SizeValueType
unsigned long SizeValueType
Superclass::SizeValueType SizeValueType
Convert floating and fixed point numbers to strings.
SmartPointer< const Self > ConstPointer
Control indentation during Print() invocation.
Abstract superclass defines mesh IO interface.