diff --git a/include/Algo/Decimation/decimation.h b/include/Algo/Decimation/decimation.h index 7dea703b0c8d4d2b7b0d4f436a4798cf4a5d0077..90e59e22963da6f9b8bf244ba51cc150a7a01303 100644 --- a/include/Algo/Decimation/decimation.h +++ b/include/Algo/Decimation/decimation.h @@ -62,7 +62,7 @@ void decimate( std::vector *>& position, unsigned int nbWantedVertices, const FunctorSelect& selected = allDarts, - VertexAttribute *edgeErrors = NULL, + EdgeAttribute *edgeErrors = NULL, void (*callback_wrapper)(void*, const void*) = NULL, void *callback_object = NULL ) ; diff --git a/include/Algo/Import/import2tablesSurface.hpp b/include/Algo/Import/import2tablesSurface.hpp index 2d2d1704697bc7fbc161a27bd17efad12568b733..d5cfded61917efc7d34b357aaff71c4e5df7b194 100644 --- a/include/Algo/Import/import2tablesSurface.hpp +++ b/include/Algo/Import/import2tablesSurface.hpp @@ -1010,12 +1010,21 @@ bool MeshTablesSurface::importPlySLFgenericBin(const std::string& filename, attrNames.push_back(positions.name()) ; VertexAttribute *frame = new VertexAttribute[3] ; - frame[0] = m_map.template addAttribute("frameT") ; // Tangent - frame[1] = m_map.template addAttribute("frameB") ; // Bitangent - frame[2] = m_map.template addAttribute("frameN") ; // Normal - attrNames.push_back(frame[0].name()) ; - attrNames.push_back(frame[1].name()) ; - attrNames.push_back(frame[2].name()) ; + if (tangent) + { + frame[0] = m_map.template addAttribute("frameT") ; // Tangent + attrNames.push_back(frame[0].name()) ; + } + if (binormal) + { + frame[1] = m_map.template addAttribute("frameB") ; // Bitangent + attrNames.push_back(frame[0].name()) ; + } + if (normal) + { + frame[2] = m_map.template addAttribute("frameN") ; // Normal + attrNames.push_back(frame[0].name()) ; + } VertexAttribute *PBcoefs = NULL, *SHcoefs = NULL ; if (PTM) @@ -1064,14 +1073,15 @@ bool MeshTablesSurface::importPlySLFgenericBin(const std::string& filename, fp.read((char*)properties,nbProps * propSize) ; - positions[id] = VEC3(properties[0],properties[1],properties[2]) ; // position - for (unsigned int k = 0 ; k < 3 ; ++k) // frame - for (unsigned int l = 0 ; l < 3 ; ++l) - frame[k][id][l] = (typename PFP::REAL)(properties[3+(3*k+l)]) ; - /* - for (unsigned int k = 0 ; k < 3 ; ++k) // coefficients - for (unsigned int l = 0 ; l < nbCoefs ; ++l) - */ + // positions + if (nbProps > 2) + positions[id] = VEC3(properties[0],properties[1],properties[2]) ; // position + + if (tangent && binormal && normal) // == if (nbprops > 11) + for (unsigned int k = 0 ; k < 3 ; ++k) // frame + for (unsigned int l = 0 ; l < 3 ; ++l) + frame[k][id][l] = (typename PFP::REAL)(properties[3+(3*k+l)]) ; + for (unsigned int l = 0 ; l < nbCoefs ; ++l) // coefficients for (unsigned int k = 0 ; k < 3 ; ++k) { @@ -1080,6 +1090,7 @@ bool MeshTablesSurface::importPlySLFgenericBin(const std::string& filename, else /* if SH */ SHcoefs[l][id][k] = (typename PFP::REAL)(properties[12+(3*l+k)]) ; } + unsigned int cur = 12+3*nbCoefs ; for (unsigned int k = 0 ; k < nbRemainders ; ++k) // remaining data remainders[k][id] = (typename PFP::REAL)(properties[cur + k]) ; diff --git a/include/Algo/ProgressiveMesh/pmesh.h b/include/Algo/ProgressiveMesh/pmesh.h index f5071ee5f58d1c991bb02477f7190158607f5cee..d5b41bcb217861f727da0a4b2e7a355f7e3ce732 100644 --- a/include/Algo/ProgressiveMesh/pmesh.h +++ b/include/Algo/ProgressiveMesh/pmesh.h @@ -65,7 +65,7 @@ private: std::vector*> m_splits ; unsigned int m_cur ; - Algo::Decimation::HalfEdgeApproximator* m_positionApproximator ; + Algo::Decimation::Approximator* m_positionApproximator ; bool m_initOk ; diff --git a/include/Algo/ProgressiveMesh/pmesh.hpp b/include/Algo/ProgressiveMesh/pmesh.hpp index 08e52013d76b6df585cf1d23db9a0acb883adb08..7f41dd3d0d6aaf73f2eae16e7c3a0e3af2a33392 100644 --- a/include/Algo/ProgressiveMesh/pmesh.hpp +++ b/include/Algo/ProgressiveMesh/pmesh.hpp @@ -108,7 +108,7 @@ ProgressiveMesh::ProgressiveMesh( if(! (*it)->init()) m_initOk = false ; if((*it)->getApproximatedAttributeName() == "position") - m_positionApproximator = reinterpret_cast*>(*it) ; + m_positionApproximator = reinterpret_cast*>(*it) ; } CGoGNout << "..done" << CGoGNendl ;