19 #ifndef __itkBYUMeshIO_h
20 #define __itkBYUMeshIO_h
61 virtual bool CanReadFile(
const char *FileNameToRead);
64 virtual void ReadMeshInformation();
67 virtual void ReadPoints(
void *buffer);
69 virtual void ReadCells(
void *buffer);
71 virtual void ReadPointData(
void *buffer);
73 virtual void ReadCellData(
void *buffer);
82 virtual bool CanWriteFile(
const char *FileNameToWrite);
85 virtual void WriteMeshInformation();
88 virtual void WritePoints(
void *buffer);
90 virtual void WriteCells(
void *buffer);
92 virtual void WritePointData(
void *buffer);
94 virtual void WriteCellData(
void *buffer);
100 template<
typename T >
101 void WritePoints(T *buffer, std::ofstream & outputFile)
108 for(
SizeValueType ii = 0; ii < this->m_NumberOfPoints; ii++ )
110 outputFile << indent;
111 for(
unsigned int jj = 0; jj < this->m_PointDimension; jj++ )
113 outputFile << convert(buffer[index++]) <<
" ";
119 template<
typename T >
120 void WriteCells(T *buffer, std::ofstream & outputFile)
125 for(
SizeValueType ii = 0; ii < this->m_NumberOfCells; ii++ )
127 unsigned int numberOfCellPoints =
static_cast< unsigned int >( buffer[++index] );
129 for (
unsigned int jj = 0; jj < numberOfCellPoints - 1; jj++ )
131 outputFile << indent << buffer[index++] + 1;
134 outputFile << indent << -
static_cast<long long>( buffer[index++] + 1 ) <<
'\n';
142 void PrintSelf(std::ostream & os,
Indent indent)
const;
146 void operator=(
const Self &);