19 #ifndef __itkOBJMeshIO_h
20 #define __itkOBJMeshIO_h
21 #include "ITKIOMeshExport.h"
59 virtual bool CanReadFile(
const char *FileNameToRead);
62 virtual void ReadMeshInformation();
65 virtual void ReadPoints(
void *buffer);
67 virtual void ReadCells(
void *buffer);
69 virtual void ReadPointData(
void *buffer);
71 virtual void ReadCellData(
void *buffer);
80 virtual bool CanWriteFile(
const char *FileNameToWrite);
83 virtual void WriteMeshInformation();
87 virtual void WritePoints(
void *buffer);
89 virtual void WriteCells(
void *buffer);
91 virtual void WritePointData(
void *buffer);
93 virtual void WriteCellData(
void *buffer);
99 template<
typename T >
105 for (
SizeValueType ii = 0; ii < this->m_NumberOfPoints; ii++ )
108 for (
unsigned int jj = 0; jj < this->m_PointDimension; jj++ )
110 outputFile << convert(buffer[index++]) <<
" ";
116 template<
typename T >
121 for (
SizeValueType ii = 0; ii < this->m_NumberOfCells; ii++ )
125 unsigned int numberOfCellPoints =
static_cast< unsigned int >( buffer[index++] );
127 for (
unsigned int jj = 0; jj < numberOfCellPoints; jj++ )
129 outputFile << buffer[index++] + 1 <<
" ";
136 template<
typename T >
142 for (
SizeValueType ii = 0; ii < this->m_NumberOfPointPixels; ii++ )
145 for (
unsigned int jj = 0; jj < this->m_PointDimension; jj++ )
147 outputFile << convert(buffer[index++]) <<
" ";
158 void PrintSelf(std::ostream & os,
Indent indent)
const;
166 void operator=(
const Self &);
void WritePointData(T *buffer, std::ofstream &outputFile)
Light weight base class for most itk classes.
void WritePoints(T *buffer, std::ofstream &outputFile)
void WriteCells(T *buffer, std::ofstream &outputFile)
This class defines how to read and write Object file format.
SmartPointer< Self > Pointer
IdentifierType SizeValueType
std::streampos m_PointsStartPosition
unsigned long SizeValueType
Superclass::SizeValueType SizeValueType
std::ifstream m_InputFile
Convert floating and fixed point numbers to strings.
SmartPointer< const Self > ConstPointer
Control indentation during Print() invocation.
Abstract superclass defines mesh IO interface.
Define additional traits for native types such as int or float.