Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Thomas Pitiot
CGoGN
Commits
3a8ecd23
Commit
3a8ecd23
authored
Dec 23, 2012
by
Thery Sylvain
Browse files
finish (??) Volume/Surface namspace for Algo
parent
4fa2f232
Changes
52
Hide whitespace changes
Inline
Side-by-side
Apps/Examples/clipping.cpp
View file @
3a8ecd23
...
...
@@ -792,7 +792,7 @@ void Clipping::importMesh(std::string& filename)
if
(
extension
==
std
::
string
(
".tet"
))
{
if
(
!
Algo
::
Import
::
importTet
<
PFP
>
(
myMap
,
filename
.
c_str
(),
attrNames
))
if
(
!
Algo
::
Volume
::
Import
::
importTet
<
PFP
>
(
myMap
,
filename
.
c_str
(),
attrNames
))
{
CGoGNerr
<<
"could not import "
<<
filename
<<
CGoGNendl
;
return
;
...
...
@@ -802,7 +802,7 @@ void Clipping::importMesh(std::string& filename)
}
else
if
(
extension
==
std
::
string
(
".ts"
))
{
if
(
!
Algo
::
Import
::
importTs
<
PFP
>
(
myMap
,
filename
.
c_str
(),
attrNames
))
if
(
!
Algo
::
Volume
::
Import
::
importTs
<
PFP
>
(
myMap
,
filename
.
c_str
(),
attrNames
))
{
CGoGNerr
<<
"could not import "
<<
filename
<<
CGoGNendl
;
return
;
...
...
@@ -1124,7 +1124,7 @@ int main(int argc, char** argv)
else
{
sqt
.
position
=
sqt
.
myMap
.
addAttribute
<
PFP
::
VEC3
,
VERTEX
>
(
"position"
);
Algo
::
Modelisation
::
Primitive3D
<
PFP
>
prim
(
sqt
.
myMap
,
sqt
.
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
);
}
...
...
Apps/Examples/concave_rendering.cpp
View file @
3a8ecd23
...
...
@@ -213,7 +213,7 @@ void MyQT::cb_keyPress(int code)
case
't'
:
{
Algo
::
Modelisation
::
EarTriangulation
<
PFP
>
triangulation
(
myMap
);
Algo
::
Surface
::
Modelisation
::
EarTriangulation
<
PFP
>
triangulation
(
myMap
);
triangulation
.
triangule
();
m_render
->
initPrimitives
<
PFP
>
(
myMap
,
allDarts
,
Algo
::
Render
::
GL2
::
TRIANGLES
);
...
...
Apps/Examples/extrusionView.cpp
View file @
3a8ecd23
...
...
@@ -133,7 +133,7 @@ int main(int argc, char **argv)
}
// extrusion
Algo
::
Modelisation
::
extrusion_scale
<
PFP
>
(
myMap
,
position
,
objV
,
PFP
::
VEC3
(
0.0
,
0.0
,
0.0
),
PFP
::
VEC3
(
0.0
,
1.0
,
0.0
),
true
,
pathV
,
false
,
pathRadius
);
Algo
::
Surface
::
Modelisation
::
extrusion_scale
<
PFP
>
(
myMap
,
position
,
objV
,
PFP
::
VEC3
(
0.0
,
0.0
,
0.0
),
PFP
::
VEC3
(
0.0
,
1.0
,
0.0
),
true
,
pathV
,
false
,
pathRadius
);
// bounding box
Geom
::
BoundingBox
<
PFP
::
VEC3
>
bb
=
Algo
::
Geometry
::
computeBoundingBox
<
PFP
>
(
myMap
,
position
);
...
...
Apps/Examples/mcmesh.cpp
View file @
3a8ecd23
...
...
@@ -133,9 +133,9 @@ void MCMesh::MC()
{
myMap
.
clear
(
false
);
// elargir l'image pour le calcul de la courbure
Algo
::
MC
::
Image
<
DATATYPE
>*
myImgFr
=
myImg
->
addFrame
(
1
);
S
Algo
::
MC
::
Image
<
DATATYPE
>*
myImgFr
=
myImg
->
addFrame
(
1
);
Algo
::
MC
::
WindowingGreater
<
DATATYPE
>
myWindFunc
;
S
Algo
::
MC
::
WindowingGreater
<
DATATYPE
>
myWindFunc
;
myWindFunc
.
setIsoValue
(
DATATYPE
(
127
));
position
=
myMap
.
getAttribute
<
VEC3
,
VERTEX
>
(
"position"
);
...
...
@@ -143,7 +143,7 @@ void MCMesh::MC()
position
=
myMap
.
addAttribute
<
VEC3
,
VERTEX
>
(
"position"
);
// instanciation du mc
Algo
::
MC
::
MarchingCube
<
DATATYPE
,
Algo
::
MC
::
WindowingGreater
,
PFP
>
mc
(
myImgFr
,
&
myMap
,
position
,
myWindFunc
,
false
);
S
Algo
::
MC
::
MarchingCube
<
DATATYPE
,
S
Algo
::
MC
::
WindowingGreater
,
PFP
>
mc
(
myImgFr
,
&
myMap
,
position
,
myWindFunc
,
false
);
mc
.
simpleMeshing
();
delete
myImgFr
;
...
...
@@ -168,7 +168,7 @@ void MCMesh::updateRender()
void
MCMesh
::
fromFile
(
char
*
fname
)
{
myImg
=
new
Algo
::
MC
::
Image
<
DATATYPE
>
();
myImg
=
new
S
Algo
::
MC
::
Image
<
DATATYPE
>
();
myImg
->
loadInrgz
(
fname
);
CGoGNout
<<
"Image chargee"
<<
CGoGNendl
;
CGoGNout
<<
myImg
->
getWidthX
()
<<
"x"
<<
myImg
->
getWidthY
()
<<
"x"
<<
myImg
->
getWidthZ
()
<<
"voxels"
<<
CGoGNendl
;
...
...
@@ -193,7 +193,7 @@ void MCMesh::sphere()
}
}
myImg
=
new
Algo
::
MC
::
Image
<
DATATYPE
>
(
img
,
128
,
128
,
128
,
1.0
f
,
1.0
f
,
1.0
f
,
false
);
myImg
=
new
S
Algo
::
MC
::
Image
<
DATATYPE
>
(
img
,
128
,
128
,
128
,
1.0
f
,
1.0
f
,
1.0
f
,
false
);
}
...
...
Apps/Examples/mcmesh.h
View file @
3a8ecd23
...
...
@@ -46,6 +46,8 @@
using
namespace
CGoGN
;
namespace
SAlgo
=
::
CGoGN
::
Algo
::
Surface
;
struct
PFP
:
public
PFP_STANDARD
{
// definition of the map
...
...
@@ -83,7 +85,7 @@ public:
Utils
::
ShaderSimpleColor
*
m_simpleColorShader
;
DATATYPE
valLabel
;
Algo
::
MC
::
Image
<
DATATYPE
>*
myImg
;
S
Algo
::
MC
::
Image
<
DATATYPE
>*
myImg
;
MCMesh
()
;
...
...
Apps/Examples/simpleGMap2.cpp
View file @
3a8ecd23
...
...
@@ -31,7 +31,7 @@ SimpleGMap2::SimpleGMap2()
{
position
=
myMap
.
addAttribute
<
VEC3
,
VERTEX
>
(
"position"
);
Dart
d
=
Algo
::
Modelisation
::
createTetrahedron
<
PFP
>
(
myMap
);
Dart
d
=
Algo
::
Surface
::
Modelisation
::
createTetrahedron
<
PFP
>
(
myMap
);
position
[
d
]
=
VEC3
(
0
,
0
,
0
);
position
[
myMap
.
phi1
(
d
)]
=
VEC3
(
10
,
0
,
15
);
position
[
myMap
.
phi_1
(
d
)]
=
VEC3
(
10
,
20
,
15
);
...
...
@@ -41,7 +41,7 @@ SimpleGMap2::SimpleGMap2()
myMap
.
cutEdge
(
d
);
position
[
myMap
.
phi1
(
d
)]
=
mid
;
Algo
::
Modelisation
::
Polyhedron
<
PFP
>
poly
(
myMap
,
position
);
Algo
::
Surface
::
Modelisation
::
Polyhedron
<
PFP
>
poly
(
myMap
,
position
);
d
=
poly
.
cylinder_topo
(
5
,
1
,
false
,
false
);
...
...
Apps/Examples/simpleGMap3.cpp
View file @
3a8ecd23
...
...
@@ -36,7 +36,7 @@ SimpleGMap3::SimpleGMap3()
CellMarker
<
EDGE
>
mE
(
myMap
);
Algo
::
Modelisation
::
Primitive3D
<
PFP
>
primCat
(
myMap
,
position
);
Algo
::
Volume
::
Modelisation
::
Primitive3D
<
PFP
>
primCat
(
myMap
,
position
);
Dart
d
=
primCat
.
hexaGrid_topo
(
3
,
1
,
1
);
primCat
.
embedHexaGrid
(
2
,
1
,
1
);
myMap
.
check
();
...
...
@@ -56,14 +56,14 @@ SimpleGMap3::SimpleGMap3()
// Geom::Plane3D<PFP::REAL> pl(VEC3(0.5,0.14,0.5),VEC3(1.5,0.45,0.5),VEC3(0.5,0.15,1.5));
Geom
::
Plane3D
<
PFP
::
REAL
>
pl
(
VEC3
(
-
1
,
-
0.5
,
-
0.5
),
VEC3
(
-
1
,
-
0.5
,
0.5
),
VEC3
(
1
,
0.5
,
0.5
));
Algo
::
Modelisation
::
sliceConvexVolume
<
PFP
>
(
myMap
,
position
,
d
,
pl
);
Algo
::
Volume
::
Modelisation
::
sliceConvexVolume
<
PFP
>
(
myMap
,
position
,
d
,
pl
);
myMap
.
check
();
for
(
unsigned
int
i
=
position
.
begin
()
;
i
!=
position
.
end
()
;
position
.
next
(
i
))
position
[
i
]
+=
VEC3
(
2
,
0
,
0
);
Algo
::
Modelisation
::
Primitive3D
<
PFP
>
prim
(
myMap
,
position
);
Algo
::
Volume
::
Modelisation
::
Primitive3D
<
PFP
>
prim
(
myMap
,
position
);
d
=
prim
.
hexaGrid_topo
(
2
,
2
,
1
);
prim
.
embedHexaGrid
(
1
,
1
,
1
);
...
...
@@ -88,7 +88,7 @@ SimpleGMap3::SimpleGMap3()
for
(
unsigned
int
i
=
position
.
begin
()
;
i
!=
position
.
end
()
;
position
.
next
(
i
))
position
[
i
]
+=
VEC3
(
0
,
2
,
0
);
Algo
::
Modelisation
::
Primitive3D
<
PFP
>
prim2
(
myMap
,
position
);
Algo
::
Volume
::
Modelisation
::
Primitive3D
<
PFP
>
prim2
(
myMap
,
position
);
d
=
prim2
.
hexaGrid_topo
(
2
,
1
,
1
);
prim2
.
embedHexaGrid
(
1
,
1
,
1
);
...
...
Apps/Examples/simpleMap3.cpp
View file @
3a8ecd23
...
...
@@ -32,7 +32,7 @@ SimpleMap3::SimpleMap3()
{
position
=
myMap
.
addAttribute
<
VEC3
,
VERTEX
>
(
"position"
);
Algo
::
Modelisation
::
Primitive3D
<
PFP
>
primCat
(
myMap
,
position
);
Algo
::
Volume
::
Modelisation
::
Primitive3D
<
PFP
>
primCat
(
myMap
,
position
);
Dart
d
=
primCat
.
hexaGrid_topo
(
2
,
1
,
1
);
primCat
.
embedHexaGrid
(
1
,
1
,
1
);
...
...
Apps/Examples/texturesExample.cpp
View file @
3a8ecd23
...
...
@@ -232,7 +232,7 @@ int main(int argc, char**argv)
#define NB 96
Algo
::
Modelisation
::
Polyhedron
<
PFP
>
prim
(
m
,
position
);
Algo
::
Surface
::
Modelisation
::
Polyhedron
<
PFP
>
prim
(
m
,
position
);
prim
.
tore_topo
(
NB
,
NB
);
prim
.
embedTore
(
40.0
f
,
20.0
f
);
...
...
Apps/Examples/viewer.cpp
View file @
3a8ecd23
...
...
@@ -219,7 +219,7 @@ void Viewer::importMesh(std::string& filename)
else
{
std
::
vector
<
std
::
string
>
attrNames
;
if
(
!
Algo
::
Import
::
importMesh
<
PFP
>
(
myMap
,
filename
.
c_str
(),
attrNames
))
if
(
!
Algo
::
Surface
::
Import
::
importMesh
<
PFP
>
(
myMap
,
filename
.
c_str
(),
attrNames
))
{
CGoGNerr
<<
"could not import "
<<
filename
<<
CGoGNendl
;
return
;
...
...
@@ -243,7 +243,7 @@ void Viewer::importMesh(std::string& filename)
if
(
!
normal
.
isValid
())
normal
=
myMap
.
addAttribute
<
VEC3
,
VERTEX
>
(
"normal"
)
;
Algo
::
Geometry
::
computeNormalVertices
<
PFP
>
(
myMap
,
position
,
normal
)
;
Algo
::
Surface
::
Geometry
::
computeNormalVertices
<
PFP
>
(
myMap
,
position
,
normal
)
;
m_positionVBO
->
updateData
(
position
)
;
m_normalVBO
->
updateData
(
normal
)
;
...
...
@@ -258,7 +258,7 @@ void Viewer::exportMesh(std::string& filename, bool askExportMode)
std
::
string
extension
=
filename
.
substr
(
pos
)
;
if
(
extension
==
std
::
string
(
".off"
))
Algo
::
Export
::
exportOFF
<
PFP
>
(
myMap
,
position
,
filename
.
c_str
(),
allDarts
)
;
Algo
::
Surface
::
Export
::
exportOFF
<
PFP
>
(
myMap
,
position
,
filename
.
c_str
(),
allDarts
)
;
else
if
(
extension
.
compare
(
0
,
4
,
std
::
string
(
".ply"
))
==
0
)
{
int
ascii
=
0
;
...
...
@@ -267,7 +267,7 @@ void Viewer::exportMesh(std::string& filename, bool askExportMode)
std
::
vector
<
VertexAttribute
<
VEC3
>*>
attributes
;
attributes
.
push_back
(
&
position
)
;
Algo
::
Export
::
exportPLYnew
<
PFP
>
(
myMap
,
attributes
,
filename
.
c_str
(),
!
ascii
,
allDarts
)
;
Algo
::
Surface
::
Export
::
exportPLYnew
<
PFP
>
(
myMap
,
attributes
,
filename
.
c_str
(),
!
ascii
,
allDarts
)
;
}
else
if
(
extension
==
std
::
string
(
".map"
))
myMap
.
saveMapBin
(
filename
)
;
...
...
Apps/Examples/volumeExplorer.cpp
View file @
3a8ecd23
...
...
@@ -146,7 +146,7 @@ void MyQT::cb_Open()
if
(
extension
==
std
::
string
(
".tet"
))
{
if
(
!
Algo
::
Import
::
importTet
<
PFP
>
(
myMap
,
filename
,
attrNames
))
if
(
!
Algo
::
Volume
::
Import
::
importTet
<
PFP
>
(
myMap
,
filename
,
attrNames
))
{
CGoGNerr
<<
"could not import "
<<
filename
<<
CGoGNendl
;
return
;
...
...
@@ -157,7 +157,7 @@ void MyQT::cb_Open()
if
(
extension
==
std
::
string
(
".node"
))
{
if
(
!
Algo
::
Import
::
importMeshV
<
PFP
>
(
myMap
,
filename
,
attrNames
,
Algo
::
Import
::
Import
Volumique
::
NODE
))
if
(
!
Algo
::
Volume
::
Import
::
importMeshV
<
PFP
>
(
myMap
,
filename
,
attrNames
,
Algo
::
Volume
::
Import
::
NODE
))
{
std
::
cerr
<<
"could not import "
<<
filename
<<
std
::
endl
;
return
;
...
...
@@ -169,7 +169,7 @@ void MyQT::cb_Open()
if
(
extension
==
std
::
string
(
".off"
))
{
if
(
!
Algo
::
Import
::
importMeshToExtrude
<
PFP
>
(
myMap
,
filename
,
attrNames
))
if
(
!
Algo
::
Volume
::
Import
::
importMeshToExtrude
<
PFP
>
(
myMap
,
filename
,
attrNames
))
{
std
::
cerr
<<
"could not import "
<<
filename
<<
std
::
endl
;
return
;
...
...
@@ -388,7 +388,7 @@ int main(int argc, char **argv)
if
(
extension
==
std
::
string
(
".tet"
))
{
if
(
!
Algo
::
Import
::
importTet
<
PFP
>
(
myMap
,
argv
[
1
],
attrNames
))
if
(
!
Algo
::
Volume
::
Import
::
importTet
<
PFP
>
(
myMap
,
argv
[
1
],
attrNames
))
{
CGoGNerr
<<
"could not import "
<<
argv
[
1
]
<<
CGoGNendl
;
return
1
;
...
...
@@ -399,7 +399,7 @@ int main(int argc, char **argv)
if
(
extension
==
std
::
string
(
".node"
))
{
if
(
!
Algo
::
Import
::
importMeshV
<
PFP
>
(
myMap
,
argv
[
1
],
attrNames
,
Algo
::
Import
::
Import
Volumique
::
NODE
))
if
(
!
Algo
::
Volume
::
Import
::
importMeshV
<
PFP
>
(
myMap
,
argv
[
1
],
attrNames
,
Algo
::
Volume
::
Import
::
NODE
))
{
std
::
cerr
<<
"could not import "
<<
argv
[
1
]
<<
std
::
endl
;
return
1
;
...
...
@@ -411,7 +411,7 @@ int main(int argc, char **argv)
if
(
extension
==
std
::
string
(
".off"
))
{
if
(
!
Algo
::
Import
::
importMeshToExtrude
<
PFP
>
(
myMap
,
argv
[
1
],
attrNames
))
if
(
!
Algo
::
Volume
::
Import
::
importMeshToExtrude
<
PFP
>
(
myMap
,
argv
[
1
],
attrNames
))
{
std
::
cerr
<<
"could not import "
<<
std
::
endl
;
return
1
;
...
...
@@ -443,7 +443,7 @@ int main(int argc, char **argv)
else
{
position
=
myMap
.
addAttribute
<
PFP
::
VEC3
,
VERTEX
>
(
"position"
);
Algo
::
Modelisation
::
Primitive3D
<
PFP
>
prim
(
myMap
,
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
);
...
...
Apps/Tuto/show_traversors.cpp
View file @
3a8ecd23
...
...
@@ -603,7 +603,7 @@ int main(int argc, char **argv)
{
position
=
myMap
.
addAttribute
<
VEC3
,
VERTEX
>
(
"position"
);
Algo
::
Modelisation
::
Primitive3D
<
PFP
>
prim
(
myMap
,
position
);
Algo
::
Volume
::
Modelisation
::
Primitive3D
<
PFP
>
prim
(
myMap
,
position
);
dglobal
=
prim
.
hexaGrid_topo
(
4
,
4
,
4
);
prim
.
embedHexaGrid
(
1.0
f
,
1.0
f
,
1.0
f
);
...
...
Apps/Tuto/tuto3.cpp
View file @
3a8ecd23
...
...
@@ -154,7 +154,7 @@ void MyQT::createMap()
position
=
myMap
.
addAttribute
<
PFP
::
VEC3
,
VERTEX
>
(
"position"
);
Algo
::
Modelisation
::
Polyhedron
<
PFP
>
prim1
(
myMap
,
position
);
Algo
::
Surface
::
Modelisation
::
Polyhedron
<
PFP
>
prim1
(
myMap
,
position
);
prim1
.
cylinder_topo
(
256
,
256
,
true
,
true
);
// topo of sphere is a closed cylinder
prim1
.
embedSphere
(
2.0
f
);
...
...
@@ -167,7 +167,7 @@ void MyQT::createMap()
// d2 = PHI<211>(d2);
// position[d2] = PFP::VEC3(0, 1, 2);
Algo
::
Modelisation
::
Polyhedron
<
PFP
>
prim2
(
myMap
,
position
);
Algo
::
Surface
::
Modelisation
::
Polyhedron
<
PFP
>
prim2
(
myMap
,
position
);
prim2
.
cylinder_topo
(
256
,
256
,
true
,
true
);
// topo of sphere is a closed cylinder
prim2
.
embedSphere
(
2.0
f
);
...
...
Apps/Tuto/tuto4.cpp
View file @
3a8ecd23
...
...
@@ -119,7 +119,7 @@ void MyQT::traverseMap()
void
MyQT
::
createMap
()
{
Dart
d1
=
Algo
::
Modelisation
::
createHexahedron
<
PFP
>
(
myMap
);
Dart
d1
=
Algo
::
Surface
::
Modelisation
::
createHexahedron
<
PFP
>
(
myMap
);
Dart
d2
=
d1
;
...
...
Apps/Tuto/tuto5.cpp
View file @
3a8ecd23
...
...
@@ -259,7 +259,7 @@ void MyQT::cb_keyPress(int code)
if
(
code
==
'c'
)
{
//SelectorDartNoBoundary<PFP::MAP> nb(myMap);
Algo
::
Modelisation
::
catmullClarkVol
<
PFP
>
(
myMap
,
position
);
Algo
::
Volume
::
Modelisation
::
catmullClarkVol
<
PFP
>
(
myMap
,
position
);
m_positionVBO
->
updateData
(
position
);
m_render
->
initPrimitives
<
PFP
>
(
myMap
,
allDarts
,
Algo
::
Render
::
GL2
::
TRIANGLES
);
...
...
@@ -277,7 +277,7 @@ int main(int argc, char **argv)
CGoGNout
<<
5.34
<<
" toto "
<<
Geom
::
Vec3f
(
2.5
f
,
2.2
f
,
4.3
f
)
<<
CGoGNendl
;
CGoGNout
<<
3
<<
" tutu "
<<
4
<<
CGoGNendl
;
Algo
::
Modelisation
::
Primitive3D
<
PFP
>
prim
(
myMap
,
position
);
Algo
::
Volume
::
Modelisation
::
Primitive3D
<
PFP
>
prim
(
myMap
,
position
);
int
nb
=
3
;
if
(
argc
>
1
)
nb
=
atoi
(
argv
[
1
]);
...
...
Apps/Tuto/tuto_histo.cpp
View file @
3a8ecd23
...
...
@@ -68,7 +68,7 @@ void MyQT::createMap(const std::string& filename)
std
::
string
extension
=
filename
.
substr
(
pos
);
std
::
vector
<
std
::
string
>
attrNames
;
if
(
!
Algo
::
Import
::
importMesh
<
PFP
>
(
myMap
,
filename
.
c_str
(),
attrNames
))
if
(
!
Algo
::
Surface
::
Import
::
importMesh
<
PFP
>
(
myMap
,
filename
.
c_str
(),
attrNames
))
{
CGoGNerr
<<
"could not import "
<<
filename
<<
CGoGNendl
;
return
;
...
...
@@ -82,7 +82,7 @@ void MyQT::createMap(const std::string& filename)
VertexAttribute
<
VEC3
>
colorF
=
myMap
.
addAttribute
<
PFP
::
VEC3
,
VERTEX
>
(
"colorF"
);
// compute the area attribute
Algo
::
Geometry
::
computeOneRingAreaVertices
<
PFP
>
(
myMap
,
position
,
area
);
Algo
::
Surface
::
Geometry
::
computeOneRingAreaVertices
<
PFP
>
(
myMap
,
position
,
area
);
// just some tricks to obtain relatives value
float
amax
=
0
;
...
...
Apps/Tuto/tuto_mt.cpp
View file @
3a8ecd23
...
...
@@ -87,7 +87,7 @@ void MyQT::cb_initGL()
m_lines
->
setScale
(
2.0
f
);
m_lines
->
setColor
(
Geom
::
Vec4f
(
0.0
f
,
1.0
f
,
0.2
f
,
0.0
f
));
Algo
::
Geometry
::
computeNormalVertices
<
PFP
>
(
myMap
,
position
,
normal
)
;
Algo
::
Surface
::
Geometry
::
computeNormalVertices
<
PFP
>
(
myMap
,
position
,
normal
)
;
m_render
->
initPrimitives
<
PFP
>
(
myMap
,
allDarts
,
Algo
::
Render
::
GL2
::
LINES
);
m_render
->
initPrimitives
<
PFP
>
(
myMap
,
allDarts
,
Algo
::
Render
::
GL2
::
POINTS
);
...
...
@@ -298,7 +298,7 @@ int main(int argc, char **argv)
if
(
argc
==
2
)
nbt
=
atoi
(
argv
[
1
]);
// create a sphere
Algo
::
Modelisation
::
Polyhedron
<
PFP
>
prim
(
myMap
,
position
);
Algo
::
Surface
::
Modelisation
::
Polyhedron
<
PFP
>
prim
(
myMap
,
position
);
prim
.
cylinder_topo
(
nbt
,
nbt
,
true
,
true
);
prim
.
embedSphere
(
20.0
f
);
...
...
Apps/Tuto/tuto_oper2.cpp
View file @
3a8ecd23
...
...
@@ -73,8 +73,8 @@ void MyQT::operation(int x)
{
dm
.
markAll
();
myMap
.
splitVertex
(
m_selected
,
m_selected2
);
PFP
::
VEC3
c1
=
Algo
::
Geometry
::
faceCentroid
<
PFP
>
(
myMap
,
m_selected
,
position
);
PFP
::
VEC3
c2
=
Algo
::
Geometry
::
faceCentroid
<
PFP
>
(
myMap
,
m_selected2
,
position
);
PFP
::
VEC3
c1
=
Algo
::
Surface
::
Geometry
::
faceCentroid
<
PFP
>
(
myMap
,
m_selected
,
position
);
PFP
::
VEC3
c2
=
Algo
::
Surface
::
Geometry
::
faceCentroid
<
PFP
>
(
myMap
,
m_selected2
,
position
);
position
[
m_selected
]
=
position
[
m_selected
]
*
0.7
f
+
c1
*
0.3
f
;
position
[
m_selected2
]
=
position
[
m_selected2
]
*
0.7
f
+
c2
*
0.3
f
;
updateMap
();
...
...
@@ -175,7 +175,7 @@ void MyQT::createMap(int n)
position
=
myMap
.
addAttribute
<
VEC3
,
VERTEX
>
(
"position"
);
colorDarts
=
myMap
.
addAttribute
<
VEC3
,
DART
>
(
"color"
);
Algo
::
Modelisation
::
Polyhedron
<
PFP
>
grid
(
myMap
,
position
);
Algo
::
Surface
::
Modelisation
::
Polyhedron
<
PFP
>
grid
(
myMap
,
position
);
grid
.
grid_topo
(
n
,
n
);
grid
.
embedGrid
(
1.
,
1.
,
0.
);
...
...
@@ -356,7 +356,7 @@ void MyQT::cb_Open()
void
MyQT
::
cb_Save
()
{
std
::
string
filename
=
selectFileSave
(
"Export SVG file "
,
"."
,
"(*.off)"
);
Algo
::
Export
::
exportOFF
<
PFP
>
(
myMap
,
position
,
filename
.
c_str
());
Algo
::
Surface
::
Export
::
exportOFF
<
PFP
>
(
myMap
,
position
,
filename
.
c_str
());
}
void
MyQT
::
importMesh
(
std
::
string
&
filename
)
...
...
@@ -374,7 +374,7 @@ void MyQT::importMesh(std::string& filename)
else
{
std
::
vector
<
std
::
string
>
attrNames
;
if
(
!
Algo
::
Import
::
importMesh
<
PFP
>
(
myMap
,
filename
.
c_str
(),
attrNames
))
if
(
!
Algo
::
Surface
::
Import
::
importMesh
<
PFP
>
(
myMap
,
filename
.
c_str
(),
attrNames
))
{
CGoGNerr
<<
"could not import "
<<
filename
<<
CGoGNendl
;
return
;
...
...
Apps/Tuto/tuto_oper3.cpp
View file @
3a8ecd23
...
...
@@ -196,7 +196,7 @@ void MyQT::operation(int x)
CGoGNout
<<
"collapse face"
<<
CGoGNendl
;
if
(
m_selected
!=
NIL
)
{
PFP
::
VEC3
Q
=
Algo
::
Geometry
::
faceCentroid
<
PFP
>
(
myMap
,
m_selected
,
position
);
PFP
::
VEC3
Q
=
Algo
::
Surface
::
Geometry
::
faceCentroid
<
PFP
>
(
myMap
,
m_selected
,
position
);
Dart
x
=
myMap
.
collapseFace
(
m_selected
);
dm
.
markAll
();
position
[
x
]
=
Q
;
...
...
@@ -208,7 +208,7 @@ void MyQT::operation(int x)
CGoGNout
<<
"collapse volume"
<<
CGoGNendl
;
if
(
m_selected
!=
NIL
)
{
PFP
::
VEC3
Q
=
Algo
::
Geometry
::
volumeCentroid
<
PFP
>
(
myMap
,
m_selected
,
position
);
PFP
::
VEC3
Q
=
Algo
::
Surface
::
Geometry
::
volumeCentroid
<
PFP
>
(
myMap
,
m_selected
,
position
);
Dart
x
=
myMap
.
collapseVolume
(
m_selected
);
dm
.
markAll
();
position
[
x
]
=
Q
;
...
...
@@ -248,7 +248,7 @@ void MyQT::createMap(int n)
position
=
myMap
.
getAttribute
<
VEC3
,
VERTEX
>
(
"position"
);
if
(
!
position
.
isValid
())
position
=
myMap
.
addAttribute
<
VEC3
,
VERTEX
>
(
"position"
);
Algo
::
Modelisation
::
Primitive3D
<
PFP
>
prim
(
myMap
,
position
);
Algo
::
Volume
::
Modelisation
::
Primitive3D
<
PFP
>
prim
(
myMap
,
position
);
prim
.
hexaGrid_topo
(
n
,
n
,
n
);
prim
.
embedHexaGrid
(
1.0
f
,
1.0
f
,
1.0
f
);
...
...
@@ -603,7 +603,7 @@ void MyQT::cb_Open()
void
MyQT
::
cb_Save
()
{
std
::
string
filename
=
selectFileSave
(
"Export SVG file "
,
"."
,
"(*.off)"
);
Algo
::
Export
::
exportOFF
<
PFP
>
(
myMap
,
position
,
filename
.
c_str
());
Algo
::
Surface
::
Export
::
exportOFF
<
PFP
>
(
myMap
,
position
,
filename
.
c_str
());
// ???
}
void
MyQT
::
importMesh
(
std
::
string
&
filename
)
...
...
@@ -621,7 +621,7 @@ void MyQT::importMesh(std::string& filename)
else
if
(
extension
==
std
::
string
(
".node"
))
{
std
::
vector
<
std
::
string
>
attrNames
;
if
(
!
Algo
::
Import
::
importMeshV
<
PFP
>
(
myMap
,
filename
,
attrNames
,
Algo
::
Import
::
Import
Volumique
::
NODE
))
if
(
!
Algo
::
Volume
::
Import
::
importMeshV
<
PFP
>
(
myMap
,
filename
,
attrNames
,
Algo
::
Volume
::
Import
::
NODE
))
{
std
::
cerr
<<
"could not import "
<<
filename
<<
std
::
endl
;
return
;
...
...
@@ -631,7 +631,7 @@ void MyQT::importMesh(std::string& filename)
else
if
(
extension
==
std
::
string
(
".tet"
))
{
std
::
vector
<
std
::
string
>
attrNames
;
if
(
!
Algo
::
Import
::
importMeshV
<
PFP
>
(
myMap
,
filename
,
attrNames
,
Algo
::
Import
::
Import
Volumique
::
TET
))
if
(
!
Algo
::
Volume
::
Import
::
importMeshV
<
PFP
>
(
myMap
,
filename
,
attrNames
,
Algo
::
Volume
::
Import
::
TET
))
{
std
::
cerr
<<
"could not import "
<<
filename
<<
std
::
endl
;
return
;
...
...
@@ -641,7 +641,7 @@ void MyQT::importMesh(std::string& filename)
else
if
(
extension
==
std
::
string
(
".off"
))
{
std
::
vector
<
std
::
string
>
attrNames
;
if
(
!
Algo
::
Import
::
importMeshV
<
PFP
>
(
myMap
,
filename
,
attrNames
,
Algo
::
Import
::
Import
Volumique
::
OFF
))
if
(
!
Algo
::
Volume
::
Import
::
importMeshV
<
PFP
>
(
myMap
,
filename
,
attrNames
,
Algo
::
Volume
::
Import
::
OFF
))
{
std
::
cerr
<<
"could not import "
<<
filename
<<
std
::
endl
;
return
;
...
...
Apps/Tuto/tuto_orbits.cpp
View file @
3a8ecd23
...
...
@@ -202,7 +202,7 @@ void MyQT::initMap()
std
::
cout
<<
"INIT MAP"
<<
std
::
endl
;
position
=
myMap
.
addAttribute
<
VEC3
,
VERTEX
>
(
"position"
);
Algo
::
Modelisation
::
Primitive3D
<
PFP
>
prim
(
myMap
,
position
);
Algo
::
Volume
::
Modelisation
::
Primitive3D
<
PFP
>
prim
(
myMap
,
position
);
int
nb
=
2
;
prim
.
hexaGrid_topo
(
nb
,
nb
,
nb
);
prim
.
embedHexaGrid
(
1.0
f
,
1.0
f
,
1.0
f
);
...
...
Prev
1
2
3
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment