19 #ifndef itkOBJMeshIO_h
20 #define itkOBJMeshIO_h
21 #include "ITKIOMeshOBJExport.h"
61 bool CanReadFile(
const char *FileNameToRead)
override;
64 void ReadMeshInformation()
override;
67 void ReadPoints(
void *buffer)
override;
69 void ReadCells(
void *buffer)
override;
71 void ReadPointData(
void *buffer)
override;
73 void ReadCellData(
void *buffer)
override;
82 bool CanWriteFile(
const char *FileNameToWrite)
override;
85 void WriteMeshInformation()
override;
89 void WritePoints(
void *buffer)
override;
91 void WriteCells(
void *buffer)
override;
93 void WritePointData(
void *buffer)
override;
95 void WriteCellData(
void *buffer)
override;
97 void Write()
override;
101 template<
typename T >
105 SizeValueType index = itk::NumericTraits< SizeValueType >::ZeroValue();
108 for (
SizeValueType ii = 0; ii < this->m_NumberOfPoints; ii++ )
111 for (
unsigned int jj = 0; jj < this->m_PointDimension; jj++ )
113 outputFile << convert(buffer[index++]) <<
" ";
119 template<
typename T >
122 SizeValueType index = itk::NumericTraits< SizeValueType >::ZeroValue();
124 for (
SizeValueType ii = 0; ii < this->m_NumberOfCells; ii++ )
128 auto numberOfCellPoints =
static_cast< unsigned int >( buffer[index++] );
130 for (
unsigned int jj = 0; jj < numberOfCellPoints; jj++ )
132 outputFile << buffer[index++] + 1 <<
" ";
139 template<
typename T >
143 SizeValueType index = itk::NumericTraits< SizeValueType >::ZeroValue();
146 for (
SizeValueType ii = 0; ii < this->m_NumberOfPointPixels; ii++ )
149 for (
unsigned int jj = 0; jj < this->m_PointDimension; jj++ )
151 outputFile << convert(buffer[index++]) <<
" ";
158 static bool SplitLine(
const std::string& line, std::string& type, std::string& content);
164 void PrintSelf(std::ostream & os,
Indent indent)
const override;
void WritePointData(T *buffer, std::ofstream &outputFile)
Light weight base class for most itk classes.
void WritePoints(T *buffer, std::ofstream &outputFile)
IdentifierType SizeValueType
unsigned long SizeValueType
void WriteCells(T *buffer, std::ofstream &outputFile)
This class defines how to read and write Object file format.
std::streampos m_PointsStartPosition
std::ifstream m_InputFile
Convert floating and fixed point numbers to strings.
Control indentation during Print() invocation.
Abstract superclass defines mesh IO interface.
Base class for most ITK classes.