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
Etienne Schmitt
CGoGN
Commits
2a524b67
Commit
2a524b67
authored
Jun 03, 2011
by
Pierre Kraemer
Browse files
debug Dart/CellMarker + suppr '_ORBIT' et '_CELL'
parent
218a41b3
Changes
114
Hide whitespace changes
Inline
Side-by-side
Apps/Examples/Tests/Algo_Geom_inclusion.cpp
View file @
2a524b67
...
...
@@ -43,7 +43,7 @@ int main()
std
::
cout
<<
"Check Status : PARTIAL"
<<
std
::
endl
;
PFP
::
MAP
map
;
AttributeHandler
<
PFP
::
VEC3
>
position
=
map
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
_ORBIT
,
"position"
);
AttributeHandler
<
PFP
::
VEC3
>
position
=
map
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"position"
);
map
.
newFace
(
3
);
PFP
::
VEC3
ta
(
0
,
0
,
0
);
...
...
Apps/Examples/Viewer.cpp
View file @
2a524b67
...
...
@@ -332,7 +332,7 @@ int main(int argc, char **argv)
if
(
argc
==
1
)
{
position
=
myMap
.
addAttribute
<
Geom
::
Vec3f
>
(
VERTEX
_ORBIT
,
"position"
);
position
=
myMap
.
addAttribute
<
Geom
::
Vec3f
>
(
VERTEX
,
"position"
);
CGoGNout
<<
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
<<
CGoGNendl
;
// typedef uint8 DATATYPE;
...
...
@@ -422,10 +422,10 @@ int main(int argc, char **argv)
//
// GLint t1 = glutGet(GLUT_ELAPSED_TIME);
//
// myMap.getAttributeContainer(VERTEX
_ORBIT
).toggleProcess(position);
//// myMap.getAttributeContainer(VERTEX
_ORBIT
).toggleProcess(idPipo);
// myMap.getAttributeContainer(VERTEX).toggleProcess(position);
//// myMap.getAttributeContainer(VERTEX).toggleProcess(idPipo);
//
// PFP::MAP::EVertex::setContainer(myMap.getAttributeContainer(VERTEX
_ORBIT
));
// PFP::MAP::EVertex::setContainer(myMap.getAttributeContainer(VERTEX));
// PFP::MAP::EVertex::setMap(myMap);
// PFP::MAP::EVertex ec(0);
//
...
...
@@ -433,7 +433,7 @@ int main(int argc, char **argv)
// GLfloat seconds = (t2 - t1) / 1000.0f;
// CGoGNout << "triangulation: "<< seconds << "sec" << CGoGNendl;
//
// Marker m = myMap.getNewMarker(VERTEX
_ORBIT
);
// Marker m = myMap.getNewMarker(VERTEX);
// myMap.markEmbVertex(myMap.begin(),m);
//
// Dart xd = myMap.alpha1(myMap.begin());
...
...
@@ -447,8 +447,8 @@ int main(int argc, char **argv)
// CGoGNout << "Marke aussi"<< CGoGNendl;
// }
//
// myMap.clearEmbMarkers(m,VERTEX
_ORBIT
);
// myMap.releaseEmbMarker(m,VERTEX
_ORBIT
);
// myMap.clearEmbMarkers(m,VERTEX);
// myMap.releaseEmbMarker(m,VERTEX);
//
// }
else
...
...
@@ -462,7 +462,7 @@ int main(int argc, char **argv)
CGoGNerr
<<
"could not import "
<<
std
::
string
(
argv
[
1
])
<<
CGoGNendl
;
exit
(
1
);
}
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
VERTEX
_ORBIT
,
attrNames
[
0
])
;
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
attrNames
[
0
])
;
GLint
t1
=
glutGet
(
GLUT_ELAPSED_TIME
);
...
...
@@ -474,10 +474,10 @@ int main(int argc, char **argv)
// Algo::Modelisation::CatmullClark<PFP, PFP::TVEC3, PFP::VEC3>(myMap,position);
// PFP::MAP::EVertex::setContainer(myMap.getAttributeContainer(VERTEX
_ORBIT
));
// PFP::MAP::EVertex::setContainer(myMap.getAttributeContainer(VERTEX));
// PFP::MAP::EVertex::setMap(myMap);
// PFP::MAP::EVertex ec(0);
// myMap.getAttributeContainer(VERTEX
_ORBIT
).toggleProcess(position);
// myMap.getAttributeContainer(VERTEX).toggleProcess(position);
//
// Algo::Modelisation::LoopSubdivision<PFP, PFP::EVERTEX, PFP::EVERTEX>(myMap,ec);
// Algo::Modelisation::LoopSubdivision<PFP, PFP::EVERTEX, PFP::EVERTEX>(myMap,ec);
...
...
@@ -490,15 +490,15 @@ int main(int argc, char **argv)
CGoGNout
<<
"subdiv: "
<<
seconds
<<
"sec"
<<
CGoGNendl
;
// myMap.getAttributeContainer(VERTEX
_ORBIT
).toggleProcess(position);
// PFP::MAP::EVertex::setContainer(myMap.getAttributeContainer(VERTEX
_ORBIT
));
// myMap.getAttributeContainer(VERTEX).toggleProcess(position);
// PFP::MAP::EVertex::setContainer(myMap.getAttributeContainer(VERTEX));
// PFP::MAP::EVertex::setMap(myMap);
// PFP::MAP::EVertex ec(0);
// Algo::Modelisation::triangleSubdivide<PFP, PFP::EVERTEX, PFP::EVERTEX>(myMap,ec);
// Algo::Modelisation::triangleSubdivide<PFP, PFP::EVERTEX, PFP::EVERTEX>(myMap,ec);
// Algo::Modelisation::triangleSubdivide<PFP, PFP::EVERTEX, PFP::EVERTEX>(myMap,ec);
CGoGNout
<<
"Nombre de sommets plonges "
<<
myMap
.
getNbCells
(
VERTEX
_ORBIT
)
<<
CGoGNendl
;
CGoGNout
<<
"Nombre de sommets plonges "
<<
myMap
.
getNbCells
(
VERTEX
)
<<
CGoGNendl
;
CGoGNout
<<
"Nombre de sommets topo: "
<<
myMap
.
getNbOrbits
(
0
)
<<
CGoGNendl
;
CGoGNout
<<
"Nombre de faces topo: "
<<
myMap
.
getNbOrbits
(
2
)
<<
CGoGNendl
;
...
...
@@ -515,7 +515,7 @@ int main(int argc, char **argv)
bool
inter
=
Algo
::
Geometry
::
areTrianglesInIntersection
<
PFP
>
(
myMap
,
0
,
10
,
position
)
;
CGoGNout
<<
"intersection = "
<<
inter
<<
CGoGNendl
;
normal
=
myMap
.
addAttribute
<
Geom
::
Vec3f
>
(
VERTEX
_ORBIT
,
"normals"
);
normal
=
myMap
.
addAttribute
<
Geom
::
Vec3f
>
(
VERTEX
,
"normals"
);
// PFP::NORMAL normal(normal,myMap);
...
...
Apps/Examples/decimationVolumique.cpp
View file @
2a524b67
...
...
@@ -235,9 +235,9 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
/** affichage **/
case
'd'
:
{
int
nbVertices
=
myMap
.
getNbOrbits
(
VERTEX
_ORBIT
)
;
int
nbVertices
=
myMap
.
getNbOrbits
(
VERTEX
)
;
CGoGNout
<<
"nb darts = "
<<
myMap
.
getNbOrbits
(
DART
_ORBIT
)
<<
CGoGNendl
;
CGoGNout
<<
"nb darts = "
<<
myMap
.
getNbOrbits
(
DART
)
<<
CGoGNendl
;
GLint
t1
=
glutGet
(
GLUT_ELAPSED_TIME
);
Algo
::
DecimationVolumique
::
decimate
<
PFP
>
(
myMap
,
Algo
::
DecimationVolumique
::
S_Random
,
Algo
::
DecimationVolumique
::
A_Centroid
,
position
,
nbVertices
*
0.75
);
...
...
@@ -370,7 +370,7 @@ int main(int argc, char **argv)
}
Algo
::
Import
::
importOFFWithELERegions
<
PFP
>
(
myMap
,
argv
[
2
],
argv
[
3
],
attrNames
);
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
VERTEX
_ORBIT
,
attrNames
[
0
])
;
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
attrNames
[
0
])
;
}
else
if
(
std
::
string
(
argv
[
1
])
==
"-tet"
)
{
...
...
@@ -380,7 +380,7 @@ int main(int argc, char **argv)
}
Algo
::
Import
::
importTet
<
PFP
>
(
myMap
,
argv
[
2
],
attrNames
);
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
VERTEX
_ORBIT
,
attrNames
[
0
])
;
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
attrNames
[
0
])
;
}
else
if
(
std
::
string
(
argv
[
1
])
==
"-ts"
)
{
...
...
@@ -390,18 +390,18 @@ int main(int argc, char **argv)
}
Algo
::
Import
::
importTs
<
PFP
>
(
myMap
,
argv
[
2
],
attrNames
);
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
VERTEX
_ORBIT
,
attrNames
[
0
])
;
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
attrNames
[
0
])
;
//scalar = myMap.getAttribute<PFP::REAL>(VERTEX
_ORBIT
, "scalar");
//scalar = myMap.getAttribute<PFP::REAL>(VERTEX, "scalar");
}
else
{
maillageTest
();
}
//CGoGNout << "Nb Tetrahedron = " << myMap.getNbOrbits(VOLUME
_ORBIT
) << CGoGNendl;
// " / Nb Edges = " << myMap.getNbOrbits(EDGE
_ORBIT
) <<
// " / Nb Vertices = " << myMap.getNbOrbits(VERTEX
_ORBIT
) << CGoGNendl;
//CGoGNout << "Nb Tetrahedron = " << myMap.getNbOrbits(VOLUME) << CGoGNendl;
// " / Nb Edges = " << myMap.getNbOrbits(EDGE) <<
// " / Nb Vertices = " << myMap.getNbOrbits(VERTEX) << CGoGNendl;
// un peu d'interface
MyGlutWin
*
mgw
=
new
MyGlutWin
(
&
argc
,
argv
,
1200
,
800
);
...
...
Apps/Examples/extrusionView.cpp
View file @
2a524b67
...
...
@@ -109,7 +109,7 @@ int main(int argc, char **argv)
QApplication
app
(
argc
,
argv
);
MyQT
sqt
;
PFP
::
TVEC3
position
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
_ORBIT
,
"position"
)
;
PFP
::
TVEC3
position
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"position"
)
;
// define the face extruded (here a cross)
std
::
vector
<
PFP
::
VEC3
>
objV
;
...
...
Apps/Examples/miniTest.cpp
View file @
2a524b67
...
...
@@ -311,8 +311,8 @@ MyGlutWin::MyGlutWin(int* argc, char **argv, int winX, int winY) :
void
MyGlutWin
::
init
()
{
normal
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
_ORBIT
,
"normal"
)
;
laplacian
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
_ORBIT
,
"laplacian"
)
;
normal
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"normal"
)
;
laplacian
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"laplacian"
)
;
vbo_render
=
new
Algo
::
Render
::
GL2
::
MapRender_VBO
()
;
updateVBOdata
(
Algo
::
Render
::
GL2
::
POSITIONS
|
Algo
::
Render
::
GL2
::
NORMALS
)
;
...
...
@@ -489,12 +489,12 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
GLfloat
seconds
=
(
t2
-
t1
)
/
1000.0
f
;
CGoGNout
<<
"sqrt3: "
<<
seconds
<<
"sec"
<<
CGoGNendl
;
normal
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
VERTEX
_ORBIT
,
"normal"
)
;
normal
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"normal"
)
;
if
(
!
normal
.
isValid
())
normal
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
_ORBIT
,
"normal"
)
;
laplacian
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
VERTEX
_ORBIT
,
"laplacian"
)
;
normal
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"normal"
)
;
laplacian
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"laplacian"
)
;
if
(
!
laplacian
.
isValid
())
laplacian
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
_ORBIT
,
"laplacian"
)
;
laplacian
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"laplacian"
)
;
t1
=
glutGet
(
GLUT_ELAPSED_TIME
)
;
...
...
@@ -560,7 +560,7 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
case
's'
:
{
unsigned
int
nbVertices
=
myMap
.
getNbOrbits
(
VERTEX
_ORBIT
)
;
unsigned
int
nbVertices
=
myMap
.
getNbOrbits
(
VERTEX
)
;
GLint
t1
=
glutGet
(
GLUT_ELAPSED_TIME
)
;
...
...
@@ -586,9 +586,9 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
case
'd'
:
{
AttributeHandler
<
PFP
::
VEC3
>
positionF
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
FACE
_ORBIT
,
"position"
)
;
AttributeHandler
<
PFP
::
VEC3
>
positionF
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
FACE
,
"position"
)
;
if
(
!
positionF
.
isValid
())
positionF
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
FACE
_ORBIT
,
"position"
)
;
positionF
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
FACE
,
"position"
)
;
Algo
::
Geometry
::
computeCentroidFaces
<
PFP
>
(
myMap
,
position
,
positionF
)
;
GLint
t1
=
glutGet
(
GLUT_ELAPSED_TIME
)
;
...
...
@@ -601,12 +601,12 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
position
=
positionF
;
normal
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
VERTEX
_ORBIT
,
"normal"
)
;
normal
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"normal"
)
;
if
(
!
normal
.
isValid
())
normal
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
_ORBIT
,
"normal"
)
;
laplacian
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
VERTEX
_ORBIT
,
"laplacian"
)
;
normal
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"normal"
)
;
laplacian
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"laplacian"
)
;
if
(
!
laplacian
.
isValid
())
laplacian
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
_ORBIT
,
"laplacian"
)
;
laplacian
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"laplacian"
)
;
t1
=
glutGet
(
GLUT_ELAPSED_TIME
)
;
...
...
@@ -649,12 +649,12 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
case
'9'
:
{
CellMarker
markVisit
(
myMap
,
VERTEX
_CELL
)
;
CellMarker
markVisit
(
myMap
,
VERTEX
)
;
CellMarker
markNoDelete
(
myMap
,
VERTEX
_CELL
)
;
CellMarker
markNoDelete
(
myMap
,
VERTEX
)
;
std
::
vector
<
Dart
>
visited
;
visited
.
reserve
(
myMap
.
getNbCells
(
VERTEX
_CELL
))
;
visited
.
reserve
(
myMap
.
getNbCells
(
VERTEX
))
;
visited
.
push_back
(
myMap
.
begin
())
;
markVisit
.
mark
(
myMap
.
begin
())
;
...
...
@@ -811,7 +811,7 @@ int main(int argc, char** argv)
return
1
;
}
mgw
->
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
VERTEX
_ORBIT
,
attrNames
[
0
])
;
mgw
->
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
attrNames
[
0
])
;
GLint
t2
=
glutGet
(
GLUT_ELAPSED_TIME
)
;
GLfloat
seconds
=
(
t2
-
t1
)
/
1000.0
f
;
CGoGNout
<<
"import: "
<<
seconds
<<
" sec"
<<
CGoGNendl
;
...
...
@@ -820,9 +820,9 @@ int main(int argc, char** argv)
// myMap.closeMap(m) ;
}
CGoGNout
<<
myMap
.
getNbOrbits
(
VERTEX
_ORBIT
)
<<
CGoGNendl
;
CGoGNout
<<
myMap
.
getNbOrbits
(
EDGE
_ORBIT
)
<<
CGoGNendl
;
CGoGNout
<<
myMap
.
getNbOrbits
(
FACE
_ORBIT
)
<<
CGoGNendl
;
CGoGNout
<<
myMap
.
getNbOrbits
(
VERTEX
)
<<
CGoGNendl
;
CGoGNout
<<
myMap
.
getNbOrbits
(
EDGE
)
<<
CGoGNendl
;
CGoGNout
<<
myMap
.
getNbOrbits
(
FACE
)
<<
CGoGNendl
;
// compute width and position of object for centering
Geom
::
BoundingBox
<
PFP
::
VEC3
>
bb
=
Algo
::
Geometry
::
computeBoundingBox
<
PFP
>
(
myMap
,
mgw
->
position
)
;
...
...
Apps/Examples/polyhedronsView.cpp
View file @
2a524b67
...
...
@@ -99,7 +99,7 @@ int main(int argc, char **argv)
QApplication
app
(
argc
,
argv
);
MyQT
sqt
;
PFP
::
TVEC3
position
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
_ORBIT
,
"position"
)
;
PFP
::
TVEC3
position
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"position"
)
;
// create a cylinder
Algo
::
Modelisation
::
Polyhedron
<
PFP
>
prim1
(
myMap
,
position
);
...
...
Apps/Examples/scene.cpp
View file @
2a524b67
...
...
@@ -211,8 +211,8 @@ int main(int argc, char **argv)
myGlutWin
mgw
(
&
argc
,
argv
,
800
,
800
);
mgw
.
init
();
mgw
.
position
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
_ORBIT
,
"position"
)
;
mgw
.
normal
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
_ORBIT
,
"normal"
)
;
mgw
.
position
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"position"
)
;
mgw
.
normal
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"normal"
)
;
glewInit
();
if
(
!
Utils
::
GLSLShader
::
areShadersSupported
())
...
...
@@ -229,7 +229,7 @@ int main(int argc, char **argv)
prim1
.
cylinder_topo
(
16
,
15
,
true
,
true
);
prim1
.
embedCylinder
(
30.0
f
,
20.0
f
,
50.0
f
);
CellMarker
mark1
(
myMap
,
VERTEX
_CELL
);
CellMarker
mark1
(
myMap
,
VERTEX
);
prim1
.
mark
(
mark1
);
// create a sphere
...
...
@@ -237,7 +237,7 @@ int main(int argc, char **argv)
prim2
.
cylinder_topo
(
16
,
16
,
true
,
true
);
prim2
.
embedSphere
(
40.0
f
);
CellMarker
mark2
(
myMap
,
VERTEX
_CELL
);
CellMarker
mark2
(
myMap
,
VERTEX
);
prim2
.
mark
(
mark2
);
// create a sphere
...
...
@@ -245,7 +245,7 @@ int main(int argc, char **argv)
prim3
.
tore_topo
(
12
,
48
);
prim3
.
embedTore
(
50.0
f
,
10.0
f
);
CellMarker
mark3
(
myMap
,
VERTEX
_CELL
);
CellMarker
mark3
(
myMap
,
VERTEX
);
prim3
.
mark
(
mark3
);
...
...
Apps/Examples/simpleEMap3.cpp
View file @
2a524b67
...
...
@@ -390,8 +390,8 @@ int main(int argc, char **argv)
{
myGlutWin
mgw
(
&
argc
,
argv
,
800
,
800
);
mgw
.
idAttr_Position
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
_ORBIT
,
"position"
,
"Geom::Vec3f"
)
;
mgw
.
idAttr_Normal
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
_ORBIT
,
"normal"
,
"Geom::Vec3f"
)
;
mgw
.
idAttr_Position
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"position"
,
"Geom::Vec3f"
)
;
mgw
.
idAttr_Normal
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"normal"
,
"Geom::Vec3f"
)
;
AttributeHandler
<
PFP
::
VEC3
>
tablePositions
(
myMap
,
mgw
.
idAttr_Position
)
;
PFP
::
VEC3
gMax
;
...
...
Apps/Examples/simpleGMap2.cpp
View file @
2a524b67
...
...
@@ -384,7 +384,7 @@ int main(int argc, char **argv)
if
(
argc
<
2
)
{
mgw
.
position
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
_ORBIT
,
"position"
)
;
mgw
.
position
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"position"
)
;
Dart
d
=
myMap
.
newFace
(
4
);
Dart
e
=
myMap
.
newFace
(
3
);
...
...
@@ -415,10 +415,10 @@ int main(int argc, char **argv)
CGoGNerr
<<
"Import fail"
<<
CGoGNendl
;
exit
(
1
);
}
mgw
.
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
VERTEX
_ORBIT
,
attrNames
[
0
])
;
mgw
.
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
attrNames
[
0
])
;
}
mgw
.
normal
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
_ORBIT
,
"normal"
)
;
mgw
.
normal
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"normal"
)
;
// pour le rendu
Geom
::
BoundingBox
<
PFP
::
VEC3
>
bb
=
Algo
::
Geometry
::
computeBoundingBox
<
PFP
>
(
myMap
,
mgw
.
position
)
;
...
...
Apps/Examples/squelette3carte.cpp
View file @
2a524b67
...
...
@@ -297,7 +297,7 @@ void maillageTest()
int
main
(
int
argc
,
char
**
argv
)
{
//Initilisation du plongement geometrique
position
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
_ORBIT
,
"position"
);
position
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"position"
);
/*
* Chargement de maillages
...
...
Apps/Examples/ter_meshes.cpp
View file @
2a524b67
...
...
@@ -131,9 +131,9 @@ int main(int argc, char **argv)
return
1
;
}
// cree un handler d'attribut pour la position des points (créé lors de l'import)
AttributeHandler
<
PFP
::
VEC3
>
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
VERTEX
_ORBIT
,
attrNames
[
0
])
;
AttributeHandler
<
PFP
::
VEC3
>
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
attrNames
[
0
])
;
// cree un handler pour les normales aux sommets
AttributeHandler
<
PFP
::
VEC3
>
normal
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
_ORBIT
,
"normal"
);
AttributeHandler
<
PFP
::
VEC3
>
normal
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"normal"
);
// // parcours de tous les brins de la carte:
...
...
@@ -148,7 +148,7 @@ int main(int argc, char **argv)
{
fonction_exemple
<
PFP
>
(
myMap
,
position
,
d
);
// marque tous les brins de la face de d
mf
.
markOrbit
(
FACE
_ORBIT
,
d
);
mf
.
markOrbit
(
FACE
,
d
);
}
}
...
...
Apps/Examples/triangulation.cpp
View file @
2a524b67
...
...
@@ -127,7 +127,7 @@ void TriangulateFromDart(typename PFP::MAP& map, const AttributeHandler<typename
Dart
e
=
d
;
do
{
indices
.
push_back
(
map
.
getEmbedding
(
e
,
VERTEX
_ORBIT
)
);
// recupere l'indice du point dans le handler
indices
.
push_back
(
map
.
getEmbedding
(
e
,
VERTEX
)
);
// recupere l'indice du point dans le handler
e
=
map
.
phi1
(
e
);
// brin suivant dans la face
}
while
(
e
!=
d
);
// tq par revenu au debut
...
...
@@ -150,7 +150,7 @@ int main(int argc, char **argv)
// 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
_ORBIT
,
"position"
);
AttributeHandler
<
PFP
::
VEC3
>
position
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"position"
);
// creation face 1 (convexe)
Dart
d1
=
myMap
.
newFace
(
5
);
...
...
Apps/Examples/viewer.cpp
View file @
2a524b67
...
...
@@ -179,7 +179,7 @@ void Viewer::importMesh(std::string& filename)
CGoGNerr
<<
"could not import "
<<
filename
<<
CGoGNendl
;
return
;
}
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
VERTEX
_ORBIT
,
attrNames
[
0
])
;
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
attrNames
[
0
])
;
m_render
->
initPrimitives
<
PFP
>
(
myMap
,
allDarts
,
Algo
::
Render
::
GL2
::
POINTS
)
;
m_render
->
initPrimitives
<
PFP
>
(
myMap
,
allDarts
,
Algo
::
Render
::
GL2
::
LINES
)
;
...
...
@@ -195,7 +195,7 @@ void Viewer::importMesh(std::string& filename)
vertexBaseSize
=
normalBaseSize
*
2.0
f
;
if
(
!
normal
.
isValid
())
normal
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
_ORBIT
,
"normal"
)
;
normal
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"normal"
)
;
Algo
::
Geometry
::
computeNormalVertices
<
PFP
>
(
myMap
,
position
,
normal
)
;
...
...
Apps/Tuto/tp_master.cpp
View file @
2a524b67
...
...
@@ -586,14 +586,14 @@ int main(int argc, char **argv)
{
std
::
vector
<
std
::
string
>
attrNames
;
Algo
::
Import
::
importMesh
<
PFP
>
(
myMap
,
argv
[
1
],
attrNames
)
;
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
VERTEX
_ORBIT
,
attrNames
[
0
])
;
normal
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
_ORBIT
,
"normal"
);
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
attrNames
[
0
])
;
normal
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"normal"
);
Algo
::
Geometry
::
computeNormalVertices
<
PFP
>
(
myMap
,
position
,
normal
)
;
}
else
{
position
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
_ORBIT
,
"position"
);
normal
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
_ORBIT
,
"normal"
);
position
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"position"
);
normal
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"normal"
);
createMap
();
}
...
...
Apps/Tuto/tuto1.cpp
View file @
2a524b67
...
...
@@ -130,7 +130,7 @@ int main(int argc, char **argv)
// creation of a new attribute on vertices of type 3D vector
// a handler to this attribute is returned
position
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
_ORBIT
,
"position"
);
position
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"position"
);
// affect a position to the vertices of the mesh
position
[
d1
]
=
PFP
::
VEC3
(
0
,
0
,
0
);
...
...
Apps/Tuto/tuto2.cpp
View file @
2a524b67
...
...
@@ -148,7 +148,7 @@ int main(int argc, char **argv)
Dart
d3
=
myMap
.
newOrientedFace
(
4
);
myMap
.
sewFaces
(
d2
,
d3
);
position
=
myMap
.
addAttribute
<
Geom
::
Vec3f
>
(
VERTEX
_ORBIT
,
"position"
);
position
=
myMap
.
addAttribute
<
Geom
::
Vec3f
>
(
VERTEX
,
"position"
);
position
[
d2
]
=
PFP
::
VEC3
(
0.0
f
,
0.0
f
,
0.0
f
);
d2
=
myMap
.
phi1
(
d2
);
...
...
@@ -175,7 +175,7 @@ int main(int argc, char **argv)
MapBrowserLinkedAuto
<
PFP
::
MAP
>
mbl
(
myMap
);
// on ajoute un brin par sommet dans le browser
myMap
.
foreach_orbit
(
VERTEX
_ORBIT
,
mbl
);
myMap
.
foreach_orbit
(
VERTEX
,
mbl
);
// et on parcours la sous-carte avec ce browser
TestDeParcoursAFF
<
PFP
>
(
myMap
,
mbl
,
position
);
...
...
@@ -186,7 +186,7 @@ int main(int argc, char **argv)
CGoGNout
<<
"Parcours avec le browser (le triangle)"
<<
CGoGNendl
;
// on cree un attribut Dart pour la liste
AutoAttributeHandler
<
Dart
>
tableLink
(
myMap
,
DART
_ORBIT
);
AutoAttributeHandler
<
Dart
>
tableLink
(
myMap
,
DART
);
// le browser
MapBrowserLinkedAttr
<
PFP
::
MAP
>
mbl2
(
tableLink
);
// que l'on remplit a la main
...
...
Apps/Tuto/tuto3.cpp
View file @
2a524b67
...
...
@@ -112,8 +112,8 @@ int main(int argc, char **argv)
Dart
d3
=
myMap
.
newOrientedFace
(
4
);
myMap
.
sewFaces
(
d2
,
d3
);
position
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
_ORBIT
,
"position"
);
color
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
_ORBIT
,
"couleur"
);
position
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"position"
);
color
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"couleur"
);
position
[
d2
]
=
PFP
::
VEC3
(
0.0
f
,
0.0
f
,
0.0
f
);
color
[
d2
]
=
PFP
::
VEC3
(
1.0
f
,
0.0
f
,
0.0
f
);
...
...
@@ -139,11 +139,11 @@ int main(int argc, char **argv)
DartMarkerStore
me
(
myMap
);
// avec lesquels on peut marquer des orbits
mf
.
markOrbit
(
FACE
_ORBIT
,
d2
);
me
.
markOrbit
(
EDGE
_ORBIT
,
d2
);
mf
.
markOrbit
(
FACE
,
d2
);
me
.
markOrbit
(
EDGE
,
d2
);
// les sommet sont plonges, on peut utiliser un marqueur de cellule sommet
CellMarker
cm
(
myMap
,
VERTEX
_ORBIT
);
CellMarker
cm
(
myMap
,
VERTEX
);
cm
.
mark
(
d3
);
for
(
Dart
d
=
myMap
.
begin
();
d
!=
myMap
.
end
();
myMap
.
next
(
d
))
...
...
@@ -204,8 +204,8 @@ int main(int argc, char **argv)
Dart
dx
=
myMap2
.
newOrientedFace
(
4
);
position2
=
myMap2
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
_ORBIT
,
"position"
);
color2
=
myMap2
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
_ORBIT
,
"couleur"
);
position2
=
myMap2
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"position"
);
color2
=
myMap2
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"couleur"
);
position2
[
dx
]
=
PFP
::
VEC3
(
0.0
f
,
0.0
f
,
0.0
f
);
color2
[
dx
]
=
PFP
::
VEC3
(
1.0
f
,
1.0
f
,
0.0
f
);
...
...
Apps/Tuto/tuto4.cpp
View file @
2a524b67
...
...
@@ -140,7 +140,7 @@ void MyQT::slider_explode(int x)
int
main
(
int
argc
,
char
**
argv
)
{
/// Utilisation des Marker
position
=
myMap
.
addAttribute
<
Geom
::
Vec3f
>
(
VERTEX
_ORBIT
,
"position"
);
position
=
myMap
.
addAttribute
<
Geom
::
Vec3f
>
(
VERTEX
,
"position"
);
Algo
::
Modelisation
::
Polyhedron
<
PFP
>
prim3
(
myMap
,
position
);
Dart
d2
=
prim3
.
tore_topo
(
16
,
24
);
...
...
@@ -158,15 +158,15 @@ int main(int argc, char **argv)
// position[d3] = PFP::VEC3(2.0f, -2.0f, 0.0f);
// d3 = myMap.phi1(d3);
// unsigned int idAttV2 = myMap.addAttribute<float>(VERTEX
_ORBIT
,"reel");
// PFP::AttributeHandler<float> tableReels(idAttV2,VERTEX
_ORBIT
,myMap);
// unsigned int idAttV2 = myMap.addAttribute<float>(VERTEX,"reel");
// PFP::AttributeHandler<float> tableReels(idAttV2,VERTEX,myMap);
//
// tableReels[d2] = 3.5f;
// tableReels[myMap.phi1(d2)] = 3.7f;
//
// // Attention ici on cree un attribut de FACE donc les face sont maintenant plangees
// // l'attribut cree se detruira a la fin de la portee de l'objet
// PFP::MAP::AutoAttributeHandler<Geom::Vec3f> tableRGB(myMap, FACE
_ORBIT
, "RGB"); // "RGB" optionnel
// PFP::MAP::AutoAttributeHandler<Geom::Vec3f> tableRGB(myMap, FACE, "RGB"); // "RGB" optionnel
//
// tableRGB[d3] = Geom::Vec3f(1.0f,2.0f,3.0f);
//
...
...
@@ -182,7 +182,7 @@ int main(int argc, char **argv)
// CGoGNout << "RGB["<<id<<"] = "<<tableRGB.at(id)<<CGoGNendl;
// }
CellMarkerStore
cm
(
myMap
,
VERTEX
_ORBIT
);
CellMarkerStore
cm
(
myMap
,
VERTEX
);
Dart
d3
=
myMap
.
phi1
(
d2
);
cm
.
mark
(
d2
);
...
...
Apps/Tuto/tuto5.cpp
View file @
2a524b67
...
...
@@ -125,7 +125,7 @@ void MyQT::animate()
void
MyQT
::
storeVerticesInfo
()
{
CellMarker
mv
(
myMap
,
VERTEX
_CELL
);
CellMarker
mv
(
myMap
,
VERTEX
);
for
(
Dart
d
=
myMap
.
begin
();
d
!=
myMap
.
end
();
myMap
.
next
(
d
))
{
if
(
!
mv
.
isMarked
(
d
))
...
...
@@ -282,7 +282,7 @@ void MyQT::cb_keyPress(int code)
int
main
(
int
argc
,
char
**
argv
)
{
position
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
_ORBIT
,
"position"
);
position
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"position"
);
CGoGNout
<<
5.34
<<
" toto "
<<
Geom
::
Vec3f
(
2.5
,
2.2
,
4.3
)
<<
CGoGNendl
;
CGoGNout
<<
3
<<
" tutu "
<<
4
<<
CGoGNendl
;
...
...
Apps/Tuto/tuto_mt.cpp
View file @
2a524b67
...
...
@@ -82,10 +82,10 @@ void MyQT::cb_Open()
}
// recuper l'attribut pour la position des points (créé lors de l'import)
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
VERTEX
_ORBIT
,
attrNames
[
0
])
;
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
attrNames
[
0
])
;
if
(
!
normal
.
isValid
())
normal
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
_ORBIT
,
"normal"
);
normal
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"normal"
);
Algo
::
Geometry
::
computeNormalVertices
<
PFP
>
(
myMap
,
position
,
normal
)
;
...
...
@@ -103,7 +103,7 @@ void MyQT::cb_Open()
void
MyQT
::
cb_New
()
{
if
(
!
position
.
isValid
())
position
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
_ORBIT
,
"position"
);
position
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"position"
);
// create a sphere
Algo
::
Modelisation
::
Polyhedron
<
PFP
>
prim
(
myMap
,
position
);
...
...
@@ -111,7 +111,7 @@ void MyQT::cb_New()
prim
.
embedSphere
(
10.0
f
);
if
(
!
normal
.
isValid
())
normal
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
_ORBIT
,
"normal"
);
normal
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"normal"
);
Algo
::
Geometry
::
computeNormalVertices
<
PFP
>
(
myMap
,
position
,
normal
)
;
...
...
@@ -317,7 +317,7 @@ public:
void
MyQT
::
menu_slot1
()
{
// cree un handler pour les normales aux sommets
AttributeHandler
<
PFP
::
VEC3
>
normal2
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
_ORBIT
,
"normal2"
);
AttributeHandler
<
PFP
::
VEC3
>