Merge branch 'ply_binary_reader_fix' into 'master'

Fixed binary reader errors in ply reader. (Thanks to Michael Kremer for the patch).

@michaelkraemer: Thanks for the patch. If all builds run fine, it will be integrated into the next release.

See merge request !64
This commit is contained in:
Jan Möbius
2016-05-17 13:59:00 +02:00
2 changed files with 10 additions and 3 deletions

View File

@@ -18,6 +18,11 @@
<li>PolyMesh: Copy per-halfedge and per-face properties to new elments during triangulation (Thanks to Max Limper for the patch)</li> <li>PolyMesh: Copy per-halfedge and per-face properties to new elments during triangulation (Thanks to Max Limper for the patch)</li>
</ul> </ul>
<b>IO</b>
<ul>
<li>PLY Reader: Fixed binary reader errors in ply reader. (Thanks to Michael Kremer for the patch)</li>
</ul>
<b>Build System</b> <b>Build System</b>
<ul> <ul>
<li>Some fixes for min gw (Thanks to Xan for the patch)</li> <li>Some fixes for min gw (Thanks to Xan for the patch)</li>

View File

@@ -606,7 +606,7 @@ bool _PLYReader_::read_binary(std::istream& _in, BaseImporter& _bi, bool /*_swap
case VERTEX_INDICES: case VERTEX_INDICES:
// nV = number of Vertices for current face // nV = number of Vertices for current face
unsigned int nV; unsigned int nV;
readValue(prop.listIndexType, _in, nV); readInteger(prop.listIndexType, _in, nV);
if (nV == 3) { if (nV == 3) {
vhandles.resize(3); vhandles.resize(3);
@@ -636,11 +636,11 @@ bool _PLYReader_::read_binary(std::istream& _in, BaseImporter& _bi, bool /*_swap
if (_opt.check(Options::Custom) && fh.is_valid()) if (_opt.check(Options::Custom) && fh.is_valid())
readCustomProperty<true>(_in, _bi, fh, prop.name, prop.value, prop.listIndexType); readCustomProperty<true>(_in, _bi, fh, prop.name, prop.value, prop.listIndexType);
else else
consume_input(_in, scalar_size_[vertexProperties_[propertyIndex].value]); consume_input(_in, scalar_size_[faceProperties_[propertyIndex].value]);
break; break;
default: default:
consume_input(_in, scalar_size_[vertexProperties_[propertyIndex].value]); consume_input(_in, scalar_size_[faceProperties_[propertyIndex].value]);
break; break;
} }
} }
@@ -1154,6 +1154,8 @@ bool _PLYReader_::can_u_read(std::istream& _is) const {
indexType = ValueTypeUINT8; indexType = ValueTypeUINT8;
} else if (listIndexType == "uchar") { } else if (listIndexType == "uchar") {
indexType = ValueTypeUCHAR; indexType = ValueTypeUCHAR;
} else if (listIndexType == "int") {
indexType = ValueTypeINT;
} else { } else {
omerr() << "Unsupported Index type for property list: " << listIndexType << std::endl; omerr() << "Unsupported Index type for property list: " << listIndexType << std::endl;
continue; continue;