52 #ifndef __PLYREADER_HH__ 53 #define __PLYREADER_HH__ 66 #include <OpenMesh/Core/Utils/SingletonT.hh> 67 #include <OpenMesh/Core/IO/reader/BaseReader.hh> 68 #include <OpenMesh/Core/Utils/GenProg.hh> 102 std::string
get_magic()
const override {
return "PLY"; }
104 bool read(
const std::string& _filename,
108 bool read(std::istream& _is,
112 bool can_u_read(
const std::string& _filename)
const override;
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 void readValue(ValueType _type , std::istream& _in,
float& _value)
const;
134 void readValue(ValueType _type , std::istream& _in,
double& _value)
const;
135 void readValue(ValueType _type , std::istream& _in,
unsigned int& _value)
const;
136 void readValue(ValueType _type , std::istream& _in,
unsigned short& _value)
const;
137 void readValue(ValueType _type , std::istream& _in,
unsigned char& _value)
const;
138 void readValue(ValueType _type , std::istream& _in,
int& _value)
const;
139 void readValue(ValueType _type , std::istream& _in,
short& _value)
const;
140 void readValue(ValueType _type , std::istream& _in,
signed char& _value)
const;
143 void readInteger(ValueType _type, std::istream& _in, T& _value)
const;
147 _in.read(reinterpret_cast<char*>(&buff[0]), _count);
150 mutable unsigned char buff[8];
158 mutable unsigned int vertexCount_;
159 mutable unsigned int faceCount_;
161 mutable uint vertexDimension_;
164 XCOORD,YCOORD,ZCOORD,
166 COLORRED,COLORGREEN,COLORBLUE,COLORALPHA,
167 XNORM,YNORM,ZNORM, CUSTOM_PROP, VERTEX_INDICES,
180 ValueType listIndexType;
181 PropertyInfo():property(UNSUPPORTED),value(Unsupported),name(
""),listIndexType(Unsupported){}
182 PropertyInfo(Property _p, ValueType _v):property(_p),value(_v),name(
""),listIndexType(Unsupported){}
183 PropertyInfo(Property _p, ValueType _v,
const std::string& _n):property(_p),value(_v),name(_n),listIndexType(Unsupported){}
198 std::vector< PropertyInfo > properties_;
201 mutable std::vector< ElementInfo > elements_;
204 inline void read(_PLYReader_::ValueType _type, std::istream& _in, T& _value, OpenMesh::GenProg::TrueType )
const 206 readValue(_type, _in, _value);
210 inline void read(_PLYReader_::ValueType _type, std::istream& _in, T& _value, OpenMesh::GenProg::FalseType )
const 216 inline void readInteger(_PLYReader_::ValueType _type, std::istream& _in, T& _value, OpenMesh::GenProg::TrueType )
const 218 readInteger(_type, _in, _value);
222 inline void readInteger(_PLYReader_::ValueType _type, std::istream& _in, T& _value, OpenMesh::GenProg::FalseType )
const 228 template<
bool binary,
typename T,
typename Handle>
229 void readCreateCustomProperty(std::istream& _in,
BaseImporter& _bi, Handle _h,
const std::string& _propName,
const ValueType _valueType,
const ValueType _listType)
const;
231 template<
bool binary,
typename Handle>
232 void readCustomProperty(std::istream& _in,
BaseImporter& _bi, Handle _h,
const std::string& _propName,
const _PLYReader_::ValueType _valueType,
const _PLYReader_::ValueType _listIndexType)
const;
std::string get_extensions() const override
Options userOptions_
Options that the user wants to read.
std::string get_magic() const override
Return magic bits used to determine file format.
void consume_input(std::istream &_in, int _count) const
Read unsupported properties in PLY file.
Set options for reader/writer modules.
Options options_
Available per file options for reading.
_PLYReader_ __PLYReaderInstance
Declare the single entity of the PLY reader.
std::string get_description() const override
Returns a brief description of the file type that can be parsed.
std::map< ValueType, int > scalar_size_
Stores sizes of property types.