From 41e15d1707bd8c6922d38b72746d124ef01d5570 Mon Sep 17 00:00:00 2001 From: Sylvain Thery Date: Sun, 30 Jan 2011 14:20:01 +0100 Subject: [PATCH] bug visual pb avec objet en static -> registred... en ptr log2 et isnan n standard sous windows --- include/Algo/Geometry/laplacian.hpp | 2 +- include/Algo/Geometry/normal.hpp | 3 ++- include/Container/attribmv.hpp | 6 +++--- include/Topology/generic/genericmap.h | 2 +- src/Topology/generic/genericmap.cpp | 11 +++++++---- 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/include/Algo/Geometry/laplacian.hpp b/include/Algo/Geometry/laplacian.hpp index e19cac23..9b67d6c8 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 f26f786b..c07b99e3 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 d47fd1b5..e3bf58a9 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 ade25a0c..eb9a83d4 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 0d9d9bc1..fabf5d09 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; } -- GitLab