diff --git a/Apps/Tuto/stage_shader.cpp b/Apps/Tuto/stage_shader.cpp index 2a9dd8e6cf33334462999e8853fbc76a71f44efb..c48649943122804d889388190f4973a4c17963f4 100644 --- a/Apps/Tuto/stage_shader.cpp +++ b/Apps/Tuto/stage_shader.cpp @@ -23,6 +23,7 @@ *******************************************************************************/ #include "stage_shader.h" +#include "Utils/static_assert.h" /******************************************************************************* * SLOTS @@ -292,7 +293,7 @@ void StageShader::cb_mousePress(int button, int x, int y) } /********************************************************************************************** - * MAIN FUNCTION * + * MAIN FUNCTION * **********************************************************************************************/ int main(int argc, char** argv) diff --git a/build/CMakeLists.txt b/build/CMakeLists.txt index 719769f2e069fdbd3da345fe4d85f9685f5d477a..ad8488499da3464ed54de3fce40833bf185784ad 100644 --- a/build/CMakeLists.txt +++ b/build/CMakeLists.txt @@ -13,6 +13,14 @@ find_package(OpenGL REQUIRED) find_package(Qt4 REQUIRED) find_package(GLUT) +IF (DEFINED ASSERTON) + add_definitions(-DCGOGN_ASSERT_BOOL=${ASSERTON}) +ELSE (DEFINED ASSERTON) + add_definitions(-DCGOGN_ASSERT_BOOL=false) +ENDIF (DEFINED ASSERTON) + +add_definitions(-DSHADERPATH="${CGoGN_ROOT_DIR}/lib/Shaders/") + # qq definition specifiques pour mac IF(APPLE) # attention a changer pour chercher la bonne version automatiquement diff --git a/build/Debug/CMakeLists.txt b/build/Debug/CMakeLists.txt index d26d63de610479931692081338a047d861e4d4e7..c63f1420880b73a9948836ccf7fde5e016e66575 100644 --- a/build/Debug/CMakeLists.txt +++ b/build/Debug/CMakeLists.txt @@ -78,8 +78,6 @@ add_library( # ${files_geometry} #) -add_definitions(-DSHADERPATH="${CGoGN_ROOT_DIR}/lib/Shaders/") -add_definitions(-DDBG_MAX_LEVEL=5) file( GLOB_RECURSE diff --git a/build/Release/CMakeLists.txt b/build/Release/CMakeLists.txt index 86700356181a82eafb2f1cf03d7e5aab89681130..9c1ccf32e8a4ea395f23d2e57c696ee474194560 100644 --- a/build/Release/CMakeLists.txt +++ b/build/Release/CMakeLists.txt @@ -80,8 +80,6 @@ add_library( # ${files_geometry} #) -add_definitions(-DSHADERPATH="${CGoGN_ROOT_DIR}/lib/Shaders/") -add_definitions(-DDBG_MAX_LEVEL=0) file( GLOB_RECURSE diff --git a/include/Algo/Import/importTet.hpp b/include/Algo/Import/importTet.hpp index 7f69d97b95fb833375a3397a52a2321c8896be87..baf3a259c6e47c4c021dfc493290b481b9bcdf32 100644 --- a/include/Algo/Import/importTet.hpp +++ b/include/Algo/Import/importTet.hpp @@ -32,6 +32,7 @@ namespace Algo namespace Import { + template bool importTet(typename PFP::MAP& map, const std::string& filename, std::vector& attrNames, float scaleFactor) { @@ -177,19 +178,18 @@ bool importTet(typename PFP::MAP& map, const std::string& filename, std::vector< //Association des phi3 for (Dart d = map.begin(); d != map.end(); map.next(d)) { - std::vector& vec = vecDartsPerVertex[d]; - - for(typename std::vector::iterator it = vec.begin(); it!=vec.end(); ++it) + const std::vector& vec = vecDartsPerVertex[d]; + for(typename std::vector::const_iterator it = vec.begin(); it!=vec.end(); ++it) { if(map.phi3(*it) == *it) { bool sewn = false; - for(typename std::vector::iterator itnext = it+1; itnext != vec.end() && !sewn; ++itnext) + for(typename std::vector::const_iterator itnext = it+1; itnext != vec.end() && !sewn; ++itnext) { if(map.getEmbedding(VERTEX,map.phi1(*it))==map.getEmbedding(VERTEX,map.phi_1(*itnext)) && map.getEmbedding(VERTEX,map.phi_1(*it))==map.getEmbedding(VERTEX,map.phi1(*itnext))) { - map.sewVolumes(*it, map.phi_1(*itnext)); + map.PFP::MAP::TOPO_MAP::sewVolumes(*it, map.phi_1(*itnext)); sewn = true; } } diff --git a/include/Topology/generic/cellmarker.h b/include/Topology/generic/cellmarker.h index 02207e1529e14afb39d6a2a896199a855b349357..c099cc826306c13c65a878706f5eb0eced94e211 100644 --- a/include/Topology/generic/cellmarker.h +++ b/include/Topology/generic/cellmarker.h @@ -29,6 +29,7 @@ #include "Topology/generic/attribmap.h" #include "Topology/generic/functor.h" +#include "Utils/static_assert.h" namespace CGoGN { @@ -196,10 +197,12 @@ public: CellMarkerStore(AttribMap& map, unsigned int cell, unsigned int thread = 0) : CellMarkerGen(map, cell, thread) {} + virtual ~CellMarkerStore() { unmarkAll() ; - assert(isAllUnmarked()) ; +// assert(isAllUnmarked); + CGoGN_ASSERT(isAllUnmarked()) } protected: @@ -239,7 +242,8 @@ public: virtual ~CellMarkerNoUnmark() { - assert(isAllUnmarked()) ; +// assert(isAllUnmarked()) ; + CGoGN_ASSERT(isAllUnmarked()) } protected: diff --git a/include/Topology/generic/embeddedMap2.h b/include/Topology/generic/embeddedMap2.h index 9d1b8515d0cc6fd4561a01f4f1308b95fac555ce..87728790ceffeb58d593e661ac02532f711bee4c 100644 --- a/include/Topology/generic/embeddedMap2.h +++ b/include/Topology/generic/embeddedMap2.h @@ -38,6 +38,7 @@ template class EmbeddedMap2 : public MAP2 { public: + typedef MAP2 TOPO_MAP; /** * The attributes attached to the old vertex are duplicated on both resulting vertices * No attribute is attached to the new edge diff --git a/include/Topology/generic/embeddedMap3.h b/include/Topology/generic/embeddedMap3.h index bfd375c56ce75e0cceecb246c64165bc17f5fff0..46533f74ee5e79edc24707b1a566cd2cec67969c 100644 --- a/include/Topology/generic/embeddedMap3.h +++ b/include/Topology/generic/embeddedMap3.h @@ -38,7 +38,7 @@ template class EmbeddedMap3 : public MAP3 { public: - + typedef MAP3 TOPO_MAP; //! /*! diff --git a/include/Utils/cgognStream.h b/include/Utils/cgognStream.h index ab259d8391daf6f08c2766c4632bb1dbc0392339..cc2f1f285db971e81f5f2de30dfed642fe0943aa 100644 --- a/include/Utils/cgognStream.h +++ b/include/Utils/cgognStream.h @@ -25,10 +25,6 @@ #ifndef _CGOGNSTREAM_H_ #define _CGOGNSTREAM_H_ -// pb of compilation ?? -#ifndef DBG_MAX_LEVEL -#define DBG_MAX_LEVEL 5 -#endif #include #include diff --git a/include/Utils/static_assert.h b/include/Utils/static_assert.h index 2cb0a98ff7b83ca184ff22d7ab028fbeffac9bcc..3caa4afac193622b6bb1432efeaa0ed9fef74055 100644 --- a/include/Utils/static_assert.h +++ b/include/Utils/static_assert.h @@ -34,5 +34,8 @@ namespace CGoGN #define CGoGN_STATIC_ASSERT(expr, msg) \ { CGoGN::CompileTimeError<((expr) != 0)> STATIC_ASSERT_ERROR_##msg; (void)STATIC_ASSERT_ERROR_##msg; } + +#define CGoGN_ASSERT(expr) if (CGOGN_ASSERT_BOOL) assert(expr); + #endif diff --git a/src/Topology/map/map3.cpp b/src/Topology/map/map3.cpp index 16832818cc84ac63213986dd78e4dab48d2dc71c..d87ba2c2e252ad7cfdc997b129883ebe2f395ffd 100644 --- a/src/Topology/map/map3.cpp +++ b/src/Topology/map/map3.cpp @@ -764,7 +764,6 @@ bool Map3::foreach_dart_of_vertex(Dart d, FunctorType& f, unsigned int thread) bool found = false; // Last functor return value std::list darts_list; //Darts that are traversed - darts_list.push_back(d); //Start with the dart d mv.mark(d); diff --git a/src/Utils/vbo.cpp b/src/Utils/vbo.cpp index e1d27083f9eed287f5df0e0f212681673889eab3..b0f79a2990e71ea8bc0580cb866fa28c0bd5f6a9 100644 --- a/src/Utils/vbo.cpp +++ b/src/Utils/vbo.cpp @@ -60,7 +60,6 @@ VBO::VBO(const VBO& vbo) : VBO::~VBO() { - std::cout << "VBO delete"<< std::endl; if (m_lock) releasePtr(); glDeleteBuffers(1, &m_id);