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
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
David Cazier
CGoGN
Commits
aae2b76b
Commit
aae2b76b
authored
Nov 15, 2012
by
Sylvain Thery
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of cgogn:CGoGN
parents
7e5dc1ac
212bdd11
Changes
46
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
46 changed files
with
6068 additions
and
3026 deletions
+6068
-3026
Apps/deprecated/tp_master.cpp
Apps/deprecated/tp_master.cpp
+1
-1
Apps/deprecated/tutoriel.cpp
Apps/deprecated/tutoriel.cpp
+34
-315
Apps/deprecated/tutoriel.h
Apps/deprecated/tutoriel.h
+1
-1
README_ECLIPSE.TXT
README_ECLIPSE.TXT
+8
-0
doc/Doxyfile
doc/Doxyfile
+257
-95
include/Algo/BooleanOperator/mergeVertices.hpp
include/Algo/BooleanOperator/mergeVertices.hpp
+1
-0
include/Algo/Decimation/approximator.h
include/Algo/Decimation/approximator.h
+171
-7
include/Algo/Decimation/colorPerVertexApproximator.h
include/Algo/Decimation/colorPerVertexApproximator.h
+44
-5
include/Algo/Decimation/colorPerVertexApproximator.hpp
include/Algo/Decimation/colorPerVertexApproximator.hpp
+5
-5
include/Algo/Decimation/decimation.h
include/Algo/Decimation/decimation.h
+15
-0
include/Algo/Decimation/decimation.hpp
include/Algo/Decimation/decimation.hpp
+30
-21
include/Algo/Decimation/edgeSelector.h
include/Algo/Decimation/edgeSelector.h
+89
-25
include/Algo/Decimation/edgeSelector.hpp
include/Algo/Decimation/edgeSelector.hpp
+106
-66
include/Algo/Decimation/geometryApproximator.h
include/Algo/Decimation/geometryApproximator.h
+14
-14
include/Algo/Decimation/geometryApproximator.hpp
include/Algo/Decimation/geometryApproximator.hpp
+10
-10
include/Algo/Decimation/halfEdgeSelector.h
include/Algo/Decimation/halfEdgeSelector.h
+120
-140
include/Algo/Decimation/halfEdgeSelector.hpp
include/Algo/Decimation/halfEdgeSelector.hpp
+690
-862
include/Algo/Decimation/lightfieldApproximator.h
include/Algo/Decimation/lightfieldApproximator.h
+145
-82
include/Algo/Decimation/lightfieldApproximator.hpp
include/Algo/Decimation/lightfieldApproximator.hpp
+281
-65
include/Algo/Decimation/selector.h
include/Algo/Decimation/selector.h
+9
-3
include/Algo/Export/exportPov.h
include/Algo/Export/exportPov.h
+2
-2
include/Algo/Import/import2tablesSurface.hpp
include/Algo/Import/import2tablesSurface.hpp
+1
-1
include/Algo/Import/importSvg.h
include/Algo/Import/importSvg.h
+6
-0
include/Algo/Import/importSvg.hpp
include/Algo/Import/importSvg.hpp
+160
-202
include/Algo/MovingObjects/particle_base.h
include/Algo/MovingObjects/particle_base.h
+20
-19
include/Algo/MovingObjects/particle_cell_2D.h
include/Algo/MovingObjects/particle_cell_2D.h
+59
-51
include/Algo/MovingObjects/particle_cell_2D.hpp
include/Algo/MovingObjects/particle_cell_2D.hpp
+210
-199
include/Algo/MovingObjects/particle_cell_2D_memo.h
include/Algo/MovingObjects/particle_cell_2D_memo.h
+27
-14
include/Algo/MovingObjects/particle_cell_2D_memo.hpp
include/Algo/MovingObjects/particle_cell_2D_memo.hpp
+260
-138
include/Algo/MovingObjects/particle_cell_2DandHalf.hpp
include/Algo/MovingObjects/particle_cell_2DandHalf.hpp
+44
-44
include/Algo/MovingObjects/particle_cell_2DandHalf_memo.h
include/Algo/MovingObjects/particle_cell_2DandHalf_memo.h
+61
-0
include/Algo/MovingObjects/particle_cell_2DandHalf_memo.hpp
include/Algo/MovingObjects/particle_cell_2DandHalf_memo.hpp
+307
-0
include/Algo/ProgressiveMesh/pmesh.h
include/Algo/ProgressiveMesh/pmesh.h
+1
-1
include/Algo/ProgressiveMesh/pmesh.hpp
include/Algo/ProgressiveMesh/pmesh.hpp
+1
-1
include/Geometry/orientation.hpp
include/Geometry/orientation.hpp
+1
-0
include/Geometry/tensor.h
include/Geometry/tensor.h
+257
-0
include/Geometry/tensor.hpp
include/Geometry/tensor.hpp
+199
-0
include/Geometry/vector_gen.h
include/Geometry/vector_gen.h
+45
-42
include/Geometry/vector_gen.hpp
include/Geometry/vector_gen.hpp
+90
-81
include/Topology/generic/dartmarker.h
include/Topology/generic/dartmarker.h
+137
-90
include/Topology/map/map2.h
include/Topology/map/map2.h
+2
-2
include/Utils/colourConverter.h
include/Utils/colourConverter.h
+11
-1
include/Utils/colourConverter.hpp
include/Utils/colourConverter.hpp
+234
-12
include/Utils/qem.h
include/Utils/qem.h
+572
-394
include/Utils/qem.hpp
include/Utils/qem.hpp
+1314
-0
src/Topology/map/map2.cpp
src/Topology/map/map2.cpp
+16
-15
No files found.
Apps/deprecated/tp_master.cpp
View file @
aae2b76b
...
...
@@ -371,7 +371,7 @@ void MyQT::cb_initGL()
m_render
=
new
Algo
::
Render
::
GL2
::
MapRender
();
m_render_topo
=
new
Algo
::
Render
::
GL2
::
TopoRender
()
;
m_ds
=
new
Utils
::
Drawer
();
m_ds
=
new
Utils
::
Drawer
()
;
// create VBO for position
m_positionVBO
=
new
Utils
::
VBO
();
...
...
Apps/deprecated/tutoriel.cpp
View file @
aae2b76b
...
...
@@ -48,13 +48,13 @@
using
namespace
CGoGN
;
// déclaration de la classe utilisée pour le TP
class
Map2TP
;
class
QuadMesh
;
// definition de la structure qui decrit le type de carte utilise
struct
PFP
:
public
PFP_STANDARD
{
// definition of the map
typedef
Map2TP
MAP
;
typedef
QuadMesh
MAP
;
};
// fonction qui renvoit vrai (pour sélectioner tous les brins)
...
...
@@ -85,277 +85,19 @@ AttributeHandler<PFP::VEC3> normal;
/// Assigner un plongement à un sommet (celui du brin d)
/// embedVertex(d,P);
class
Map2TP
:
public
Map2
class
QuadMesh
:
public
Embedded
Map2
{
private:
// 3 brins de la carte
Dart
d_carre
;
Dart
d_tri
;
Dart
d_multiFaces
;
// Assigne un nouveau plongement au sommet. Les anciens plongements sont libérés.
void
newVertex
(
Dart
d
)
{
embedNewCell
(
VERTEX
,
d
);
}
public:
// Fonction Carre: construit un carre et renvoit un brin
Dart
Carre
()
{
Point3D
P
[
4
];
P
[
0
]
=
Point3D
(
0.0
f
,
0.0
f
,
0.0
f
);
P
[
1
]
=
Point3D
(
1.0
f
,
0.0
f
,
0.0
f
);
P
[
2
]
=
Point3D
(
1.0
f
,
1.0
f
,
0.0
f
);
P
[
3
]
=
Point3D
(
0.0
f
,
1.0
f
,
0.0
f
);
Dart
d0
=
newOrientedFace
(
4
);
position
[
d0
]
=
P
[
0
];
Dart
d1
=
phi1
(
d0
);
position
[
d1
]
=
P
[
1
];
Dart
d2
=
phi1
(
d1
);
position
[
d2
]
=
P
[
2
];
Dart
d3
=
phi1
(
d2
);
position
[
d3
]
=
P
[
3
];
return
d0
;
void
createMesh
()
{
}
// Fonction Triangle: construit un triangle et renvoit un brin
Dart
Triangle
()
{
Point3D
P
[
3
];
P
[
0
]
=
Point3D
(
0.0
f
,
1.1
f
,
0.0
f
);
P
[
1
]
=
Point3D
(
1.0
f
,
1.1
f
,
0.0
f
);
P
[
2
]
=
Point3D
(
0.5
f
,
2.0
f
,
0.0
f
);
Dart
d0
=
newOrientedFace
(
3
);
position
[
d0
]
=
P
[
0
];
Dart
d1
=
phi1
(
d0
);
position
[
d1
]
=
P
[
1
];
Dart
d2
=
phi1
(
d1
);
position
[
d2
]
=
P
[
2
];
return
d0
;
}
// Construit un polygone de taille "size"
Dart
Polygone
(
Point3D
*
P
,
unsigned
size
)
{
Dart
d
=
newOrientedFace
(
size
);
for
(
unsigned
i
=
0
;
i
<
size
;
i
++
)
{
position
[
d
]
=
P
[
i
];
d
=
phi1
(
d
);
}
return
d
;
}
// appel clavier touche 'c'
void
Colle
(
Dart
d
,
Dart
e
)
{
Point3D
p
=
position
[
d
];
Point3D
q
=
position
[
phi1
(
d
)];
phi2sew
(
d
,
e
);
newVertex
(
d
);
position
[
d
]
=
p
;
newVertex
(
e
);
position
[
e
]
=
q
;
}
// appel clavier touche 'm'
void
ColleMilieu
(
Dart
d
,
Dart
e
)
{
Point3D
p1
=
position
[
d
];
Point3D
p2
=
position
[
phi1
(
d
)];
Point3D
q1
=
position
[
e
];
Point3D
q2
=
position
[
phi1
(
e
)];
Point3D
m1
=
(
p1
+
q2
)
/
2
;
Point3D
m2
=
(
q1
+
p2
)
/
2
;;
phi2sew
(
d
,
e
);
newVertex
(
d
);
position
[
d
]
=
m1
;
newVertex
(
e
);
position
[
e
]
=
m2
;
}
// Construit une figure
Dart
MultiFaces
()
{
Point3D
P
[
6
];
P
[
0
]
=
Point3D
(
2.0
f
,
0.0
f
,
0.0
f
);
P
[
1
]
=
Point3D
(
3.0
f
,
0.0
f
,
0.0
f
);
P
[
2
]
=
Point3D
(
3.5
f
,
1.0
f
,
0.0
f
);
P
[
3
]
=
Point3D
(
3.0
f
,
1.8
f
,
0.0
f
);
P
[
4
]
=
Point3D
(
2.0
f
,
1.8
f
,
0.0
f
);
P
[
5
]
=
Point3D
(
1.5
f
,
1.0
f
,
0.0
f
);
Dart
hexa
=
Polygone
(
P
,
6
);
Point3D
Q
[
3
];
Q
[
0
]
=
Point3D
(
2.0
f
,
2.0
f
,
0.0
f
);
Q
[
1
]
=
Point3D
(
3.0
f
,
2.0
f
,
0.0
f
);
Q
[
2
]
=
Point3D
(
2.5
f
,
3.0
f
,
0.0
f
);
Dart
triangle
=
Polygone
(
Q
,
3
);
Point3D
R
[
4
];
R
[
0
]
=
Point3D
(
4.0
f
,
0.0
f
,
0.0
f
);
R
[
1
]
=
Point3D
(
5.0
f
,
0.0
f
,
0.0
f
);
R
[
2
]
=
Point3D
(
5.0
f
,
1.0
f
,
0.0
f
);
R
[
3
]
=
Point3D
(
4.0
f
,
1.0
f
,
0.0
f
);
Dart
carre
=
Polygone
(
R
,
4
);
Point3D
S
[
3
];
S
[
0
]
=
Point3D
(
4.0
f
,
1.2
f
,
0.0
f
);
S
[
1
]
=
Point3D
(
5.0
f
,
1.2
f
,
0.0
f
);
S
[
2
]
=
Point3D
(
4.5
f
,
2.2
f
,
0.0
f
);
Dart
triangle2
=
Polygone
(
S
,
3
);
Dart
haut_carre
=
phi1
(
phi1
(
carre
));
Dart
hexa2
=
phi1
(
phi1
(
phi1
(
hexa
)));
// Test du phi1Sew
// myMap.phi1sew(hexa,hexa2);
// myMap.phi1sew(myMap.phi1(hexa),myMap.phi_1(carre));
// Génére un maillage à la fin
Colle
(
haut_carre
,
triangle2
);
Colle
(
hexa2
,
triangle
);
Colle
(
phi_1
(
triangle2
),
phi_1
(
hexa2
));
Colle
(
phi1
(
hexa
),
phi_1
(
carre
));
return
hexa
;
}
// Fonction de creation de la carte (appelee par le main)
void
createMap
()
{
d_carre
=
Carre
();
d_tri
=
Triangle
();
d_multiFaces
=
MultiFaces
();
Colle
(
phi1
(
phi1
(
d_carre
)),
d_tri
);
Colle
(
phi_1
(
d_multiFaces
),
phi1
(
d_carre
));
Colle
(
phi_1
(
phi_1
(
d_multiFaces
)),
phi1
(
d_tri
));
}
// Touche x
void
coupeFace
(
Dart
d
,
Dart
e
)
{
Point3D
p
=
position
[
phi1
(
d
)];
Point3D
q
=
position
[
phi1
(
e
)];
Dart
dd
=
newOrientedFace
(
2
);
Dart
ee
=
phi1
(
dd
);
phi1sew
(
d
,
dd
);
phi1sew
(
e
,
ee
);
phi2sew
(
dd
,
ee
);
newVertex
(
ee
);
position
[
ee
]
=
p
;
newVertex
(
dd
);
position
[
dd
]
=
q
;
}
// Touche y
void
coupeArete
(
Dart
d
)
{
Point3D
p
=
position
[
d
];
Point3D
q
=
position
[
phi1
(
d
)];
Point3D
milieu
=
(
p
+
q
+
Point3D
(
0.2
f
,
0.2
f
,
0.0
f
)
/* decalage pour voir le point */
)
/
2
;
Dart
dd
=
newDart
();
phi1sew
(
d
,
dd
);
Dart
e
=
phi2
(
d
);
if
(
e
!=
d
)
{
Dart
ee
=
newDart
();
phi1sew
(
e
,
ee
);
phi2unsew
(
d
);
phi2sew
(
d
,
ee
);
phi2sew
(
e
,
dd
);
}
newVertex
(
dd
);
position
[
dd
]
=
milieu
;
}
// Touche z
void
arrondi
(
Dart
d
)
{
Dart
e
=
phi_1
(
d
);
coupeArete
(
d
);
coupeArete
(
e
);
e
=
phi1
(
e
);
Point3D
P
=
position
[
d
];
Point3D
Q
=
position
[
e
];
Point3D
R
=
position
[
phi1
(
d
)];
Point3D
M
=
(
P
+
P
+
Q
+
R
)
/
4
;
position
[
d
]
=
M
;
}
unsigned
face_size
(
Dart
d
)
{
unsigned
n
=
0
;
Dart
e
=
d
;
do
{
n
++
;
e
=
phi1
(
e
);
}
while
(
e
!=
d
);
return
n
;
}
// Touche p
void
triangule
()
{
Dart
d
;
for
(
d
=
begin
();
d
!=
end
();)
{
if
(
face_size
(
d
)
>
3
)
{
coupeFace
(
d
,
phi1
(
phi1
(
d
)));
}
else
{
next
(
d
);
}
}
}
// Touche q
void
fusionSommet
(
Dart
d
)
{
Point3D
P
=
position
[
d
];
Point3D
Q
=
position
[
phi1
(
d
)];
Point3D
M
=
(
P
+
Q
)
/
2
;
// On attrape des pointeurs sur les brins à manipuler
Dart
dd
=
phi1
(
d
);
Dart
ddd
=
phi1
(
dd
);
Dart
e
=
phi2
(
d
);
Dart
ee
=
phi1
(
e
);
Dart
eee
=
phi1
(
ee
);
Dart
dd2
=
phi2
(
dd
);
Dart
ee2
=
phi2
(
ee
);
Dart
ddd2
=
phi2
(
ddd
);
Dart
eee2
=
phi2
(
eee
);
// On découd les triangles du centre
phi2unsew
(
d
);
phi2unsew
(
dd
);
phi2unsew
(
ee
);
phi2unsew
(
ddd
);
phi2unsew
(
eee
);
// On détruit les 2 triangles
deleteOrientedFace
(
d
);
deleteOrientedFace
(
e
);
// On recout les brins restants
phi2sew
(
dd2
,
ddd2
);
phi2sew
(
ee2
,
eee2
);
// On plonge le sommet central sur le nouveau point calculé
newVertex
(
ddd2
);
position
[
ddd2
]
=
M
;
}
// Longueur d'une arête
...
...
@@ -380,13 +122,12 @@ public:
lmin
=
longueur
(
d
);
}
}
fusionSommet
(
dmin
);
}
};
// definition de la carte comme variable globale
PFP
::
MAP
my
Map
;
PFP
::
MAP
my
QuadMesh
;
// pile des brins selectionnes (6 max)
std
::
vector
<
Dart
>
selected_darts
;
...
...
@@ -420,7 +161,7 @@ void MyQT::drawSelected()
{
const
PFP
::
VEC3
&
P
=
position
[
d
];
m_ds
->
vertex
(
P
);
d
=
my
Map
.
phi1
(
d
);
d
=
my
QuadMesh
.
phi1
(
d
);
}
while
(
d
!=
d_faces
[
i
]);
m_ds
->
end
();
...
...
@@ -439,7 +180,7 @@ void MyQT::drawSelected()
Dart
d
=
d_edges
[
i
];
const
PFP
::
VEC3
&
P
=
position
[
d
];
m_ds
->
vertex
(
P
);
d
=
my
Map
.
phi1
(
d
);
d
=
my
QuadMesh
.
phi1
(
d
);
const
PFP
::
VEC3
&
Q
=
position
[
d
];
m_ds
->
vertex
(
Q
);
}
...
...
@@ -527,17 +268,17 @@ void MyQT::cb_initGL()
void
MyQT
::
cb_redraw
()
{
// update des normales aux sommets
Algo
::
Geometry
::
computeNormalVertices
<
PFP
>
(
my
Map
,
position
,
normal
)
;
Algo
::
Geometry
::
computeNormalVertices
<
PFP
>
(
my
QuadMesh
,
position
,
normal
)
;
// update du VBO position (contexte GL necessaire)
m_positionVBO
->
updateData
(
position
);
m_normalVBO
->
updateData
(
normal
);
// update des primitives du renderer
m_render
->
initPrimitives
<
PFP
>
(
my
Map
,
allDarts
,
Algo
::
Render
::
GL2
::
TRIANGLES
);
m_render
->
initPrimitives
<
PFP
>
(
my
Map
,
allDarts
,
Algo
::
Render
::
GL2
::
LINES
);
m_render
->
initPrimitives
<
PFP
>
(
my
QuadMesh
,
CGoGN
::
allDarts
,
Algo
::
Render
::
GL2
::
TRIANGLES
);
m_render
->
initPrimitives
<
PFP
>
(
my
QuadMesh
,
CGoGN
::
allDarts
,
Algo
::
Render
::
GL2
::
LINES
);
m_render_topo
->
updateData
<
PFP
>
(
my
Map
,
position
,
0.9
f
,
0.9
f
);
m_render_topo
->
updateData
<
PFP
>
(
my
QuadMesh
,
position
,
0.9
f
,
0.9
f
);
drawSelected
();
if
(
renderTopo
)
...
...
@@ -593,7 +334,7 @@ void MyQT::cb_keyPress(int keycode)
// Sélectionne un brin
case
'd'
:
Algo
::
Selection
::
dartsRaySelection
<
PFP
>
(
my
Map
,
position
,
rayA
,
AB
,
darts
,
SelectorTrue
());
Algo
::
Selection
::
dartsRaySelection
<
PFP
>
(
my
QuadMesh
,
position
,
rayA
,
AB
,
darts
,
SelectorTrue
());
if
(
!
darts
.
empty
()
&&
selected_darts
.
size
()
<
6
)
{
...
...
@@ -603,13 +344,13 @@ void MyQT::cb_keyPress(int keycode)
// Affiche les informations sur un brin
case
'D'
:
Algo
::
Selection
::
dartsRaySelection
<
PFP
>
(
my
Map
,
position
,
rayA
,
AB
,
darts
,
SelectorTrue
());
Algo
::
Selection
::
dartsRaySelection
<
PFP
>
(
my
QuadMesh
,
position
,
rayA
,
AB
,
darts
,
SelectorTrue
());
if
(
!
darts
.
empty
())
{
std
::
stringstream
ss
;
Dart
d1
=
my
Map
.
phi1
(
darts
[
0
]);
Dart
d2
=
my
Map
.
phi2
(
darts
[
0
]);
Dart
d1
=
my
QuadMesh
.
phi1
(
darts
[
0
]);
Dart
d2
=
my
QuadMesh
.
phi2
(
darts
[
0
]);
ss
<<
"dart:"
<<
darts
[
0
].
index
<<
" /phi1:"
<<
d1
.
index
<<
" /phi2:"
<<
d2
.
index
;
const
Point3D
&
P
=
position
[
darts
[
0
]];
...
...
@@ -621,7 +362,7 @@ void MyQT::cb_keyPress(int keycode)
// Sélectionne des faces
case
'f'
:
d_faces
.
clear
();
Algo
::
Selection
::
facesRaySelection
<
PFP
>
(
myMap
,
position
,
SelectorTrue
(),
rayA
,
AB
,
d_faces
);
Algo
::
Selection
::
facesRaySelection
<
PFP
>
(
myQuadMesh
,
position
,
SelectorTrue
(),
rayA
,
AB
,
d_faces
);
if
(
!
d_faces
.
empty
())
{
...
...
@@ -634,15 +375,15 @@ void MyQT::cb_keyPress(int keycode)
// Sélectionne des arêtes
case
'a'
:
d_edges
.
clear
();
Algo
::
Selection
::
edgesRaySelection
<
PFP
>
(
my
Map
,
position
,
SelectorTrue
(),
rayA
,
AB
,
d_edges
,
dist
);
Algo
::
Selection
::
edgesRaySelection
<
PFP
>
(
my
QuadMesh
,
position
,
SelectorTrue
(),
rayA
,
AB
,
d_edges
,
dist
);
if
(
!
d_edges
.
empty
())
{
std
::
stringstream
ss
;
Dart
dd
=
my
Map
.
phi2
(
d_edges
[
0
]);
ss
<<
"Arete: dart: "
<<
d_edges
[
0
].
index
<<
" phi1: "
<<
my
Map
.
phi1
(
d_edges
[
0
]).
index
;
Dart
dd
=
my
QuadMesh
.
phi2
(
d_edges
[
0
]);
ss
<<
"Arete: dart: "
<<
d_edges
[
0
].
index
<<
" phi1: "
<<
my
QuadMesh
.
phi1
(
d_edges
[
0
]).
index
;
if
(
dd
!=
d_edges
[
0
])
ss
<<
" phi2: "
<<
dd
.
index
<<
" phi1: "
<<
my
Map
.
phi1
(
dd
).
index
;
ss
<<
" phi2: "
<<
dd
.
index
<<
" phi1: "
<<
my
QuadMesh
.
phi1
(
dd
).
index
;
statusMsg
(
ss
.
str
().
c_str
());
}
break
;
...
...
@@ -650,12 +391,12 @@ void MyQT::cb_keyPress(int keycode)
// Sélectionne des sommets
case
's'
:
d_vertices
.
clear
();
Algo
::
Selection
::
verticesRaySelection
<
PFP
>
(
my
Map
,
position
,
rayA
,
AB
,
d_vertices
,
dist
,
SelectorTrue
());
Algo
::
Selection
::
verticesRaySelection
<
PFP
>
(
my
QuadMesh
,
position
,
rayA
,
AB
,
d_vertices
,
dist
,
SelectorTrue
());
if
(
!
d_vertices
.
empty
())
{
std
::
stringstream
ss
;
ss
<<
"Sommet: dart: "
<<
d_vertices
[
0
].
index
<<
": "
<<
position
[
d_vertices
[
0
]]
<<
"( id emb:"
<<
my
Map
.
getEmbedding
(
VERTEX
,
d_vertices
[
0
])
<<
")"
<<
std
::
endl
;
;
ss
<<
"Sommet: dart: "
<<
d_vertices
[
0
].
index
<<
": "
<<
position
[
d_vertices
[
0
]]
<<
"( id emb:"
<<
my
QuadMesh
.
getEmbedding
(
VERTEX
,
d_vertices
[
0
])
<<
")"
<<
std
::
endl
;
;
statusMsg
(
ss
.
str
().
c_str
());
}
break
;
...
...
@@ -669,15 +410,6 @@ void MyQT::cb_keyPress(int keycode)
switch
(
keycode
)
{
// Colle 2 arêtes
case
'c'
:
myMap
.
Colle
(
selected_darts
[
0
],
selected_darts
[
1
]);
break
;
// Colle 2 arêtes en leur milieu
case
'm'
:
myMap
.
ColleMilieu
(
selected_darts
[
0
],
selected_darts
[
1
]);
break
;
// Coupe une face en 2 avec une nouvelle arête
case
'x'
:
myMap
.
coupeFace
(
selected_darts
[
0
],
selected_darts
[
1
]);
break
;
}
selected_darts
.
clear
();
...
...
@@ -693,15 +425,7 @@ void MyQT::cb_keyPress(int keycode)
switch
(
keycode
)
{
// Coupe une arête en 2 avec un nouveau sommet
case
'y'
:
myMap
.
coupeArete
(
selected_darts
[
0
]);
break
;
// Arrondi
case
'z'
:
myMap
.
arrondi
(
selected_darts
[
0
]);
break
;
// Fusion de sommet
case
'q'
:
myMap
.
fusionSommet
(
selected_darts
[
0
]);
myQuadMesh
.
coupeArete
(
selected_darts
[
0
]);
break
;
}
selected_darts
.
clear
();
...
...
@@ -709,14 +433,9 @@ void MyQT::cb_keyPress(int keycode)
break
;
// Opérations globales
// Triangulation
case
'p'
:
myMap
.
triangule
();
selected_darts
.
clear
();
break
;
// Simplification
case
'k'
:
my
Map
.
simplifie
();
my
QuadMesh
.
simplifie
();
selected_darts
.
clear
();
break
;
}
...
...
@@ -732,25 +451,25 @@ int main(int argc, char **argv)
if
(
argc
==
2
)
{
std
::
vector
<
std
::
string
>
attrNames
;
Algo
::
Import
::
importMesh
<
PFP
>
(
my
Map
,
argv
[
1
],
attrNames
)
;
position
=
my
Map
.
getAttribute
<
Point3D
>
(
VERTEX
,
attrNames
[
0
])
;
normal
=
my
Map
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"normal"
);
Algo
::
Geometry
::
computeNormalVertices
<
PFP
>
(
my
Map
,
position
,
normal
)
;
Algo
::
Import
::
importMesh
<
PFP
>
(
my
QuadMesh
,
argv
[
1
],
attrNames
)
;
position
=
my
QuadMesh
.
getAttribute
<
Point3D
>
(
VERTEX
,
attrNames
[
0
])
;
normal
=
my
QuadMesh
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"normal"
);
Algo
::
Geometry
::
computeNormalVertices
<
PFP
>
(
my
QuadMesh
,
position
,
normal
)
;
}
else
{
position
=
my
Map
.
addAttribute
<
Point3D
>
(
VERTEX
,
"position"
);
normal
=
my
Map
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"normal"
);
my
Map
.
createMap
();
Algo
::
Geometry
::
computeNormalVertices
<
PFP
>
(
my
Map
,
position
,
normal
)
;
position
=
my
QuadMesh
.
addAttribute
<
Point3D
>
(
VERTEX
,
"position"
);
normal
=
my
QuadMesh
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"normal"
);
my
QuadMesh
.
createMesh
();
Algo
::
Geometry
::
computeNormalVertices
<
PFP
>
(
my
QuadMesh
,
position
,
normal
)
;
}
if
(
my
Map
.
getNbDarts
()
==
0
)
{
if
(
my
QuadMesh
.
getNbDarts
()
==
0
)
{
CGoGNout
<<
"Aucun brin dans la carte. Sortie ..."
<<
CGoGNendl
;
exit
(
0
);
}
// Parametre de la fenetre en fonction de la taille du maillage à afficher
Geom
::
BoundingBox
<
Point3D
>
bb
=
Algo
::
Geometry
::
computeBoundingBox
<
PFP
>
(
my
Map
,
position
);
Geom
::
BoundingBox
<
Point3D
>
bb
=
Algo
::
Geometry
::
computeBoundingBox
<
PFP
>
(
my
QuadMesh
,
position
);
float
lWidthObj
=
std
::
max
(
std
::
max
(
bb
.
size
(
0
),
bb
.
size
(
1
)),
bb
.
size
(
2
));
Point3D
lPosObj
=
(
bb
.
min
()
+
bb
.
max
())
/
2
;
sqt
.
setParamObject
(
lWidthObj
,
lPosObj
.
data
());
...
...
Apps/deprecated/tutoriel.h
View file @
aae2b76b
...
...
@@ -27,7 +27,7 @@
#include <iostream>
#include "Utils/qtSimple.h"
#include "Utils/
Qt/
qtSimple.h"
// forward definitions (minimize includes)
namespace
CGoGN
{
namespace
Algo
{
namespace
Render
{
namespace
GL2
{
class
MapRender
;
}
}
}
}
...
...
README_ECLIPSE.TXT
View file @
aae2b76b
...
...
@@ -59,6 +59,10 @@ Dans Preferences -> Shaders Preferences, on peut désormais configurer certaines
- Installer et redémarrer
- Dans Preferences -> General -> Editors -> File Associations il est possible d'associer les CMakeLists.txt à ce logiciel d'édition
* Problème indexeur
Si l'indexeur plante avec comme message "Out of memory" (c'est la cas par défaut sur Juno lors de l'indexation totale de CGoGN),
relancer eclipse avec l'option "/opt/eclipse/eclipse -vmargs -Xms512m -Xmx1024M" avant de refaire une indexation globale.
=========================================================================================
ENGLISH VERSION
=========================================================================================
...
...
@@ -122,3 +126,7 @@ In Preferences -> Shaders Preferences, you can now configure some options relate
- Install and restart
- In Preferences -> General -> Editors -> File Associations You can associate the CMakeLists.txt to editing software
* Indexer problem
If the indexer fails with an "Out of Memory" error (this is the case when indexing CGoGN fully on eclipse Juno for instance),
then relaunch eclipse using some options to use a bigger heap "/opt/eclipse/eclipse -vmargs -Xms512m -Xmx1024M" before indexing
CGoGN globally.
doc/Doxyfile
View file @
aae2b76b
This diff is collapsed.
Click to expand it.
include/Algo/BooleanOperator/mergeVertices.hpp
View file @
aae2b76b
...
...
@@ -51,6 +51,7 @@ void mergeVertex(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC
ee
=
map
.
phi2_1
(
ee
);
}
while
(
ee
!=
e
);
map
.
insertEdgeInVertex
(
ee
,
dd
);
}
while
(
dd
!=
d
);
}
...
...
include/Algo/Decimation/approximator.h
View file @
aae2b76b
...
...
@@ -48,8 +48,8 @@ enum ApproximatorType
A_Lightfield
,
// note: the following "h" prefix means that half-edges are prioritized instead of edges.
A_hHalfCollapse
,
A_hQEM
// A_hLightfieldHalf,
A_hQEM
,
A_hLightfieldHalf
}
;
template
<
typename
PFP
>
...
...
@@ -81,7 +81,8 @@ public:
virtual
void
addDetail
(
Dart
d
,
double
amount
,
bool
sign
,
typename
PFP
::
MATRIX33
*
detailTransform
)
=
0
;
}
;
template
<
typename
PFP
,
typename
T
>
template
<
typename
PFP
,
typename
T
,
unsigned
int
ORBIT
>
class
Approximator
:
public
ApproximatorGen
<
PFP
>
{
public:
...
...
@@ -93,8 +94,8 @@ protected:
Predictor
<
PFP
,
T
>*
m_predictor
;
std
::
vector
<
VertexAttribute
<
T
>*
>
m_attrV
;
// vertex attributes to be approximated
std
::
vector
<
EdgeAttribute
<
T
>
>
m_approx
;
// attributes to store approximation result
std
::
vector
<
EdgeAttribute
<
T
>
>
m_detail
;
// attributes to store detail information for reconstruction
std
::
vector
<
AttributeHandler
<
T
,
ORBI
T
>
>
m_approx
;
// attributes to store approximation result
std
::
vector
<
AttributeHandler
<
T
,
ORBI
T
>
>
m_detail
;
// attributes to store detail information for reconstruction
std
::
vector
<
T
>
m_app
;
public:
...
...
@@ -115,13 +116,13 @@ public:
std
::
stringstream
aname
;
aname
<<
"approx_"
<<
m_attrV
[
i
]
->
name
()
;
m_approx
[
i
]
=
this
->
m_map
.
template
addAttribute
<
T
,
EDGE
>(
aname
.
str
())
;
m_approx
[
i
]
=
this
->
m_map
.
template
addAttribute
<
T
,
ORBIT
>(
aname
.
str
())
;
if
(
m_predictor
)
// if predictors are associated to the approximator
{
// create attributes to store the details needed for reconstruction
std
::
stringstream
dname
;
dname
<<
"detail_"
<<
m_attrV
[
i
]
->
name
()
;
m_detail
[
i
]
=
this
->
m_map
.
template
addAttribute
<
T
,
EDGE
>(
dname
.
str
())
;
m_detail
[
i
]
=
this
->
m_map
.
template
addAttribute
<
T
,
ORBIT
>(
dname
.
str
())
;