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
CGoGN
CGoGN
Commits
38d9dff7
Commit
38d9dff7
authored
Jun 07, 2011
by
Kenneth Vanhoey
Browse files
merge
parents
7b67fb82
2cffdbb3
Changes
154
Hide whitespace changes
Inline
Side-by-side
Apps/CMakeLists.txt
View file @
38d9dff7
...
...
@@ -9,11 +9,10 @@ IF(WIN32)
add_subdirectory
(
Examples/Release
)
add_subdirectory
(
Tuto
)
ELSE
(
WIN32
)
SET
(
CGoGN_LIBS_D topologyD algoD
containerD utilsD
)
SET
(
CGoGN_LIBS_D topologyD algoD containerD utilsD
)
add_subdirectory
(
Examples/Release
)
add_subdirectory
(
Examples/Debug
)
add_subdirectory
(
Examples/Tests
)
add_subdirectory
(
Tuto
)
ENDIF
(
WIN32
)
Apps/Examples/Debug/CMakeLists.txt
View file @
38d9dff7
...
...
@@ -10,10 +10,9 @@ SET(QT_USE_QTOPENGL TRUE)
INCLUDE
(
${
QT_USE_FILE
}
)
ADD_DEFINITIONS
(
${
QT_DEFINITIONS
}
)
# define includes path
include_directories
(
${
CMAKE_CURRENT_BINARY_DIR
}
/usr/include/libxml2/
${
CGoGN_ROOT_DIR
}
/include
${
CGoGN_ROOT_DIR
}
/ThirdParty/Numerical
...
...
@@ -34,51 +33,19 @@ link_directories(
#define exec to compile
#add_executable( miniTestD ../miniTest.cpp)
#target_link_libraries( miniTestD
# containerD topologyD utilsD algoD numerical lapack blas f2c ${COMMON_LIBS} )
#add_executable( ViewerD ../Viewer.cpp)
#target_link_libraries( ViewerD
# containerD topologyD utilsD algoD ${COMMON_LIBS} )
#add_executable( simpleGMap2D ../simpleGMap2.cpp)
#target_link_libraries( simpleGMap2D
# containerD topologyD utilsD algoD ${COMMON_LIBS} Zinri)
#add_executable( SimpleEMap3D ../simpleEMap3.cpp)
#target_link_libraries( SimpleEMap3D
# containerD topologyD utilsD algoD ${COMMON_LIBS} )
#add_executable( triangulationD ../triangulation.cpp)
#target_link_libraries( triangulationD
# containerD topologyD utilsD algoD ${COMMON_LIBS} )
#add_executable( decimationVolumiqueD ../decimationVolumique.cpp)
#target_link_libraries( decimationVolumiqueD
# containerD topologyD utilsD algoD numerical lapack blas f2c ${COMMON_LIBS} )
#add_executable( ter_meshesD ../ter_meshes.cpp)
#target_link_libraries( ter_meshesD
# containerD topologyD utilsD algoD ${COMMON_LIBS} )
QT4_WRAP_CPP
(
polyhedronsView_moc ../polyhedronsView.h
)
add_executable
(
polyhedronsViewD ../polyhedronsView.cpp
${
polyhedronsView_moc
}
)
target_link_libraries
(
polyhedronsViewD
${
CGoGN_LIBS_D
}
${
COMMON_LIBS
}
${
QT_LIBRARIES
}
)
${
CGoGN_LIBS_D
}
${
COMMON_LIBS
}
${
QT_LIBRARIES
}
)
QT4_WRAP_CPP
(
extrusionView_moc ../extrusionView.h
)
add_executable
(
extrusionViewD ../extrusionView.cpp
${
extrusionView_moc
}
)
target_link_libraries
(
extrusionViewD
${
CGoGN_LIBS_D
}
${
COMMON_LIBS
}
${
QT_LIBRARIES
}
)
#add_executable( sceneD ../scene.cpp)
#target_link_libraries( sceneD
# containerD topologyD utilsD algoD ${COMMON_LIBS} )
#add_executable( VizVolumeD ../VizVolume.cpp)
#target_link_libraries( VizVolumeD
# containerD topologyD utilsD algoD ${COMMON_LIBS} Zinri)
${
CGoGN_LIBS_D
}
${
COMMON_LIBS
}
${
QT_LIBRARIES
}
)
QT4_WRAP_UI
(
viewer_ui ../viewer.ui
)
QT4_WRAP_CPP
(
viewer_moc ../viewer.h
)
add_executable
(
viewerD ../viewer.cpp
${
viewer_moc
}
${
viewer_ui
}
)
target_link_libraries
(
viewerD
${
CGoGN_LIBS_D
}
${
NUMERICAL_LIBS
}
${
COMMON_LIBS
}
${
QT_LIBRARIES
}
)
Apps/Examples/Release/CMakeLists.txt
View file @
38d9dff7
...
...
@@ -37,38 +37,6 @@ ENDIF(WIN32)
#define exec to compile
#add_executable( miniTest ../miniTest.cpp)
#target_link_libraries( miniTest
# container topology utils algo numerical lapack blas f2c ${COMMON_LIBS} )
#add_executable( Viewer ../Viewer.cpp)
#target_link_libraries( Viewer
# container topology utils algo ${COMMON_LIBS} )
#add_executable( simpleGMap2 ../simpleGMap2.cpp)
#target_link_libraries( simpleGMap2
# container topology utils algo ${COMMON_LIBS} Zinri)
# add_executable( hm_convexhull ../hm_convexhull.cpp)
# target_link_libraries( hm_convexhull
# topology utils algo ${COMMON_LIBS})
#add_executable( squelette3carte ../squelette3carte.cpp)
#target_link_libraries( squelette3carte
# container topology utils algo numerical lapack blas f2c ${COMMON_LIBS} )
#add_executable( decimationVolumique ../decimationVolumique.cpp)
#target_link_libraries( decimationVolumique
# container topology utils algo numerical lapack blas f2c ${COMMON_LIBS} )
#add_executable( triangulation ../triangulation.cpp)
#target_link_libraries( triangulation
# container topology utils algo ${COMMON_LIBS} )
#add_executable( ter_meshes ../ter_meshes.cpp)
#target_link_libraries( ter_meshes
# container topology utils algo ${COMMON_LIBS} )
QT4_WRAP_CPP
(
polyhedronsView_moc ../polyhedronsView.h
)
add_executable
(
polyhedronsView ../polyhedronsView.cpp
${
polyhedronsView_moc
}
)
target_link_libraries
(
polyhedronsView
...
...
@@ -78,7 +46,10 @@ QT4_WRAP_CPP(extrusionView_moc ../extrusionView.h)
add_executable
(
extrusionView ../extrusionView.cpp
${
extrusionView_moc
}
)
target_link_libraries
(
extrusionView
${
CGoGN_LIBS_R
}
${
COMMON_LIBS
}
${
QT_LIBRARIES
}
)
#add_executable( scene ../scene.cpp)
#target_link_libraries( scene
# container topology utils algo ${COMMON_LIBS} )
QT4_WRAP_UI
(
viewer_ui ../viewer.ui
)
QT4_WRAP_CPP
(
viewer_moc ../viewer.h
)
add_executable
(
viewer ../viewer.cpp
${
viewer_moc
}
${
viewer_ui
}
)
target_link_libraries
(
viewer
${
CGoGN_LIBS_R
}
${
NUMERICAL_LIBS
}
${
COMMON_LIBS
}
${
QT_LIBRARIES
}
)
Apps/Examples/Tests/Algo_Geom_inclusion.cpp
View file @
38d9dff7
...
...
@@ -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 @
38d9dff7
...
...
@@ -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 @
38d9dff7
...
...
@@ -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 @
38d9dff7
...
...
@@ -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 @
38d9dff7
...
...
@@ -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 @
38d9dff7
...
...
@@ -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 @
38d9dff7
...
...
@@ -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 @
38d9dff7
...
...
@@ -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 @
38d9dff7
...
...
@@ -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 @
38d9dff7
...
...
@@ -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 @
38d9dff7
...
...
@@ -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 @
38d9dff7
...
...
@@ -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
0 → 100644
View file @
38d9dff7
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps *
* version 0.1 *
* Copyright (C) 2009, 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: https://iggservis.u-strasbg.fr/CGoGN/ *
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
#include
"viewer.h"
Viewer
::
Viewer
()
:
m_renderStyle
(
FLAT
),
m_drawVertices
(
false
),
m_drawEdges
(
false
),
m_drawFaces
(
true
),
m_drawNormals
(
false
),
m_render
(
NULL
),
m_phongShader
(
NULL
),
m_flatShader
(
NULL
),
m_vectorShader
(
NULL
),
m_simpleColorShader
(
NULL
),
m_pointSprite
(
NULL
)
{
normalScaleFactor
=
1.0
f
;
vertexScaleFactor
=
1.0
f
;
faceShrinkage
=
1.0
f
;
colClear
=
Geom
::
Vec4f
(
0.2
f
,
0.2
f
,
0.2
f
,
0.1
f
)
;
colDif
=
Geom
::
Vec4f
(
0.8
f
,
0.9
f
,
0.7
f
,
1.0
f
)
;
colSpec
=
Geom
::
Vec4f
(
0.9
f
,
0.9
f
,
0.9
f
,
1.0
f
)
;
colNormal
=
Geom
::
Vec4f
(
1.0
f
,
0.0
f
,
0.0
f
,
1.0
f
)
;
shininess
=
80.0
f
;
}
void
Viewer
::
initGUI
()
{
setDock
(
&
dock
)
;
dock
.
check_drawVertices
->
setChecked
(
false
)
;
dock
.
check_drawEdges
->
setChecked
(
false
)
;
dock
.
check_drawFaces
->
setChecked
(
true
)
;
dock
.
check_drawNormals
->
setChecked
(
false
)
;
dock
.
slider_verticesSize
->
setVisible
(
false
)
;
dock
.
slider_normalsSize
->
setVisible
(
false
)
;
dock
.
slider_verticesSize
->
setSliderPosition
(
50
)
;
dock
.
slider_normalsSize
->
setSliderPosition
(
50
)
;
setCallBack
(
dock
.
check_drawVertices
,
SIGNAL
(
toggled
(
bool
)),
SLOT
(
slot_drawVertices
(
bool
))
)
;
setCallBack
(
dock
.
slider_verticesSize
,
SIGNAL
(
valueChanged
(
int
)),
SLOT
(
slot_verticesSize
(
int
))
)
;
setCallBack
(
dock
.
check_drawEdges
,
SIGNAL
(
toggled
(
bool
)),
SLOT
(
slot_drawEdges
(
bool
))
)
;
setCallBack
(
dock
.
check_drawFaces
,
SIGNAL
(
toggled
(
bool
)),
SLOT
(
slot_drawFaces
(
bool
))
)
;