diff --git a/src/Mod/Mesh/App/Core/MeshIO.cpp b/src/Mod/Mesh/App/Core/MeshIO.cpp index afb93a713..e7a7c3872 100644 --- a/src/Mod/Mesh/App/Core/MeshIO.cpp +++ b/src/Mod/Mesh/App/Core/MeshIO.cpp @@ -496,15 +496,21 @@ bool MeshInput::LoadOFF (std::istream &rstrIn) } namespace MeshCore { - struct MeshPly_Property : public std::binary_function, - std::string, bool> - { - bool operator()(const std::pair& x, - const std::string& y) const + namespace Ply { + enum Number { + int8, uint8, int16, uint16, int32, uint32, float32, float64 + }; + struct Property : public std::binary_function, + std::string, bool> { - return x.first == y; - } - }; + bool operator()(const std::pair& x, + const std::string& y) const + { + return x.first == y; + } + }; + } + using namespace Ply; } bool MeshInput::LoadPLY (std::istream &inp) @@ -515,12 +521,8 @@ bool MeshInput::LoadPLY (std::istream &inp) MeshFacetArray meshFacets; enum { - ascii, binary_little_endian, binary_big_endian - } format; - - enum Number { - int8, uint8, int16, uint16, int32, uint32, float32, float64 - }; + unknown, ascii, binary_little_endian, binary_big_endian + } format = unknown; if (!inp || inp.bad() == true) return false; @@ -538,8 +540,8 @@ bool MeshInput::LoadPLY (std::istream &inp) if ((ply[0] != 'p') || (ply[1] != 'l') || (ply[2] != 'y')) return false; // wrong header - std::vector > vertex_props; - std::vector face_props; + std::vector > vertex_props; + std::vector face_props; std::string line, element; MeshIO::Binding rgb_value = MeshIO::OVERALL; @@ -613,7 +615,7 @@ bool MeshInput::LoadPLY (std::istream &inp) str >> space >> std::ws >> type >> space >> std::ws >> name >> std::ws; - Number number; + Ply::Number number; if (type == "char" || type == "int8") { number = int8; } @@ -701,7 +703,7 @@ bool MeshInput::LoadPLY (std::istream &inp) } // check if valid 3d points - MeshPly_Property property; + Property property; std::size_t num_x = std::count_if(vertex_props.begin(), vertex_props.end(), std::bind2nd(property, "x")); if (num_x != 1)