19 #ifndef itkBYUMeshIO_h
20 #define itkBYUMeshIO_h
21 #include "ITKIOMeshBYUExport.h"
64 bool CanReadFile(
const char *FileNameToRead)
override;
67 void ReadMeshInformation()
override;
70 void ReadPoints(
void *buffer)
override;
72 void ReadCells(
void *buffer)
override;
74 void ReadPointData(
void *buffer)
override;
76 void ReadCellData(
void *buffer)
override;
85 bool CanWriteFile(
const char *FileNameToWrite)
override;
88 void WriteMeshInformation()
override;
91 void WritePoints(
void *buffer)
override;
93 void WriteCells(
void *buffer)
override;
95 void WritePointData(
void *buffer)
override;
97 void WriteCellData(
void *buffer)
override;
99 void Write()
override;
103 template<
typename T >
108 SizeValueType index = itk::NumericTraits< SizeValueType >::ZeroValue();
111 for(
SizeValueType ii = 0; ii < this->m_NumberOfPoints; ii++ )
113 outputFile << indent;
114 for(
unsigned int jj = 0; jj < this->m_PointDimension; jj++ )
116 outputFile << convert(buffer[index++]) <<
" ";
122 template<
typename T >
126 SizeValueType index = itk::NumericTraits< SizeValueType >::ZeroValue();
128 for(
SizeValueType ii = 0; ii < this->m_NumberOfCells; ii++ )
130 auto numberOfCellPoints =
static_cast< unsigned int >( buffer[++index] );
132 for (
unsigned int jj = 0; jj < numberOfCellPoints - 1; jj++ )
134 outputFile << indent << buffer[index++] + 1;
137 outputFile << indent << -
static_cast<long long>( buffer[index++] + 1 ) <<
'\n';
145 void PrintSelf(std::ostream & os,
Indent indent)
const override;
void WriteCells(T *buffer, std::ofstream &outputFile)
Light weight base class for most itk classes.
SizeValueType m_LastCellId
void WritePoints(T *buffer, std::ofstream &outputFile)
IdentifierType SizeValueType
unsigned long SizeValueType
std::streamoff StreamOffsetType
Convert floating and fixed point numbers to strings.
SizeValueType m_FirstCellId
Control indentation during Print() invocation.
Abstract superclass defines mesh IO interface.
Base class for most ITK classes.
This class defines how to read and write BYU Geometry File Format.