52 #ifndef __PLYREADER_HH__ 53 #define __PLYREADER_HH__ 65 #include <OpenMesh/Core/System/config.h> 66 #include <OpenMesh/Core/Utils/SingletonT.hh> 67 #include <OpenMesh/Core/IO/reader/BaseReader.hh> 68 #include <OpenMesh/Core/Utils/GenProg.hh> 104 bool read(
const std::string& _filename,
108 bool read(std::istream& _is,
112 bool can_u_read(
const std::string& _filename)
const;
116 ValueTypeINT8, ValueTypeCHAR,
117 ValueTypeUINT8, ValueTypeUCHAR,
118 ValueTypeINT16, ValueTypeSHORT,
119 ValueTypeUINT16, ValueTypeUSHORT,
120 ValueTypeINT32, ValueTypeINT,
121 ValueTypeUINT32, ValueTypeUINT,
122 ValueTypeFLOAT32, ValueTypeFLOAT,
123 ValueTypeFLOAT64, ValueTypeDOUBLE
128 bool can_u_read(std::istream& _is)
const;
131 bool read_binary(std::istream& _in,
BaseImporter& _bi,
bool swap,
const Options& _opt)
const;
133 float readToFloatValue(ValueType _type , std::fstream& _in)
const;
135 void readValue(ValueType _type , std::istream& _in,
float& _value)
const;
136 void readValue(ValueType _type , std::istream& _in,
double& _value)
const;
137 void readValue(ValueType _type , std::istream& _in,
unsigned int& _value)
const;
138 void readValue(ValueType _type , std::istream& _in,
unsigned short& _value)
const;
139 void readValue(ValueType _type , std::istream& _in,
unsigned char& _value)
const;
140 void readValue(ValueType _type , std::istream& _in,
int& _value)
const;
141 void readValue(ValueType _type , std::istream& _in,
short& _value)
const;
142 void readValue(ValueType _type , std::istream& _in,
signed char& _value)
const;
144 void readInteger(ValueType _type, std::istream& _in,
int& _value)
const;
145 void readInteger(ValueType _type, std::istream& _in,
unsigned int& _value)
const;
148 void consume_input(std::istream& _in,
int _count)
const {
149 _in.read(reinterpret_cast<char*>(&buff[0]), _count);
152 mutable unsigned char buff[8];
160 mutable unsigned int vertexCount_;
161 mutable unsigned int faceCount_;
163 mutable uint vertexDimension_;
166 XCOORD,YCOORD,ZCOORD,
168 COLORRED,COLORGREEN,COLORBLUE,COLORALPHA,
169 XNORM,YNORM,ZNORM, CUSTOM_PROP, VERTEX_INDICES,
174 mutable std::map<ValueType, int> scalar_size_;
182 ValueType listIndexType;
183 PropertyInfo():property(UNSUPPORTED),value(Unsupported),name(
""),listIndexType(Unsupported){}
184 PropertyInfo(Property _p, ValueType _v):property(_p),value(_v),name(
""),listIndexType(Unsupported){}
185 PropertyInfo(Property _p, ValueType _v,
const std::string& _n):property(_p),value(_v),name(_n),listIndexType(Unsupported){}
200 std::vector< PropertyInfo > properties_;
203 mutable std::vector< ElementInfo > elements_;
206 inline void read(_PLYReader_::ValueType _type, std::istream& _in, T& _value, OpenMesh::GenProg::TrueType )
const 208 readValue(_type, _in, _value);
212 inline void read(_PLYReader_::ValueType _type, std::istream& _in, T& _value, OpenMesh::GenProg::FalseType )
const 218 template<
bool binary,
typename T,
typename Handle>
219 void readCreateCustomProperty(std::istream& _in,
BaseImporter& _bi, Handle _h,
const std::string& _propName,
const ValueType _valueType,
const ValueType _listType)
const;
221 template<
bool binary,
typename Handle>
222 void readCustomProperty(std::istream& _in,
BaseImporter& _bi, Handle _h,
const std::string& _propName,
const _PLYReader_::ValueType _valueType,
const _PLYReader_::ValueType _listIndexType)
const;
Base class for reader modules.
Definition: BaseReader.hh:89
std::string get_description() const
Returns a brief description of the file type that can be parsed.
Definition: PLYReader.hh:100
_PLYReader_ __PLYReaderInstance
Declare the single entity of the PLY reader.
Definition: PLYReader.cc:72
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition: MeshItems.hh:59
Set options for reader/writer modules.
Definition: Options.hh:90
std::string get_magic() const
Return magic bits used to determine file format.
Definition: PLYReader.hh:102
Implementation of the PLY format reader.
Definition: PLYReader.hh:94
Base class for importer modules.
Definition: BaseImporter.hh:83
std::string get_extensions() const
Returns a string with the accepted file extensions separated by a whitespace and in small caps...
Definition: PLYReader.hh:101