57 #ifndef __PLYREADER_HH__ 58 #define __PLYREADER_HH__ 70 #include <OpenMesh/Core/System/config.h> 71 #include <OpenMesh/Core/Utils/SingletonT.hh> 72 #include <OpenMesh/Core/IO/reader/BaseReader.hh> 73 #include <OpenMesh/Core/Utils/GenProg.hh> 109 bool read(
const std::string& _filename,
113 bool read(std::istream& _is,
117 bool can_u_read(
const std::string& _filename)
const;
121 ValueTypeINT8, ValueTypeCHAR,
122 ValueTypeUINT8, ValueTypeUCHAR,
123 ValueTypeINT16, ValueTypeSHORT,
124 ValueTypeUINT16, ValueTypeUSHORT,
125 ValueTypeINT32, ValueTypeINT,
126 ValueTypeUINT32, ValueTypeUINT,
127 ValueTypeFLOAT32, ValueTypeFLOAT,
128 ValueTypeFLOAT64, ValueTypeDOUBLE
133 bool can_u_read(std::istream& _is)
const;
136 bool read_binary(std::istream& _in,
BaseImporter& _bi,
bool swap,
const Options& _opt)
const;
138 float readToFloatValue(ValueType _type , std::fstream& _in)
const;
140 void readValue(ValueType _type , std::istream& _in,
float& _value)
const;
141 void readValue(ValueType _type , std::istream& _in,
double& _value)
const;
142 void readValue(ValueType _type , std::istream& _in,
unsigned int& _value)
const;
143 void readValue(ValueType _type , std::istream& _in,
unsigned short& _value)
const;
144 void readValue(ValueType _type , std::istream& _in,
unsigned char& _value)
const;
145 void readValue(ValueType _type , std::istream& _in,
int& _value)
const;
146 void readValue(ValueType _type , std::istream& _in,
short& _value)
const;
147 void readValue(ValueType _type , std::istream& _in,
signed char& _value)
const;
149 void readInteger(ValueType _type, std::istream& _in,
int& _value)
const;
150 void readInteger(ValueType _type, std::istream& _in,
unsigned int& _value)
const;
153 void consume_input(std::istream& _in,
int _count)
const {
154 _in.read(reinterpret_cast<char*>(&buff[0]), _count);
157 mutable unsigned char buff[8];
165 mutable unsigned int vertexCount_;
166 mutable unsigned int faceCount_;
168 mutable uint vertexDimension_;
171 XCOORD,YCOORD,ZCOORD,
173 COLORRED,COLORGREEN,COLORBLUE,COLORALPHA,
174 XNORM,YNORM,ZNORM, CUSTOM_PROP, VERTEX_INDICES,
179 mutable std::map<ValueType, int> scalar_size_;
187 ValueType listIndexType;
188 PropertyInfo():property(UNSUPPORTED),value(Unsupported),name(
""),listIndexType(Unsupported){}
189 PropertyInfo(Property _p, ValueType _v):property(_p),value(_v),name(
""),listIndexType(Unsupported){}
190 PropertyInfo(Property _p, ValueType _v,
const std::string& _n):property(_p),value(_v),name(_n),listIndexType(Unsupported){}
205 std::vector< PropertyInfo > properties_;
208 mutable std::vector< ElementInfo > elements_;
211 inline void read(_PLYReader_::ValueType _type, std::istream& _in, T& _value, OpenMesh::GenProg::TrueType )
const 213 readValue(_type, _in, _value);
217 inline void read(_PLYReader_::ValueType _type, std::istream& _in, T& _value, OpenMesh::GenProg::FalseType )
const 223 template<
bool binary,
typename T,
typename Handle>
224 void readCreateCustomProperty(std::istream& _in,
BaseImporter& _bi, Handle _h,
const std::string& _propName,
const ValueType _valueType,
const ValueType _listType)
const;
226 template<
bool binary,
typename Handle>
227 void readCustomProperty(std::istream& _in,
BaseImporter& _bi, Handle _h,
const std::string& _propName,
const _PLYReader_::ValueType _valueType,
const _PLYReader_::ValueType _listIndexType)
const;
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition: MeshItems.hh:64
Base class for reader modules.
Definition: BaseReader.hh:94
std::string get_description() const
Returns a brief description of the file type that can be parsed.
Definition: PLYReader.hh:105
std::string get_magic() const
Return magic bits used to determine file format.
Definition: PLYReader.hh:107
std::string get_extensions() const
Returns a string with the accepted file extensions separated by a whitespace and in small caps...
Definition: PLYReader.hh:106
Set options for reader/writer modules.
Definition: Options.hh:95
Base class for importer modules.
Definition: BaseImporter.hh:88
Implementation of the PLY format reader.
Definition: PLYReader.hh:99
_PLYReader_ __PLYReaderInstance
Declare the single entity of the PLY reader.
Definition: PLYReader.cc:79