21#include "ITKIOMeshOFFExport.h"
117 template <
typename T>
122 unsigned int numberOfPoints = 0;
127 inputFile >> numberOfPoints;
128 buffer[index++] =
static_cast<T
>(numberOfPoints);
129 for (
unsigned int jj = 0; jj < numberOfPoints; ++jj)
131 inputFile >> buffer[index++];
133 std::getline(inputFile, line,
'\n');
140 template <
typename TInput,
typename TOutput>
151 auto numberOfPoints =
static_cast<unsigned int>(input[indInput++]);
152 output[indOutput++] =
static_cast<TOutput
>(numberOfPoints);
153 for (
unsigned int jj = 0; jj < numberOfPoints; ++jj)
155 output[indOutput++] =
static_cast<TOutput
>(input[indInput++]);
162 template <
typename T>
171 auto numberOfCellPoints =
static_cast<unsigned int>(buffer[index++]);
172 outputFile << numberOfCellPoints <<
" ";
174 for (
unsigned int jj = 0; jj < numberOfCellPoints; ++jj)
176 outputFile << buffer[index++] <<
" ";
183 template <
typename TOutput,
typename TInput>
187 const auto data = make_unique_for_overwrite<TOutput[]>(m_CellBufferSize - this->m_NumberOfCells);
189 ReadCellsBuffer(buffer, data.get());
190 WriteBufferAsBinary<TOutput>(data.get(), outputFile, m_CellBufferSize - this->m_NumberOfCells);
207 std::ifstream m_InputFile{};
209 bool m_TriangleCellType{};
Control indentation during Print() invocation.
Light weight base class for most itk classes.
Abstract superclass defines mesh IO interface.
IdentifierType SizeValueType
std::streamoff StreamOffsetType
this class defines how to read and write Object file format.
void ReadPointData(void *buffer) override
bool CanWriteFile(const char *fileName) override
void ReadCellsBuffer(TInput *input, TOutput *output)
void WriteCells(void *buffer) override
void WriteCellData(void *buffer) override
void ReadPoints(void *buffer) override
void WriteCellsAsAscii(T *buffer, std::ofstream &outputFile)
void WriteCellsAsBinary(TInput *buffer, std::ofstream &outputFile)
void WriteMeshInformation() override
void ReadCells(void *buffer) override
void WritePoints(void *buffer) override
void PrintSelf(std::ostream &os, Indent indent) const override
void ReadCellsBufferAsAscii(T *buffer, std::ifstream &inputFile)
void WritePointData(void *buffer) override
bool CanReadFile(const char *fileName) override
void ReadCellData(void *buffer) override
void ReadMeshInformation() override
Base class for most ITK classes.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
unsigned long SizeValueType