50 #ifndef __PLYREADER_HH__
51 #define __PLYREADER_HH__
62 #include <OpenMesh/Core/System/config.h>
63 #include <OpenMesh/Core/Utils/SingletonT.hh>
64 #include <OpenMesh/Core/IO/reader/BaseReader.hh>
102 bool read(
const std::string& _filename,
106 bool read(std::istream& _is,
110 bool can_u_read(
const std::string& _filename)
const;
114 ValueTypeINT8, ValueTypeCHAR,
115 ValueTypeUINT8, ValueTypeUCHAR,
116 ValueTypeINT16, ValueTypeSHORT,
117 ValueTypeUINT16, ValueTypeUSHORT,
118 ValueTypeINT32, ValueTypeINT,
119 ValueTypeUINT32, ValueTypeUINT,
120 ValueTypeFLOAT32, ValueTypeFLOAT,
121 ValueTypeFLOAT64, ValueTypeDOUBLE
126 bool can_u_read(std::istream& _is)
const;
128 bool read_ascii(std::istream& _in, BaseImporter& _bi,
const Options& _opt)
const;
129 bool read_binary(std::istream& _in, BaseImporter& _bi,
bool swap,
const Options& _opt)
const;
131 float readToFloatValue(ValueType _type , std::fstream& _in)
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,
int& _value)
const;
138 void readInteger(ValueType _type, std::istream& _in,
int& _value)
const;
139 void readInteger(ValueType _type, std::istream& _in,
unsigned int& _value)
const;
142 void consume_input(std::istream& _in,
int _count)
const {
143 _in.read(reinterpret_cast<char*>(&buff[0]), _count);
146 mutable unsigned char buff[8];
149 mutable Options options_;
152 mutable Options userOptions_;
154 mutable unsigned int vertexCount_;
155 mutable unsigned int faceCount_;
157 mutable ValueType vertexType_;
158 mutable uint vertexDimension_;
160 mutable ValueType faceIndexType_;
161 mutable ValueType faceEntryType_;
163 enum VertexProperty {
164 XCOORD,YCOORD,ZCOORD,
166 COLORRED,COLORGREEN,COLORBLUE,COLORALPHA,
172 mutable std::map<ValueType, int> scalar_size_;
175 mutable unsigned int vertexPropertyCount_;
176 mutable std::map< int , std::pair< VertexProperty, ValueType> > vertexPropertyMap_;
186 OPENMESHDLLEXPORT _PLYReader_& PLYReader();