57 #ifndef __PLYREADER_HH__
58 #define __PLYREADER_HH__
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;
135 bool read_ascii(std::istream& _in,
BaseImporter& _bi,
const Options& _opt)
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;
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 ValueType vertexType_;
169 mutable uint vertexDimension_;
172 XCOORD,YCOORD,ZCOORD,
174 COLORRED,COLORGREEN,COLORBLUE,COLORALPHA,
175 XNORM,YNORM,ZNORM, CUSTOM_PROP, VERTEX_INDICES,
188 ValueType listIndexType;
189 PropertyInfo():property(UNSUPPORTED),value(Unsupported),name(
""),listIndexType(Unsupported){}
190 PropertyInfo(Property _p, ValueType _v):property(_p),value(_v),name(
""),listIndexType(Unsupported){}
191 PropertyInfo(Property _p, ValueType _v,
const std::string& _n):property(_p),value(_v),name(_n),listIndexType(Unsupported){}
193 mutable std::vector< PropertyInfo > vertexProperties_;
194 mutable std::vector< PropertyInfo > faceProperties_;
197 inline void read(_PLYReader_::ValueType _type, std::istream& _in, T& _value, OpenMesh::GenProg::TrueType )
const
199 readValue(_type, _in, _value);
203 inline void read(_PLYReader_::ValueType _type, std::istream& _in, T& _value, OpenMesh::GenProg::FalseType )
const
209 template<
bool binary,
typename T,
typename Handle>
210 void readCreateCustomProperty(std::istream& _in,
BaseImporter& _bi, Handle _h,
const std::string& _propName,
const ValueType _valueType,
const ValueType _listType)
const;
212 template<
bool binary,
typename Handle>
213 void readCustomProperty(std::istream& _in,
BaseImporter& _bi, Handle _h,
const std::string& _propName,
const _PLYReader_::ValueType _valueType,
const _PLYReader_::ValueType _listIndexType)
const;
222 OPENMESHDLLEXPORT _PLYReader_& PLYReader();
Options userOptions_
Options that the user wants to read.
Options options_
Available per file options for reading.
Set options for reader/writer modules.
_PLYReader_ __PLYReaderInstance
Declare the single entity of the PLY reader.
std::string get_description() const
Returns a brief description of the file type that can be parsed.
std::string get_extensions() const
std::map< ValueType, int > scalar_size_
Stores sizes of property types.
std::string get_magic() const
Return magic bits used to determine file format.
void consume_input(std::istream &_in, int _count) const
Read unsupported properties in PLY file.