19 #ifndef itkOFFMeshIO_h
20 #define itkOFFMeshIO_h
21 #include "ITKIOMeshOFFExport.h"
64 CanReadFile(
const char *
fileName)
override;
68 ReadMeshInformation()
override;
72 ReadPoints(
void * buffer)
override;
75 ReadCells(
void * buffer)
override;
78 ReadPointData(
void * buffer)
override;
81 ReadCellData(
void * buffer)
override;
91 CanWriteFile(
const char *
fileName)
override;
95 WriteMeshInformation()
override;
100 WritePoints(
void * buffer)
override;
103 WriteCells(
void * buffer)
override;
106 WritePointData(
void * buffer)
override;
109 WriteCellData(
void * buffer)
override;
116 template <
typename T>
121 unsigned int numberOfPoints = 0;
126 inputFile >> numberOfPoints;
127 buffer[index++] = static_cast<T>(numberOfPoints);
128 for (
unsigned int jj = 0; jj < numberOfPoints; jj++)
130 inputFile >> buffer[index++];
132 std::getline(inputFile, line,
'\n');
139 template <
typename TInput,
typename TOutput>
150 auto numberOfPoints = static_cast<unsigned int>(input[indInput++]);
151 output[indOutput++] = static_cast<TOutput>(numberOfPoints);
152 for (
unsigned int jj = 0; jj < numberOfPoints; jj++)
154 output[indOutput++] = static_cast<TOutput>(input[indInput++]);
161 template <
typename T>
170 auto numberOfCellPoints = static_cast<unsigned int>(buffer[index++]);
171 outputFile << numberOfCellPoints <<
" ";
173 for (
unsigned int jj = 0; jj < numberOfCellPoints; jj++)
175 outputFile << buffer[index++] <<
" ";
182 template <
typename TOutput,
typename TInput>
186 auto * data =
new TOutput[m_CellBufferSize - this->m_NumberOfCells];
188 ReadCellsBuffer(buffer, data);
189 WriteBufferAsBinary<TOutput>(data, outputFile, m_CellBufferSize - this->m_NumberOfCells);
199 PrintSelf(std::ostream & os,
Indent indent)
const override;