diff --git a/include/Algo/Geometry/laplacian.hpp b/include/Algo/Geometry/laplacian.hpp index e19cac23654b469a9bedb336cd578fa5aff355b5..9b67d6c892f637d53b4afaaca63fb74712446ee4 100644 --- a/include/Algo/Geometry/laplacian.hpp +++ b/include/Algo/Geometry/laplacian.hpp @@ -39,7 +39,7 @@ void computeLaplacianVertices( LaplacianType type, const typename PFP::TVEC3& position, typename PFP::TVEC3& laplacian, - const FunctorSelect& select = SelectorTrue()) + const FunctorSelect& select) { CellMarker marker(map, VERTEX_CELL); for(Dart d = map.begin(); d != map.end(); map.next(d)) diff --git a/include/Algo/Geometry/normal.hpp b/include/Algo/Geometry/normal.hpp index f26f786bd80837822bea228f58231fc96fd6581a..c07b99e3ca2762cad5a2870ca31553f001073beb 100644 --- a/include/Algo/Geometry/normal.hpp +++ b/include/Algo/Geometry/normal.hpp @@ -64,7 +64,8 @@ typename PFP::VEC3 faceNormal(typename PFP::MAP& map, Dart d, const typename PFP do { VEC3 n = triangleNormal(map, it, position) ; - if(!std::isnan(n[0])) + //if(!std::isnan(n[0])) + if (n[0] == n[0]) N += n ; it = map.phi1(it) ; } while (it != d) ; diff --git a/include/Container/attribmv.hpp b/include/Container/attribmv.hpp index d47fd1b5ddfba87b864e33e1cac73cac95da0701..e3bf58a924c77bc1e61dfd04c0065af82db19f8a 100644 --- a/include/Container/attribmv.hpp +++ b/include/Container/attribmv.hpp @@ -211,7 +211,7 @@ void AttribMultiVect::addBlocksBefore(unsigned int nbb) std::vector< T* > tempo; tempo.reserve(1024); - for (uint i= 0; i ::saveBin(CGoGNostream& fs, unsigned int id) fs.write(reinterpret_cast(nbs),2*sizeof(unsigned int)); // store data blocks - for(uint i=0; i(m_tableData[i]),_BLOCKSIZE_*sizeof(T)); } @@ -311,7 +311,7 @@ bool AttribMultiVect::loadBin(CGoGNistream& fs) // load data blocks m_tableData.resize(nb); - for(uint i=0; i(ptr),_BLOCKSIZE_*sizeof(T)); diff --git a/include/Topology/generic/genericmap.h b/include/Topology/generic/genericmap.h index ade25a0cce4c8622ae02a2c6157bf6e670cdd82e..eb9a83d454484986ed2784e8d9f489a8615b288c 100644 --- a/include/Topology/generic/genericmap.h +++ b/include/Topology/generic/genericmap.h @@ -87,7 +87,7 @@ protected: */ AttribContainer m_attribs[NB_ORBITS] ; - static std::map< std::string, RegisteredBaseAttribute* > m_attributes_registry_map ; + static std::map< std::string, RegisteredBaseAttribute* >* m_attributes_registry_map ; /** * Direct access to the Dart attributes that store the orbits embeddings diff --git a/src/Topology/generic/genericmap.cpp b/src/Topology/generic/genericmap.cpp index 0d9d9bc198512c16290ffdc8d6bc530fe008725a..fabf5d094967c7512c34d03cba9f4153e600b2a5 100644 --- a/src/Topology/generic/genericmap.cpp +++ b/src/Topology/generic/genericmap.cpp @@ -30,11 +30,12 @@ namespace CGoGN { - -std::map< std::string, RegisteredBaseAttribute* > GenericMap::m_attributes_registry_map = std::map< std::string, RegisteredBaseAttribute* >(); +std::map< std::string, RegisteredBaseAttribute* >* GenericMap::m_attributes_registry_map = NULL; GenericMap::GenericMap() { + + m_attributes_registry_map = new std::map< std::string, RegisteredBaseAttribute* >; // register all known types registerAttribute("Dart"); registerAttribute("Mark"); @@ -65,7 +66,7 @@ GenericMap::GenericMap() for (unsigned int i = 0; i < NB_ORBITS; ++i) { - m_attribs[i].setRegistry(&m_attributes_registry_map) ; + m_attribs[i].setRegistry(m_attributes_registry_map) ; m_embeddings[i] = NULL ; m_markerTables[i] = NULL ; } @@ -80,6 +81,8 @@ GenericMap::~GenericMap() m_attribs[i].clear(true) ; } } + if (m_attributes_registry_map) + delete m_attributes_registry_map; } /**************************************** @@ -136,7 +139,7 @@ bool GenericMap::registerAttribute(const std::string &nameType) ra->setTypeName(nameType); - m_attributes_registry_map.insert(std::pair(nameType,ra)); + m_attributes_registry_map->insert(std::pair(nameType,ra)); return true; }