49 #include <OpenMesh/Core/IO/reader/PLYReader.hh> 50 #include <OpenMesh/Core/IO/IOManager.hh> 51 #include <OpenMesh/Core/Utils/color_cast.hh> 80 _PLYReader_::_PLYReader_() {
108 std::fstream in(_filename.c_str(), (std::ios_base::binary | std::ios_base::in) );
110 if (!in.is_open() || !in.good()) {
111 omerr() <<
"[PLYReader] : cannot not open file " << _filename << std::endl;
115 bool result =
read(in, _bi, _opt);
127 omerr() <<
"[PLYReader] : cannot not use stream" << std::endl;
133 omerr() <<
"[PLYReader] : Unable to parse header\n";
173 return (
options_.is_binary() ? read_binary(_in, _bi, swap, _opt) : read_ascii(_in, _bi, _opt));
177 template<
typename T,
typename Handle>
193 template<
bool binary,
typename T,
typename Handle>
194 void _PLYReader_::readCreateCustomProperty(std::istream& _in,
BaseImporter& _bi, Handle _h,
const std::string& _propName,
const _PLYReader_::ValueType _valueType,
const _PLYReader_::ValueType _listType)
const 196 if (_listType == Unsupported)
203 _bi.kernel()->
property(prop).set_persistent(
true);
208 read(_valueType, _in, in, OpenMesh::GenProg::Bool2Type<binary>());
209 _bi.kernel()->
property(prop,_h) = in;
218 _bi.kernel()->
property(prop).set_persistent(
true);
223 read(_listType, _in, numberOfValues, OpenMesh::GenProg::Bool2Type<binary>());
225 vec.reserve(numberOfValues);
227 for (
int i = 0; i < numberOfValues; ++i)
230 read(_valueType, _in, in, OpenMesh::GenProg::Bool2Type<binary>());
233 _bi.kernel()->
property(prop,_h) = vec;
237 template<
bool binary,
typename Handle>
238 void _PLYReader_::readCustomProperty(std::istream& _in,
BaseImporter& _bi, Handle _h,
const std::string& _propName,
const _PLYReader_::ValueType _valueType,
const _PLYReader_::ValueType _listIndexType)
const 244 readCreateCustomProperty<binary,signed char>(_in,_bi,_h,_propName,_valueType,_listIndexType);
248 readCreateCustomProperty<binary,unsigned char>(_in,_bi,_h,_propName,_valueType,_listIndexType);
252 readCreateCustomProperty<binary,short>(_in,_bi,_h,_propName,_valueType,_listIndexType);
254 case ValueTypeUINT16:
255 case ValueTypeUSHORT:
256 readCreateCustomProperty<binary,unsigned short>(_in,_bi,_h,_propName,_valueType,_listIndexType);
260 readCreateCustomProperty<binary,int>(_in,_bi,_h,_propName,_valueType,_listIndexType);
262 case ValueTypeUINT32:
264 readCreateCustomProperty<binary,unsigned int>(_in,_bi,_h,_propName,_valueType,_listIndexType);
266 case ValueTypeFLOAT32:
268 readCreateCustomProperty<binary,float>(_in,_bi,_h,_propName,_valueType,_listIndexType);
270 case ValueTypeFLOAT64:
271 case ValueTypeDOUBLE:
272 readCreateCustomProperty<binary,double>(_in,_bi,_h,_propName,_valueType,_listIndexType);
275 std::cerr <<
"unsupported type" << std::endl;
283 bool _PLYReader_::read_ascii(std::istream& _in,
BaseImporter& _bi,
const Options& _opt)
const {
285 unsigned int i, j, k, l, idx;
292 BaseImporter::VHandles vhandles;
295 _bi.reserve(vertexCount_, 3* vertexCount_ , faceCount_);
297 if (vertexDimension_ != 3) {
298 omerr() <<
"[PLYReader] : Only vertex dimension 3 is supported." << std::endl;
302 const bool err_enabled = omerr().is_enabled();
303 size_t complex_faces = 0;
307 for (std::vector<ElementInfo>::iterator e_it = elements_.begin(); e_it != elements_.end(); ++e_it)
313 omerr() <<
"Unexpected end of file while reading." << std::endl;
317 if (e_it->element_== VERTEX)
320 for (i = 0; i < e_it->count_ && !_in.eof(); ++i) {
321 vh = _bi.add_vertex();
339 for (
size_t propertyIndex = 0; propertyIndex < e_it->properties_.size(); ++propertyIndex) {
341 switch (prop.property) {
367 if (prop.value == ValueTypeFLOAT32 ||
368 prop.value == ValueTypeFLOAT) {
370 c[0] =
static_cast<OpenMesh::Vec4i::value_type
> (tmp * 255.0f);
376 if (prop.value == ValueTypeFLOAT32 ||
377 prop.value == ValueTypeFLOAT) {
379 c[1] =
static_cast<OpenMesh::Vec4i::value_type
> (tmp * 255.0f);
385 if (prop.value == ValueTypeFLOAT32 ||
386 prop.value == ValueTypeFLOAT) {
388 c[2] =
static_cast<OpenMesh::Vec4i::value_type
> (tmp * 255.0f);
394 if (prop.value == ValueTypeFLOAT32 ||
395 prop.value == ValueTypeFLOAT) {
397 c[3] =
static_cast<OpenMesh::Vec4i::value_type
> (tmp * 255.0f);
404 readCustomProperty<false>(_in, _bi, vh, prop.name, prop.value, prop.listIndexType);
414 _bi.set_point(vh, v);
415 if (_opt.vertex_has_normal())
416 _bi.set_normal(vh, n);
417 if (_opt.vertex_has_texcoord())
418 _bi.set_texcoord(vh, t);
419 if (_opt.vertex_has_color())
420 _bi.set_color(vh,
Vec4uc(c));
423 else if (e_it->element_ == FACE)
426 for (i = 0; i < faceCount_ && !_in.eof(); ++i) {
434 for (
size_t propertyIndex = 0; propertyIndex < e_it->properties_.size(); ++propertyIndex) {
436 switch (prop.property) {
454 for (j = 0; j < nV; ++j) {
460 fh = _bi.add_face(vhandles);
466 if (prop.value == ValueTypeFLOAT32 || prop.value == ValueTypeFLOAT) {
468 c[0] =
static_cast<OpenMesh::Vec4i::value_type
> (tmp * 255.0f);
474 if (prop.value == ValueTypeFLOAT32 || prop.value == ValueTypeFLOAT) {
476 c[1] =
static_cast<OpenMesh::Vec4i::value_type
> (tmp * 255.0f);
482 if (prop.value == ValueTypeFLOAT32 || prop.value == ValueTypeFLOAT) {
484 c[2] =
static_cast<OpenMesh::Vec4i::value_type
> (tmp * 255.0f);
490 if (prop.value == ValueTypeFLOAT32 || prop.value == ValueTypeFLOAT) {
492 c[3] =
static_cast<OpenMesh::Vec4i::value_type
> (tmp * 255.0f);
499 readCustomProperty<false>(_in, _bi, fh, prop.name, prop.value, prop.listIndexType);
509 if (_opt.face_has_color())
510 _bi.set_color(fh,
Vec4uc(c));
516 for (i = 0; i < e_it->count_ && !_in.eof(); ++i) {
517 for (
size_t propertyIndex = 0; propertyIndex < e_it->properties_.size(); ++propertyIndex)
525 if(e_it->element_== FACE)
534 omerr() << complex_faces <<
"The reader encountered invalid faces, that could not be added.\n";
542 bool _PLYReader_::read_binary(std::istream& _in,
BaseImporter& _bi,
bool ,
const Options& _opt)
const {
546 BaseImporter::VHandles vhandles;
551 _bi.reserve(vertexCount_, 3* vertexCount_ , faceCount_);
553 const bool err_enabled = omerr().is_enabled();
554 size_t complex_faces = 0;
558 for (std::vector<ElementInfo>::iterator e_it = elements_.begin(); e_it != elements_.end(); ++e_it)
560 if (e_it->element_ == VERTEX)
563 for (
unsigned int i = 0; i < e_it->count_ && !_in.eof(); ++i) {
564 vh = _bi.add_vertex();
582 for (
size_t propertyIndex = 0; propertyIndex < e_it->properties_.size(); ++propertyIndex) {
584 switch (prop.property) {
586 readValue(prop.value, _in, v[0]);
589 readValue(prop.value, _in, v[1]);
592 readValue(prop.value, _in, v[2]);
595 readValue(prop.value, _in, n[0]);
598 readValue(prop.value, _in, n[1]);
601 readValue(prop.value, _in, n[2]);
604 readValue(prop.value, _in, t[0]);
607 readValue(prop.value, _in, t[1]);
610 if (prop.value == ValueTypeFLOAT32 || prop.value == ValueTypeFLOAT) {
611 readValue(prop.value, _in, tmp);
613 c[0] =
static_cast<OpenMesh::Vec4i::value_type
> (tmp * 255.0f);
616 readInteger(prop.value, _in, c[0]);
620 if (prop.value == ValueTypeFLOAT32 || prop.value == ValueTypeFLOAT) {
621 readValue(prop.value, _in, tmp);
622 c[1] =
static_cast<OpenMesh::Vec4i::value_type
> (tmp * 255.0f);
625 readInteger(prop.value, _in, c[1]);
629 if (prop.value == ValueTypeFLOAT32 || prop.value == ValueTypeFLOAT) {
630 readValue(prop.value, _in, tmp);
631 c[2] =
static_cast<OpenMesh::Vec4i::value_type
> (tmp * 255.0f);
634 readInteger(prop.value, _in, c[2]);
638 if (prop.value == ValueTypeFLOAT32 || prop.value == ValueTypeFLOAT) {
639 readValue(prop.value, _in, tmp);
640 c[3] =
static_cast<OpenMesh::Vec4i::value_type
> (tmp * 255.0f);
643 readInteger(prop.value, _in, c[3]);
648 readCustomProperty<true>(_in, _bi, vh, prop.name, prop.value, prop.listIndexType);
660 _bi.set_point(vh, v);
661 if (_opt.vertex_has_normal())
662 _bi.set_normal(vh, n);
663 if (_opt.vertex_has_texcoord())
664 _bi.set_texcoord(vh, t);
665 if (_opt.vertex_has_color())
666 _bi.set_color(vh,
Vec4uc(c));
669 else if (e_it->element_ == FACE) {
670 for (
unsigned i = 0; i < e_it->count_ && !_in.eof(); ++i) {
678 for (
size_t propertyIndex = 0; propertyIndex < e_it->properties_.size(); ++propertyIndex)
681 switch (prop.property) {
686 readInteger(prop.listIndexType, _in, nV);
690 unsigned int j, k, l;
691 readInteger(prop.value, _in, j);
692 readInteger(prop.value, _in, k);
693 readInteger(prop.value, _in, l);
701 for (
unsigned j = 0; j < nV; ++j) {
703 readInteger(prop.value, _in, idx);
708 fh = _bi.add_face(vhandles);
713 if (prop.value == ValueTypeFLOAT32 ||
714 prop.value == ValueTypeFLOAT) {
715 readValue(prop.value, _in, tmp);
716 c[0] =
static_cast<OpenMesh::Vec4i::value_type
> (tmp * 255.0f);
718 readInteger(prop.value, _in, c[0]);
721 if (prop.value == ValueTypeFLOAT32 ||
722 prop.value == ValueTypeFLOAT) {
723 readValue(prop.value, _in, tmp);
724 c[1] =
static_cast<OpenMesh::Vec4i::value_type
> (tmp * 255.0f);
726 readInteger(prop.value, _in, c[1]);
729 if (prop.value == ValueTypeFLOAT32 ||
730 prop.value == ValueTypeFLOAT) {
731 readValue(prop.value, _in, tmp);
732 c[2] =
static_cast<OpenMesh::Vec4i::value_type
> (tmp * 255.0f);
734 readInteger(prop.value, _in, c[2]);
737 if (prop.value == ValueTypeFLOAT32 ||
738 prop.value == ValueTypeFLOAT) {
739 readValue(prop.value, _in, tmp);
740 c[3] =
static_cast<OpenMesh::Vec4i::value_type
> (tmp * 255.0f);
742 readInteger(prop.value, _in, c[3]);
746 readCustomProperty<true>(_in, _bi, fh, prop.name, prop.value, prop.listIndexType);
756 if (_opt.face_has_color())
757 _bi.set_color(fh,
Vec4uc(c));
761 for (
unsigned int i = 0; i < e_it->count_ && !_in.eof(); ++i)
763 for (
size_t propertyIndex = 0; propertyIndex < e_it->properties_.size(); ++propertyIndex)
776 omerr() <<
"Unexpected end of file while reading." << std::endl;
780 if (e_it->element_ == FACE)
788 omerr() << complex_faces <<
"The reader encountered invalid faces, that could not be added.\n";
798 void _PLYReader_::readValue(ValueType _type, std::istream& _in,
float& _value)
const {
801 case ValueTypeFLOAT32:
809 std::cerr <<
"unsupported conversion type to float: " << _type << std::endl;
818 void _PLYReader_::readValue(ValueType _type, std::istream& _in,
double& _value)
const {
822 case ValueTypeFLOAT64:
824 case ValueTypeDOUBLE:
835 std::cerr <<
"unsupported conversion type to double: " << _type << std::endl;
844 void _PLYReader_::readValue(ValueType _type, std::istream& _in,
unsigned char& _value)
const{
846 readValue(_type,_in,tmp);
852 void _PLYReader_::readValue(ValueType _type, std::istream& _in,
unsigned short& _value)
const{
854 readValue(_type,_in,tmp);
860 void _PLYReader_::readValue(ValueType _type, std::istream& _in,
signed char& _value)
const{
862 readValue(_type,_in,tmp);
868 void _PLYReader_::readValue(ValueType _type, std::istream& _in,
short& _value)
const{
870 readValue(_type,_in,tmp);
876 void _PLYReader_::readValue(ValueType _type, std::istream& _in,
unsigned int& _value)
const {
886 case ValueTypeUINT32:
889 _value = tmp_uint32_t;
893 case ValueTypeUSHORT:
895 case ValueTypeUINT16:
898 _value = tmp_uint16_t;
914 std::cerr <<
"unsupported conversion type to unsigned int: " << _type << std::endl;
924 void _PLYReader_::readValue(ValueType _type, std::istream& _in,
int& _value)
const {
937 _value = tmp_int32_t;
946 _value = tmp_int16_t;
962 std::cerr <<
"unsupported conversion type to int: " << _type << std::endl;
972 void _PLYReader_::readInteger(ValueType _type, std::istream& _in,
int& _value)
const {
986 _value = tmp_int32_t;
992 case ValueTypeUINT32:
995 _value = tmp_uint32_t;
1008 case ValueTypeUCHAR:
1010 case ValueTypeUINT8:
1020 std::cerr <<
"unsupported conversion type to int: " << _type << std::endl;
1030 void _PLYReader_::readInteger(ValueType _type, std::istream& _in,
unsigned int& _value)
const {
1041 case ValueTypeUINT32:
1044 _value = tmp_uint32_t;
1050 case ValueTypeINT32:
1053 _value = tmp_int32_t;
1057 case ValueTypeUCHAR:
1059 case ValueTypeUINT8:
1078 std::cerr <<
"unsupported conversion type to unsigned int: " << _type << std::endl;
1094 std::ifstream ifs(_filename.c_str());
1107 std::string get_property_name(std::string _string1, std::string _string2) {
1109 if (_string1 ==
"float32" || _string1 ==
"float64" || _string1 ==
"float" || _string1 ==
"double" ||
1110 _string1 ==
"int8" || _string1 ==
"uint8" || _string1 ==
"char" || _string1 ==
"uchar" ||
1111 _string1 ==
"int32" || _string1 ==
"uint32" || _string1 ==
"int" || _string1 ==
"uint" ||
1112 _string1 ==
"int16" || _string1 ==
"uint16" || _string1 ==
"short" || _string1 ==
"ushort")
1115 if (_string2 ==
"float32" || _string2 ==
"float64" || _string2 ==
"float" || _string2 ==
"double" ||
1116 _string2 ==
"int8" || _string2 ==
"uint8" || _string2 ==
"char" || _string2 ==
"uchar" ||
1117 _string2 ==
"int32" || _string2 ==
"uint32" || _string2 ==
"int" || _string2 ==
"uint" ||
1118 _string2 ==
"int16" || _string2 ==
"uint16" || _string2 ==
"short" || _string2 ==
"ushort")
1122 std::cerr <<
"Unsupported entry type" << std::endl;
1123 return "Unsupported";
1128 _PLYReader_::ValueType get_property_type(std::string& _string1, std::string& _string2) {
1130 if (_string1 ==
"float32" || _string2 ==
"float32")
1132 return _PLYReader_::ValueTypeFLOAT32;
1134 else if (_string1 ==
"float64" || _string2 ==
"float64")
1136 return _PLYReader_::ValueTypeFLOAT64;
1138 else if (_string1 ==
"float" || _string2 ==
"float")
1140 return _PLYReader_::ValueTypeFLOAT;
1142 else if (_string1 ==
"double" || _string2 ==
"double")
1144 return _PLYReader_::ValueTypeDOUBLE;
1146 else if (_string1 ==
"int8" || _string2 ==
"int8")
1148 return _PLYReader_::ValueTypeINT8;
1150 else if (_string1 ==
"uint8" || _string2 ==
"uint8")
1152 return _PLYReader_::ValueTypeUINT8;
1154 else if (_string1 ==
"char" || _string2 ==
"char")
1156 return _PLYReader_::ValueTypeCHAR;
1158 else if (_string1 ==
"uchar" || _string2 ==
"uchar")
1160 return _PLYReader_::ValueTypeUCHAR;
1162 else if (_string1 ==
"int32" || _string2 ==
"int32")
1164 return _PLYReader_::ValueTypeINT32;
1166 else if (_string1 ==
"uint32" || _string2 ==
"uint32")
1168 return _PLYReader_::ValueTypeUINT32;
1170 else if (_string1 ==
"int" || _string2 ==
"int")
1172 return _PLYReader_::ValueTypeINT;
1174 else if (_string1 ==
"uint" || _string2 ==
"uint")
1176 return _PLYReader_::ValueTypeUINT;
1178 else if (_string1 ==
"int16" || _string2 ==
"int16")
1180 return _PLYReader_::ValueTypeINT16;
1182 else if (_string1 ==
"uint16" || _string2 ==
"uint16")
1184 return _PLYReader_::ValueTypeUINT16;
1186 else if (_string1 ==
"short" || _string2 ==
"short")
1188 return _PLYReader_::ValueTypeSHORT;
1190 else if (_string1 ==
"ushort" || _string2 ==
"ushort")
1192 return _PLYReader_::ValueTypeUSHORT;
1194 return _PLYReader_::Unsupported;
1210 std::getline(_is, line);
1214 const size_t s = line.size();
1215 if( s > 0 && line[s - 1] ==
'\r') line.resize(s - 1);
1218 if (line !=
"PLY" && line !=
"ply")
1223 vertexDimension_ = 0;
1225 unsigned int elementCount = 0;
1227 std::string keyword;
1228 std::string fileType;
1229 std::string elementName =
"";
1230 std::string propertyName;
1231 std::string listIndexType;
1232 std::string listEntryType;
1240 omerr() <<
"Defect PLY header detected" << std::endl;
1244 if (fileType ==
"ascii") {
1246 }
else if (fileType ==
"binary_little_endian") {
1252 }
else if (fileType ==
"binary_big_endian") {
1259 omerr() <<
"Unsupported PLY format: " << fileType << std::endl;
1263 std::streamoff streamPos = _is.tellg();
1265 while (keyword !=
"end_header") {
1267 if (keyword ==
"comment") {
1268 std::getline(_is, line);
1269 }
else if (keyword ==
"element") {
1271 _is >> elementCount;
1274 element.name_ = elementName;
1275 element.count_ = elementCount;
1277 if (elementName ==
"vertex") {
1278 vertexCount_ = elementCount;
1279 element.element_ = VERTEX;
1280 }
else if (elementName ==
"face") {
1281 faceCount_ = elementCount;
1282 element.element_ = FACE;
1284 omerr() <<
"PLY header unsupported element type: " << elementName << std::endl;
1285 element.element_ = UNKNOWN;
1288 elements_.push_back(element);
1289 }
else if (keyword ==
"property") {
1296 if (tmp1 ==
"list") {
1297 _is >> listIndexType;
1298 _is >> listEntryType;
1299 _is >> propertyName;
1301 ValueType indexType = Unsupported;
1302 ValueType entryType = Unsupported;
1304 if (listIndexType ==
"uint8") {
1305 indexType = ValueTypeUINT8;
1306 }
else if (listIndexType ==
"uint16") {
1307 indexType = ValueTypeUINT16;
1308 }
else if (listIndexType ==
"uchar") {
1309 indexType = ValueTypeUCHAR;
1310 }
else if (listIndexType ==
"int") {
1311 indexType = ValueTypeINT;
1313 omerr() <<
"Unsupported Index type for property list: " << listIndexType << std::endl;
1317 entryType = get_property_type(listEntryType, listEntryType);
1319 if (entryType == Unsupported) {
1320 omerr() <<
"Unsupported Entry type for property list: " << listEntryType << std::endl;
1323 PropertyInfo property(CUSTOM_PROP, entryType, propertyName);
1324 property.listIndexType = indexType;
1326 if (elementName ==
"face")
1329 if (propertyName ==
"vertex_index" || propertyName ==
"vertex_indices")
1331 property.property = VERTEX_INDICES;
1333 if (!elements_.back().properties_.empty())
1335 omerr() <<
"Custom face Properties defined, before 'vertex_indices' property was defined. They will be skipped" << std::endl;
1336 elements_.back().properties_.clear();
1344 omerr() <<
"property " << propertyName <<
" belongs to unsupported element " << elementName << std::endl;
1346 elements_.back().properties_.push_back(property);
1355 ValueType valueType = get_property_type(tmp1, tmp2);
1356 propertyName = get_property_name(tmp1, tmp2);
1361 if (elementName ==
"vertex") {
1362 if (propertyName ==
"x") {
1365 }
else if (propertyName ==
"y") {
1368 }
else if (propertyName ==
"z") {
1371 }
else if (propertyName ==
"nx") {
1374 }
else if (propertyName ==
"ny") {
1377 }
else if (propertyName ==
"nz") {
1380 }
else if (propertyName ==
"u" || propertyName ==
"s") {
1383 }
else if (propertyName ==
"v" || propertyName ==
"t") {
1386 }
else if (propertyName ==
"red") {
1389 if (valueType == ValueTypeFLOAT || valueType == ValueTypeFLOAT32)
1391 }
else if (propertyName ==
"green") {
1394 if (valueType == ValueTypeFLOAT || valueType == ValueTypeFLOAT32)
1396 }
else if (propertyName ==
"blue") {
1399 if (valueType == ValueTypeFLOAT || valueType == ValueTypeFLOAT32)
1401 }
else if (propertyName ==
"diffuse_red") {
1404 if (valueType == ValueTypeFLOAT || valueType == ValueTypeFLOAT32)
1406 }
else if (propertyName ==
"diffuse_green") {
1409 if (valueType == ValueTypeFLOAT || valueType == ValueTypeFLOAT32)
1411 }
else if (propertyName ==
"diffuse_blue") {
1414 if (valueType == ValueTypeFLOAT || valueType == ValueTypeFLOAT32)
1416 }
else if (propertyName ==
"alpha") {
1420 if (valueType == ValueTypeFLOAT || valueType == ValueTypeFLOAT32)
1424 else if (elementName ==
"face") {
1425 if (propertyName ==
"red") {
1428 if (valueType == ValueTypeFLOAT || valueType == ValueTypeFLOAT32)
1430 }
else if (propertyName ==
"green") {
1433 if (valueType == ValueTypeFLOAT || valueType == ValueTypeFLOAT32)
1435 }
else if (propertyName ==
"blue") {
1438 if (valueType == ValueTypeFLOAT || valueType == ValueTypeFLOAT32)
1440 }
else if (propertyName ==
"alpha") {
1444 if (valueType == ValueTypeFLOAT || valueType == ValueTypeFLOAT32)
1450 if (entry.value == Unsupported){
1451 Property prop = CUSTOM_PROP;
1456 if (entry.property != UNSUPPORTED)
1458 elements_.back().properties_.push_back(entry);
1463 omlog() <<
"Unsupported keyword : " << keyword << std::endl;
1466 streamPos = _is.tellg();
1469 omerr() <<
"Error while reading PLY file header" << std::endl;
1477 _is.seekg(streamPos);
1484 if (c1 == 0x0D && c2 == 0x0A) {
1485 _is.seekg(streamPos + 14);
1488 _is.seekg(streamPos + 12);
Has (r) / store (w) vertex colors.
Swap byte order in binary mode.
Handle for a vertex entity.
virtual bool can_u_read(const std::string &_filename) const
Returns true if writer can parse _filename (checks extension). _filename can also provide an extensio...
Assume little endian byte ordering.
bool read(const std::string &_filename, BaseImporter &_bi, Options &_opt)
bool register_module(BaseReader *_bl)
Has (r) / store (w) face colors.
void consume_input(std::istream &_in, int _count) const
Read unsupported properties in PLY file.
Has (r) / store (w) float values for colors (currently only implemented for PLY and OFF files) ...
Options options_
Available per file options for reading.
_IOManager_ & IOManager()
std::map< ValueType, int > scalar_size_
Stores sizes of property types.
_PLYReader_ __PLYReaderInstance
Declare the single entity of the PLY reader.
Has (r) / store (w) texture coordinates.
void add_property(VPropHandleT< T > &_ph, const std::string &_name="<vprop>")
PropertyT< T > & property(VPropHandleT< T > _ph)
bool get_property_handle(VPropHandleT< T > &_ph, const std::string &_name) const
Handle for a face entity.
void clear(void)
Clear all bits.
void cleanup(void)
Restore state after default constructor.
Has (r) custom properties (currently only implemented in PLY Reader ASCII version) ...
Set options for reader/writer modules.
Has (r) / store (w) alpha values for colors.
Has (r) / store (w) vertex normals.
bool is_valid() const
The handle is valid iff the index is not negative.
Cellection of information about a property.
Assume big endian byte ordering.
bool can_u_read(const std::string &_filename) const
Returns true if writer can parse _filename (checks extension). _filename can also provide an extensio...
Options userOptions_
Options that the user wants to read.