Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CGoGN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
KennethVanhoey
CGoGN
Commits
6d8c1419
Commit
6d8c1419
authored
Jan 30, 2014
by
Sylvain Thery
Browse files
Options
Browse Files
Download
Plain Diff
Merge cgogn:~untereiner/CGoGN
parents
95cf4074
a119b8e3
Changes
83
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
83 changed files
with
16442 additions
and
2114 deletions
+16442
-2114
Apps/Examples/clipping.cpp
Apps/Examples/clipping.cpp
+4
-4
Apps/Examples/clipping.h
Apps/Examples/clipping.h
+1
-1
Apps/Examples/simpleGMap2.cpp
Apps/Examples/simpleGMap2.cpp
+4
-5
Apps/Examples/simpleGMap3.cpp
Apps/Examples/simpleGMap3.cpp
+11
-12
Apps/Examples/simpleMap3.cpp
Apps/Examples/simpleMap3.cpp
+17
-18
Apps/Examples/texturesExample.cpp
Apps/Examples/texturesExample.cpp
+4
-4
Apps/Examples/volumeExplorer.cpp
Apps/Examples/volumeExplorer.cpp
+5
-5
Apps/SandBox/CMakeLists.txt
Apps/SandBox/CMakeLists.txt
+6
-2
Apps/SandBox/tilings.cpp
Apps/SandBox/tilings.cpp
+320
-0
Apps/SandBox/tilings.h
Apps/SandBox/tilings.h
+102
-0
Apps/Tuto/show_traversors.cpp
Apps/Tuto/show_traversors.cpp
+4
-4
Apps/Tuto/tuto3.cpp
Apps/Tuto/tuto3.cpp
+64
-65
Apps/Tuto/tuto5.cpp
Apps/Tuto/tuto5.cpp
+4
-4
Apps/Tuto/tuto_mt.cpp
Apps/Tuto/tuto_mt.cpp
+4
-4
Apps/Tuto/tuto_oper2.cpp
Apps/Tuto/tuto_oper2.cpp
+3
-4
Apps/Tuto/tuto_oper3.cpp
Apps/Tuto/tuto_oper3.cpp
+3
-10
Apps/Tuto/tuto_orbits.cpp
Apps/Tuto/tuto_orbits.cpp
+4
-5
SCHNApps/Plugins/CMakeLists.txt
SCHNApps/Plugins/CMakeLists.txt
+1
-0
doc/Doxyfile
doc/Doxyfile
+1
-1
doc/doxygraph/COPYING
doc/doxygraph/COPYING
+373
-0
doc/doxygraph/README
doc/doxygraph/README
+77
-0
doc/doxygraph/doxygraph/MANIFEST
doc/doxygraph/doxygraph/MANIFEST
+6
-0
doc/doxygraph/doxygraph/Makefile.PL
doc/doxygraph/doxygraph/Makefile.PL
+19
-0
doc/doxygraph/doxygraph/README
doc/doxygraph/doxygraph/README
+54
-0
doc/doxygraph/doxygraph/doxygraph
doc/doxygraph/doxygraph/doxygraph
+76
-0
doc/doxygraph/doxygraph/lib/Doxygen/XML.pm
doc/doxygraph/doxygraph/lib/Doxygen/XML.pm
+602
-0
doc/doxygraph/doxygraph/lib/GraphViz/UML.pm
doc/doxygraph/doxygraph/lib/GraphViz/UML.pm
+393
-0
doc/doxygraph/doxyviz/README
doc/doxygraph/doxyviz/README
+46
-0
doc/doxygraph/doxyviz/bindviz/README
doc/doxygraph/doxyviz/bindviz/README
+123
-0
doc/doxygraph/doxyviz/bindviz/bindviz.cpp
doc/doxygraph/doxyviz/bindviz/bindviz.cpp
+187
-0
doc/doxygraph/doxyviz/bindviz/cgraph.3.pdf
doc/doxygraph/doxyviz/bindviz/cgraph.3.pdf
+0
-0
doc/doxygraph/doxyviz/bindviz/gvc.3.pdf
doc/doxygraph/doxyviz/bindviz/gvc.3.pdf
+0
-0
doc/doxygraph/doxyviz/htdocs/bindviz.js
doc/doxygraph/doxyviz/htdocs/bindviz.js
+6375
-0
doc/doxygraph/doxyviz/htdocs/doxyviz.js
doc/doxygraph/doxyviz/htdocs/doxyviz.js
+119
-0
doc/doxygraph/doxyviz/htdocs/graph.dot
doc/doxygraph/doxyviz/htdocs/graph.dot
+1933
-0
doc/doxygraph/doxyviz/htdocs/index.html
doc/doxygraph/doxyviz/htdocs/index.html
+41
-0
doc/doxygraph/doxyviz/htdocs/logo.png
doc/doxygraph/doxyviz/htdocs/logo.png
+0
-0
doc/doxygraph/doxyviz/htdocs/svgpan.js
doc/doxygraph/doxyviz/htdocs/svgpan.js
+294
-0
include/Algo/Export/export.h
include/Algo/Export/export.h
+1
-1
include/Algo/Export/export.hpp
include/Algo/Export/export.hpp
+1
-1
include/Algo/Geometry/area.h
include/Algo/Geometry/area.h
+19
-0
include/Algo/ImplicitHierarchicalMesh/ihm.hppxx
include/Algo/ImplicitHierarchicalMesh/ihm.hppxx
+0
-0
include/Algo/ImplicitHierarchicalMesh/ihm.hxx
include/Algo/ImplicitHierarchicalMesh/ihm.hxx
+0
-0
include/Algo/ImplicitHierarchicalMesh/subdivision.hppxx
include/Algo/ImplicitHierarchicalMesh/subdivision.hppxx
+79
-79
include/Algo/ImplicitHierarchicalMesh/subdivision.hxx
include/Algo/ImplicitHierarchicalMesh/subdivision.hxx
+0
-0
include/Algo/Import/import.hpp
include/Algo/Import/import.hpp
+511
-432
include/Algo/Import/import2tablesVolume.hpp
include/Algo/Import/import2tablesVolume.hpp
+146
-10
include/Algo/Import/importMRDAT.h
include/Algo/Import/importMRDAT.h
+7
-0
include/Algo/Import/importMRDAT.hpp
include/Algo/Import/importMRDAT.hpp
+2
-14
include/Algo/Modelisation/extrusion.h
include/Algo/Modelisation/extrusion.h
+8
-5
include/Algo/Modelisation/extrusion.hpp
include/Algo/Modelisation/extrusion.hpp
+25
-13
include/Algo/Modelisation/polyhedron.h
include/Algo/Modelisation/polyhedron.h
+255
-255
include/Algo/Modelisation/polyhedron.hpp
include/Algo/Modelisation/polyhedron.hpp
+799
-786
include/Algo/Modelisation/primitives3d.hppxx
include/Algo/Modelisation/primitives3d.hppxx
+0
-0
include/Algo/Modelisation/primitives3d.hxx
include/Algo/Modelisation/primitives3d.hxx
+0
-0
include/Algo/Multiresolution/IHM2/ihm2_PrimalAdapt.h
include/Algo/Multiresolution/IHM2/ihm2_PrimalAdapt.h
+54
-8
include/Algo/Multiresolution/IHM2/ihm2_PrimalAdapt.hpp
include/Algo/Multiresolution/IHM2/ihm2_PrimalAdapt.hpp
+333
-83
include/Algo/Multiresolution/IHM2/ihm2_PrimalRegular.h
include/Algo/Multiresolution/IHM2/ihm2_PrimalRegular.h
+94
-0
include/Algo/Multiresolution/IHM2/ihm2_PrimalRegular.hpp
include/Algo/Multiresolution/IHM2/ihm2_PrimalRegular.hpp
+327
-0
include/Algo/Multiresolution/Map2MR/Filters/lerp.h
include/Algo/Multiresolution/Map2MR/Filters/lerp.h
+5
-3
include/Algo/Multiresolution/Map2MR/Masks/catmullClark.h
include/Algo/Multiresolution/Map2MR/Masks/catmullClark.h
+1
-1
include/Algo/Multiresolution/Map2MR/Masks/lerp.h
include/Algo/Multiresolution/Map2MR/Masks/lerp.h
+2
-2
include/Algo/Multiresolution/Map2MR/map2MR_PrimalRegular.h
include/Algo/Multiresolution/Map2MR/map2MR_PrimalRegular.h
+5
-1
include/Algo/Multiresolution/Map2MR/map2MR_PrimalRegular.hpp
include/Algo/Multiresolution/Map2MR/map2MR_PrimalRegular.hpp
+104
-2
include/Algo/Tiling/Surface/hexagonal.h
include/Algo/Tiling/Surface/hexagonal.h
+124
-0
include/Algo/Tiling/Surface/hexagonal.hpp
include/Algo/Tiling/Surface/hexagonal.hpp
+123
-0
include/Algo/Tiling/Surface/square.h
include/Algo/Tiling/Surface/square.h
+304
-0
include/Algo/Tiling/Surface/square.hpp
include/Algo/Tiling/Surface/square.hpp
+600
-0
include/Algo/Tiling/Surface/triangular.h
include/Algo/Tiling/Surface/triangular.h
+124
-0
include/Algo/Tiling/Surface/triangular.hpp
include/Algo/Tiling/Surface/triangular.hpp
+122
-0
include/Algo/Tiling/Volume/cubic.h
include/Algo/Tiling/Volume/cubic.h
+136
-0
include/Algo/Tiling/Volume/cubic.hpp
include/Algo/Tiling/Volume/cubic.hpp
+247
-0
include/Algo/Tiling/tiling.h
include/Algo/Tiling/tiling.h
+114
-0
include/Algo/Tiling/tiling.hpp
include/Algo/Tiling/tiling.hpp
+116
-0
include/Topology/generic/genericmap.h
include/Topology/generic/genericmap.h
+1
-1
include/Topology/generic/traversor2.hpp
include/Topology/generic/traversor2.hpp
+2
-2
include/Topology/ihmap/ihm2.h
include/Topology/ihmap/ihm2.h
+63
-48
include/Topology/ihmap/ihm2.hpp
include/Topology/ihmap/ihm2.hpp
+67
-11
include/Topology/map/map1.hpp
include/Topology/map/map1.hpp
+1
-1
src/Algo/ImplicitHierarchicalMesh/ihm.cppxx
src/Algo/ImplicitHierarchicalMesh/ihm.cppxx
+0
-0
src/Topology/generic/genericmap.cpp
src/Topology/generic/genericmap.cpp
+19
-7
src/Topology/ihmap/ihm2.cpp
src/Topology/ihmap/ihm2.cpp
+215
-197
src/Topology/map/embeddedMap2.cpp
src/Topology/map/embeddedMap2.cpp
+6
-3
No files found.
Apps/Examples/clipping.cpp
View file @
6d8c1419
...
...
@@ -1114,10 +1114,10 @@ int main(int argc, char** argv)
}
else
{
sqt
.
position
=
sqt
.
myMap
.
addAttribute
<
PFP
::
VEC3
,
VERTEX
>
(
"position"
);
Algo
::
Volume
::
Modelisation
::
Primitive3D
<
PFP
>
prim
(
sqt
.
myMap
,
sqt
.
position
);
prim
.
hexaGrid_topo
(
10
,
10
,
10
);
prim
.
embedHexaGrid
(
1.0
f
,
1.0
f
,
1.0
f
);
sqt
.
position
=
sqt
.
myMap
.
addAttribute
<
PFP
::
VEC3
,
VERTEX
>
(
"position"
);
Algo
::
Volume
::
Tilings
::
Cubic
::
Grid
<
PFP
>
cubic
(
sqt
.
myMap
,
10
,
10
,
10
);
cubic
.
embedIntoGrid
(
sqt
.
position
,
1.0
f
,
1.0
f
,
1.0
f
);
}
sqt
.
initGUI
();
...
...
Apps/Examples/clipping.h
View file @
6d8c1419
...
...
@@ -57,7 +57,7 @@
#include "Utils/cgognStream.h"
#include "Utils/drawer.h"
#include "Algo/
Modelisation/primitives3d
.h"
#include "Algo/
Tiling/Volume/cubic
.h"
#include <string>
#include <sstream>
...
...
Apps/Examples/simpleGMap2.cpp
View file @
6d8c1419
...
...
@@ -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
<
PFP
>
poly
(
myMap
,
position
);
d
=
poly
.
cylinder_topo
(
5
,
1
,
false
,
false
);
poly
.
embedCylinder
(
10
,
10
,
5
);
Algo
::
Surface
::
Tilings
::
Square
::
Cylinder
<
PFP
>
poly
(
myMap
,
5
,
1
,
false
,
false
);
d
=
poly
.
getDart
();
poly
.
embedIntoCylinder
(
position
,
10
,
10
,
5
);
d
=
myMap
.
phi1
(
d
);
Dart
dd
=
myMap
.
beta2
(
d
);
...
...
Apps/Examples/simpleGMap3.cpp
View file @
6d8c1419
...
...
@@ -25,7 +25,7 @@
#include "simpleGMap3.h"
#include "Utils/GLSLShader.h"
#include "Algo/Geometry/boundingbox.h"
#include "Algo/
Modelisation/primitives3d
.h"
#include "Algo/
Tiling/Volume/cubic
.h"
#include "Algo/Modelisation/subdivision3.h"
SimpleGMap3
::
SimpleGMap3
()
...
...
@@ -35,22 +35,21 @@ SimpleGMap3::SimpleGMap3()
// CellMarker<EDGE> mE(myMap);
Algo
::
Volume
::
Modelisation
::
Primitive3D
<
PFP
>
primCat
(
myMap
,
position
);
Dart
d
=
primCat
.
hexaGrid_topo
(
1
,
1
,
1
);
primCat
.
embedHexaGrid
(
1
,
1
,
1
);
Algo
::
Volume
::
Tilings
::
Cubic
::
Grid
<
PFP
>
cubic
(
myMap
,
1
,
1
,
1
);
cubic
.
embedIntoGrid
(
position
,
1.0
f
,
1.0
f
,
1.0
f
);
myMap
.
check
();
Dart
dp
=
Algo
::
Surface
::
Modelisation
::
createQuadrangularPyramid
<
PFP
>
(
myMap
);
//
Dart dp = Algo::Surface::Modelisation::createQuadrangularPyramid<PFP>(myMap);
position
[
dp
]
=
typename
PFP
::
VEC3
(
0.5
,
0.5
,
-
0.5
);
position
[
myMap
.
phi1
(
dp
)]
=
typename
PFP
::
VEC3
(
0.5
,
0.5
,
0.5
);
position
[
myMap
.
phi1
(
myMap
.
phi1
(
dp
))]
=
typename
PFP
::
VEC3
(
0.5
,
-
0.5
,
0.5
);
position
[
myMap
.
phi_1
(
dp
)]
=
typename
PFP
::
VEC3
(
0.5
,
-
0.5
,
-
0.5
);
position
[
myMap
.
phi_1
(
myMap
.
phi2
(
dp
))]
=
typename
PFP
::
VEC3
(
1.5
f
,
0.0
f
,
0.0
f
);
//
position[dp] = typename PFP::VEC3(0.5,0.5,-0.5);
//
position[myMap.phi1(dp)] = typename PFP::VEC3(0.5,0.5,0.5);
//
position[myMap.phi1(myMap.phi1(dp))] = typename PFP::VEC3(0.5,-0.5,0.5);
//
position[myMap.phi_1(dp)] = typename PFP::VEC3(0.5,-0.5,-0.5);
//
position[myMap.phi_1(myMap.phi2(dp))] = typename PFP::VEC3(1.5f, 0.0f, 0.0f);
Dart
dtemp
=
myMap
.
beta1
(
myMap
.
beta0
(
myMap
.
beta1
(
myMap
.
beta2
(
myMap
.
beta1
(
myMap
.
beta0
(
myMap
.
beta1
(
myMap
.
beta2
(
d
))))))));
//
Dart dtemp = myMap.beta1(myMap.beta0(myMap.beta1(myMap.beta2(myMap.beta1(myMap.beta0(myMap.beta1(myMap.beta2(d))))))));
myMap
.
sewVolumes
(
dtemp
,
dp
);
//
myMap.sewVolumes(dtemp,dp);
// Geom::Plane3D<PFP::REAL> pl(VEC3(-1,-0.5,-0.5),VEC3(-1,-0.5,0.5),VEC3(1,0.5,0.5));
// Algo::Volume::Modelisation::sliceConvexVolume<PFP>(myMap, position, d, pl);
...
...
Apps/Examples/simpleMap3.cpp
View file @
6d8c1419
...
...
@@ -25,35 +25,34 @@
#include "simpleMap3.h"
#include "Utils/GLSLShader.h"
#include "Algo/Geometry/boundingbox.h"
#include "Algo/
Modelisation/primitives3d
.h"
#include "Algo/
Tiling/Volume/cubic
.h"
#include "Algo/Modelisation/subdivision3.h"
SimpleMap3
::
SimpleMap3
()
{
position
=
myMap
.
addAttribute
<
VEC3
,
VERTEX
>
(
"position"
);
Algo
::
Volume
::
Modelisation
::
Primitive3D
<
PFP
>
primCat
(
myMap
,
position
);
Dart
d
=
primCat
.
hexaGrid_topo
(
1
,
1
,
1
);
primCat
.
embedHexaGrid
(
1
,
1
,
1
);
myMap
.
closeMap
();
myMap
.
check
();
Dart
dp
=
Algo
::
Surface
::
Modelisation
::
createQuadrangularPyramid
<
PFP
>
(
myMap
);
Algo
::
Volume
::
Tilings
::
Cubic
::
Grid
<
PFP
>
cubic
(
myMap
,
1
,
1
,
1
);
cubic
.
embedIntoGrid
(
position
,
1.0
f
,
1.0
f
,
1.0
f
);
myMap
.
check
();
position
[
dp
]
=
typename
PFP
::
VEC3
(
0.5
,
0.5
,
-
0.5
);
position
[
myMap
.
phi1
(
dp
)]
=
typename
PFP
::
VEC3
(
0.5
,
0.5
,
0.5
);
position
[
myMap
.
phi1
(
myMap
.
phi1
(
dp
))]
=
typename
PFP
::
VEC3
(
0.5
,
-
0.5
,
0.5
);
position
[
myMap
.
phi_1
(
dp
)]
=
typename
PFP
::
VEC3
(
0.5
,
-
0.5
,
-
0.5
);
position
[
myMap
.
phi_1
(
myMap
.
phi2
(
dp
))]
=
typename
PFP
::
VEC3
(
1.5
f
,
0.0
f
,
0.0
f
);
Dart
dtemp
=
myMap
.
phi_1
(
myMap
.
phi2
(
myMap
.
phi_1
(
myMap
.
phi_1
(
myMap
.
phi2
(
d
))))
);
// Dart dp = Algo::Surface::Modelisation::createQuadrangularPyramid<PFP>(myMap
);
myMap
.
sewVolumes
(
dtemp
,
dp
);
// position[dp] = typename PFP::VEC3(0.5,0.5,-0.5);
// position[myMap.phi1(dp)] = typename PFP::VEC3(0.5,0.5,0.5);
// position[myMap.phi1(myMap.phi1(dp))] = typename PFP::VEC3(0.5,-0.5,0.5);
// position[myMap.phi_1(dp)] = typename PFP::VEC3(0.5,-0.5,-0.5);
// position[myMap.phi_1(myMap.phi2(dp))] = typename PFP::VEC3(1.5f, 0.0f, 0.0f);
// Algo::Volume::Modelisation::Primitive3D<PFP> primCat(myMap, position);
// Dart d = primCat.hexaGrid_topo(2,1,1);
// primCat.embedHexaGrid(1,1,1);
// myMap.closeMap();
// Dart dtemp = myMap.phi_1(myMap.phi2(myMap.phi_1(myMap.phi_1(myMap.phi2(d)))));
// myMap.sewVolumes(dtemp,dp);
// Algo::Volume::Tilings::Cubic::Grid<PFP> cubic(myMap, 2, 1, 1);
// cubic.embedIntoGrid(position, 1.0f, 1.0f, 1.0f);
// myMap.check();
// unsigned int nb=0;
// for(unsigned int i = position.begin(); i!=position.end(); position.next(i))
...
...
Apps/Examples/texturesExample.cpp
View file @
6d8c1419
...
...
@@ -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
<
VEC3
>
position
=
myMap
.
addAttribute
<
VEC3
,
VERTEX
>
(
"position"
);
VertexAttribute
<
Geom
::
Vec2f
>
texcoord
=
myMap
.
addAttribute
<
Geom
::
Vec2f
,
VERTEX
>
(
"texcoord"
);
Algo
::
Surface
::
Modelisation
::
Polyhedron
<
PFP
>
prim
(
myMap
,
position
);
prim
.
tore_topo
(
NB
,
NB
);
prim
.
embedTore
(
40.0
f
,
20.0
f
);
//
Algo::Surface::Modelisation::Polyhedron<PFP> prim(myMap, position);
Algo
::
Surface
::
Tilings
::
Square
::
Tore
<
PFP
>
prim
(
myMap
,
NB
,
NB
);
prim
.
embedIntoTore
(
position
,
40.0
f
,
20.0
f
);
Dart
d
=
prim
.
getDart
();
for
(
unsigned
int
i
=
0
;
i
<
NB
;
++
i
)
{
...
...
Apps/Examples/volumeExplorer.cpp
View file @
6d8c1419
...
...
@@ -26,7 +26,7 @@
#include "volumeExplorer.h"
#include <iostream>
#include "Algo/
Modelisation/primitives3d
.h"
#include "Algo/
Tiling/Volume/cubic
.h"
#include "Algo/Modelisation/polyhedron.h"
#include "Algo/Import/import.h"
#include "Algo/Geometry/volume.h"
...
...
@@ -214,7 +214,7 @@ void MyQT::cb_initGL()
// create the renders
m_topo_render
=
new
Algo
::
Render
::
GL2
::
Topo3Render
();
m_explode_render
=
new
Algo
::
Render
::
GL2
::
ExplodeVolumeRender
(
true
,
true
,
fals
e
);
m_explode_render
=
new
Algo
::
Render
::
GL2
::
ExplodeVolumeRender
(
true
,
true
,
tru
e
);
// SelectorDartNoBoundary<PFP::MAP> nb(myMap);
m_topo_render
->
updateData
<
PFP
>
(
myMap
,
position
,
0.8
f
,
0.8
f
,
0.8
f
);
...
...
@@ -440,10 +440,10 @@ int main(int argc, char **argv)
else
{
position
=
myMap
.
addAttribute
<
PFP
::
VEC3
,
VERTEX
>
(
"position"
);
Algo
::
Volume
::
Modelisation
::
Primitive3D
<
PFP
>
prim
(
myMap
,
position
);
int
nb
=
8
;
prim
.
hexaGrid_topo
(
nb
,
nb
,
nb
);
prim
.
embedHexaGrid
(
1.0
f
,
1.0
f
,
1.0
f
);
Algo
::
Volume
::
Tilings
::
Cubic
::
Grid
<
PFP
>
cubic
(
myMap
,
nb
,
nb
,
nb
);
cubic
.
embedIntoGrid
(
position
,
1.0
f
,
1.0
f
,
1.0
f
);
for
(
unsigned
int
i
=
position
.
begin
();
i
!=
position
.
end
();
position
.
next
(
i
))
{
...
...
Apps/SandBox/CMakeLists.txt
View file @
6d8c1419
...
...
@@ -23,8 +23,12 @@ ENDIF(WIN32)
#define exec to compile
add_executable
(
multi_att multi_att.cpp
)
target_link_libraries
(
multi_att
${
CGoGN_LIBS_D
}
${
CGoGN_EXT_LIBS
}
)
add_executable
(
multi_att multi_att.cpp
)
target_link_libraries
(
multi_att
${
CGoGN_LIBS_D
}
${
CGoGN_EXT_LIBS
}
)
QT4_WRAP_CPP
(
tilings_moc tilings.h
)
add_executable
(
tilings tilings.cpp
${
tilings_moc
}
)
target_link_libraries
(
tilings
${
CGoGN_LIBS_D
}
${
CGoGN_EXT_LIBS
}
)
# Example with Qt
#
...
...
Apps/SandBox/tilings.cpp
0 → 100644
View file @
6d8c1419
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps *
* version 0.1 *
* Copyright (C) 2009-2012, 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: http://cgogn.unistra.fr/ *
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
#include "tilings.h"
#include "Geometry/vector_gen.h"
#include "Algo/Import/import.h"
#include "Algo/Geometry/boundingbox.h"
#include "Utils/GLSLShader.h"
//#include "Algo/Geometry/area.h"
#include "Algo/Geometry/normal.h"
#include "Utils/cgognStream.h"
#include "Utils/chrono.h"
using
namespace
CGoGN
;
/**
* Struct that contains some informations about the types of the manipulated objects
* Mainly here to be used by the algorithms that are parameterized by it
*/
struct
PFP
:
public
PFP_STANDARD
{
// definition of the map
typedef
EmbeddedMap2
MAP
;
};
PFP
::
MAP
myMap
;
VertexAttribute
<
PFP
::
VEC3
>
position
;
VertexAttribute
<
PFP
::
VEC3
>
position2
;
VertexAttribute
<
PFP
::
VEC3
>
normal
;
void
MyQT
::
cb_initGL
()
{
Utils
::
GLSLShader
::
setCurrentOGLVersion
(
2
);
// create the render
m_render
=
new
Algo
::
Render
::
GL2
::
MapRender
();
// create VBO for position
m_positionVBO
=
new
Utils
::
VBO
();
m_positionVBO
->
updateData
(
position
);
m_normalVBO
=
new
Utils
::
VBO
();
m_shader
=
new
Utils
::
ShaderSimpleColor
();
m_shader
->
setAttributePosition
(
m_positionVBO
);
m_shader
->
setColor
(
Geom
::
Vec4f
(
1.
,
1.
,
0.
,
0.
));
m_lines
=
new
Utils
::
ShaderVectorPerVertex
();
m_lines
->
setAttributePosition
(
m_positionVBO
);
m_lines
->
setAttributeVector
(
m_normalVBO
);
m_lines
->
setScale
(
0.2
f
);
m_lines
->
setColor
(
Geom
::
Vec4f
(
0.0
f
,
1.0
f
,
0.2
f
,
0.0
f
));
Algo
::
Surface
::
Geometry
::
computeNormalVertices
<
PFP
>
(
myMap
,
position
,
normal
)
;
m_render
->
initPrimitives
<
PFP
>
(
myMap
,
Algo
::
Render
::
GL2
::
LINES
);
m_render
->
initPrimitives
<
PFP
>
(
myMap
,
Algo
::
Render
::
GL2
::
POINTS
);
registerShader
(
m_shader
);
registerShader
(
m_lines
);
m_normalVBO
->
updateData
(
normal
);
}
void
MyQT
::
cb_redraw
()
{
m_render
->
draw
(
m_shader
,
Algo
::
Render
::
GL2
::
LINES
);
m_render
->
draw
(
m_lines
,
Algo
::
Render
::
GL2
::
POINTS
);
}
void
MyQT
::
squareTiling
(
int
code
)
{
switch
(
code
)
{
case
1
:
{
std
::
cout
<<
"square grid tiling"
<<
std
::
endl
;
Algo
::
Surface
::
Tilings
::
Square
::
Grid
<
PFP
>
g
(
myMap
,
10
,
10
,
true
);
g
.
embedIntoGrid
(
position
,
50
,
50
);
break
;
}
case
2
:
{
std
::
cout
<<
"square grid twisted strip tiling"
<<
std
::
endl
;
Algo
::
Surface
::
Tilings
::
Square
::
Grid
<
PFP
>
g
(
myMap
,
10
,
10
,
true
);
g
.
embedIntoTwistedStrip
(
position
,
0.3
,
0.8
,
5
);
break
;
}
case
3
:
{
std
::
cout
<<
"square grid helocoid tiling"
<<
std
::
endl
;
Algo
::
Surface
::
Tilings
::
Square
::
Grid
<
PFP
>
g
(
myMap
,
20
,
20
,
true
);
g
.
embedIntoHelicoid
(
position
,
0.3
,
0.8
,
5.0
,
2.0
);
break
;
}
case
4
:
{
std
::
cout
<<
"square cylinder tiling"
<<
std
::
endl
;
Algo
::
Surface
::
Tilings
::
Square
::
Cylinder
<
PFP
>
c
(
myMap
,
20
,
20
);
c
.
embedIntoCylinder
(
position
,
0.5
,
0.7
,
5.0
);
break
;
}
case
5
:
{
std
::
cout
<<
"square cylinder tiling"
<<
std
::
endl
;
Algo
::
Surface
::
Tilings
::
Square
::
Cylinder
<
PFP
>
c
(
myMap
,
20
,
20
);
c
.
triangleBottom
();
c
.
triangleTop
();
c
.
embedIntoCylinder
(
position
,
0.5
,
0.7
,
5.0
);
break
;
}
case
6
:
{
std
::
cout
<<
"square cylinder sphere tiling"
<<
std
::
endl
;
Algo
::
Surface
::
Tilings
::
Square
::
Cylinder
<
PFP
>
c
(
myMap
,
20
,
20
);
c
.
triangleTop
();
c
.
triangleBottom
();
c
.
embedIntoSphere
(
position
,
0.5
);
break
;
}
case
7
:
{
std
::
cout
<<
"square cylinder cone tiling"
<<
std
::
endl
;
Algo
::
Surface
::
Tilings
::
Square
::
Cylinder
<
PFP
>
c
(
myMap
,
20
,
20
);
c
.
triangleTop
();
c
.
triangleBottom
();
c
.
embedIntoCone
(
position
,
0.5
,
5.0
);
break
;
}
case
8
:
{
std
::
cout
<<
"square cylinder cone tiling"
<<
std
::
endl
;
Algo
::
Surface
::
Tilings
::
Square
::
Cube
<
PFP
>
c
(
myMap
,
20
,
20
,
20
);
c
.
embedIntoCube
(
position
,
5.0
,
5.0
,
5.0
);
break
;
}
case
9
:
{
std
::
cout
<<
"square cylinder cone tiling"
<<
std
::
endl
;
Algo
::
Surface
::
Tilings
::
Square
::
Tore
<
PFP
>
c
(
myMap
,
20
,
10
);
c
.
embedIntoTore
(
position
,
5.0
,
2.0
);
break
;
}
default:
{
break
;
}
}
}
// mouse picking
void
MyQT
::
triangularTiling
(
int
code
)
{
switch
(
code
)
{
case
1
:
{
std
::
cout
<<
"square grid tiling"
<<
std
::
endl
;
Algo
::
Surface
::
Tilings
::
Triangular
::
Grid
<
PFP
>
g
(
myMap
,
10
,
10
,
true
);
g
.
embedIntoGrid
(
position
,
50
,
50
);
break
;
}
case
2
:
{
// std::cout << "square grid twisted strip tiling" << std::endl;
// Algo::Surface::Tilings::Square::Grid<PFP> g(myMap,10,10,true);
// g.embedIntoTwistedStrip(position, 0.3, 0.8, 5);
break
;
}
case
3
:
{
// std::cout << "square grid helocoid tiling" << std::endl;
// Algo::Surface::Tilings::Square::Grid<PFP> g(myMap,20,20,true);
// g.embedIntoHelicoid(position, 0.3, 0.8, 5.0, 2.0);
break
;
}
case
4
:
{
// std::cout << "square cylinder tiling" << std::endl;
// Algo::Surface::Tilings::Square::Cylinder<PFP> c(myMap,20,20);
// c.embedIntoCylinder(position,0.5,0.7,5.0);
break
;
}
case
5
:
{
// std::cout << "square cylinder tiling" << std::endl;
// Algo::Surface::Tilings::Square::Cylinder<PFP> c(myMap,20,20);
// c.triangleBottom();
// c.triangleTop();
// c.embedIntoCylinder(position,0.5,0.7,5.0);
break
;
}
case
6
:
{
// std::cout << "square cylinder sphere tiling" << std::endl;
// Algo::Surface::Tilings::Square::Cylinder<PFP> c(myMap,20,20);
// c.triangleTop();
// c.triangleBottom();
// c.embedIntoSphere(position,0.5);
break
;
}
case
7
:
{
// std::cout << "square cylinder cone tiling" << std::endl;
// Algo::Surface::Tilings::Square::Cylinder<PFP> c(myMap,20,20);
// c.triangleTop();
// c.triangleBottom();
// c.embedIntoCone(position,0.5, 5.0);
break
;
}
case
8
:
{
// std::cout << "square cylinder cone tiling" << std::endl;
// Algo::Surface::Tilings::Square::Cube<PFP> c(myMap,20,20,20);
// c.embedIntoCube(position,5.0,5.0, 5.0);
break
;
}
case
9
:
{
// std::cout << "square cylinder cone tiling" << std::endl;
// Algo::Surface::Tilings::Square::Tore<PFP> c(myMap,20,10);
// c.embedIntoTore(position,5.0,2.0);
break
;
}
default:
{
break
;
}
}
}
int
main
(
int
argc
,
char
**
argv
)
{
// interface:
QApplication
app
(
argc
,
argv
);
MyQT
sqt
;
sqt
.
statusMsg
(
"Neww to create a sphere or Load for a mesh file"
);
CGoGNStream
::
allToConsole
(
&
sqt
);
if
(
!
position
.
isValid
())
position
=
myMap
.
addAttribute
<
PFP
::
VEC3
,
VERTEX
>
(
"position"
);
if
(
!
normal
.
isValid
())
normal
=
myMap
.
addAttribute
<
PFP
::
VEC3
,
VERTEX
>
(
"normal"
);
if
(
argc
==
3
)
{
if
(
argv
[
1
][
0
]
==
'S'
)
sqt
.
squareTiling
(
atoi
(
argv
[
2
]));
else
if
(
argv
[
1
][
0
]
==
'T'
)
sqt
.
triangularTiling
(
atoi
(
argv
[
2
]));
}
// bounding box
Geom
::
BoundingBox
<
PFP
::
VEC3
>
bb
=
Algo
::
Geometry
::
computeBoundingBox
<
PFP
>
(
myMap
,
position
);
float
lWidthObj
=
std
::
max
<
PFP
::
REAL
>
(
std
::
max
<
PFP
::
REAL
>
(
bb
.
size
(
0
),
bb
.
size
(
1
)),
bb
.
size
(
2
));
Geom
::
Vec3f
lPosObj
=
(
bb
.
min
()
+
bb
.
max
())
/
PFP
::
REAL
(
2
);
CGoGNout
<<
"lPosObj="
<<
lPosObj
<<
CGoGNendl
;
CGoGNout
<<
"lWidthObj="
<<
lWidthObj
<<
CGoGNendl
;
sqt
.
setParamObject
(
lWidthObj
,
lPosObj
.
data
());
// myMap.enableQuickTraversal<EDGE>() ;
// myMap.enableQuickTraversal<VERTEX>() ;
sqt
.
show
();
return
app
.
exec
();
}
Apps/SandBox/tilings.h
0 → 100644
View file @
6d8c1419
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps *
* version 0.1 *
* Copyright (C) 2009-2012, 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: http://cgogn.unistra.fr/ *
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
#ifndef TUTO_TILINGS_H
#define TUTO_TILINGS_H
#include <iostream>
#include "Utils/Qt/qtSimple.h"
#include "Topology/generic/parameters.h"
#include "Topology/map/embeddedMap2.h"
#include "Geometry/vector_gen.h"
#include "Algo/Geometry/boundingbox.h"
#include "Algo/Render/GL2/mapRender.h"
#include "Utils/Shaders/shaderSimpleColor.h"
#include "Utils/Shaders/shaderVectorPerVertex.h"
#include "Utils/vbo.h"
#include "Utils/cgognStream.h"
#include "Algo/Tiling/Surface/square.h"
#include "Algo/Tiling/Surface/triangular.h"
// forward definitions (minimize includes)
namespace
CGoGN
{
namespace
Algo
{
namespace
Render
{
namespace
GL1
{
class
MapRender
;
}
}
}
}
namespace
CGoGN
{
namespace
Utils
{
class
VBO
;
}
}
namespace
CGoGN
{
namespace
Utils
{
class
ShaderSimpleColor
;
}
}
using
namespace
CGoGN
;
/**
* A class for a little interface and rendering
*/
class
MyQT
:
public
Utils
::
QT
::
SimpleQT
{
Q_OBJECT
public:
Algo
::
Render
::
GL2
::
MapRender
*
m_render
;
Utils
::
VBO
*
m_positionVBO
;
Utils
::
VBO
*
m_normalVBO
;