Coupure prévue mardi 3 Août au matin pour maintenance du serveur. Nous faisons au mieux pour que celle-ci soit la plus brève possible.

Commit 21085006 authored by CGoGN GIT Supervisor's avatar CGoGN GIT Supervisor
Browse files

Merge branch 'master' of /home/thery/CGoGN

* 'master' of /home/thery/CGoGN:
  remove cmake_... file (not needed)
  ajout mini graph de scene vbo avec partage de sommets
  ajout exemple: polyhedron, extrusion, scene ajout d'un mini graphe de scene OGL dans Utils vbo_MapRender plus template

Conflicts:
	ThirdParty/Assimp/code/cmake_install.cmake
parents 3bb52406 bfc452aa
...@@ -73,3 +73,14 @@ add_executable( ter_meshesD ../ter_meshes.cpp) ...@@ -73,3 +73,14 @@ add_executable( ter_meshesD ../ter_meshes.cpp)
target_link_libraries( ter_meshesD target_link_libraries( ter_meshesD
containerD topologyD utilsD algoD ${COMMON_LIBS} ) containerD topologyD utilsD algoD ${COMMON_LIBS} )
add_executable( polyhedronsViewD ../polyhedronsView.cpp)
target_link_libraries( polyhedronsViewD
containerD topologyD utilsD algoD ${COMMON_LIBS} )
add_executable( extrusionViewD ../extrusionView.cpp)
target_link_libraries( extrusionViewD
containerD topologyD utilsD algoD ${COMMON_LIBS} )
add_executable( sceneD ../scene.cpp)
target_link_libraries( sceneD
containerD topologyD utilsD algoD ${COMMON_LIBS} )
...@@ -237,9 +237,9 @@ void MyGlutWin::init() ...@@ -237,9 +237,9 @@ void MyGlutWin::init()
myMap.copyAttribute(originalPosition, position) ; myMap.copyAttribute(originalPosition, position) ;
vbo_render = new Algo::Render::VBO::MapRender_VBO<PFP>(myMap, allDarts) ; vbo_render = new Algo::Render::VBO::MapRender_VBO() ;
vbo_render->initPrimitives(Algo::Render::VBO::TRIANGLES) ; vbo_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::VBO::TRIANGLES) ;
vbo_render->initPrimitives(Algo::Render::VBO::LINES) ; vbo_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::VBO::LINES) ;
updateVBOdata(Algo::Render::VBO::POSITIONS | Algo::Render::VBO::NORMALS) ; updateVBOdata(Algo::Render::VBO::POSITIONS | Algo::Render::VBO::NORMALS) ;
} }
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include "Utils/glutwin_atb.h" #include "Utils/glutwin_atb.h"
#include "Topology/generic/parameters.h"
#include "Topology/map/map2.h" #include "Topology/map/map2.h"
#include "Geometry/vector_gen.h" #include "Geometry/vector_gen.h"
#include "Geometry/matrix.h" #include "Geometry/matrix.h"
...@@ -44,23 +45,10 @@ ...@@ -44,23 +45,10 @@
using namespace CGoGN ; using namespace CGoGN ;
struct PFP struct PFP: public PFP_STANDARD
{ {
// definition of the map // definition of the map
typedef Map2 MAP; typedef Map2 MAP;
// definition of the type of real value
typedef float REAL;
// other types definitions
typedef Geom::Vector<3,REAL> VEC3;
typedef Geom::Vector<6,REAL> VEC6;
typedef Geom::Matrix<3,3,REAL> MATRIX33;
typedef Geom::Matrix<4,4,REAL> MATRIX44;
typedef Geom::Matrix<3,6,REAL> MATRIX36;
typedef AttributeHandler<VEC3> TVEC3;
typedef AttributeHandler<REAL> TREAL;
}; };
...@@ -105,7 +93,7 @@ public: ...@@ -105,7 +93,7 @@ public:
PFP::TVEC3 faceNormal ; PFP::TVEC3 faceNormal ;
PFP::TVEC3 faceCentroid ; PFP::TVEC3 faceCentroid ;
Algo::Render::VBO::MapRender_VBO<PFP>* vbo_render ; Algo::Render::VBO::MapRender_VBO* vbo_render ;
GLuint dl_norm ; GLuint dl_norm ;
MyGlutWin(int* argc, char **argv, int winX, int winY) ; MyGlutWin(int* argc, char **argv, int winX, int winY) ;
......
...@@ -236,8 +236,8 @@ void myGlutWin::initDL(void) ...@@ -236,8 +236,8 @@ void myGlutWin::initDL(void)
vbor = new VBORenderType(myMap,allDarts, my_vbo_cb); vbor = new VBORenderType(myMap,allDarts, my_vbo_cb);
vbor->initData(0,invertedNormals); vbor->initData(0,invertedNormals);
vbor->initPrimitives(Algo::Render::VBO::VBO_TRIANGLES); vbor->initPrimitives<PFP>(myMap, good, Algo::Render::VBO::VBO_TRIANGLES);
vbor->initPrimitives(Algo::Render::VBO::VBO_LINES); vbor->initPrimitives<PFP>(myMap, good, Algo::Render::VBO::VBO_LINES);
// vbor->initEmb_Flat_Exploded(myMap.getNbDarts() , true, invertedNormals,0.8f); // vbor->initEmb_Flat_Exploded(myMap.getNbDarts() , true, invertedNormals,0.8f);
......
...@@ -141,3 +141,15 @@ target_link_libraries( triangulation ...@@ -141,3 +141,15 @@ target_link_libraries( triangulation
add_executable( ter_meshes ../ter_meshes.cpp) add_executable( ter_meshes ../ter_meshes.cpp)
target_link_libraries( ter_meshes target_link_libraries( ter_meshes
container topology utils algo ${COMMON_LIBS} ) container topology utils algo ${COMMON_LIBS} )
add_executable( polyhedronsView ../polyhedronsView.cpp)
target_link_libraries( polyhedronsView
container topology utils algo ${COMMON_LIBS} )
add_executable( extrusionView ../extrusionView.cpp)
target_link_libraries( extrusionView
container topology utils algo ${COMMON_LIBS} )
add_executable( scene ../scene.cpp)
target_link_libraries( scene
container topology utils algo ${COMMON_LIBS} )
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include <iostream> #include <iostream>
// #include "Definitions.h" // #include "Definitions.h"
#include "Topology/generic/parameters.h"
#include "Topology/map/map2.h" #include "Topology/map/map2.h"
#include "Topology/generic/embeddedMap2.h" #include "Topology/generic/embeddedMap2.h"
...@@ -23,28 +24,19 @@ using namespace CGoGN; ...@@ -23,28 +24,19 @@ using namespace CGoGN;
class Agent; class Agent;
struct PFP { struct PFP: public PFP_STANDARD
{
// definition de la carte // definition de la carte
// typedef EmbeddedMap2<Map2> MAP; // typedef EmbeddedMap2<Map2> MAP;
typedef Algo::IHM::ImplicitHierarchicalMap MAP; typedef Algo::IHM::ImplicitHierarchicalMap MAP;
// definition du type de reel utilise
typedef float REAL;
// definition du type de vecteur (point) utilise
typedef Geom::Vec3f VEC3;
// definition des listes d'agent // definition des listes d'agent
// typedef std::vector<Agent *> AGENTS; // typedef std::vector<Agent *> AGENTS;
typedef std::vector<Agent * > AGENTS; typedef std::vector<Agent * > AGENTS;
typedef NoMathIONameAttribute<AGENTS > AGENTVECT; typedef NoMathIONameAttribute<AGENTS > AGENTVECT;
typedef AttributeHandler<VEC3> TVEC3;
typedef AttributeHandler<AGENTVECT> TAB_AGENTVECT; typedef AttributeHandler<AGENTVECT> TAB_AGENTVECT;
// definition des cellules abstraites
// typedef MAP::EVertex EVERTEX;
// typedef MAP::EEdge EEDGE;
// typedef MAP::EFace EFACE;
// typedef MAP::EVolume EVOLUME;
}; };
typedef PFP::VEC3 VEC3 ; typedef PFP::VEC3 VEC3 ;
......
...@@ -72,8 +72,8 @@ public: ...@@ -72,8 +72,8 @@ public:
void myKeyboard(unsigned char keycode, int x, int y); void myKeyboard(unsigned char keycode, int x, int y);
void myMouse(int button, int state, int x, int y); void myMouse(int button, int state, int x, int y);
Algo::Render::VBO::MapRender_VBO<PFP>* m_render; Algo::Render::VBO::MapRender_VBO* m_render;
Algo::Render::VBO::MapRender_VBO<PFP>* m_render_line ; Algo::Render::VBO::MapRender_VBO* m_render_line ;
// Algo::Render::VBO::topo_MD2_VBORender<PFP>* topo_render ; // Algo::Render::VBO::topo_MD2_VBORender<PFP>* topo_render ;
// Algo::Render::VBO::topo_VBORenderMapD* topo_render ; // Algo::Render::VBO::topo_VBORenderMapD* topo_render ;
......
...@@ -63,15 +63,15 @@ void MyGlutWin::init() ...@@ -63,15 +63,15 @@ void MyGlutWin::init()
// topo_render = new Algo::Render::VBO::topo_VBORenderMapD() ; // topo_render = new Algo::Render::VBO::topo_VBORenderMapD() ;
// m_render = new Algo::Render::VBO::MapRender_VBO<PFP>(sim->envMap.map, allDarts) ; // m_render = new Algo::Render::VBO::MapRender_VBO(sim->envMap.map, allDarts) ;
// m_render->initPrimitives(Algo::Render::VBO::TRIANGLES) ; // m_render->initPrimitives<PFP>(myMap, good, Algo::Render::VBO::TRIANGLES) ;
// m_render->updateData(Algo::Render::VBO::POSITIONS, sim->envMap.position) ; // m_render->updateData(Algo::Render::VBO::POSITIONS, sim->envMap.position) ;
// Algo::Geometry::computeNormalFaces<PFP>(sim->envMap.map, sim->envMap.position, sim->envMap.normal) ; // Algo::Geometry::computeNormalFaces<PFP>(sim->envMap.map, sim->envMap.position, sim->envMap.normal) ;
// m_render->updateData(Algo::Render::VBO::NORMALS, sim->envMap.normal) ;; // m_render->updateData(Algo::Render::VBO::NORMALS, sim->envMap.normal) ;;
// m_render->initPrimitives(Algo::Render::VBO::TRIANGLES) ; // m_render->initPrimitives<PFP>(myMap, good, Algo::Render::VBO::TRIANGLES) ;
// m_render->initPrimitives(Algo::Render::VBO::LINES) ; // m_render->initPrimitives<PFP>(myMap, good, Algo::Render::VBO::LINES) ;
} }
void MyGlutWin::initGUI() void MyGlutWin::initGUI()
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include "Utils/GLSLShader.h" #include "Utils/GLSLShader.h"
#include "Utils/glutwin.h" #include "Utils/glutwin.h"
#include "Topology/generic/parameters.h"
#include "Topology/map/map2.h" #include "Topology/map/map2.h"
#include "Topology/generic/embeddedMap2.h" #include "Topology/generic/embeddedMap2.h"
...@@ -55,23 +56,10 @@ ...@@ -55,23 +56,10 @@
using namespace CGoGN; using namespace CGoGN;
struct PFP struct PFP: public PFP_STANDARD
{ {
// definition of the map // definition of the map
typedef EmbeddedMap2<Map2> MAP; typedef EmbeddedMap2<Map2> MAP;
// definition of the type of real value
typedef float REAL;
// other types definitions
typedef Geom::Vector<3,REAL> VEC3;
typedef Geom::Vector<6,REAL> VEC6;
typedef Geom::Matrix<3,3,REAL> MATRIX33;
typedef Geom::Matrix<4,4,REAL> MATRIX44;
typedef Geom::Matrix<3,6,REAL> MATRIX36;
typedef AttributeHandler<VEC3> TVEC3;
typedef AttributeHandler<REAL> TREAL;
}; };
...@@ -149,7 +137,7 @@ public: ...@@ -149,7 +137,7 @@ public:
*/ */
int renderStyle; int renderStyle;
Algo::Render::VBO::MapRender_VBO<PFP>* m_render; Algo::Render::VBO::MapRender_VBO* m_render;
/** /**
* render mode enum * render mode enum
...@@ -165,13 +153,13 @@ public: ...@@ -165,13 +153,13 @@ public:
if (this->shaderOk) shaders[0].loadShaders("phong_vs.txt","phong_ps.txt"); if (this->shaderOk) shaders[0].loadShaders("phong_vs.txt","phong_ps.txt");
// m_cb = new Algo::Render::VBO::VBO_CB_PositionNormal<PFP>(myMap); // m_cb = new Algo::Render::VBO::VBO_CB_PositionNormal<PFP>(myMap);
// m_render = new Algo::Render::VBO::MapRender_VBO<PFP>(myMap, allDarts, m_cb); // m_render = new Algo::Render::VBO::MapRender_VBO(myMap, allDarts, m_cb);
// //
// m_render->initBuffers(); // m_render->initBuffers();
// m_render->updateData(Algo::Render::VBO::POSITIONS, position ); // m_render->updateData(Algo::Render::VBO::POSITIONS, position );
// m_render->updateData(Algo::Render::VBO::NORMALS, normal ); // m_render->updateData(Algo::Render::VBO::NORMALS, normal );
// m_render->initPrimitives(Algo::Render::VBO::TRIANGLES); // m_render->initPrimitives<PFP>(myMap, good, Algo::Render::VBO::TRIANGLES);
// m_render->initPrimitives(Algo::Render::VBO::LINES); // m_render->initPrimitives<PFP>(myMap, good, Algo::Render::VBO::LINES);
} }
}; };
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
gmtl::Vec3f gMax; gmtl::Vec3f gMax;
gmtl::Vec3f gMin; gmtl::Vec3f gMin;
struct PFP struct PFP: public PFP_STANDARD
{ {
typedef DartObj<DP::DefaultDartParameters> DART; typedef DartObj<DP::DefaultDartParameters> DART;
typedef e0mapd2<DART> MAP; typedef e0mapd2<DART> MAP;
......
...@@ -148,12 +148,12 @@ void MyGlutWin::myRedraw(void) ...@@ -148,12 +148,12 @@ void MyGlutWin::myRedraw(void)
if(render_obj) if(render_obj)
{ {
m_render->updateData(Algo::Render::VBO::POSITIONS, position ); m_render->updateData(Algo::Render::VBO::POSITIONS, position );
//m_render->initPrimitives(Algo::Render::VBO::POINTS); //m_render->initPrimitives<PFP>(myMap, good, Algo::Render::VBO::POINTS);
if(renderObjStyle == O_ALL) if(renderObjStyle == O_ALL)
{ {
m_render->initPrimitives(Algo::Render::VBO::TRIANGLES); m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::VBO::TRIANGLES);
m_render->initPrimitives(Algo::Render::VBO::LINES); m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::VBO::LINES);
glEnable( GL_POLYGON_OFFSET_FILL ); glEnable( GL_POLYGON_OFFSET_FILL );
glPolygonOffset( 1.0f, 1.0f ); glPolygonOffset( 1.0f, 1.0f );
...@@ -171,7 +171,7 @@ void MyGlutWin::myRedraw(void) ...@@ -171,7 +171,7 @@ void MyGlutWin::myRedraw(void)
} }
else if(renderObjStyle == O_FACES) else if(renderObjStyle == O_FACES)
{ {
m_render->initPrimitives(Algo::Render::VBO::TRIANGLES); m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::VBO::TRIANGLES);
glEnable( GL_POLYGON_OFFSET_FILL ); glEnable( GL_POLYGON_OFFSET_FILL );
glPolygonOffset( 1.0f, 1.0f ); glPolygonOffset( 1.0f, 1.0f );
...@@ -182,7 +182,7 @@ void MyGlutWin::myRedraw(void) ...@@ -182,7 +182,7 @@ void MyGlutWin::myRedraw(void)
} }
else if(renderObjStyle == O_LINE) else if(renderObjStyle == O_LINE)
{ {
m_render->initPrimitives(Algo::Render::VBO::LINES); m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::VBO::LINES);
// on trace les ligne devant // on trace les ligne devant
glDisable( GL_POLYGON_OFFSET_FILL ); glDisable( GL_POLYGON_OFFSET_FILL );
...@@ -277,8 +277,8 @@ void MyGlutWin::initRender() ...@@ -277,8 +277,8 @@ void MyGlutWin::initRender()
std::cout << "updateData: "<< seconds << "sec" << std::endl; std::cout << "updateData: "<< seconds << "sec" << std::endl;
// creation des primitives de rendu a partir de la carte // creation des primitives de rendu a partir de la carte
t1 = glutGet(GLUT_ELAPSED_TIME); t1 = glutGet(GLUT_ELAPSED_TIME);
m_render->initPrimitives(Algo::Render::VBO::TRIANGLES); m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::VBO::TRIANGLES);
m_render->initPrimitives(Algo::Render::VBO::LINES); m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::VBO::LINES);
t2 = glutGet(GLUT_ELAPSED_TIME); t2 = glutGet(GLUT_ELAPSED_TIME);
seconds = (t2 - t1) / 1000.0f; seconds = (t2 - t1) / 1000.0f;
std::cout << "initPrimitives: "<< seconds << "sec" << std::endl; std::cout << "initPrimitives: "<< seconds << "sec" << std::endl;
...@@ -414,7 +414,7 @@ int main(int argc, char **argv) ...@@ -414,7 +414,7 @@ int main(int argc, char **argv)
// allocation des objets necessaires pour le rendu // allocation des objets necessaires pour le rendu
mgw->m_render = new Algo::Render::VBO::MapRender_VBO<PFP>(myMap, allDarts); mgw->m_render = new Algo::Render::VBO::MapRender_VBO();
//mgw->m_render_topo = new Algo::Render::VBO::topo3_VBORenderMap<PFP::MAP>(); //mgw->m_render_topo = new Algo::Render::VBO::topo3_VBORenderMap<PFP::MAP>();
mgw->m_render_topo = new Algo::Render::VBO::topo3_VBORenderMapD(); mgw->m_render_topo = new Algo::Render::VBO::topo3_VBORenderMapD();
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include "Utils/glutwin_atb.h" #include "Utils/glutwin_atb.h"
#include "Topology/generic/parameters.h"
#include "Topology/map/map3.h" #include "Topology/map/map3.h"
#include "Topology/generic/cellmarker.h" #include "Topology/generic/cellmarker.h"
...@@ -46,23 +47,11 @@ ...@@ -46,23 +47,11 @@
using namespace CGoGN ; using namespace CGoGN ;
struct PFP struct PFP: public PFP_STANDARD
{ {
// definition of the map // definition of the map
typedef Map3 MAP; typedef Map3 MAP;
// definition of the type of real value
typedef float REAL;
// other types definitions
typedef Geom::Vector<3,REAL> VEC3;
typedef Geom::Vector<6,REAL> VEC6;
typedef Geom::Matrix<3,3,REAL> MATRIX33;
typedef Geom::Matrix<4,4,REAL> MATRIX44;
typedef Geom::Matrix<3,6,REAL> MATRIX36;
typedef AttributeHandler<VEC3> TVEC3;
typedef AttributeHandler<REAL> TREAL;
}; };
PFP::MAP myMap; PFP::MAP myMap;
...@@ -143,7 +132,7 @@ public: ...@@ -143,7 +132,7 @@ public:
/* /*
* VBO Object rendering * VBO Object rendering
*/ */
Algo::Render::VBO::MapRender_VBO<PFP>* m_render; Algo::Render::VBO::MapRender_VBO* m_render;
/* /*
* VBO Topo rendering * VBO Topo rendering
......
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps *
* version 0.1 *
* Copyright (C) 2009, IGG Team, LSIIT, University of Strasbourg *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation; either version 2.1 of the License, or (at your *
* option) any later version. *
* *
* This library is distributed in the hope that it will be useful, but WITHOUT *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
* for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this library; if not, write to the Free Software Foundation, *
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
* *
* Web site: https://iggservis.u-strasbg.fr/CGoGN/ *
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
#include <iostream>
#include "Utils/glutwin.h"
#include "Topology/generic/parameters.h"
#include "Topology/map/map2.h"
#include "Topology/generic/embeddedMap2.h"
#include "Geometry/vector_gen.h"
#include "Geometry/matrix.h"
#include "Geometry/transfo.h"
#include "Algo/Geometry/boundingbox.h"
#include "Algo/Render/vbo_MapRender.h"
#include "Algo/Modelisation/extrusion.h"
#include "Topology/generic/parameters.h"
#include <vector>
using namespace CGoGN;
struct PFP: public PFP_STANDARD
{
// definition de la carte
typedef EmbeddedMap2<Map2> MAP;
};
PFP::MAP myMap;
class myGlutWin: public Utils::SimpleGlutWin
{
public:
/**
* position of object
*/
Geom::Vec3f gPosObj;
/**
* width of object
*/
float gWidthObj;
/**
* redraw CB
*/
void myRedraw();
/**
* keyboard CB
*/
void myKeyboard(unsigned char keycode, int x, int y);
/**
* Update VBO buffers for map
*/
void updateRender();
/**
* GL initialization
*/
void init();
// position handler
PFP::TVEC3 position ;
/**
* render object
*/
Algo::Render::VBO::MapRender_VBO* m_render;
myGlutWin( int* argc, char **argv, int winX, int winY) :
SimpleGlutWin(argc,argv,winX,winY),
m_render(NULL)
{ }
~myGlutWin();
};
myGlutWin::~myGlutWin()
{
if (m_render)
delete m_render;
}
void myGlutWin::init()
{
glClearColor(0.1f,0.1f,0.1f,0.0f);
glEnable(GL_DEPTH_TEST);
glEnable(GL_NORMALIZE);
glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE);
glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, 1);
glLightfv(GL_LIGHT0, GL_DIFFUSE, lightZeroColor);
glLightfv(GL_LIGHT0, GL_POSITION, lightZeroPosition);
glEnable(GL_LIGHT0);
}
void myGlutWin::updateRender()
{
SelectorTrue allDarts;
// create the renderer (first call only)
if (m_render == NULL)
m_render = new Algo::Render::VBO::MapRender_VBO() ;
// update buffer op vertices positions
m_render->updateData(Algo::Render::VBO::POSITIONS, position);