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)
105 for (
SizeValueType ii = 0; ii < this->m_NumberOfPoints; ii++ )
108 for (
unsigned int jj = 0; jj < this->m_PointDimension; jj++ )
110 outputFile << convert(buffer[index++]) <<
" ";
116 template<
typename T >
121 for (
SizeValueType ii = 0; ii < this->m_NumberOfCells; ii++ )
125 unsigned int numberOfCellPoints =
static_cast< unsigned int >( buffer[index++] );
127 for (
unsigned int jj = 0; jj < numberOfCellPoints; jj++ )
129 outputFile << buffer[index++] + 1 <<
" ";
136 template<
typename T >
142 for (
SizeValueType ii = 0; ii < this->m_NumberOfPointPixels; ii++ )
145 for (
unsigned int jj = 0; jj < this->m_PointDimension; jj++ )
147 outputFile << convert(buffer[index++]) <<
" ";
158 virtual void PrintSelf(std::ostream & os,
Indent indent)
const ITK_OVERRIDE;
166 void operator=(
const Self &);
void WritePointData(T *buffer, std::ofstream &outputFile)
Light weight base class for most itk classes.
void WriteCells(T *buffer, std::ofstream &outputFile)
This class defines how to read and write Object file format.
SmartPointer< Self > Pointer
IdentifierType SizeValueType
std::streampos m_PointsStartPosition
unsigned long SizeValueType
Superclass::SizeValueType SizeValueType
std::ifstream m_InputFile
Convert floating and fixed point numbers to strings.
SmartPointer< const Self > ConstPointer
Control indentation during Print() invocation.
Abstract superclass defines mesh IO interface.
Define additional traits for native types such as int or float.