Commit 41e15d17 authored by Sylvain Thery's avatar Sylvain Thery

bug visual pb avec objet en static -> registred... en ptr

log2 et isnan n standard sous windows
parent 7a730c5b
...@@ -39,7 +39,7 @@ void computeLaplacianVertices( ...@@ -39,7 +39,7 @@ void computeLaplacianVertices(
LaplacianType type, LaplacianType type,
const typename PFP::TVEC3& position, const typename PFP::TVEC3& position,
typename PFP::TVEC3& laplacian, typename PFP::TVEC3& laplacian,
const FunctorSelect& select = SelectorTrue()) const FunctorSelect& select)
{ {
CellMarker marker(map, VERTEX_CELL); CellMarker marker(map, VERTEX_CELL);
for(Dart d = map.begin(); d != map.end(); map.next(d)) for(Dart d = map.begin(); d != map.end(); map.next(d))
......
...@@ -64,7 +64,8 @@ typename PFP::VEC3 faceNormal(typename PFP::MAP& map, Dart d, const typename PFP ...@@ -64,7 +64,8 @@ typename PFP::VEC3 faceNormal(typename PFP::MAP& map, Dart d, const typename PFP
do do
{ {
VEC3 n = triangleNormal<PFP>(map, it, position) ; VEC3 n = triangleNormal<PFP>(map, it, position) ;
if(!std::isnan(n[0])) //if(!std::isnan(n[0]))
if (n[0] == n[0])
N += n ; N += n ;
it = map.phi1(it) ; it = map.phi1(it) ;
} while (it != d) ; } while (it != d) ;
......
...@@ -211,7 +211,7 @@ void AttribMultiVect<T>::addBlocksBefore(unsigned int nbb) ...@@ -211,7 +211,7 @@ void AttribMultiVect<T>::addBlocksBefore(unsigned int nbb)
std::vector< T* > tempo; std::vector< T* > tempo;
tempo.reserve(1024); tempo.reserve(1024);
for (uint i= 0; i <nbb; ++i) for (unsigned int i= 0; i <nbb; ++i)
{ {
T* ptr = new T[_BLOCKSIZE_]; T* ptr = new T[_BLOCKSIZE_];
tempo.push_back( ptr ); tempo.push_back( ptr );
...@@ -277,7 +277,7 @@ void AttribMultiVect<T>::saveBin(CGoGNostream& fs, unsigned int id) ...@@ -277,7 +277,7 @@ void AttribMultiVect<T>::saveBin(CGoGNostream& fs, unsigned int id)
fs.write(reinterpret_cast<const char*>(nbs),2*sizeof(unsigned int)); fs.write(reinterpret_cast<const char*>(nbs),2*sizeof(unsigned int));
// store data blocks // store data blocks
for(uint i=0; i<nbs[0]; ++i) for(unsigned int i=0; i<nbs[0]; ++i)
{ {
fs.write(reinterpret_cast<const char*>(m_tableData[i]),_BLOCKSIZE_*sizeof(T)); fs.write(reinterpret_cast<const char*>(m_tableData[i]),_BLOCKSIZE_*sizeof(T));
} }
...@@ -311,7 +311,7 @@ bool AttribMultiVect<T>::loadBin(CGoGNistream& fs) ...@@ -311,7 +311,7 @@ bool AttribMultiVect<T>::loadBin(CGoGNistream& fs)
// load data blocks // load data blocks
m_tableData.resize(nb); m_tableData.resize(nb);
for(uint i=0; i<nb; ++i) for(unsigned int i=0; i<nb; ++i)
{ {
T* ptr = new T[_BLOCKSIZE_]; T* ptr = new T[_BLOCKSIZE_];
fs.read(reinterpret_cast<char*>(ptr),_BLOCKSIZE_*sizeof(T)); fs.read(reinterpret_cast<char*>(ptr),_BLOCKSIZE_*sizeof(T));
......
...@@ -87,7 +87,7 @@ protected: ...@@ -87,7 +87,7 @@ protected:
*/ */
AttribContainer m_attribs[NB_ORBITS] ; 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 * Direct access to the Dart attributes that store the orbits embeddings
......
...@@ -30,11 +30,12 @@ ...@@ -30,11 +30,12 @@
namespace CGoGN namespace CGoGN
{ {
std::map< std::string, RegisteredBaseAttribute* >* GenericMap::m_attributes_registry_map = NULL;
std::map< std::string, RegisteredBaseAttribute* > GenericMap::m_attributes_registry_map = std::map< std::string, RegisteredBaseAttribute* >();
GenericMap::GenericMap() GenericMap::GenericMap()
{ {
m_attributes_registry_map = new std::map< std::string, RegisteredBaseAttribute* >;
// register all known types // register all known types
registerAttribute<Dart>("Dart"); registerAttribute<Dart>("Dart");
registerAttribute<Mark>("Mark"); registerAttribute<Mark>("Mark");
...@@ -65,7 +66,7 @@ GenericMap::GenericMap() ...@@ -65,7 +66,7 @@ GenericMap::GenericMap()
for (unsigned int i = 0; i < NB_ORBITS; ++i) 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_embeddings[i] = NULL ;
m_markerTables[i] = NULL ; m_markerTables[i] = NULL ;
} }
...@@ -80,6 +81,8 @@ GenericMap::~GenericMap() ...@@ -80,6 +81,8 @@ GenericMap::~GenericMap()
m_attribs[i].clear(true) ; 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) ...@@ -136,7 +139,7 @@ bool GenericMap::registerAttribute(const std::string &nameType)
ra->setTypeName(nameType); ra->setTypeName(nameType);
m_attributes_registry_map.insert(std::pair<std::string, RegisteredBaseAttribute*>(nameType,ra)); m_attributes_registry_map->insert(std::pair<std::string, RegisteredBaseAttribute*>(nameType,ra));
return true; return true;
} }
......
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