Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Thomas Pitiot
CGoGN
Commits
61426fcd
Commit
61426fcd
authored
Apr 21, 2011
by
Sylvain Thery
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Utilisation des CGoGNStream partout !
Utilisation possible (encore) de GL 1
parent
47d0007d
Changes
105
Hide whitespace changes
Inline
Side-by-side
Showing
75 changed files
with
898 additions
and
764 deletions
+898
-764
Apps/Examples/Tests/Geom_inclusion.cpp
Apps/Examples/Tests/Geom_inclusion.cpp
+13
-13
Apps/Examples/Tests/Geom_orientation.cpp
Apps/Examples/Tests/Geom_orientation.cpp
+7
-7
Apps/Examples/Viewer.cpp
Apps/Examples/Viewer.cpp
+26
-26
Apps/Examples/decimationVolumique.cpp
Apps/Examples/decimationVolumique.cpp
+17
-17
Apps/Examples/miniTest.cpp
Apps/Examples/miniTest.cpp
+22
-22
Apps/Examples/scene.cpp
Apps/Examples/scene.cpp
+2
-2
Apps/Examples/simpleGMap2.cpp
Apps/Examples/simpleGMap2.cpp
+1
-1
Apps/Examples/squelette3carte.cpp
Apps/Examples/squelette3carte.cpp
+1
-1
Apps/Examples/ter_meshes.cpp
Apps/Examples/ter_meshes.cpp
+2
-2
Apps/Examples/test_mapd1.cpp
Apps/Examples/test_mapd1.cpp
+32
-32
Apps/Examples/triangulation.cpp
Apps/Examples/triangulation.cpp
+2
-2
Apps/Tuto/CMakeLists.txt
Apps/Tuto/CMakeLists.txt
+3
-2
Apps/Tuto/tp_master.cpp
Apps/Tuto/tp_master.cpp
+2
-2
Apps/Tuto/tuto1.cpp
Apps/Tuto/tuto1.cpp
+6
-43
Apps/Tuto/tuto1.h
Apps/Tuto/tuto1.h
+4
-3
Apps/Tuto/tuto2.cpp
Apps/Tuto/tuto2.cpp
+6
-6
Apps/Tuto/tuto3.cpp
Apps/Tuto/tuto3.cpp
+3
-3
Apps/Tuto/tuto4.cpp
Apps/Tuto/tuto4.cpp
+4
-4
Apps/Tuto/tuto5.cpp
Apps/Tuto/tuto5.cpp
+6
-6
Apps/Tuto/tuto5.h
Apps/Tuto/tuto5.h
+1
-0
Apps/Tuto/tuto_mt.cpp
Apps/Tuto/tuto_mt.cpp
+139
-82
Apps/Tuto/tuto_mt.h
Apps/Tuto/tuto_mt.h
+69
-0
Apps/Tuto/tuto_ogl3.cpp
Apps/Tuto/tuto_ogl3.cpp
+53
-71
Apps/Tuto/tuto_ogl3.h
Apps/Tuto/tuto_ogl3.h
+27
-23
Apps/Tuto/tuto_subdivision.cpp
Apps/Tuto/tuto_subdivision.cpp
+1
-1
include/Algo/Decimation/decimation.hpp
include/Algo/Decimation/decimation.hpp
+6
-6
include/Algo/Decimation/halfEdgeSelector.hpp
include/Algo/Decimation/halfEdgeSelector.hpp
+4
-4
include/Algo/Decimation/lightfieldApproximator.hpp
include/Algo/Decimation/lightfieldApproximator.hpp
+14
-14
include/Algo/DecimationVolumique/approximator.hpp
include/Algo/DecimationVolumique/approximator.hpp
+2
-2
include/Algo/DecimationVolumique/decimator.hpp
include/Algo/DecimationVolumique/decimator.hpp
+3
-3
include/Algo/DecimationVolumique/operator.hpp
include/Algo/DecimationVolumique/operator.hpp
+8
-8
include/Algo/DecimationVolumique/selector.hpp
include/Algo/DecimationVolumique/selector.hpp
+2
-2
include/Algo/Export/export.hpp
include/Algo/Export/export.hpp
+61
-61
include/Algo/Export/exportPov.h
include/Algo/Export/exportPov.h
+40
-40
include/Algo/Filters2D/average_normals.hpp
include/Algo/Filters2D/average_normals.hpp
+4
-4
include/Algo/Filters2D/bilateral.hpp
include/Algo/Filters2D/bilateral.hpp
+1
-1
include/Algo/Geometry/inclusion.hpp
include/Algo/Geometry/inclusion.hpp
+5
-5
include/Algo/Geometry/stats.h
include/Algo/Geometry/stats.h
+5
-5
include/Algo/ImplicitHierarchicalMesh/subdivision3.hpp
include/Algo/ImplicitHierarchicalMesh/subdivision3.hpp
+7
-7
include/Algo/Import/import2tablesSurface.hpp
include/Algo/Import/import2tablesSurface.hpp
+53
-25
include/Algo/Import/import2tablesVolume.hpp
include/Algo/Import/import2tablesVolume.hpp
+16
-10
include/Algo/Import/importInESS.hpp
include/Algo/Import/importInESS.hpp
+2
-2
include/Algo/Import/importMesh.hpp
include/Algo/Import/importMesh.hpp
+4
-4
include/Algo/Import/importObjEle.hpp
include/Algo/Import/importObjEle.hpp
+15
-15
include/Algo/Import/importObjTex.hpp
include/Algo/Import/importObjTex.hpp
+6
-6
include/Algo/Import/importTet.hpp
include/Algo/Import/importTet.hpp
+15
-15
include/Algo/Import/importTs.hpp
include/Algo/Import/importTs.hpp
+15
-15
include/Algo/MC/buffer.hpp
include/Algo/MC/buffer.hpp
+3
-3
include/Algo/MC/bufferGen.hpp
include/Algo/MC/bufferGen.hpp
+5
-5
include/Algo/MC/image.hpp
include/Algo/MC/image.hpp
+5
-5
include/Algo/MC/marchingcube.hpp
include/Algo/MC/marchingcube.hpp
+5
-5
include/Algo/MC/marchingcubeGen.hpp
include/Algo/MC/marchingcubeGen.hpp
+5
-5
include/Algo/Modelisation/extrusion.hpp
include/Algo/Modelisation/extrusion.hpp
+2
-2
include/Algo/Modelisation/polyhedron.hpp
include/Algo/Modelisation/polyhedron.hpp
+7
-7
include/Algo/Modelisation/primitives3d.hpp
include/Algo/Modelisation/primitives3d.hpp
+1
-1
include/Algo/Modelisation/subdivision.h
include/Algo/Modelisation/subdivision.h
+4
-4
include/Algo/Modelisation/subdivision.hpp
include/Algo/Modelisation/subdivision.hpp
+3
-3
include/Algo/MovingObjects/particle_cell_2D.hpp
include/Algo/MovingObjects/particle_cell_2D.hpp
+21
-21
include/Algo/MovingObjects/particle_cell_2D_memo.hpp
include/Algo/MovingObjects/particle_cell_2D_memo.hpp
+3
-3
include/Algo/Optimized/optimizedMap.hpp
include/Algo/Optimized/optimizedMap.hpp
+2
-2
include/Algo/ProgressiveMesh/pmesh.hpp
include/Algo/ProgressiveMesh/pmesh.hpp
+17
-17
include/Algo/Render/Deprecated/gl3mapRender.hpp
include/Algo/Render/Deprecated/gl3mapRender.hpp
+4
-4
include/Algo/Render/Deprecated/vbo_MapRender.hpp
include/Algo/Render/Deprecated/vbo_MapRender.hpp
+5
-5
include/Algo/Render/GL1/map_glRender.h
include/Algo/Render/GL1/map_glRender.h
+1
-1
include/Algo/Render/GL1/map_glRender.hpp
include/Algo/Render/GL1/map_glRender.hpp
+2
-2
include/Algo/Render/GL1/renderFunctor.hpp
include/Algo/Render/GL1/renderFunctor.hpp
+6
-6
include/Algo/Render/GL2/mapRender.hpp
include/Algo/Render/GL2/mapRender.hpp
+1
-1
include/Algo/Render/GL2/topo3Render.hpp
include/Algo/Render/GL2/topo3Render.hpp
+1
-1
include/Algo/Render/GL2/topoRender.hpp
include/Algo/Render/GL2/topoRender.hpp
+1
-1
include/Algo/Selection/raySelectFunctor.hpp
include/Algo/Selection/raySelectFunctor.hpp
+4
-4
include/Container/attributeMultiVector.hpp
include/Container/attributeMultiVector.hpp
+9
-9
include/Geometry/intersection.hpp
include/Geometry/intersection.hpp
+6
-6
include/Topology/generic/attribops.h
include/Topology/generic/attribops.h
+32
-10
include/Topology/generic/ecell.hpp
include/Topology/generic/ecell.hpp
+1
-1
include/Topology/generic/embeddedMap2.hpp
include/Topology/generic/embeddedMap2.hpp
+5
-5
No files found.
Apps/Examples/Tests/Geom_inclusion.cpp
View file @
61426fcd
...
...
@@ -30,10 +30,10 @@ using namespace CGoGN;
int
main
()
{
typedef
Geom
::
Vec3f
VEC3
;
std
::
c
out
<<
"Check Geometry/inclusion.h"
<<
std
::
endl
;
std
::
c
out
<<
"Check Status : PARTIAL"
<<
std
::
endl
;
CGoGN
out
<<
"Check Geometry/inclusion.h"
<<
CGoGN
endl
;
CGoGN
out
<<
"Check Status : PARTIAL"
<<
CGoGN
endl
;
std
::
c
out
<<
"Check isPointInTriangle : Start"
<<
std
::
endl
;
CGoGN
out
<<
"Check isPointInTriangle : Start"
<<
CGoGN
endl
;
VEC3
ta
(
0
,
0
,
0
);
VEC3
tb
(
5
,
0
,
0
);
VEC3
tc
(
0
,
5
,
0
);
...
...
@@ -45,51 +45,51 @@ int main()
if
(
Geom
::
isPointInTriangle
<
VEC3
>
(
pIn1
,
ta
,
tb
,
tc
)
!=
Geom
::
FACE_INCLUSION
)
{
std
::
c
out
<<
"ERROR : isPointInTriangle : face inclusion"
<<
std
::
endl
;
CGoGN
out
<<
"ERROR : isPointInTriangle : face inclusion"
<<
CGoGN
endl
;
}
if
(
Geom
::
isPointInTriangle
<
VEC3
>
(
pIn2
,
ta
,
tb
,
tc
)
!=
Geom
::
EDGE_INCLUSION
)
{
std
::
c
out
<<
"ERROR : isPointInTriangle : edge inclusion"
<<
std
::
endl
;
CGoGN
out
<<
"ERROR : isPointInTriangle : edge inclusion"
<<
CGoGN
endl
;
}
if
(
Geom
::
isPointInTriangle
<
VEC3
>
(
pIn3
,
ta
,
tb
,
tc
)
!=
Geom
::
EDGE_INCLUSION
)
{
std
::
c
out
<<
"ERROR : isPointInTriangle : edge inclusion"
<<
std
::
endl
;
CGoGN
out
<<
"ERROR : isPointInTriangle : edge inclusion"
<<
CGoGN
endl
;
}
if
(
Geom
::
isPointInTriangle
<
VEC3
>
(
pIn4
,
ta
,
tb
,
tc
)
!=
Geom
::
EDGE_INCLUSION
)
{
std
::
c
out
<<
"ERROR : isPointInTriangle : edge inclusion"
<<
std
::
endl
;
CGoGN
out
<<
"ERROR : isPointInTriangle : edge inclusion"
<<
CGoGN
endl
;
}
if
(
Geom
::
isPointInTriangle
<
VEC3
>
(
ta
,
ta
,
tb
,
tc
)
!=
Geom
::
VERTEX_INCLUSION
)
{
std
::
c
out
<<
"ERROR : isPointInTriangle : vertex inclusion"
<<
std
::
endl
;
CGoGN
out
<<
"ERROR : isPointInTriangle : vertex inclusion"
<<
CGoGN
endl
;
}
if
(
Geom
::
isPointInTriangle
<
VEC3
>
(
pOut
,
ta
,
tb
,
tc
)
!=
Geom
::
NO_INCLUSION
)
{
std
::
c
out
<<
"ERROR : isPointInTriangle : no inclusion"
<<
std
::
endl
;
CGoGN
out
<<
"ERROR : isPointInTriangle : no inclusion"
<<
CGoGN
endl
;
}
std
::
c
out
<<
"Check isPointInTriangle : Done"
<<
std
::
endl
;
CGoGN
out
<<
"Check isPointInTriangle : Done"
<<
CGoGN
endl
;
// Inclusion isSegmentInTriangle(const VEC3& P1, const VEC3& P2, const VEC3& Ta, const VEC3& Tb, const VEC3& Tc, const VEC3& N) ;
// bool isPointInTetrahedron(VEC3 points[4], VEC3& point, bool CCW) ;
// bool isEdgeInOrIntersectingTetrahedron(VEC3 points[4], VEC3& point1, VEC3& point2, bool CCW) ;
std
::
c
out
<<
"Check arePointsEquals : Start"
<<
std
::
endl
;
CGoGN
out
<<
"Check arePointsEquals : Start"
<<
CGoGN
endl
;
VEC3
p1
(
0
,
0
,
0
);
VEC3
p2
(
0.1
,
0.1
,
0.1
);
if
(
!
Geom
::
arePointsEquals
<
VEC3
>
(
p1
,
p1
)
||
!
Geom
::
arePointsEquals
<
VEC3
>
(
p2
,
p2
)
||
Geom
::
arePointsEquals
<
VEC3
>
(
p1
,
p2
)
||
Geom
::
arePointsEquals
<
VEC3
>
(
p2
,
p1
))
{
std
::
c
out
<<
"ERROR : arePointsEquals"
<<
std
::
endl
;
CGoGN
out
<<
"ERROR : arePointsEquals"
<<
CGoGN
endl
;
}
std
::
c
out
<<
"Check arePointsEquals : Done"
<<
std
::
endl
;
CGoGN
out
<<
"Check arePointsEquals : Done"
<<
CGoGN
endl
;
return
0
;
}
Apps/Examples/Tests/Geom_orientation.cpp
View file @
61426fcd
...
...
@@ -6,8 +6,8 @@ using namespace CGoGN;
int
main
()
{
typedef
Geom
::
Vec3f
VEC3
;
std
::
c
out
<<
"Check Geometry/orientation.h"
<<
std
::
endl
;
std
::
c
out
<<
"Check Status : PARTIAL"
<<
std
::
endl
;
CGoGN
out
<<
"Check Geometry/orientation.h"
<<
CGoGN
endl
;
CGoGN
out
<<
"Check Status : PARTIAL"
<<
CGoGN
endl
;
// OrientationLine testOrientationLines<VEC3>(const VEC3& a, const VEC3& b, const VEC3& c, const VEC3& d);
...
...
@@ -15,17 +15,17 @@ int main()
// Orientation3D testOrientation3D<VEC3>(const VEC3& P, const VEC3& N, const VEC3& PP);
std
::
c
out
<<
"Check testOrientation2D : Start"
<<
std
::
endl
;
CGoGN
out
<<
"Check testOrientation2D : Start"
<<
CGoGN
endl
;
VEC3
p1
(
0
,
0
,
0
);
VEC3
p2
(
5
,
0
,
0
);
VEC3
p3
(
5
,
5
,
0
);
VEC3
p4
(
5
,
10
,
0
);
if
(
Geom
::
testOrientation2D
<
VEC3
>
(
p3
,
p2
,
p1
)
!=
Geom
::
RIGHT
)
{
std
::
c
out
<<
"ERROR : testOrientation2D : testRight"
<<
std
::
endl
;
CGoGN
out
<<
"ERROR : testOrientation2D : testRight"
<<
CGoGN
endl
;
}
if
(
Geom
::
testOrientation2D
<
VEC3
>
(
p1
,
p2
,
p3
)
!=
Geom
::
LEFT
)
{
std
::
c
out
<<
"ERROR : testOrientation2D : testLeft"
<<
std
::
endl
;
CGoGN
out
<<
"ERROR : testOrientation2D : testLeft"
<<
CGoGN
endl
;
}
if
(
Geom
::
testOrientation2D
<
VEC3
>
(
p4
,
p2
,
p3
)
!=
Geom
::
ALIGNED
...
...
@@ -33,10 +33,10 @@ int main()
||
Geom
::
testOrientation2D
<
VEC3
>
(
p3
,
p2
,
p3
)
!=
Geom
::
ALIGNED
||
Geom
::
testOrientation2D
<
VEC3
>
(
p2
,
p2
,
p2
)
!=
Geom
::
ALIGNED
)
{
std
::
c
out
<<
"ERROR : testOrientation2D : testAligned"
<<
std
::
endl
;
CGoGN
out
<<
"ERROR : testOrientation2D : testAligned"
<<
CGoGN
endl
;
}
std
::
c
out
<<
"Check testOrientation2D : Done"
<<
std
::
endl
;
CGoGN
out
<<
"Check testOrientation2D : Done"
<<
CGoGN
endl
;
// bool isTetrahedronWellOriented<VEC3>(const VEC3 points[4], bool CCW = true) ;
...
...
Apps/Examples/Viewer.cpp
View file @
61426fcd
...
...
@@ -249,7 +249,7 @@ void myGlutWin::myKeyboard(unsigned char keycode, int, int)
Algo
::
Modelisation
::
CatmullClarkSubdivision
<
PFP
>
(
myMap
,
position
);
GLint
t2
=
glutGet
(
GLUT_ELAPSED_TIME
);
GLfloat
seconds
=
(
t2
-
t1
)
/
1000.0
f
;
std
::
c
out
<<
"catmull-clark: "
<<
seconds
<<
"sec"
<<
std
::
endl
;
CGoGN
out
<<
"catmull-clark: "
<<
seconds
<<
"sec"
<<
CGoGN
endl
;
Algo
::
Geometry
::
computeNormalVertices
<
PFP
>
(
myMap
,
position
,
normal
)
;
...
...
@@ -266,7 +266,7 @@ void myGlutWin::myKeyboard(unsigned char keycode, int, int)
Algo
::
Modelisation
::
LoopSubdivision
<
PFP
>
(
myMap
,
position
);
GLint
t2
=
glutGet
(
GLUT_ELAPSED_TIME
);
GLfloat
seconds
=
(
t2
-
t1
)
/
1000.0
f
;
std
::
c
out
<<
"loop: "
<<
seconds
<<
"sec"
<<
std
::
endl
;
CGoGN
out
<<
"loop: "
<<
seconds
<<
"sec"
<<
CGoGN
endl
;
Algo
::
Geometry
::
computeNormalVertices
<
PFP
>
(
myMap
,
position
,
normal
,
allDarts
)
;
...
...
@@ -279,7 +279,7 @@ void myGlutWin::myKeyboard(unsigned char keycode, int, int)
Algo
::
Modelisation
::
Sqrt3Subdivision
<
PFP
>
(
myMap
,
position
);
GLint
t2
=
glutGet
(
GLUT_ELAPSED_TIME
);
GLfloat
seconds
=
(
t2
-
t1
)
/
1000.0
f
;
std
::
c
out
<<
"dual: "
<<
seconds
<<
"sec"
<<
std
::
endl
;
CGoGN
out
<<
"dual: "
<<
seconds
<<
"sec"
<<
CGoGN
endl
;
Algo
::
Geometry
::
computeNormalVertices
<
PFP
>
(
myMap
,
position
,
normal
,
allDarts
)
;
...
...
@@ -334,17 +334,17 @@ int main(int argc, char **argv)
{
position
=
myMap
.
addAttribute
<
Geom
::
Vec3f
>
(
VERTEX_ORBIT
,
"position"
);
std
::
c
out
<<
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
<<
std
::
endl
;
CGoGN
out
<<
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
<<
CGoGN
endl
;
// typedef uint8 DATATYPE;
// Algo::MC::Image<DATATYPE> myImg;
// myImg.loadPNG3D("liver.png");
//
//
std::c
out << "Image chargee"<<
std::
endl;
//
std::c
out << myImg.getWidthX() <<"x"<< myImg.getWidthY() <<"x"<< myImg.getWidthZ() << "voxels"<<
std::
endl;
//
CGoGN
out << "Image chargee"<<
CGoGN
endl;
//
CGoGN
out << myImg.getWidthX() <<"x"<< myImg.getWidthY() <<"x"<< myImg.getWidthZ() << "voxels"<<
CGoGN
endl;
//
// // ajouté pour vérifier que ça marche sur les images non bool
//// myImg.Blur3();
////
std::c
out << "Image lissee"<<
std::
endl;
////
CGoGN
out << "Image lissee"<<
CGoGN
endl;
//
// // fonction de fenetrage de type superieur à ...
// Algo::MC::WindowingGreater<DATATYPE> myWindFunc;
...
...
@@ -353,13 +353,13 @@ int main(int argc, char **argv)
// myWindFunc.setIsoValue(DATATYPE(127));
//
// // instanciation du mc
//
std::c
out << "mc init"<<
std::
endl;
//
CGoGN
out << "mc init"<<
CGoGN
endl;
// Algo::MC::MarchingCube<DATATYPE,Algo::MC::WindowingGreater,PFP> mc(&myImg, &myMap, position, myWindFunc, false);
// // MarchingCube<DATATYPE,WindowingDiff> mc(&myImg, &myMap, myWindFunc, false);
//
// // realisation du maillage
// mc.simpleMeshing();
//
std::c
out << "mc ok"<<
std::
endl;
//
CGoGN
out << "mc ok"<<
CGoGN
endl;
// typedef float DATATYPE;
//
...
...
@@ -371,7 +371,7 @@ int main(int argc, char **argv)
//
// Scal3D myImg(256);
//
//
std::c
out << "mc init"<<
std::
endl;
//
CGoGN
out << "mc init"<<
CGoGN
endl;
// Algo::MC::MarchingCubeGen<DATATYPE, Scal3D, Algo::MC::WindowingGreater,PFP> mc(&myImg, &myMap, position, myWindFunc, false);
//
// //realisation du maillage
...
...
@@ -431,7 +431,7 @@ int main(int argc, char **argv)
//
// GLint t2 = glutGet(GLUT_ELAPSED_TIME);
// GLfloat seconds = (t2 - t1) / 1000.0f;
//
std::c
out << "triangulation: "<< seconds << "sec" <<
std::
endl;
//
CGoGN
out << "triangulation: "<< seconds << "sec" <<
CGoGN
endl;
//
// Marker m = myMap.getNewMarker(VERTEX_ORBIT);
// myMap.markEmbVertex(myMap.begin(),m);
...
...
@@ -439,12 +439,12 @@ int main(int argc, char **argv)
// Dart xd = myMap.alpha1(myMap.begin());
// if (myMap.isMarkedEmbVertex(xd,m))
// {
//
std::c
out << "Marke"<<
std::
endl;
//
CGoGN
out << "Marke"<<
CGoGN
endl;
// }
// xd = myMap.phi2(xd);
// if (myMap.isMarkedEmbVertex(xd,m))
// {
//
std::c
out << "Marke aussi"<<
std::
endl;
//
CGoGN
out << "Marke aussi"<<
CGoGN
endl;
// }
//
// myMap.clearEmbMarkers(m,VERTEX_ORBIT);
...
...
@@ -459,7 +459,7 @@ int main(int argc, char **argv)
std
::
vector
<
std
::
string
>
attrNames
;
if
(
!
Algo
::
Import
::
importMesh
<
PFP
>
(
myMap
,
std
::
string
(
argv
[
1
]),
attrNames
))
{
std
::
c
err
<<
"could not import "
<<
std
::
string
(
argv
[
1
])
<<
std
::
endl
;
CGoGN
err
<<
"could not import "
<<
std
::
string
(
argv
[
1
])
<<
CGoGN
endl
;
exit
(
1
);
}
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
VERTEX_ORBIT
,
attrNames
[
0
])
;
...
...
@@ -487,7 +487,7 @@ int main(int argc, char **argv)
GLint
t2
=
glutGet
(
GLUT_ELAPSED_TIME
);
GLfloat
seconds
=
(
t2
-
t1
)
/
1000.0
f
;
std
::
c
out
<<
"subdiv: "
<<
seconds
<<
"sec"
<<
std
::
endl
;
CGoGN
out
<<
"subdiv: "
<<
seconds
<<
"sec"
<<
CGoGN
endl
;
// myMap.getAttributeContainer(VERTEX_ORBIT).toggleProcess(position);
...
...
@@ -498,22 +498,22 @@ int main(int argc, char **argv)
// Algo::Modelisation::triangleSubdivide<PFP, PFP::EVERTEX, PFP::EVERTEX>(myMap,ec);
// Algo::Modelisation::triangleSubdivide<PFP, PFP::EVERTEX, PFP::EVERTEX>(myMap,ec);
std
::
c
out
<<
"Nombre de sommets plonges "
<<
myMap
.
getNbCells
(
VERTEX_ORBIT
)
<<
std
::
endl
;
std
::
c
out
<<
"Nombre de sommets topo: "
<<
myMap
.
getNbOrbits
(
0
)
<<
std
::
endl
;
std
::
c
out
<<
"Nombre de faces topo: "
<<
myMap
.
getNbOrbits
(
2
)
<<
std
::
endl
;
CGoGN
out
<<
"Nombre de sommets plonges "
<<
myMap
.
getNbCells
(
VERTEX_ORBIT
)
<<
CGoGN
endl
;
CGoGN
out
<<
"Nombre de sommets topo: "
<<
myMap
.
getNbOrbits
(
0
)
<<
CGoGN
endl
;
CGoGN
out
<<
"Nombre de faces topo: "
<<
myMap
.
getNbOrbits
(
2
)
<<
CGoGN
endl
;
// GLint t2 = glutGet(GLUT_ELAPSED_TIME);
// GLfloat seconds = (t2 - t1) / 1000.0f;
//
std::c
out << "import: "<< seconds << "sec" <<
std::
endl;
//
CGoGN
out << "import: "<< seconds << "sec" <<
CGoGN
endl;
}
float
area
=
Algo
::
Geometry
::
totalArea
<
PFP
>
(
myMap
,
position
)
;
std
::
c
out
<<
"total area = "
<<
area
<<
std
::
endl
;
CGoGN
out
<<
"total area = "
<<
area
<<
CGoGN
endl
;
bool
inter
=
Algo
::
Geometry
::
areTrianglesInIntersection
<
PFP
>
(
myMap
,
0
,
10
,
position
)
;
std
::
c
out
<<
"intersection = "
<<
inter
<<
std
::
endl
;
CGoGN
out
<<
"intersection = "
<<
inter
<<
CGoGN
endl
;
normal
=
myMap
.
addAttribute
<
Geom
::
Vec3f
>
(
VERTEX_ORBIT
,
"normals"
);
// PFP::NORMAL normal(normal,myMap);
...
...
@@ -526,17 +526,17 @@ int main(int argc, char **argv)
// for (Dart dd=myMap.begin(); dd!= myMap.end(); myMap.next(dd))
// {
// unsigned int a = myMap.getEmbedding(dd, 0);
//
std::c
out << "dart:"<<dd.index<< " / ";
//
std::c
out << "emb:"<<a<< " / ";
//
std::c
out<<position[a]<< " / ";
//
std::c
out << tm[a]<<
std::
endl;
//
CGoGN
out << "dart:"<<dd.index<< " / ";
//
CGoGN
out << "emb:"<<a<< " / ";
//
CGoGN
out<<position[a]<< " / ";
//
CGoGN
out << tm[a]<<
CGoGN
endl;
// }
Geom
::
BoundingBox
<
PFP
::
VEC3
>
bb
=
Algo
::
Geometry
::
computeBoundingBox
<
PFP
>
(
myMap
,
position
);
std
::
c
out
<<
"BB: "
<<
bb
.
min
()
<<
" / "
<<
bb
.
max
()
<<
std
::
endl
;
CGoGN
out
<<
"BB: "
<<
bb
.
min
()
<<
" / "
<<
bb
.
max
()
<<
CGoGN
endl
;
// compute width and position of object for centering
...
...
Apps/Examples/decimationVolumique.cpp
View file @
61426fcd
...
...
@@ -237,13 +237,13 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
{
int
nbVertices
=
myMap
.
getNbOrbits
(
VERTEX_ORBIT
)
;
std
::
c
out
<<
"nb darts = "
<<
myMap
.
getNbOrbits
(
DART_ORBIT
)
<<
std
::
endl
;
CGoGN
out
<<
"nb darts = "
<<
myMap
.
getNbOrbits
(
DART_ORBIT
)
<<
CGoGN
endl
;
GLint
t1
=
glutGet
(
GLUT_ELAPSED_TIME
);
Algo
::
DecimationVolumique
::
decimate
<
PFP
>
(
myMap
,
Algo
::
DecimationVolumique
::
S_Random
,
Algo
::
DecimationVolumique
::
A_Centroid
,
position
,
nbVertices
*
0.75
);
GLint
t2
=
glutGet
(
GLUT_ELAPSED_TIME
);
GLfloat
seconds
=
(
t2
-
t1
)
/
1000.0
f
;
std
::
c
out
<<
"decimation: "
<<
seconds
<<
"sec"
<<
std
::
endl
;
CGoGN
out
<<
"decimation: "
<<
seconds
<<
"sec"
<<
CGoGN
endl
;
break
;
}
case
'h'
:
...
...
@@ -253,7 +253,7 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
}
default
:
{
std
::
c
out
<<
"not implemented"
<<
std
::
endl
;
CGoGN
out
<<
"not implemented"
<<
CGoGN
endl
;
break
;
}
...
...
@@ -274,21 +274,21 @@ void MyGlutWin::initRender()
m_render
->
updateData
(
Algo
::
Render
::
GL2
::
POSITIONS
,
position
);
GLint
t2
=
glutGet
(
GLUT_ELAPSED_TIME
);
GLfloat
seconds
=
(
t2
-
t1
)
/
1000.0
f
;
std
::
c
out
<<
"updateData: "
<<
seconds
<<
"sec"
<<
std
::
endl
;
CGoGN
out
<<
"updateData: "
<<
seconds
<<
"sec"
<<
CGoGN
endl
;
// creation des primitives de rendu a partir de la carte
t1
=
glutGet
(
GLUT_ELAPSED_TIME
);
m_render
->
initPrimitives
<
PFP
>
(
myMap
,
allDarts
,
Algo
::
Render
::
GL2
::
TRIANGLES
);
m_render
->
initPrimitives
<
PFP
>
(
myMap
,
allDarts
,
Algo
::
Render
::
GL2
::
LINES
);
t2
=
glutGet
(
GLUT_ELAPSED_TIME
);
seconds
=
(
t2
-
t1
)
/
1000.0
f
;
std
::
c
out
<<
"initPrimitives: "
<<
seconds
<<
"sec"
<<
std
::
endl
;
CGoGN
out
<<
"initPrimitives: "
<<
seconds
<<
"sec"
<<
CGoGN
endl
;
// creation des primitives de rendu de la topologie a partir de la carte
t1
=
glutGet
(
GLUT_ELAPSED_TIME
);
//m_render_topo->updateData<PFP>(myMap,allDarts,position,coefTopoExplod[0],coefTopoExplod[1],coefTopoExplod[2]);
t2
=
glutGet
(
GLUT_ELAPSED_TIME
);
seconds
=
(
t2
-
t1
)
/
1000.0
f
;
std
::
c
out
<<
"map update: "
<<
seconds
<<
"sec"
<<
std
::
endl
;
CGoGN
out
<<
"map update: "
<<
seconds
<<
"sec"
<<
CGoGN
endl
;
}
void
MyGlutWin
::
initGUI
()
...
...
@@ -354,18 +354,18 @@ int main(int argc, char **argv)
std
::
vector
<
std
::
string
>
attrNames
;
if
(
argc
<
2
)
{
std
::
c
err
<<
"usage : "
<<
argv
[
0
]
<<
" -off"
<<
std
::
endl
;
std
::
c
err
<<
"or"
<<
std
::
endl
;
std
::
c
err
<<
"usage : "
<<
argv
[
0
]
<<
" -tet"
<<
std
::
endl
;
std
::
c
err
<<
"or"
<<
std
::
endl
;
std
::
c
err
<<
"usage : "
<<
argv
[
0
]
<<
" -ts"
<<
std
::
endl
;
CGoGN
err
<<
"usage : "
<<
argv
[
0
]
<<
" -off"
<<
CGoGN
endl
;
CGoGN
err
<<
"or"
<<
CGoGN
endl
;
CGoGN
err
<<
"usage : "
<<
argv
[
0
]
<<
" -tet"
<<
CGoGN
endl
;
CGoGN
err
<<
"or"
<<
CGoGN
endl
;
CGoGN
err
<<
"usage : "
<<
argv
[
0
]
<<
" -ts"
<<
CGoGN
endl
;
return
1
;
}
else
if
(
std
::
string
(
argv
[
1
])
==
"-off"
)
{
std
::
c
out
<<
argv
[
1
]
<<
std
::
endl
;
CGoGN
out
<<
argv
[
1
]
<<
CGoGN
endl
;
if
(
argc
!=
4
)
{
std
::
c
err
<<
"usage : "
<<
argv
[
0
]
<<
" -off <filename.off> <filename.ele>"
<<
std
::
endl
;
CGoGN
err
<<
"usage : "
<<
argv
[
0
]
<<
" -off <filename.off> <filename.ele>"
<<
CGoGN
endl
;
return
1
;
}
...
...
@@ -375,7 +375,7 @@ int main(int argc, char **argv)
else
if
(
std
::
string
(
argv
[
1
])
==
"-tet"
)
{
if
(
argc
!=
3
)
{
std
::
c
err
<<
"usage : "
<<
argv
[
0
]
<<
" -tet <filename.tet>"
<<
std
::
endl
;
CGoGN
err
<<
"usage : "
<<
argv
[
0
]
<<
" -tet <filename.tet>"
<<
CGoGN
endl
;
return
1
;
}
...
...
@@ -385,7 +385,7 @@ int main(int argc, char **argv)
else
if
(
std
::
string
(
argv
[
1
])
==
"-ts"
)
{
if
(
argc
!=
3
)
{
std
::
c
err
<<
"usage : "
<<
argv
[
0
]
<<
" -ts <filename.ts>"
<<
std
::
endl
;
CGoGN
err
<<
"usage : "
<<
argv
[
0
]
<<
" -ts <filename.ts>"
<<
CGoGN
endl
;
return
1
;
}
...
...
@@ -399,9 +399,9 @@ int main(int argc, char **argv)
maillageTest
();
}
//
std::c
out << "Nb Tetrahedron = " << myMap.getNbOrbits(VOLUME_ORBIT) <<
std::
endl;
//
CGoGN
out << "Nb Tetrahedron = " << myMap.getNbOrbits(VOLUME_ORBIT) <<
CGoGN
endl;
// " / Nb Edges = " << myMap.getNbOrbits(EDGE_ORBIT) <<
// " / Nb Vertices = " << myMap.getNbOrbits(VERTEX_ORBIT) <<
std::
endl;
// " / Nb Vertices = " << myMap.getNbOrbits(VERTEX_ORBIT) <<
CGoGN
endl;
// un peu d'interface
MyGlutWin
*
mgw
=
new
MyGlutWin
(
&
argc
,
argv
,
1200
,
800
);
...
...
Apps/Examples/miniTest.cpp
View file @
61426fcd
...
...
@@ -439,7 +439,7 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
GLint
t2
=
glutGet
(
GLUT_ELAPSED_TIME
)
;
GLfloat
seconds
=
(
t2
-
t1
)
/
1000.0
f
;
std
::
c
out
<<
"loop: "
<<
seconds
<<
"sec"
<<
std
::
endl
;
CGoGN
out
<<
"loop: "
<<
seconds
<<
"sec"
<<
CGoGN
endl
;
t1
=
glutGet
(
GLUT_ELAPSED_TIME
)
;
...
...
@@ -449,7 +449,7 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
t2
=
glutGet
(
GLUT_ELAPSED_TIME
)
;
seconds
=
(
t2
-
t1
)
/
1000.0
f
;
std
::
c
out
<<
"display update: "
<<
seconds
<<
"sec"
<<
std
::
endl
;
CGoGN
out
<<
"display update: "
<<
seconds
<<
"sec"
<<
CGoGN
endl
;
glutPostRedisplay
()
;
break
;
...
...
@@ -463,7 +463,7 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
GLint
t2
=
glutGet
(
GLUT_ELAPSED_TIME
)
;
GLfloat
seconds
=
(
t2
-
t1
)
/
1000.0
f
;
std
::
c
out
<<
"catmull-clark: "
<<
seconds
<<
"sec"
<<
std
::
endl
;
CGoGN
out
<<
"catmull-clark: "
<<
seconds
<<
"sec"
<<
CGoGN
endl
;
t1
=
glutGet
(
GLUT_ELAPSED_TIME
)
;
...
...
@@ -473,7 +473,7 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
t2
=
glutGet
(
GLUT_ELAPSED_TIME
)
;
seconds
=
(
t2
-
t1
)
/
1000.0
f
;
std
::
c
out
<<
"display update: "
<<
seconds
<<
"sec"
<<
std
::
endl
;
CGoGN
out
<<
"display update: "
<<
seconds
<<
"sec"
<<
CGoGN
endl
;
glutPostRedisplay
()
;
break
;
...
...
@@ -487,7 +487,7 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
GLint
t2
=
glutGet
(
GLUT_ELAPSED_TIME
)
;
GLfloat
seconds
=
(
t2
-
t1
)
/
1000.0
f
;
std
::
c
out
<<
"sqrt3: "
<<
seconds
<<
"sec"
<<
std
::
endl
;
CGoGN
out
<<
"sqrt3: "
<<
seconds
<<
"sec"
<<
CGoGN
endl
;
normal
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
VERTEX_ORBIT
,
"normal"
)
;
if
(
!
normal
.
isValid
())
...
...
@@ -504,7 +504,7 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
t2
=
glutGet
(
GLUT_ELAPSED_TIME
)
;
seconds
=
(
t2
-
t1
)
/
1000.0
f
;
std
::
c
out
<<
"display update: "
<<
seconds
<<
"sec"
<<
std
::
endl
;
CGoGN
out
<<
"display update: "
<<
seconds
<<
"sec"
<<
CGoGN
endl
;
glutPostRedisplay
()
;
break
;
...
...
@@ -518,7 +518,7 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
GLint
t2
=
glutGet
(
GLUT_ELAPSED_TIME
)
;
GLfloat
seconds
=
(
t2
-
t1
)
/
1000.0
f
;
std
::
c
out
<<
"triangulation: "
<<
seconds
<<
"sec"
<<
std
::
endl
;
CGoGN
out
<<
"triangulation: "
<<
seconds
<<
"sec"
<<
CGoGN
endl
;
t1
=
glutGet
(
GLUT_ELAPSED_TIME
)
;
...
...
@@ -528,7 +528,7 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
t2
=
glutGet
(
GLUT_ELAPSED_TIME
)
;
seconds
=
(
t2
-
t1
)
/
1000.0
f
;
std
::
c
out
<<
"display update: "
<<
seconds
<<
"sec"
<<
std
::
endl
;
CGoGN
out
<<
"display update: "
<<
seconds
<<
"sec"
<<
CGoGN
endl
;
glutPostRedisplay
()
;
break
;
...
...
@@ -542,7 +542,7 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
GLint
t2
=
glutGet
(
GLUT_ELAPSED_TIME
)
;
GLfloat
seconds
=
(
t2
-
t1
)
/
1000.0
f
;
std
::
c
out
<<
"quadrangulation: "
<<
seconds
<<
"sec"
<<
std
::
endl
;
CGoGN
out
<<
"quadrangulation: "
<<
seconds
<<
"sec"
<<
CGoGN
endl
;
t1
=
glutGet
(
GLUT_ELAPSED_TIME
)
;
...
...
@@ -552,7 +552,7 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
t2
=
glutGet
(
GLUT_ELAPSED_TIME
)
;
seconds
=
(
t2
-
t1
)
/
1000.0
f
;
std
::
c
out
<<
"display update: "
<<
seconds
<<
"sec"
<<
std
::
endl
;
CGoGN
out
<<
"display update: "
<<
seconds
<<
"sec"
<<
CGoGN
endl
;
glutPostRedisplay
()
;
break
;
...
...
@@ -568,7 +568,7 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
GLint
t2
=
glutGet
(
GLUT_ELAPSED_TIME
)
;
GLfloat
seconds
=
(
t2
-
t1
)
/
1000.0
f
;
std
::
c
out
<<
"decimation: "
<<
seconds
<<
"sec"
<<
std
::
endl
;
CGoGN
out
<<
"decimation: "
<<
seconds
<<
"sec"
<<
CGoGN
endl
;
t1
=
glutGet
(
GLUT_ELAPSED_TIME
)
;
...
...
@@ -578,7 +578,7 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
t2
=
glutGet
(
GLUT_ELAPSED_TIME
)
;
seconds
=
(
t2
-
t1
)
/
1000.0
f
;
std
::
c
out
<<
"display update: "
<<
seconds
<<
"sec"
<<
std
::
endl
;
CGoGN
out
<<
"display update: "
<<
seconds
<<
"sec"
<<
CGoGN
endl
;
glutPostRedisplay
()
;
break
;
...
...
@@ -597,7 +597,7 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
GLint
t2
=
glutGet
(
GLUT_ELAPSED_TIME
)
;
GLfloat
seconds
=
(
t2
-
t1
)
/
1000.0
f
;
std
::
c
out
<<
"dual computation: "
<<
seconds
<<
"sec"
<<
std
::
endl
;
CGoGN
out
<<
"dual computation: "
<<
seconds
<<
"sec"
<<
CGoGN
endl
;
position
=
positionF
;
...
...
@@ -616,7 +616,7 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
t2
=
glutGet
(
GLUT_ELAPSED_TIME
)
;
seconds
=
(
t2
-
t1
)
/
1000.0
f
;
std
::
c
out
<<
"display update: "
<<
seconds
<<
"sec"
<<
std
::
endl
;
CGoGN
out
<<
"display update: "
<<
seconds
<<
"sec"
<<
CGoGN
endl
;
glutPostRedisplay
()
;
break
;
...
...
@@ -631,7 +631,7 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
GLint
t2
=
glutGet
(
GLUT_ELAPSED_TIME
)
;
GLfloat
seconds
=
(
t2
-
t1
)
/
1000.0
f
;
std
::
c
out
<<
"pliant remeshing: "
<<
seconds
<<
"sec"
<<
std
::
endl
;
CGoGN
out
<<
"pliant remeshing: "
<<
seconds
<<
"sec"
<<
CGoGN
endl
;
t1
=
glutGet
(
GLUT_ELAPSED_TIME
)
;
...
...
@@ -641,7 +641,7 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
t2
=
glutGet
(
GLUT_ELAPSED_TIME
)
;
seconds
=
(
t2
-
t1
)
/
1000.0
f
;
std
::
c
out
<<
"display update: "
<<
seconds
<<
"sec"
<<
std
::
endl
;
CGoGN
out
<<
"display update: "
<<
seconds
<<
"sec"
<<
CGoGN
endl
;
glutPostRedisplay
()
;
break
;
...
...
@@ -802,26 +802,26 @@ int main(int argc, char** argv)
std
::
vector
<
std
::
string
>
attrNames
;
if
(
!
Algo
::
Import
::
importMesh
<
PFP
>
(
myMap
,
filename
,
attrNames
))
{
std
::
c
err
<<
"could not import "
<<
filename
<<
std
::
endl
;
CGoGN
err
<<
"could not import "
<<
filename
<<
CGoGN
endl
;
return
1
;
}
mgw
->
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
VERTEX_ORBIT
,
attrNames
[
0
])
;
GLint
t2
=
glutGet
(
GLUT_ELAPSED_TIME
)
;
GLfloat
seconds
=
(
t2
-
t1
)
/
1000.0
f
;
std
::
c
out
<<
"import: "
<<
seconds
<<
" sec"
<<
std
::
endl
;
CGoGN
out
<<
"import: "
<<
seconds
<<
" sec"
<<
CGoGN
endl
;
// DartMarker m(myMap) ;
// myMap.closeMap(m) ;
}
std
::
c
out
<<
myMap
.
getNbOrbits
(
VERTEX_ORBIT
)
<<
std
::
endl
;
std
::
c
out
<<
myMap
.
getNbOrbits
(
EDGE_ORBIT
)
<<
std
::
endl
;
std
::
c
out
<<
myMap
.
getNbOrbits
(
FACE_ORBIT
)
<<
std
::
endl
;
CGoGN
out
<<
myMap
.
getNbOrbits
(
VERTEX_ORBIT
)
<<
CGoGN
endl
;
CGoGN
out
<<
myMap
.
getNbOrbits
(
EDGE_ORBIT
)
<<
CGoGN
endl
;
CGoGN
out
<<
myMap
.
getNbOrbits
(
FACE_ORBIT
)
<<
CGoGN
endl
;
// compute width and position of object for centering
Geom
::
BoundingBox
<
PFP
::
VEC3
>
bb
=
Algo
::
Geometry
::
computeBoundingBox
<
PFP
>
(
myMap
,
mgw
->
position
)
;
std
::
c
out
<<
bb
<<
std
::
endl
;
CGoGN
out
<<
bb
<<
CGoGN
endl
;
mgw
->
gPosObj
=
bb
.
center
()
;
float
tailleX
=
bb
.
size
(
0
)
;
...
...
Apps/Examples/scene.cpp
View file @
61426fcd
...
...
@@ -117,7 +117,7 @@ public:
void
myGlutWin
::
exitCallback
()
{
std
::
c
out
<<
"DESTRUCTOR"
<<
std
::
endl
;
CGoGN
out
<<
"DESTRUCTOR"
<<
CGoGN
endl
;
eraseGraph
(
root
);
// if (m_render)
// delete m_render;
...
...
@@ -217,7 +217,7 @@ int main(int argc, char **argv)
glewInit
();
if
(
!
Utils
::
GLSLShader
::
areShadersSupported
())
{
std
::
c
err
<<
"Shaders not supported"
<<
std
::
endl
;