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)
104 for (
SizeValueType ii = 0; ii < this->m_NumberOfPoints; ii++ )
107 for (
unsigned int jj = 0; jj < this->m_PointDimension; jj++ )
109 outputFile << convert(buffer[index++]) <<
" ";
115 template<
typename T >
116 void WriteCells(T *buffer, std::ofstream & outputFile)
120 for (
SizeValueType ii = 0; ii < this->m_NumberOfCells; ii++ )
124 unsigned int numberOfCellPoints =
static_cast< unsigned int >( buffer[index++] );
126 for (
unsigned int jj = 0; jj < numberOfCellPoints; jj++ )
128 outputFile << buffer[index++] + 1 <<
" ";
135 template<
typename T >
136 void WritePointData(T *buffer, std::ofstream & outputFile)
141 for (
SizeValueType ii = 0; ii < this->m_NumberOfPointPixels; ii++ )
144 for (
unsigned int jj = 0; jj < this->m_PointDimension; jj++ )
146 outputFile << convert(buffer[index++]) <<
" ";
157 void PrintSelf(std::ostream & os,
Indent indent)
const;
165 void operator=(
const Self &);