Création d'un compte pour un collaborateur extérieur au laboratoire depuis l'intranet ICube : https://intranet.icube.unistra.fr/fr/labs/member/profile

Commit a503cc8c authored by Pierre Kraemer's avatar Pierre Kraemer
Browse files

Merge branch 'no_boundary'

Conflicts:
	Apps/Tuto/tp_master.cpp
	include/Algo/Export/exportPov.h
	include/Algo/Geometry/normal.h
	include/Topology/generic/embeddedMap2.h
	include/Topology/generic/embeddedMap2.hpp
	include/Topology/map/map2.h
	include/Topology/map/map2.hpp
	include/Topology/map/map3.h
	src/Topology/gmap/gmap2.cpp
	src/Topology/map/map2.cpp
	src/Topology/map/map3.cpp
parents 3d3eff3d e017aa7e
......@@ -213,7 +213,6 @@ void MyQT::cb_keyPress(int code)
Algo::Modelisation::EarTriangulation<PFP> triangulation(myMap);
triangulation.triangule();
SelectorTrue allDarts;
m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::GL2::TRIANGLES);
m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::GL2::LINES);
updateGL();
......@@ -439,7 +438,6 @@ int main(int argc, char **argv)
sqt.m_positionVBO->updateData(position);
// update des primitives du renderer
SelectorTrue allDarts;
sqt.m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::GL2::TRIANGLES);
sqt.m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::GL2::LINES);
sqt.m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::GL2::POINTS);
......
......@@ -81,7 +81,6 @@ public:
//Manip Carte
MAP myMap ;
SelectorTrue allDarts ;
TVEC3 position;
Dart dglobal;
......
......@@ -55,7 +55,6 @@ struct PFP: public PFP_STANDARD
};
PFP::MAP myMap;
SelectorTrue allDarts;
PFP::TVEC3 position ;
PFP::TREAL scalar;
Dart dglobal;
......
......@@ -155,7 +155,6 @@ int main(int argc, char **argv)
sqt.m_positionVBO->updateData(position);
// update des primitives du renderer
SelectorTrue allDarts;
sqt.m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::GL2::TRIANGLES);
sqt.m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::GL2::LINES);
......
......@@ -56,7 +56,6 @@ struct PFP: public PFP_STANDARD
typedef PFP::MAP MAP;
MAP myMap ;
SelectorTrue allDarts ;
class MyGlutWin : public Utils::GlutWin_ATB
{
......
......@@ -154,7 +154,6 @@ int main(int argc, char **argv)
sqt.m_positionVBO->updateData(position);
// update des primitives du renderer
SelectorTrue allDarts;
sqt.m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::GL2::TRIANGLES);
sqt.m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::GL2::LINES);
......
......@@ -140,8 +140,6 @@ void myGlutWin::init()
void myGlutWin::updateRender()
{
SelectorTrue allDarts;
// create the renderer (first call only)
if (m_render == NULL)
m_render = new Algo::Render::GL2::MapRender_VBO() ;
......
......@@ -50,7 +50,6 @@ class SimpleGMap2 : public Utils::QT::SimpleQT
public:
MAP myMap ;
SelectorTrue allDarts ;
PFP::TVEC3 position ;
......
......@@ -51,7 +51,6 @@ class SimpleGMap3 : public Utils::QT::SimpleQT
public:
MAP myMap ;
SelectorTrue allDarts ;
PFP::TVEC3 position ;
PFP::TVEC3 normal ;
......
......@@ -55,7 +55,6 @@ struct PFP: public PFP_STANDARD
PFP::MAP myMap;
SelectorTrue allDarts;
PFP::TVEC3 position ;
Dart dglobal;
......
......@@ -119,10 +119,6 @@ int main(int argc, char **argv)
// declaration of the map
PFP::MAP myMap;
// this selector is going to select all the darts
SelectorTrue allDarts;
std::vector<std::string> attrNames ;
if(!Algo::Import::importMesh<PFP>(myMap, argv[1], attrNames))
{
......
......@@ -63,7 +63,6 @@ protected:
public:
MAP myMap ;
SelectorTrue allDarts ;
// render
Algo::Render::GL2::MapRender* m_render;
......
......@@ -144,9 +144,6 @@ int main(int argc, char **argv)
// declaration of the map
PFP::MAP myMap;
// this selector is going to select all the darts
SelectorTrue allDarts;
// creation of a new attribute on vertices of type 3D vector
// a handler to this attribute is returned
AttributeHandler<PFP::VEC3> position = myMap.addAttribute<PFP::VEC3>(VERTEX, "position");
......
......@@ -173,6 +173,13 @@ void Viewer::cb_Open()
updateGL() ;
}
void Viewer::cb_Save()
{
std::string filters("off (*.off)") ;
std::string filename = selectFileSave("Save Mesh", "", filters) ;
Algo::Export::exportOFF<PFP>(myMap, position, filename.c_str(), allDarts) ;
}
void Viewer::importMesh(std::string& filename)
{
myMap.clear(true) ;
......@@ -187,7 +194,7 @@ void Viewer::importMesh(std::string& filename)
m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::GL2::POINTS) ;
m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::GL2::LINES) ;
m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::GL2::TRIANGLES) ;
m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::GL2::TRIANGLES, false) ;
bb = Algo::Geometry::computeBoundingBox<PFP>(myMap, position) ;
normalBaseSize = bb.diagSize() / 100.0f ;
......
......@@ -35,6 +35,7 @@
#include "Geometry/matrix.h"
#include "Algo/Import/import.h"
#include "Algo/Export/export.h"
#include "Algo/Render/GL2/mapRender.h"
......@@ -63,7 +64,6 @@ class Viewer : public Utils::QT::SimpleQT
public:
MAP myMap ;
SelectorTrue allDarts ;
Utils::QT::uiDockInterface dock ;
......@@ -110,6 +110,7 @@ public:
void cb_initGL() ;
void cb_redraw() ;
void cb_Open() ;
void cb_Save() ;
void importMesh(std::string& filename) ;
......
......@@ -48,7 +48,6 @@ struct PFP: public PFP_STANDARD
PFP::MAP myMap;
SelectorTrue allDarts;
PFP::TVEC3 position ;
......
......@@ -57,10 +57,16 @@ struct PFP: public PFP_STANDARD
typedef Map2TP MAP;
};
// fonction qui renvoit vrai (pour sélectioner tous les brins)
SelectorTrue allDarts;
/// definition de la carte en global, plus facile
PFP::MAP myMap;
// handler d'attribut de position par sommet
AttributeHandler<PFP::VEC3> position;
// handler d'attribut de normale par sommet
AttributeHandler<PFP::VEC3> normal;
// typedef pour le plongement des sommets
/// encore 1 typedef pour simplifier l'ecriture du code
typedef PFP::VEC3 Point3D;
// Variables pour la gestion des plongements
......@@ -625,7 +631,20 @@ int main(int argc, char **argv)
Point3D lPosObj = (bb.min() + bb.max()) / 2;
sqt.setParamObject(lWidthObj,lPosObj.data());
// show pour optenir le contexte GL
// show 1 pour optenir le contexte GL
sqt.show();
// update du VBO position (contexte GL necessaire)
sqt.m_positionVBO->updateData(position);
sqt.m_normalVBO->updateData(normal);
// update des primitives du renderer
sqt.m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::GL2::TRIANGLES);
sqt.m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::GL2::LINES);
sqt.m_render_topo->updateData<PFP>(myMap, position, 0.9f, 0.9f);
// show final pour premier redraw
sqt.show();
// et on attend la fin.
......
......@@ -88,6 +88,14 @@ void MyQT::cb_redraw()
m_shader->setColor(Geom::Vec4f(1.,1.,0.,0.));
m_render->draw(m_shader, Algo::Render::GL2::LINES);
m_shader->setColor(Geom::Vec4f(0.,1.,1.,0.));
m_render->draw(m_shader, Algo::Render::GL2::BOUNDARY);
glPointSize(7.0f);
m_shader->setColor(Geom::Vec4f(1.,1.,1.,0.));
m_render->draw(m_shader, Algo::Render::GL2::POINTS);
glEnable(GL_POLYGON_OFFSET_FILL);
glPolygonOffset(1.0f, 1.0f);
......@@ -118,6 +126,8 @@ void MyQT::cb_keyPress(int code)
}
}
int main(int argc, char **argv)
{
......@@ -168,9 +178,20 @@ int main(int argc, char **argv)
sqt.m_positionVBO->updateData(position);
// update des primitives du renderer
SelectorTrue allDarts;
SelectorEdgeNoBoundary<PFP::MAP> insideEdges(myMap);// just to draw only inside edges
DartMarker dm(myMap);
dm.markOrbit(VERTEX,d2);
dm.markOrbit(VERTEX,d1);
CellMarker cm(myMap,FACE);
cm.mark(d2);
sqt.m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::GL2::TRIANGLES);
sqt.m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::GL2::LINES);
sqt.m_render->initPrimitives<PFP>(myMap, insideEdges, Algo::Render::GL2::LINES);
sqt.m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::GL2::BOUNDARY); // special primitive for boundary edges
// example of using boolean operator on Selectors
sqt.m_render->initPrimitives<PFP>(myMap, ( SelectorFalse() || ( SelectorTrue() && (SelectorMarked(dm) && SelectorCellMarked(cm)))) , Algo::Render::GL2::POINTS); // special primitive for boundary edges
// show final pour premier redraw
sqt.show();
......
......@@ -46,8 +46,6 @@ struct PFP: public PFP_STANDARD
PFP::MAP myMap;
SelectorTrue allDarts;
PFP::TVEC3 position ;
PFP::TVEC3 normal ;
AttributeHandler<Geom::Vec4f> color ;
......@@ -251,7 +249,6 @@ int main(int argc, char **argv)
sqt.m_positionVBO->updateData(position);
// update des primitives du renderer
SelectorTrue allDarts;
sqt.m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::GL2::TRIANGLES);
sqt.m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::GL2::LINES);
......
......@@ -103,7 +103,6 @@ void MyQT::cb_keyPress(int code)
int main(int argc, char **argv)
{
PFP::MAP myMap;
SelectorTrue allDarts;
PFP::TVEC3 position ;
PFP::TVEC3 normal ;
......
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