19 #ifndef __itkOBJMeshIO_h
20 #define __itkOBJMeshIO_h
58 virtual bool CanReadFile(
const char *FileNameToRead);
61 virtual void ReadMeshInformation();
64 virtual void ReadPoints(
void *buffer);
66 virtual void ReadCells(
void *buffer);
68 virtual void ReadPointData(
void *buffer);
70 virtual void ReadCellData(
void *buffer);
79 virtual bool CanWriteFile(
const char *FileNameToWrite);
82 virtual void WriteMeshInformation();
86 virtual void WritePoints(
void *buffer);
88 virtual void WriteCells(
void *buffer);
90 virtual void WritePointData(
void *buffer);
92 virtual void WriteCellData(
void *buffer);
98 template<
typename T >
99 void WritePoints(T *buffer, std::ofstream & outputFile)
103 for (
SizeValueType ii = 0; ii < this->m_NumberOfPoints; ii++ )
106 for (
unsigned int jj = 0; jj < this->m_PointDimension; jj++ )
108 outputFile << buffer[index++] <<
" ";
114 template<
typename T >
115 void WriteCells(T *buffer, std::ofstream & outputFile)
119 for (
SizeValueType ii = 0; ii < this->m_NumberOfCells; ii++ )
123 unsigned int numberOfCellPoints =
static_cast< unsigned int >( buffer[index++] );
125 for (
unsigned int jj = 0; jj < numberOfCellPoints; jj++ )
127 outputFile << buffer[index++] + 1 <<
" ";
134 template<
typename T >
135 void WritePointData(T *buffer, std::ofstream & outputFile)
139 for (
SizeValueType ii = 0; ii < this->m_NumberOfPointPixels; ii++ )
142 for (
unsigned int jj = 0; jj < this->m_PointDimension; jj++ )
144 outputFile << buffer[index++] <<
" ";
155 void PrintSelf(std::ostream & os,
Indent indent)
const;
163 void operator=(
const Self &);