Commit f4a367fd authored by Jan Möbius's avatar Jan Möbius
Browse files

Fixed uchar read of ply reader

git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@119 fdac6126-5c0c-442c-9429-916003d36597
parent fa016f0f
...@@ -162,7 +162,6 @@ _PLYReader_::read_ascii(std::fstream& _in, BaseImporter& _bi) const ...@@ -162,7 +162,6 @@ _PLYReader_::read_ascii(std::fstream& _in, BaseImporter& _bi) const
_bi.reserve(vertexCount_, 3*vertexCount_, faceCount_); _bi.reserve(vertexCount_, 3*vertexCount_, faceCount_);
std::cerr << "Vertices : " << vertexCount_ << std::endl;
if ( vertexDimension_ != 3 ) { if ( vertexDimension_ != 3 ) {
omerr() << "[PLYReader] : Only vertex dimension 3 is supported." << std::endl; omerr() << "[PLYReader] : Only vertex dimension 3 is supported." << std::endl;
return false; return false;
...@@ -372,6 +371,7 @@ _PLYReader_::read_binary(std::fstream& _in, BaseImporter& _bi, bool /*_swap*/) c ...@@ -372,6 +371,7 @@ _PLYReader_::read_binary(std::fstream& _in, BaseImporter& _bi, bool /*_swap*/) c
case COLORRED: case COLORRED:
if ( vertexPropertyMap_ [ propertyIndex].second == ValueTypeFLOAT32 ){ if ( vertexPropertyMap_ [ propertyIndex].second == ValueTypeFLOAT32 ){
readValue(vertexPropertyMap_ [ propertyIndex].second,_in,tmp); readValue(vertexPropertyMap_ [ propertyIndex].second,_in,tmp);
c[0] = tmp * 255.0f; c[0] = tmp * 255.0f;
}else }else
readValue(vertexPropertyMap_ [ propertyIndex].second,_in,c[0]); readValue(vertexPropertyMap_ [ propertyIndex].second,_in,c[0]);
...@@ -491,7 +491,7 @@ _PLYReader_::ValueType get_property_type(std::string _string1 , std::string _str ...@@ -491,7 +491,7 @@ _PLYReader_::ValueType get_property_type(std::string _string1 , std::string _str
else if ( _string1 == "int32" || _string2 == "float32" ) else if ( _string1 == "int32" || _string2 == "float32" )
return _PLYReader_::ValueTypeINT32; return _PLYReader_::ValueTypeINT32;
else if ( _string1 == "uchar" || _string2 == "uchar" ) else if ( _string1 == "uchar" || _string2 == "uchar" )
return _PLYReader_::ValueTypeINT32; return _PLYReader_::ValueTypeUCHAR;
else if ( _string1 == "float" || _string2 == "float" ) else if ( _string1 == "float" || _string2 == "float" )
return _PLYReader_::ValueTypeFLOAT; return _PLYReader_::ValueTypeFLOAT;
...@@ -612,8 +612,6 @@ bool _PLYReader_::can_u_read(std::istream& _is) const ...@@ -612,8 +612,6 @@ bool _PLYReader_::can_u_read(std::istream& _is) const
ValueType valueType = get_property_type(tmp1,tmp2); ValueType valueType = get_property_type(tmp1,tmp2);
propertyName = get_property_name(tmp1,tmp2); propertyName = get_property_name(tmp1,tmp2);
std::cerr << "property " << propertyName << " Type " << valueType << std::endl;
if ( propertyName == "x" ) { if ( propertyName == "x" ) {
std::pair< VertexProperty, ValueType> entry(XCOORD,valueType); std::pair< VertexProperty, ValueType> entry(XCOORD,valueType);
vertexPropertyMap_[vertexPropertyCount_] = entry; vertexPropertyMap_[vertexPropertyCount_] = entry;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment