19 #ifndef __itkBYUMeshIO_h
20 #define __itkBYUMeshIO_h
21 #include "ITKIOMeshExport.h"
62 virtual bool CanReadFile(
const char *FileNameToRead) ITK_OVERRIDE;
65 virtual void ReadMeshInformation() ITK_OVERRIDE;
68 virtual
void ReadPoints(
void *buffer) ITK_OVERRIDE;
70 virtual
void ReadCells(
void *buffer) ITK_OVERRIDE;
72 virtual
void ReadPointData(
void *buffer) ITK_OVERRIDE;
74 virtual
void ReadCellData(
void *buffer) ITK_OVERRIDE;
83 virtual
bool CanWriteFile(const
char *FileNameToWrite) ITK_OVERRIDE;
86 virtual
void WriteMeshInformation() ITK_OVERRIDE;
89 virtual
void WritePoints(
void *buffer) ITK_OVERRIDE;
91 virtual
void WriteCells(
void *buffer) ITK_OVERRIDE;
93 virtual
void WritePointData(
void *buffer) ITK_OVERRIDE;
95 virtual
void WriteCellData(
void *buffer) ITK_OVERRIDE;
97 virtual
void Write() ITK_OVERRIDE;
101 template< typename T >
102 void WritePoints(T *buffer, std::ofstream & outputFile)
109 for(
SizeValueType ii = 0; ii < this->m_NumberOfPoints; ii++ )
111 outputFile << indent;
112 for(
unsigned int jj = 0; jj < this->m_PointDimension; jj++ )
114 outputFile << convert(buffer[index++]) <<
" ";
120 template<
typename T >
126 for(
SizeValueType ii = 0; ii < this->m_NumberOfCells; ii++ )
128 unsigned int numberOfCellPoints =
static_cast< unsigned int >( buffer[++index] );
130 for (
unsigned int jj = 0; jj < numberOfCellPoints - 1; jj++ )
132 outputFile << indent << buffer[index++] + 1;
135 outputFile << indent << -
static_cast<long long>( buffer[index++] + 1 ) <<
'\n';
143 virtual void PrintSelf(std::ostream & os,
Indent indent)
const ITK_OVERRIDE;
147 void operator=(
const Self &);
void WriteCells(T *buffer, std::ofstream &outputFile)
Light weight base class for most itk classes.
SizeValueType m_LastCellId
std::streamoff StreamOffsetType
Superclass::StreamOffsetType StreamOffsetType
IdentifierType SizeValueType
Convert floating and fixed point numbers to strings.
SmartPointer< Self > Pointer
Superclass::SizeValueType SizeValueType
SizeValueType m_FirstCellId
SmartPointer< const Self > ConstPointer
Control indentation during Print() invocation.
Abstract superclass defines mesh IO interface.
StreamOffsetType m_FilePosition
Define additional traits for native types such as int or float.
This class defines how to read and write BYU Geometry File Format.