19 #ifndef __itkBYUMeshIO_h
20 #define __itkBYUMeshIO_h
60 virtual bool CanReadFile(
const char *FileNameToRead);
63 virtual void ReadMeshInformation();
66 virtual void ReadPoints(
void *buffer);
68 virtual void ReadCells(
void *buffer);
70 virtual void ReadPointData(
void *buffer);
72 virtual void ReadCellData(
void *buffer);
81 virtual bool CanWriteFile(
const char *FileNameToWrite);
84 virtual void WriteMeshInformation();
87 virtual void WritePoints(
void *buffer);
89 virtual void WriteCells(
void *buffer);
91 virtual void WritePointData(
void *buffer);
93 virtual void WriteCellData(
void *buffer);
99 template<
typename T >
100 void WritePoints(T *buffer, std::ofstream & outputFile)
106 for(
SizeValueType ii = 0; ii < this->m_NumberOfPoints; ii++ )
108 outputFile << indent;
109 for(
unsigned int jj = 0; jj < this->m_PointDimension; jj++ )
111 outputFile << std::scientific << buffer[index++] <<
" ";
117 template<
typename T >
118 void WriteCells(T *buffer, std::ofstream & outputFile)
123 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 - 1; jj++ )
129 outputFile << indent << buffer[index++] + 1;
132 outputFile << indent << -
static_cast<long long>( buffer[index++] + 1 ) <<
'\n';
140 void PrintSelf(std::ostream & os,
Indent indent)
const;
144 void operator=(
const Self &);