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 10e52114 by untereiner

### Tilings :

```- changed all polyhedron to tiling square
- renamed primitives3d to kick out
IHM2 :
- renamed Algo/IHM/ihm.h/hpp to kick out (use Topology/ihmap/ihm2.h instead)
- add ihm2_PrimalRegular object wich is similar implicit equivalent to map2MR_PrimalRegular```
parent 492e71b3
 ... ... @@ -26,6 +26,7 @@ #include "Utils/GLSLShader.h" #include "Algo/Geometry/boundingbox.h" #include "Algo/Modelisation/polyhedron.h" #include "Algo/Tiling/Surface/square.h" SimpleGMap2::SimpleGMap2() { ... ... @@ -41,11 +42,9 @@ SimpleGMap2::SimpleGMap2() myMap.cutEdge(d); position[myMap.phi1(d)] = mid; Algo::Surface::Modelisation::Polyhedron poly(myMap, position); d = poly.cylinder_topo(5, 1, false, false); poly.embedCylinder(10, 10, 5); Algo::Surface::Tilings::Square::Cylinder poly(myMap, 5 ,1, false, false); d = poly.getDart(); poly.embedIntoCylinder(position, 10, 10, 5); d = myMap.phi1(d); Dart dd = myMap.beta2(d); ... ...
 ... ... @@ -24,7 +24,7 @@ #include "texturesExample.h" #include "Algo/Geometry/boundingbox.h" #include "Algo/Modelisation/polyhedron.h" #include "Algo/Tiling/Surface/square.h" #include "Utils/vbo.h" TexView::TexView(): ... ... @@ -215,9 +215,9 @@ void TexView::computeTore() VertexAttribute position = myMap.addAttribute("position"); VertexAttribute texcoord = myMap.addAttribute("texcoord"); Algo::Surface::Modelisation::Polyhedron prim(myMap, position); prim.tore_topo(NB, NB); prim.embedTore(40.0f,20.0f); //Algo::Surface::Modelisation::Polyhedron prim(myMap, position); Algo::Surface::Tilings::Square::Tore prim(myMap, NB, NB); prim.embedIntoTore(position, 40.0f,20.0f); Dart d = prim.getDart(); for(unsigned int i=0; i
 ... ... @@ -25,7 +25,7 @@ #include "tuto3.h" #include "Algo/Geometry/boundingbox.h" #include "Algo/Selection/raySelector.h" #include "Algo/Modelisation/polyhedron.h" #include "Algo/Tiling/Surface/square.h" using namespace CGoGN ; ... ... @@ -154,9 +154,8 @@ void MyQT::createMap() position = myMap.addAttribute("position"); Algo::Surface::Modelisation::Polyhedron prim1(myMap, position); prim1.cylinder_topo(256, 256, true, true); // topo of sphere is a closed cylinder prim1.embedSphere(2.0f); Algo::Surface::Tilings::Square::Cylinder prim1(myMap, 256,256,true,true); prim1.embedIntoSphere(position, 2.0f); // Dart d2 = d1; // position[d2] = PFP::VEC3(1, 0, 0); ... ... @@ -167,14 +166,14 @@ void MyQT::createMap() // d2 = PHI<211>(d2); // position[d2] = PFP::VEC3(0, 1, 2); Algo::Surface::Modelisation::Polyhedron prim2(myMap, position); prim2.cylinder_topo(256, 256, true, true); // topo of sphere is a closed cylinder prim2.embedSphere(2.0f); Algo::Surface::Tilings::Square::Cylinder prim2(myMap, 256 ,256, true, true); prim2.embedIntoSphere(position, 2.0f); Geom::Matrix44f trf; trf.identity(); Geom::translate(5.0f, 0.0, 0.0, trf); prim2.transform(trf); prim2.transform(position, trf); xd1 = prim2.getDart(); ... ...
 ... ... @@ -36,7 +36,8 @@ #include "Utils/GLSLShader.h" //#include "Algo/Geometry/area.h" #include "Algo/Geometry/normal.h" #include "Algo/Modelisation/polyhedron.h" //#include "Algo/Modelisation/polyhedron.h" #include "Algo/Tiling/Surface/square.h" #include "Algo/Parallel/parallel_foreach.h" ... ... @@ -298,9 +299,8 @@ int main(int argc, char **argv) if (argc==2) nbt = atoi(argv[1]); // create a sphere Algo::Surface::Modelisation::Polyhedron prim(myMap, position); prim.cylinder_topo(nbt,nbt, true, true); prim.embedSphere(20.0f); Algo::Surface::Tilings::Square::Cylinder prim(myMap, nbt, nbt, true, true); prim.embedIntoSphere(position, 20.0f); // bounding box ... ...
 ... ... @@ -24,7 +24,7 @@ #include "tuto_oper2.h" #include "Algo/Geometry/boundingbox.h" #include "Algo/Modelisation/polyhedron.h" #include "Algo/Tiling/Surface/square.h" #include "Algo/Geometry/centroid.h" #include "Algo/Import/import.h" #include "Algo/Export/export.h" ... ... @@ -175,9 +175,8 @@ void MyQT::createMap(int n) position = myMap.addAttribute("position"); colorDarts = myMap.addAttribute("color"); Algo::Surface::Modelisation::Polyhedron grid(myMap,position); grid.grid_topo(n,n); grid.embedGrid(1.,1.,0.); Algo::Surface::Tilings::Square::Grid grid(myMap, n, n, true); grid.embedIntoGrid(position, 1.,1.,0.); // bounding box of scene Geom::BoundingBox bb = Algo::Geometry::computeBoundingBox(myMap, position) ; ... ...
 ... ... @@ -94,65 +94,65 @@ void subdivideFace(typename PFP::MAP& map, Dart d, VertexAttribute
 ... ... @@ -27,7 +27,7 @@ #include #include #include "Algo/Modelisation/polyhedron.h" #include "Algo/Tiling/Surface/square.h" #include "Algo/Modelisation/subdivision.h" #include "Algo/Geometry/normal.h" ... ... @@ -82,7 +82,8 @@ Dart extrusion_scale(typename PFP::MAP& the_map, VertexAttribute Polyhedron* extrusion_scale_prim(typename PFP::MAP& the_map, VertexAttribute& positions, //Polyhedron* extrusion_scale_prim(typename PFP::MAP& the_map, VertexAttribute& positions, Algo::Surface::Tilings::Tiling* extrusion_scale_prim(typename PFP::MAP& the_map, VertexAttribute& positions, const std::vector& profile, const typename PFP::VEC3& centerProfile, const typename PFP::VEC3& normalProfile, ... ... @@ -106,7 +107,8 @@ Polyhedron* extrusion_scale_prim(typename PFP::MAP& the_map, VertexAttribut * size of vector must be the same as path */ template Polyhedron* extrusion_prim(typename PFP::MAP& the_map, VertexAttribute& positions, //Polyhedron* extrusion_prim(typename PFP::MAP& the_map, VertexAttribute& positions, Algo::Surface::Tilings::Tiling* extrusion_prim(typename PFP::MAP& the_map, VertexAttribute& positions, const std::vector& profile, const typename PFP::VEC3& centerProfile, const typename PFP::VEC3& normalProfile, ... ... @@ -146,7 +148,8 @@ Dart extrusion(typename PFP::MAP& the_map, VertexAttribute& * @param nbSide number of steps around the revolution */ template Polyhedron* revolution_prim(typename PFP::MAP& the_map, VertexAttribute& positions, //Polyhedron* revolution_prim(typename PFP::MAP& the_map, VertexAttribute& positions, Algo::Surface::Tilings::Tiling* revolution_prim(typename PFP::MAP& the_map, VertexAttribute& positions, const std::vector& profile, const typename PFP::VEC3& center, const typename PFP::VEC3& axis, ... ... @@ -197,7 +200,7 @@ Dart extrudeRegion(typename PFP::MAP& the_map, VertexAttribute
 ... ... @@ -38,7 +38,8 @@ namespace Modelisation { template Polyhedron* revolution_prim(typename PFP::MAP& the_map, VertexAttribute& position, const std::vector& profile, const typename PFP::VEC3& center, //Polyhedron* revolution_prim(typename PFP::MAP& the_map, VertexAttribute& position, const std::vector& profile, const typename PFP::VEC3& center, Algo::Surface::Tilings::Tiling* revolution_prim(typename PFP::MAP& the_map, VertexAttribute& position, const std::vector& profile, const typename PFP::VEC3& center, const typename PFP::VEC3& axis, bool profile_closed, int nbSides) { typedef typename PFP::VEC3 VEC3 ; ... ... @@ -70,7 +71,8 @@ template Dart revolution(typename PFP::MAP& the_map, VertexAttribute& position, const std::vector& profile, const typename PFP::VEC3& center, const typename PFP::VEC3& axis, bool profile_closed, int nbSides) { Polyhedron *prim = revolution_prim(the_map, position, profile, center, axis, profile_closed, nbSides); //Polyhedron *prim = revolution_prim(the_map, position, profile, center, axis, profile_closed, nbSides); Algo::Surface::Tilings::Tiling *prim = revolution_prim(the_map, position, profile, center, axis, profile_closed, nbSides); Dart d = prim->getDart(); delete prim; return d; ... ... @@ -81,7 +83,8 @@ template Dart extrusion_scale(typename PFP::MAP& the_map, VertexAttribute& position, const std::vector& profile, const typename PFP::VEC3& centerProfile, const typename PFP::VEC3& normalProfile, bool profile_closed, const std::vector& path, bool path_closed, const std::vector& scalePath) { Polyhedron *prim = extrusion_scale_prim(the_map, position, profile, centerProfile, normalProfile, profile_closed, path, path_closed,scalePath); //Polyhedron *prim = extrusion_scale_prim(the_map, position, profile, centerProfile, normalProfile, profile_closed, path, path_closed,scalePath); Algo::Surface::Tilings::Tiling *prim = extrusion_scale_prim(the_map, position, profile, centerProfile, normalProfile, profile_closed, path, path_closed,scalePath); Dart d = prim->getDart(); delete prim; return d; ... ... @@ -92,14 +95,16 @@ Dart extrusion(typename PFP::MAP& the_map, VertexAttribute& const std::vector& path, bool path_closed) { std::vector scalePath; Polyhedron *prim = extrusion_scale_prim(the_map, position, profile, centerProfile, normalProfile, profile_closed, path, path_closed,scalePath); //Polyhedron *prim = extrusion_scale_prim(the_map, position, profile, centerProfile, normalProfile, profile_closed, path, path_closed,scalePath); Algo::Surface::Tilings::Tiling *prim = extrusion_scale_prim(the_map, position, profile, centerProfile, normalProfile, profile_closed, path, path_closed,scalePath); Dart d = prim->getDart(); delete prim; return d; } template Polyhedron* extrusion_prim(typename PFP::MAP& the_map, VertexAttribute& position, const std::vector& profile, const typename PFP::VEC3& centerProfile, const typename PFP::VEC3& normalProfile, bool profile_closed, //Polyhedron* extrusion_prim(typename PFP::MAP& the_map, VertexAttribute& position, const std::vector& profile, const typename PFP::VEC3& centerProfile, const typename PFP::VEC3& normalProfile, bool profile_closed, Algo::Surface::Tilings::Tiling* extrusion_prim(typename PFP::MAP& the_map, VertexAttribute& position, const std::vector& profile, const typename PFP::VEC3& centerProfile, const typename PFP::VEC3& normalProfile, bool profile_closed, const std::vector& path, bool path_closed) { std::vector scalePath; ... ... @@ -107,24 +112,30 @@ Polyhedron* extrusion_prim(typename PFP::MAP& the_map, VertexAttribute Polyhedron* extrusion_scale_prim(typename PFP::MAP& the_map, VertexAttribute& position, const std::vector& profile, const typename PFP::VEC3& centerProfile, const typename PFP::VEC3& normal, bool profile_closed, const std::vector& path, bool path_closed, const std::vector& scalePath) //Polyhedron* extrusion_scale_prim(typename PFP::MAP& the_map, VertexAttribute& position, const std::vector& profile, const typename PFP::VEC3& centerProfile, const typename PFP::VEC3& normal, bool profile_closed, const std::vector& path, bool path_closed, const std::vector& scalePath) Algo::Surface::Tilings::Tiling* extrusion_scale_prim(typename PFP::MAP& the_map, VertexAttribute& position, const std::vector& profile, const typename PFP::VEC3& centerProfile, const typename PFP::VEC3& normal, bool profile_closed, const std::vector& path, bool path_closed, const std::vector& scalePath) { // topological creation Polyhedron *prim = new Polyhedron(the_map, position); Dart grid; //Polyhedron *prim = new Polyhedron(the_map, position); Algo::Surface::Tilings::Tiling* prim; //Dart grid; if (profile_closed) { if (path_closed) grid = prim->tore_topo(profile.size() ,path.size()); //grid = prim->tore_topo(profile.size() ,path.size()); prim = new Algo::Surface::Tilings::Square::Tore(the_map, profile.size(), path.size()); else grid = prim->cylinder_topo(profile.size() ,path.size()-1, false, false); //grid = prim->cylinder_topo(profile.size() ,path.size()-1, false, false); prim = new Algo::Surface::Tilings::Square::Cylinder(the_map, profile.size(), path.size()-1,false, false); } else { if (path_closed) { grid = prim->grid_topo(profile.size()-1 ,path.size()); //grid = prim->grid_topo(profile.size()-1 ,path.size()); prim = new Algo::Surface::Tilings::Square::Grid(the_map, profile.size()-1 ,path.size(), true); // sewing boundaries correponding to path boundaries std::vector& darts = prim->getVertexDarts(); int index = profile.size()*path.size(); ... ... @@ -138,7 +149,8 @@ Polyhedron* extrusion_scale_prim(typename PFP::MAP& the_map, VertexAttribut } else grid = prim->grid_topo(profile.size()-1 ,path.size()-1); //grid = prim->grid_topo(profile.size()-1 ,path.size()-1); prim = new Algo::Surface::Tilings::Square::Grid(the_map, profile.size()-1 ,path.size()-1, true); } glPushMatrix(); ... ... @@ -478,7 +490,7 @@ Dart extrudeRegion(typename PFP::MAP& the_map, VertexAttribute
 ... ... @@ -45,7 +45,7 @@ namespace Surface namespace Modelisation { enum { NONE, GRID, CUBE, CYLINDER, CONE, SPHERE, TORE, COMPOSED }; //enum { NONE, GRID, CUBE, CYLINDER, CONE, SPHERE, TORE, COMPOSED }; //template //void sewFaceEmb(typename PFP::MAP& map, Dart d, Dart e); ... ... @@ -149,263 +149,263 @@ Dart embedPyramid(typename PFP::MAP& map, VertexAttribute& p /** * class of geometric Polyhedron * It alloaw the creation of: * - grid 2D * - subdivided cube * - subdivided cone * - subdivided cylinder * - subdivided tore * - subdivided sphere (with pole) * * Topological creation methods are separated from embedding to * easily allow specific embedding. */ template class Polyhedron { typedef typename PFP::MAP MAP; typedef typename PFP::VEC3 VEC3; public: enum {NONE,GRID, CUBE, CYLINDER, CONE, SPHERE, TORE, COMPOSED}; protected: /** * Map in which we are working */ MAP& m_map; /** * Reference dart of Polyhedron */ Dart m_dart; /** * Kind of Polyhedron (grid, cylinder, */ int m_kind; /** * Table of vertex darts (one dart per vertex) * Order depend on Polyhedron kind */ std::vector m_tableVertDarts; /** * numbers that defined the subdivision of Polyhedron */ unsigned int m_nx; unsigned int m_ny; unsigned int m_nz; bool m_top_closed; bool m_bottom_closed; VertexAttribute& m_positions; VEC3 m_center; /** * return the dart of next vertex when traversing the boundary of a quad or trifan grid */ Dart nextDV(Dart d) { return m_map.phi1(m_map.phi2(m_map.phi1(d))); } /** * return the dart of preceding vertex when traversing the boundary of a quad or trifan grid */ Dart precDV(Dart d) { return m_map.phi_1(m_map.phi2(m_map.phi_1(d))); } void computeCenter(); Dart grid_topo_open(unsigned int x, unsigned int y); Dart cylinder_topo_open(unsigned int n, unsigned int z); public: /** * Constructor * @param map the map in which we want to work * @param idPositions id of attribute position */ Polyhedron(MAP& map, VertexAttribute& position): m_map(map), m_kind(NONE), m_nx(-1), m_ny(-1), m_nz(-1), m_top_closed(false), m_bottom_closed(false), m_positions(position) { computeCenter(); } /** * Polyhedron fusion: give a COMPOSED type * @param p1 first Polyhedron * @param p1 second Polyhedron */ Polyhedron(const Polyhedron& p1, const Polyhedron& p2); /* * get the reference dart */