Commit 9db0337f authored by untereiner's avatar untereiner

Merge branch 'master' of cgogn:~kraemer/CGoGN

Conflicts:
	Apps/SandBox/tilings.cpp
	Apps/SandBox/tilings.h
	include/Algo/Import/import2tablesVolume.hpp
	include/Algo/Import/importMSH.hpp
	include/Algo/Import/importNAS.hpp
	include/Algo/Import/importVBGZ.hpp
	include/Algo/Import/importVTU.hpp
	include/Algo/Modelisation/planeCutting.hpp
	include/Algo/Modelisation/tetrahedralization.hpp
parents f06a52d2 9e94ac25
...@@ -63,19 +63,17 @@ target_link_libraries( clippingD ${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS} ) ...@@ -63,19 +63,17 @@ target_link_libraries( clippingD ${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS} )
QT4_WRAP_UI( volumeExplorer_ui ../volumeExplorer.ui ) QT4_WRAP_UI( volumeExplorer_ui ../volumeExplorer.ui )
QT4_WRAP_CPP( volumeExplorer_moc ../volumeExplorer.h ) QT4_WRAP_CPP( volumeExplorer_moc ../volumeExplorer.h )
add_executable( volumeExplorerD ../volumeExplorer.cpp ${volumeExplorer_ui} ${volumeExplorer_moc}) add_executable( volumeExplorerD ../volumeExplorer.cpp ${volumeExplorer_ui} ${volumeExplorer_moc})
target_link_libraries( volumeExplorerD ${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS} ) target_link_libraries( volumeExplorerD ${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS} )
QT4_WRAP_UI( mcmesh_ui ../mcmesh.ui ) QT4_WRAP_UI( mcmesh_ui ../mcmesh.ui )
QT4_WRAP_CPP( mcmesh_moc ../mcmesh.h ) QT4_WRAP_CPP( mcmesh_moc ../mcmesh.h )
add_executable( mcmeshD ../mcmesh.cpp ${mcmesh_moc} ${mcmesh_ui} ) add_executable( mcmeshD ../mcmesh.cpp ${mcmesh_moc} ${mcmesh_ui} )
target_link_libraries( mcmeshD ${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS}) target_link_libraries( mcmeshD ${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS} )
QT4_WRAP_CPP( concave_rendering_moc ../concave_rendering.h ) QT4_WRAP_CPP( concave_rendering_moc ../concave_rendering.h )
add_executable( concave_renderingD ../concave_rendering.cpp ${concave_rendering_moc} ${concave_rendering_ui} ) add_executable( concave_renderingD ../concave_rendering.cpp ${concave_rendering_moc} ${concave_rendering_ui} )
target_link_libraries( concave_renderingD ${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS}) target_link_libraries( concave_renderingD ${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS} )
QT4_WRAP_CPP( viewerOBJ_moc ../viewerOBJ.h ) QT4_WRAP_CPP( viewerOBJ_moc ../viewerOBJ.h )
add_executable( viewerOBJD ../viewerOBJ.cpp ${viewerOBJ_moc} ) add_executable( viewerOBJD ../viewerOBJ.cpp ${viewerOBJ_moc} )
target_link_libraries( viewerOBJD ${CGoGN_LIBS_R} ${CGoGN_EXT_LIBS} ) target_link_libraries( viewerOBJD ${CGoGN_LIBS_R} ${CGoGN_EXT_LIBS} )
...@@ -31,6 +31,10 @@ QT4_WRAP_CPP( texturesExample_moc ../texturesExample.h ) ...@@ -31,6 +31,10 @@ QT4_WRAP_CPP( texturesExample_moc ../texturesExample.h )
add_executable( texturesExample ../texturesExample.cpp ${texturesExample_moc} ) add_executable( texturesExample ../texturesExample.cpp ${texturesExample_moc} )
target_link_libraries( texturesExample ${CGoGN_LIBS_R} ${CGoGN_EXT_LIBS} ) target_link_libraries( texturesExample ${CGoGN_LIBS_R} ${CGoGN_EXT_LIBS} )
QT4_WRAP_CPP(simpleMap3_moc ../simpleMap3.h)
add_executable( simpleMap3 ../simpleMap3.cpp ${simpleMap3_moc} )
target_link_libraries( simpleMap3 ${CGoGN_LIBS_R} ${CGoGN_EXT_LIBS} )
QT4_WRAP_CPP( simpleGMap2_moc ../simpleGMap2.h ) QT4_WRAP_CPP( simpleGMap2_moc ../simpleGMap2.h )
add_executable( simpleGMap2 ../simpleGMap2.cpp ${simpleGMap2_moc} ) add_executable( simpleGMap2 ../simpleGMap2.cpp ${simpleGMap2_moc} )
target_link_libraries( simpleGMap2 ${CGoGN_LIBS_R} ${CGoGN_EXT_LIBS} ) target_link_libraries( simpleGMap2 ${CGoGN_LIBS_R} ${CGoGN_EXT_LIBS} )
...@@ -69,5 +73,4 @@ target_link_libraries( concave_rendering ${CGoGN_LIBS_R} ${CGoGN_EXT_LIBS} ) ...@@ -69,5 +73,4 @@ target_link_libraries( concave_rendering ${CGoGN_LIBS_R} ${CGoGN_EXT_LIBS} )
QT4_WRAP_CPP( viewerOBJ_moc ../viewerOBJ.h ) QT4_WRAP_CPP( viewerOBJ_moc ../viewerOBJ.h )
add_executable( viewerOBJ ../viewerOBJ.cpp ${viewerOBJ_moc} ) add_executable( viewerOBJ ../viewerOBJ.cpp ${viewerOBJ_moc} )
target_link_libraries( viewerOBJ ${CGoGN_LIBS_R} ${CGoGN_EXT_LIBS} ) target_link_libraries( viewerOBJ ${CGoGN_LIBS_R} ${CGoGN_EXT_LIBS} )
...@@ -138,21 +138,21 @@ void Clipping::slot_drawFaces(bool b) ...@@ -138,21 +138,21 @@ void Clipping::slot_drawFaces(bool b)
void Clipping::slot_explodTopoPhi1(double c) void Clipping::slot_explodTopoPhi1(double c)
{ {
m_coeffTopoExplod[0] = (float)c; m_coeffTopoExplod[0] = (float)c;
m_render_topo->updateData<PFP>(myMap, position, m_coeffTopoExplod[0], m_coeffTopoExplod[1], m_coeffTopoExplod[2]); m_render_topo->updateData(myMap, position, m_coeffTopoExplod[0], m_coeffTopoExplod[1], m_coeffTopoExplod[2]);
updateGL(); updateGL();
} }
void Clipping::slot_explodTopoPhi2(double c) void Clipping::slot_explodTopoPhi2(double c)
{ {
m_coeffTopoExplod[1] = (float)c; m_coeffTopoExplod[1] = (float)c;
m_render_topo->updateData<PFP>(myMap, position, m_coeffTopoExplod[0], m_coeffTopoExplod[1], m_coeffTopoExplod[2]); m_render_topo->updateData(myMap, position, m_coeffTopoExplod[0], m_coeffTopoExplod[1], m_coeffTopoExplod[2]);
updateGL(); updateGL();
} }
void Clipping::slot_explodTopoPhi3(double c) void Clipping::slot_explodTopoPhi3(double c)
{ {
m_coeffTopoExplod[2] = (float)c; m_coeffTopoExplod[2] = (float)c;
m_render_topo->updateData<PFP>(myMap, position, m_coeffTopoExplod[0], m_coeffTopoExplod[1], m_coeffTopoExplod[2]); m_render_topo->updateData(myMap, position, m_coeffTopoExplod[0], m_coeffTopoExplod[1], m_coeffTopoExplod[2]);
updateGL(); updateGL();
} }
...@@ -814,7 +814,7 @@ void Clipping::importMesh(std::string& filename) ...@@ -814,7 +814,7 @@ void Clipping::importMesh(std::string& filename)
updateVBOprimitives(Algo::Render::GL2::TRIANGLES | Algo::Render::GL2::LINES | Algo::Render::GL2::POINTS) ; updateVBOprimitives(Algo::Render::GL2::TRIANGLES | Algo::Render::GL2::LINES | Algo::Render::GL2::POINTS) ;
m_render_topo->updateData<PFP>(myMap, position, m_coeffTopoExplod[0], m_coeffTopoExplod[1], m_coeffTopoExplod[2]); m_render_topo->updateData(myMap, position, m_coeffTopoExplod[0], m_coeffTopoExplod[1], m_coeffTopoExplod[2]);
m_bb = Algo::Geometry::computeBoundingBox<PFP>(myMap, position) ; m_bb = Algo::Geometry::computeBoundingBox<PFP>(myMap, position) ;
gPosObj = m_bb.center() ; gPosObj = m_bb.center() ;
...@@ -843,7 +843,7 @@ void Clipping::cb_initGL() ...@@ -843,7 +843,7 @@ void Clipping::cb_initGL()
// create the render // create the render
m_render = new Algo::Render::GL2::MapRender(); m_render = new Algo::Render::GL2::MapRender();
m_render_topo = new Algo::Render::GL2::Topo3Render(); m_render_topo = new Algo::Render::GL2::Topo3RenderMap<PFP>();
// create VBO for position // create VBO for position
m_positionVBO = new Utils::VBO(); m_positionVBO = new Utils::VBO();
......
...@@ -70,18 +70,18 @@ struct PFP: public PFP_STANDARD ...@@ -70,18 +70,18 @@ struct PFP: public PFP_STANDARD
typedef EmbeddedMap3 MAP; typedef EmbeddedMap3 MAP;
}; };
typedef PFP::MAP MAP;
typedef PFP::MAP::IMPL MAP_IMPL;
typedef PFP::VEC3 VEC3;
class Clipping: public Utils::QT::SimpleQT class Clipping: public Utils::QT::SimpleQT
{ {
Q_OBJECT Q_OBJECT
public: public:
typedef PFP::MAP MAP;
typedef PFP::VEC3 VEC3;
//Manip Carte //Manip Carte
MAP myMap ; MAP myMap ;
VertexAttribute<VEC3> position; VertexAttribute<VEC3, MAP_IMPL> position;
Dart dglobal; Dart dglobal;
//Render //Render
...@@ -91,7 +91,7 @@ public: ...@@ -91,7 +91,7 @@ public:
bool m_drawTopo; bool m_drawTopo;
Algo::Render::GL2::MapRender* m_render; Algo::Render::GL2::MapRender* m_render;
Algo::Render::GL2::Topo3Render* m_render_topo; Algo::Render::GL2::Topo3Render<PFP>* m_render_topo;
Geom::BoundingBox<PFP::VEC3> m_bb; Geom::BoundingBox<PFP::VEC3> m_bb;
......
...@@ -128,12 +128,13 @@ struct PFP: public PFP_STANDARD ...@@ -128,12 +128,13 @@ struct PFP: public PFP_STANDARD
}; };
typedef PFP::MAP MAP ; typedef PFP::MAP MAP ;
typedef PFP::MAP::IMPL MAP_IMPL ;
typedef PFP::VEC3 VEC3 ; typedef PFP::VEC3 VEC3 ;
// declaration of the map // declaration of the map
MAP myMap; MAP myMap;
// and attribute of position // and attribute of position
VertexAttribute<VEC3> position; VertexAttribute<VEC3, MAP_IMPL> position;
unsigned int nb_ears; unsigned int nb_ears;
......
...@@ -53,6 +53,7 @@ struct PFP: public PFP_STANDARD ...@@ -53,6 +53,7 @@ struct PFP: public PFP_STANDARD
}; };
typedef PFP::MAP MAP ; typedef PFP::MAP MAP ;
typedef PFP::MAP::IMPL MAP_IMPL ;
typedef PFP::VEC3 VEC3 ; typedef PFP::VEC3 VEC3 ;
MAP myMap; MAP myMap;
...@@ -103,7 +104,7 @@ int main(int argc, char **argv) ...@@ -103,7 +104,7 @@ int main(int argc, char **argv)
QApplication app(argc, argv); QApplication app(argc, argv);
MyQT sqt; MyQT sqt;
VertexAttribute<VEC3> position = myMap.addAttribute<VEC3, VERTEX>("position") ; VertexAttribute<VEC3, MAP_IMPL> position = myMap.addAttribute<VEC3, VERTEX>("position") ;
// define the face extruded (here a cross) // define the face extruded (here a cross)
std::vector<PFP::VEC3> objV; std::vector<PFP::VEC3> objV;
......
...@@ -197,7 +197,6 @@ void MCMesh::sphere() ...@@ -197,7 +197,6 @@ void MCMesh::sphere()
myImg = new SAlgo::MC::Image<DATATYPE>(img,128,128,128,1.0f,1.0f,1.0f,false); myImg = new SAlgo::MC::Image<DATATYPE>(img,128,128,128,1.0f,1.0f,1.0f,false);
} }
/********************************************************************************************** /**********************************************************************************************
* MAIN FUNCTION * * MAIN FUNCTION *
**********************************************************************************************/ **********************************************************************************************/
...@@ -210,7 +209,7 @@ int main(int argc, char **argv) ...@@ -210,7 +209,7 @@ int main(int argc, char **argv)
sqt.setGeometry(0, 0, 1000, 800); sqt.setGeometry(0, 0, 1000, 800);
sqt.show(); sqt.show();
sqt.valLabel=DATATYPE(0); sqt.valLabel = DATATYPE(0);
if(argc == 2) if(argc == 2)
{ {
......
...@@ -29,9 +29,10 @@ ...@@ -29,9 +29,10 @@
#include "Utils/Qt/qtui.h" #include "Utils/Qt/qtui.h"
#include "Topology/generic/parameters.h" #include "Topology/generic/parameters.h"
#include "Topology/map/map2.h"
#include "Topology/map/embeddedMap2.h" #include "Topology/map/embeddedMap2.h"
#include "Algo/MC/marchingcube.h"
#include "Geometry/vector_gen.h" #include "Geometry/vector_gen.h"
#include "Geometry/matrix.h" #include "Geometry/matrix.h"
...@@ -41,8 +42,6 @@ ...@@ -41,8 +42,6 @@
#include "Utils/vbo.h" #include "Utils/vbo.h"
#include "Algo/Geometry/boundingbox.h" #include "Algo/Geometry/boundingbox.h"
#include "Algo/MC/marchingcube.h"
using namespace CGoGN ; using namespace CGoGN ;
...@@ -55,6 +54,7 @@ struct PFP: public PFP_STANDARD ...@@ -55,6 +54,7 @@ struct PFP: public PFP_STANDARD
}; };
typedef PFP::MAP MAP ; typedef PFP::MAP MAP ;
typedef PFP::MAP::IMPL MAP_IMPL ;
typedef PFP::VEC3 VEC3 ; typedef PFP::VEC3 VEC3 ;
typedef unsigned char DATATYPE; typedef unsigned char DATATYPE;
...@@ -65,7 +65,6 @@ class MCMesh : public Utils::QT::SimpleQT ...@@ -65,7 +65,6 @@ class MCMesh : public Utils::QT::SimpleQT
public: public:
MAP myMap ; MAP myMap ;
SelectorTrue allDarts ;
Utils::QT::uiDockInterface dock ; Utils::QT::uiDockInterface dock ;
...@@ -76,7 +75,7 @@ public: ...@@ -76,7 +75,7 @@ public:
bool m_drawEdges ; bool m_drawEdges ;
bool m_drawFaces ; bool m_drawFaces ;
VertexAttribute<VEC3> position ; VertexAttribute<VEC3, MAP_IMPL> position ;
Algo::Render::GL2::MapRender* m_render ; Algo::Render::GL2::MapRender* m_render ;
......
...@@ -42,6 +42,7 @@ struct PFP: public PFP_STANDARD ...@@ -42,6 +42,7 @@ struct PFP: public PFP_STANDARD
}; };
typedef PFP::MAP MAP ; typedef PFP::MAP MAP ;
typedef PFP::MAP::IMPL MAP_IMPL ;
typedef PFP::VEC3 VEC3 ; typedef PFP::VEC3 VEC3 ;
class SimpleGMap2 : public Utils::QT::SimpleQT class SimpleGMap2 : public Utils::QT::SimpleQT
...@@ -51,7 +52,7 @@ class SimpleGMap2 : public Utils::QT::SimpleQT ...@@ -51,7 +52,7 @@ class SimpleGMap2 : public Utils::QT::SimpleQT
public: public:
MAP myMap ; MAP myMap ;
VertexAttribute<VEC3> position ; VertexAttribute<VEC3, MAP_IMPL> position ;
SimpleGMap2() ; SimpleGMap2() ;
......
...@@ -132,10 +132,10 @@ void SimpleGMap3::cb_initGL() ...@@ -132,10 +132,10 @@ void SimpleGMap3::cb_initGL()
float gWidthObj = std::max<float>(std::max<float>(tailleX, tailleY), tailleZ) ; float gWidthObj = std::max<float>(std::max<float>(tailleX, tailleY), tailleZ) ;
setParamObject(gWidthObj, gPosObj.data()); setParamObject(gWidthObj, gPosObj.data());
m_render_topo = new Algo::Render::GL2::Topo3Render(); m_render_topo = new Algo::Render::GL2::Topo3RenderGMap<PFP>();
m_render_topo->setDartWidth(2.0f); m_render_topo->setDartWidth(2.0f);
m_render_topo->setInitialDartsColor(1.0f,1.0f,1.0f); m_render_topo->setInitialDartsColor(1.0f,1.0f,1.0f);
m_render_topo->updateData<PFP>(myMap, position, 0.9f,0.9f,0.8f); m_render_topo->updateData(myMap, position, 0.9f,0.9f,0.8f);
} }
void SimpleGMap3::cb_redraw() void SimpleGMap3::cb_redraw()
......
...@@ -43,6 +43,7 @@ struct PFP: public PFP_STANDARD ...@@ -43,6 +43,7 @@ struct PFP: public PFP_STANDARD
}; };
typedef PFP::MAP MAP ; typedef PFP::MAP MAP ;
typedef PFP::MAP::IMPL MAP_IMPL ;
typedef PFP::VEC3 VEC3 ; typedef PFP::VEC3 VEC3 ;
class SimpleGMap3 : public Utils::QT::SimpleQT class SimpleGMap3 : public Utils::QT::SimpleQT
...@@ -52,10 +53,10 @@ class SimpleGMap3 : public Utils::QT::SimpleQT ...@@ -52,10 +53,10 @@ class SimpleGMap3 : public Utils::QT::SimpleQT
public: public:
MAP myMap ; MAP myMap ;
VertexAttribute<VEC3> position ; VertexAttribute<VEC3, MAP_IMPL> position ;
VolumeAttribute<VEC3> volume ; VolumeAttribute<VEC3, MAP_IMPL> volume ;
Algo::Render::GL2::Topo3Render* m_render_topo; Algo::Render::GL2::Topo3Render<PFP>* m_render_topo;
SimpleGMap3() ; SimpleGMap3() ;
......
...@@ -106,20 +106,20 @@ void SimpleMap3::cb_initGL() ...@@ -106,20 +106,20 @@ void SimpleMap3::cb_initGL()
float gWidthObj = std::max<float>(std::max<float>(tailleX, tailleY), tailleZ) ; float gWidthObj = std::max<float>(std::max<float>(tailleX, tailleY), tailleZ) ;
setParamObject(gWidthObj, gPosObj.data()); setParamObject(gWidthObj, gPosObj.data());
m_render_topo = new Algo::Render::GL2::Topo3Render(); m_render_topo = new Algo::Render::GL2::Topo3RenderMap<PFP>();
m_render_topo->setDartWidth(2.0f); m_render_topo->setDartWidth(2.0f);
m_render_topo->setInitialDartsColor(1.0f,1.0f,1.0f); m_render_topo->setInitialDartsColor(1.0f,1.0f,1.0f);
m_render_topo->updateData<PFP>(myMap, position, 0.9f,0.9f,0.8f); m_render_topo->updateData(myMap, position, 0.9f,0.9f,0.8f);
m_render_topo_boundary = new Algo::Render::GL2::TopoRender(); m_render_topo_boundary = new Algo::Render::GL2::TopoRenderMap<PFP>();
m_render_topo_boundary->setDartWidth(2.0f); m_render_topo_boundary->setDartWidth(2.0f);
m_render_topo_boundary->setInitialDartsColor(0.4f,0.8f,0.4f); m_render_topo_boundary->setInitialDartsColor(0.4f,0.8f,0.4f);
m_render_topo_boundary->updateDataBoundary<PFP>(myMap, position, 0.9f,0.9f,bb.maxSize()/50.0f); m_render_topo_boundary->updateDataBoundary(myMap, position, 0.9f,0.9f,bb.maxSize()/50.0f);
m_render_topo_primal = new Algo::Render::GL2::Topo3PrimalRender(); m_render_topo_primal = new Algo::Render::GL2::Topo3PrimalRender<PFP>();
m_render_topo_primal->setDartWidth(2.0f); m_render_topo_primal->setDartWidth(2.0f);
m_render_topo_primal->setInitialDartsColor(1.0f,1.0f,1.0f); m_render_topo_primal->setInitialDartsColor(1.0f,1.0f,1.0f);
m_render_topo_primal->updateData<PFP>(myMap, position, 0.95f,0.85f); m_render_topo_primal->updateData(myMap, position, 0.95f,0.85f);
} }
void SimpleMap3::cb_keyPress(int code) void SimpleMap3::cb_keyPress(int code)
......
...@@ -45,6 +45,7 @@ struct PFP: public PFP_STANDARD ...@@ -45,6 +45,7 @@ struct PFP: public PFP_STANDARD
}; };
typedef PFP::MAP MAP ; typedef PFP::MAP MAP ;
typedef PFP::MAP::IMPL MAP_IMPL ;
typedef PFP::VEC3 VEC3 ; typedef PFP::VEC3 VEC3 ;
class SimpleMap3 : public Utils::QT::SimpleQT class SimpleMap3 : public Utils::QT::SimpleQT
...@@ -55,11 +56,11 @@ public: ...@@ -55,11 +56,11 @@ public:
MAP myMap ; MAP myMap ;
SelectorTrue allDarts ; SelectorTrue allDarts ;
VertexAttribute<VEC3> position ; VertexAttribute<VEC3, MAP_IMPL> position ;
Algo::Render::GL2::Topo3Render* m_render_topo; Algo::Render::GL2::Topo3RenderMap<PFP>* m_render_topo;
Algo::Render::GL2::TopoRender* m_render_topo_boundary; Algo::Render::GL2::TopoRenderMap<PFP>* m_render_topo_boundary;
Algo::Render::GL2::Topo3PrimalRender* m_render_topo_primal; Algo::Render::GL2::Topo3PrimalRender<PFP>* m_render_topo_primal;
SimpleMap3() ; SimpleMap3() ;
...@@ -69,4 +70,3 @@ public: ...@@ -69,4 +70,3 @@ public:
void cb_redraw() ; void cb_redraw() ;
void cb_keyPress(int code); void cb_keyPress(int code);
}; };
...@@ -85,12 +85,11 @@ void TexView::cb_initGL() ...@@ -85,12 +85,11 @@ void TexView::cb_initGL()
m_shader2->setSpecular(Geom::Vec4f(0.5)); m_shader2->setSpecular(Geom::Vec4f(0.5));
registerShader(m_shader2); registerShader(m_shader2);
glEnable(GL_TEXTURE_2D); glEnable(GL_TEXTURE_2D);
if (!m_obj.hasNormals()) if (!m_obj.hasNormals())