Commit 61426fcd authored by Sylvain Thery's avatar Sylvain Thery
Browse files

Utilisation des CGoGNStream partout !

Utilisation possible (encore) de GL 1
parent 47d0007d
...@@ -30,10 +30,10 @@ using namespace CGoGN; ...@@ -30,10 +30,10 @@ using namespace CGoGN;
int main() int main()
{ {
typedef Geom::Vec3f VEC3; typedef Geom::Vec3f VEC3;
std::cout << "Check Geometry/inclusion.h" << std::endl; CGoGNout << "Check Geometry/inclusion.h" << CGoGNendl;
std::cout << "Check Status : PARTIAL" << std::endl; CGoGNout << "Check Status : PARTIAL" << CGoGNendl;
std::cout << "Check isPointInTriangle : Start" << std::endl; CGoGNout << "Check isPointInTriangle : Start" << CGoGNendl;
VEC3 ta(0,0,0); VEC3 ta(0,0,0);
VEC3 tb(5,0,0); VEC3 tb(5,0,0);
VEC3 tc(0,5,0); VEC3 tc(0,5,0);
...@@ -45,51 +45,51 @@ int main() ...@@ -45,51 +45,51 @@ int main()
if(Geom::isPointInTriangle<VEC3>(pIn1,ta,tb,tc)!=Geom::FACE_INCLUSION) if(Geom::isPointInTriangle<VEC3>(pIn1,ta,tb,tc)!=Geom::FACE_INCLUSION)
{ {
std::cout << "ERROR : isPointInTriangle : face inclusion" << std::endl; CGoGNout << "ERROR : isPointInTriangle : face inclusion" << CGoGNendl;
} }
if(Geom::isPointInTriangle<VEC3>(pIn2,ta,tb,tc)!=Geom::EDGE_INCLUSION) if(Geom::isPointInTriangle<VEC3>(pIn2,ta,tb,tc)!=Geom::EDGE_INCLUSION)
{ {
std::cout << "ERROR : isPointInTriangle : edge inclusion" << std::endl; CGoGNout << "ERROR : isPointInTriangle : edge inclusion" << CGoGNendl;
} }
if(Geom::isPointInTriangle<VEC3>(pIn3,ta,tb,tc)!=Geom::EDGE_INCLUSION) if(Geom::isPointInTriangle<VEC3>(pIn3,ta,tb,tc)!=Geom::EDGE_INCLUSION)
{ {
std::cout << "ERROR : isPointInTriangle : edge inclusion" << std::endl; CGoGNout << "ERROR : isPointInTriangle : edge inclusion" << CGoGNendl;
} }
if(Geom::isPointInTriangle<VEC3>(pIn4,ta,tb,tc)!=Geom::EDGE_INCLUSION) if(Geom::isPointInTriangle<VEC3>(pIn4,ta,tb,tc)!=Geom::EDGE_INCLUSION)
{ {
std::cout << "ERROR : isPointInTriangle : edge inclusion" << std::endl; CGoGNout << "ERROR : isPointInTriangle : edge inclusion" << CGoGNendl;
} }
if(Geom::isPointInTriangle<VEC3>(ta,ta,tb,tc)!=Geom::VERTEX_INCLUSION) if(Geom::isPointInTriangle<VEC3>(ta,ta,tb,tc)!=Geom::VERTEX_INCLUSION)
{ {
std::cout << "ERROR : isPointInTriangle : vertex inclusion" << std::endl; CGoGNout << "ERROR : isPointInTriangle : vertex inclusion" << CGoGNendl;
} }
if(Geom::isPointInTriangle<VEC3>(pOut,ta,tb,tc)!=Geom::NO_INCLUSION) if(Geom::isPointInTriangle<VEC3>(pOut,ta,tb,tc)!=Geom::NO_INCLUSION)
{ {
std::cout << "ERROR : isPointInTriangle : no inclusion" << std::endl; CGoGNout << "ERROR : isPointInTriangle : no inclusion" << CGoGNendl;
} }
std::cout << "Check isPointInTriangle : Done" << std::endl; CGoGNout << "Check isPointInTriangle : Done" << CGoGNendl;
// Inclusion isSegmentInTriangle(const VEC3& P1, const VEC3& P2, const VEC3& Ta, const VEC3& Tb, const VEC3& Tc, const VEC3& N) ; // 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 isPointInTetrahedron(VEC3 points[4], VEC3& point, bool CCW) ;
// bool isEdgeInOrIntersectingTetrahedron(VEC3 points[4], VEC3& point1, VEC3& point2, bool CCW) ; // bool isEdgeInOrIntersectingTetrahedron(VEC3 points[4], VEC3& point1, VEC3& point2, bool CCW) ;
std::cout << "Check arePointsEquals : Start" << std::endl; CGoGNout << "Check arePointsEquals : Start" << CGoGNendl;
VEC3 p1(0,0,0); VEC3 p1(0,0,0);
VEC3 p2(0.1,0.1,0.1); VEC3 p2(0.1,0.1,0.1);
if(!Geom::arePointsEquals<VEC3>(p1,p1) || !Geom::arePointsEquals<VEC3>(p2,p2) if(!Geom::arePointsEquals<VEC3>(p1,p1) || !Geom::arePointsEquals<VEC3>(p2,p2)
|| Geom::arePointsEquals<VEC3>(p1,p2) || Geom::arePointsEquals<VEC3>(p2,p1)) || Geom::arePointsEquals<VEC3>(p1,p2) || Geom::arePointsEquals<VEC3>(p2,p1))
{ {
std::cout << "ERROR : arePointsEquals" << std::endl; CGoGNout << "ERROR : arePointsEquals" << CGoGNendl;
} }
std::cout << "Check arePointsEquals : Done" << std::endl; CGoGNout << "Check arePointsEquals : Done" << CGoGNendl;
return 0; return 0;
} }
...@@ -6,8 +6,8 @@ using namespace CGoGN; ...@@ -6,8 +6,8 @@ using namespace CGoGN;
int main() int main()
{ {
typedef Geom::Vec3f VEC3; typedef Geom::Vec3f VEC3;
std::cout << "Check Geometry/orientation.h" << std::endl; CGoGNout << "Check Geometry/orientation.h" << CGoGNendl;
std::cout << "Check Status : PARTIAL" << std::endl; CGoGNout << "Check Status : PARTIAL" << CGoGNendl;
// OrientationLine testOrientationLines<VEC3>(const VEC3& a, const VEC3& b, const VEC3& c, const VEC3& d); // OrientationLine testOrientationLines<VEC3>(const VEC3& a, const VEC3& b, const VEC3& c, const VEC3& d);
...@@ -15,17 +15,17 @@ int main() ...@@ -15,17 +15,17 @@ int main()
// Orientation3D testOrientation3D<VEC3>(const VEC3& P, const VEC3& N, const VEC3& PP); // Orientation3D testOrientation3D<VEC3>(const VEC3& P, const VEC3& N, const VEC3& PP);
std::cout << "Check testOrientation2D : Start" << std::endl; CGoGNout << "Check testOrientation2D : Start" << CGoGNendl;
VEC3 p1(0,0,0); VEC3 p1(0,0,0);
VEC3 p2(5,0,0); VEC3 p2(5,0,0);
VEC3 p3(5,5,0); VEC3 p3(5,5,0);
VEC3 p4(5,10,0); VEC3 p4(5,10,0);
if(Geom::testOrientation2D<VEC3>(p3,p2,p1)!= Geom::RIGHT) { if(Geom::testOrientation2D<VEC3>(p3,p2,p1)!= Geom::RIGHT) {
std::cout << "ERROR : testOrientation2D : testRight" << std::endl; CGoGNout << "ERROR : testOrientation2D : testRight" << CGoGNendl;
} }
if(Geom::testOrientation2D<VEC3>(p1,p2,p3)!= Geom::LEFT) { if(Geom::testOrientation2D<VEC3>(p1,p2,p3)!= Geom::LEFT) {
std::cout << "ERROR : testOrientation2D : testLeft" << std::endl; CGoGNout << "ERROR : testOrientation2D : testLeft" << CGoGNendl;
} }
if(Geom::testOrientation2D<VEC3>(p4,p2,p3)!= Geom::ALIGNED if(Geom::testOrientation2D<VEC3>(p4,p2,p3)!= Geom::ALIGNED
...@@ -33,10 +33,10 @@ int main() ...@@ -33,10 +33,10 @@ int main()
|| Geom::testOrientation2D<VEC3>(p3,p2,p3)!= Geom::ALIGNED || Geom::testOrientation2D<VEC3>(p3,p2,p3)!= Geom::ALIGNED
|| Geom::testOrientation2D<VEC3>(p2,p2,p2)!= Geom::ALIGNED || Geom::testOrientation2D<VEC3>(p2,p2,p2)!= Geom::ALIGNED
) { ) {
std::cout << "ERROR : testOrientation2D : testAligned" << std::endl; CGoGNout << "ERROR : testOrientation2D : testAligned" << CGoGNendl;
} }
std::cout << "Check testOrientation2D : Done" << std::endl; CGoGNout << "Check testOrientation2D : Done" << CGoGNendl;
// bool isTetrahedronWellOriented<VEC3>(const VEC3 points[4], bool CCW = true) ; // bool isTetrahedronWellOriented<VEC3>(const VEC3 points[4], bool CCW = true) ;
......
...@@ -249,7 +249,7 @@ void myGlutWin::myKeyboard(unsigned char keycode, int, int) ...@@ -249,7 +249,7 @@ void myGlutWin::myKeyboard(unsigned char keycode, int, int)
Algo::Modelisation::CatmullClarkSubdivision<PFP>(myMap, position); Algo::Modelisation::CatmullClarkSubdivision<PFP>(myMap, position);
GLint t2 = glutGet(GLUT_ELAPSED_TIME); GLint t2 = glutGet(GLUT_ELAPSED_TIME);
GLfloat seconds = (t2 - t1) / 1000.0f; GLfloat seconds = (t2 - t1) / 1000.0f;
std::cout << "catmull-clark: "<< seconds << "sec" << std::endl; CGoGNout << "catmull-clark: "<< seconds << "sec" << CGoGNendl;
Algo::Geometry::computeNormalVertices<PFP>(myMap, position, normal) ; Algo::Geometry::computeNormalVertices<PFP>(myMap, position, normal) ;
...@@ -266,7 +266,7 @@ void myGlutWin::myKeyboard(unsigned char keycode, int, int) ...@@ -266,7 +266,7 @@ void myGlutWin::myKeyboard(unsigned char keycode, int, int)
Algo::Modelisation::LoopSubdivision<PFP>(myMap, position); Algo::Modelisation::LoopSubdivision<PFP>(myMap, position);
GLint t2 = glutGet(GLUT_ELAPSED_TIME); GLint t2 = glutGet(GLUT_ELAPSED_TIME);
GLfloat seconds = (t2 - t1) / 1000.0f; GLfloat seconds = (t2 - t1) / 1000.0f;
std::cout << "loop: "<< seconds << "sec" << std::endl; CGoGNout << "loop: "<< seconds << "sec" << CGoGNendl;
Algo::Geometry::computeNormalVertices<PFP>(myMap, position, normal, allDarts) ; Algo::Geometry::computeNormalVertices<PFP>(myMap, position, normal, allDarts) ;
...@@ -279,7 +279,7 @@ void myGlutWin::myKeyboard(unsigned char keycode, int, int) ...@@ -279,7 +279,7 @@ void myGlutWin::myKeyboard(unsigned char keycode, int, int)
Algo::Modelisation::Sqrt3Subdivision<PFP>(myMap, position); Algo::Modelisation::Sqrt3Subdivision<PFP>(myMap, position);
GLint t2 = glutGet(GLUT_ELAPSED_TIME); GLint t2 = glutGet(GLUT_ELAPSED_TIME);
GLfloat seconds = (t2 - t1) / 1000.0f; GLfloat seconds = (t2 - t1) / 1000.0f;
std::cout << "dual: "<< seconds << "sec" << std::endl; CGoGNout << "dual: "<< seconds << "sec" << CGoGNendl;
Algo::Geometry::computeNormalVertices<PFP>(myMap, position, normal, allDarts) ; Algo::Geometry::computeNormalVertices<PFP>(myMap, position, normal, allDarts) ;
...@@ -334,17 +334,17 @@ int main(int argc, char **argv) ...@@ -334,17 +334,17 @@ int main(int argc, char **argv)
{ {
position = myMap.addAttribute<Geom::Vec3f>(VERTEX_ORBIT, "position"); position = myMap.addAttribute<Geom::Vec3f>(VERTEX_ORBIT, "position");
std::cout <<"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"<<std::endl; CGoGNout <<"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"<<CGoGNendl;
// typedef uint8 DATATYPE; // typedef uint8 DATATYPE;
// Algo::MC::Image<DATATYPE> myImg; // Algo::MC::Image<DATATYPE> myImg;
// myImg.loadPNG3D("liver.png"); // myImg.loadPNG3D("liver.png");
// //
// std::cout << "Image chargee"<<std::endl; // CGoGNout << "Image chargee"<<CGoGNendl;
// std::cout << myImg.getWidthX() <<"x"<< myImg.getWidthY() <<"x"<< myImg.getWidthZ() << "voxels"<<std::endl; // CGoGNout << myImg.getWidthX() <<"x"<< myImg.getWidthY() <<"x"<< myImg.getWidthZ() << "voxels"<<CGoGNendl;
// //
// // ajouté pour vérifier que ça marche sur les images non bool // // ajouté pour vérifier que ça marche sur les images non bool
//// myImg.Blur3(); //// myImg.Blur3();
//// std::cout << "Image lissee"<<std::endl; //// CGoGNout << "Image lissee"<<CGoGNendl;
// //
// // fonction de fenetrage de type superieur à ... // // fonction de fenetrage de type superieur à ...
// Algo::MC::WindowingGreater<DATATYPE> myWindFunc; // Algo::MC::WindowingGreater<DATATYPE> myWindFunc;
...@@ -353,13 +353,13 @@ int main(int argc, char **argv) ...@@ -353,13 +353,13 @@ int main(int argc, char **argv)
// myWindFunc.setIsoValue(DATATYPE(127)); // myWindFunc.setIsoValue(DATATYPE(127));
// //
// // instanciation du mc // // instanciation du mc
// std::cout << "mc init"<<std::endl; // CGoGNout << "mc init"<<CGoGNendl;
// Algo::MC::MarchingCube<DATATYPE,Algo::MC::WindowingGreater,PFP> mc(&myImg, &myMap, position, myWindFunc, false); // Algo::MC::MarchingCube<DATATYPE,Algo::MC::WindowingGreater,PFP> mc(&myImg, &myMap, position, myWindFunc, false);
// // MarchingCube<DATATYPE,WindowingDiff> mc(&myImg, &myMap, myWindFunc, false); // // MarchingCube<DATATYPE,WindowingDiff> mc(&myImg, &myMap, myWindFunc, false);
// //
// // realisation du maillage // // realisation du maillage
// mc.simpleMeshing(); // mc.simpleMeshing();
// std::cout << "mc ok"<<std::endl; // CGoGNout << "mc ok"<<CGoGNendl;
// typedef float DATATYPE; // typedef float DATATYPE;
// //
...@@ -371,7 +371,7 @@ int main(int argc, char **argv) ...@@ -371,7 +371,7 @@ int main(int argc, char **argv)
// //
// Scal3D myImg(256); // Scal3D myImg(256);
// //
// std::cout << "mc init"<<std::endl; // CGoGNout << "mc init"<<CGoGNendl;
// Algo::MC::MarchingCubeGen<DATATYPE, Scal3D, Algo::MC::WindowingGreater,PFP> mc(&myImg, &myMap, position, myWindFunc, false); // Algo::MC::MarchingCubeGen<DATATYPE, Scal3D, Algo::MC::WindowingGreater,PFP> mc(&myImg, &myMap, position, myWindFunc, false);
// //
// //realisation du maillage // //realisation du maillage
...@@ -431,7 +431,7 @@ int main(int argc, char **argv) ...@@ -431,7 +431,7 @@ int main(int argc, char **argv)
// //
// GLint t2 = glutGet(GLUT_ELAPSED_TIME); // GLint t2 = glutGet(GLUT_ELAPSED_TIME);
// GLfloat seconds = (t2 - t1) / 1000.0f; // GLfloat seconds = (t2 - t1) / 1000.0f;
// std::cout << "triangulation: "<< seconds << "sec" << std::endl; // CGoGNout << "triangulation: "<< seconds << "sec" << CGoGNendl;
// //
// Marker m = myMap.getNewMarker(VERTEX_ORBIT); // Marker m = myMap.getNewMarker(VERTEX_ORBIT);
// myMap.markEmbVertex(myMap.begin(),m); // myMap.markEmbVertex(myMap.begin(),m);
...@@ -439,12 +439,12 @@ int main(int argc, char **argv) ...@@ -439,12 +439,12 @@ int main(int argc, char **argv)
// Dart xd = myMap.alpha1(myMap.begin()); // Dart xd = myMap.alpha1(myMap.begin());
// if (myMap.isMarkedEmbVertex(xd,m)) // if (myMap.isMarkedEmbVertex(xd,m))
// { // {
// std::cout << "Marke"<< std::endl; // CGoGNout << "Marke"<< CGoGNendl;
// } // }
// xd = myMap.phi2(xd); // xd = myMap.phi2(xd);
// if (myMap.isMarkedEmbVertex(xd,m)) // if (myMap.isMarkedEmbVertex(xd,m))
// { // {
// std::cout << "Marke aussi"<< std::endl; // CGoGNout << "Marke aussi"<< CGoGNendl;
// } // }
// //
// myMap.clearEmbMarkers(m,VERTEX_ORBIT); // myMap.clearEmbMarkers(m,VERTEX_ORBIT);
...@@ -459,7 +459,7 @@ int main(int argc, char **argv) ...@@ -459,7 +459,7 @@ int main(int argc, char **argv)
std::vector<std::string> attrNames ; std::vector<std::string> attrNames ;
if(!Algo::Import::importMesh<PFP>(myMap, std::string(argv[1]), attrNames)) if(!Algo::Import::importMesh<PFP>(myMap, std::string(argv[1]), attrNames))
{ {
std::cerr << "could not import " << std::string(argv[1]) << std::endl ; CGoGNerr << "could not import " << std::string(argv[1]) << CGoGNendl ;
exit(1); exit(1);
} }
position = myMap.getAttribute<PFP::VEC3>(VERTEX_ORBIT, attrNames[0]) ; position = myMap.getAttribute<PFP::VEC3>(VERTEX_ORBIT, attrNames[0]) ;
...@@ -487,7 +487,7 @@ int main(int argc, char **argv) ...@@ -487,7 +487,7 @@ int main(int argc, char **argv)
GLint t2 = glutGet(GLUT_ELAPSED_TIME); GLint t2 = glutGet(GLUT_ELAPSED_TIME);
GLfloat seconds = (t2 - t1) / 1000.0f; GLfloat seconds = (t2 - t1) / 1000.0f;
std::cout << "subdiv: "<< seconds << "sec" << std::endl; CGoGNout << "subdiv: "<< seconds << "sec" << CGoGNendl;
// myMap.getAttributeContainer(VERTEX_ORBIT).toggleProcess(position); // myMap.getAttributeContainer(VERTEX_ORBIT).toggleProcess(position);
...@@ -498,22 +498,22 @@ int main(int argc, char **argv) ...@@ -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);
// Algo::Modelisation::triangleSubdivide<PFP, PFP::EVERTEX, PFP::EVERTEX>(myMap,ec); // Algo::Modelisation::triangleSubdivide<PFP, PFP::EVERTEX, PFP::EVERTEX>(myMap,ec);
std::cout << "Nombre de sommets plonges "<< myMap.getNbCells(VERTEX_ORBIT)<<std::endl; CGoGNout << "Nombre de sommets plonges "<< myMap.getNbCells(VERTEX_ORBIT)<<CGoGNendl;
std::cout << "Nombre de sommets topo: "<< myMap.getNbOrbits(0)<<std::endl; CGoGNout << "Nombre de sommets topo: "<< myMap.getNbOrbits(0)<<CGoGNendl;
std::cout << "Nombre de faces topo: "<< myMap.getNbOrbits(2)<<std::endl; CGoGNout << "Nombre de faces topo: "<< myMap.getNbOrbits(2)<<CGoGNendl;
// GLint t2 = glutGet(GLUT_ELAPSED_TIME); // GLint t2 = glutGet(GLUT_ELAPSED_TIME);
// GLfloat seconds = (t2 - t1) / 1000.0f; // GLfloat seconds = (t2 - t1) / 1000.0f;
// std::cout << "import: "<< seconds << "sec" << std::endl; // CGoGNout << "import: "<< seconds << "sec" << CGoGNendl;
} }
float area = Algo::Geometry::totalArea<PFP>(myMap, position) ; float area = Algo::Geometry::totalArea<PFP>(myMap, position) ;
std::cout << "total area = " << area << std::endl ; CGoGNout << "total area = " << area << CGoGNendl ;
bool inter = Algo::Geometry::areTrianglesInIntersection<PFP>(myMap,0,10,position) ; bool inter = Algo::Geometry::areTrianglesInIntersection<PFP>(myMap,0,10,position) ;
std::cout << "intersection = " << inter << std::endl ; CGoGNout << "intersection = " << inter << CGoGNendl ;
normal = myMap.addAttribute<Geom::Vec3f>(VERTEX_ORBIT, "normals"); normal = myMap.addAttribute<Geom::Vec3f>(VERTEX_ORBIT, "normals");
// PFP::NORMAL normal(normal,myMap); // PFP::NORMAL normal(normal,myMap);
...@@ -526,17 +526,17 @@ int main(int argc, char **argv) ...@@ -526,17 +526,17 @@ int main(int argc, char **argv)
// for (Dart dd=myMap.begin(); dd!= myMap.end(); myMap.next(dd)) // for (Dart dd=myMap.begin(); dd!= myMap.end(); myMap.next(dd))
// { // {
// unsigned int a = myMap.getEmbedding(dd, 0); // unsigned int a = myMap.getEmbedding(dd, 0);
// std::cout << "dart:"<<dd.index<< " / "; // CGoGNout << "dart:"<<dd.index<< " / ";
// std::cout << "emb:"<<a<< " / "; // CGoGNout << "emb:"<<a<< " / ";
// std::cout<<position[a]<< " / "; // CGoGNout<<position[a]<< " / ";
// std::cout << tm[a]<< std::endl; // CGoGNout << tm[a]<< CGoGNendl;
// } // }
Geom::BoundingBox<PFP::VEC3> bb = Algo::Geometry::computeBoundingBox<PFP>(myMap,position); Geom::BoundingBox<PFP::VEC3> bb = Algo::Geometry::computeBoundingBox<PFP>(myMap,position);
std::cout << "BB: "<< bb.min() << " / "<< bb.max() << std::endl; CGoGNout << "BB: "<< bb.min() << " / "<< bb.max() << CGoGNendl;
// compute width and position of object for centering // compute width and position of object for centering
......
...@@ -237,13 +237,13 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y) ...@@ -237,13 +237,13 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
{ {
int nbVertices = myMap.getNbOrbits(VERTEX_ORBIT) ; int nbVertices = myMap.getNbOrbits(VERTEX_ORBIT) ;
std::cout << "nb darts = " << myMap.getNbOrbits(DART_ORBIT) << std::endl; CGoGNout << "nb darts = " << myMap.getNbOrbits(DART_ORBIT) << CGoGNendl;
GLint t1 = glutGet(GLUT_ELAPSED_TIME); GLint t1 = glutGet(GLUT_ELAPSED_TIME);
Algo::DecimationVolumique::decimate<PFP>(myMap, Algo::DecimationVolumique::S_Random, Algo::DecimationVolumique::A_Centroid, position, nbVertices * 0.75); Algo::DecimationVolumique::decimate<PFP>(myMap, Algo::DecimationVolumique::S_Random, Algo::DecimationVolumique::A_Centroid, position, nbVertices * 0.75);
GLint t2 = glutGet(GLUT_ELAPSED_TIME); GLint t2 = glutGet(GLUT_ELAPSED_TIME);
GLfloat seconds = (t2 - t1) / 1000.0f; GLfloat seconds = (t2 - t1) / 1000.0f;
std::cout << "decimation: "<< seconds << "sec" << std::endl; CGoGNout << "decimation: "<< seconds << "sec" << CGoGNendl;
break; break;
} }
case 'h': case 'h':
...@@ -253,7 +253,7 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y) ...@@ -253,7 +253,7 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
} }
default : default :
{ {
std::cout << "not implemented" << std::endl; CGoGNout << "not implemented" << CGoGNendl;
break; break;
} }
...@@ -274,21 +274,21 @@ void MyGlutWin::initRender() ...@@ -274,21 +274,21 @@ void MyGlutWin::initRender()
m_render->updateData(Algo::Render::GL2::POSITIONS, position ); m_render->updateData(Algo::Render::GL2::POSITIONS, position );
GLint t2 = glutGet(GLUT_ELAPSED_TIME); GLint t2 = glutGet(GLUT_ELAPSED_TIME);
GLfloat seconds = (t2 - t1) / 1000.0f; GLfloat seconds = (t2 - t1) / 1000.0f;
std::cout << "updateData: "<< seconds << "sec" << std::endl; CGoGNout << "updateData: "<< seconds << "sec" << CGoGNendl;
// creation des primitives de rendu a partir de la carte // creation des primitives de rendu a partir de la carte
t1 = glutGet(GLUT_ELAPSED_TIME); t1 = glutGet(GLUT_ELAPSED_TIME);
m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::GL2::TRIANGLES); m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::GL2::TRIANGLES);
m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::GL2::LINES); m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::GL2::LINES);
t2 = glutGet(GLUT_ELAPSED_TIME); t2 = glutGet(GLUT_ELAPSED_TIME);
seconds = (t2 - t1) / 1000.0f; seconds = (t2 - t1) / 1000.0f;
std::cout << "initPrimitives: "<< seconds << "sec" << std::endl; CGoGNout << "initPrimitives: "<< seconds << "sec" << CGoGNendl;
// creation des primitives de rendu de la topologie a partir de la carte // creation des primitives de rendu de la topologie a partir de la carte
t1 = glutGet(GLUT_ELAPSED_TIME); t1 = glutGet(GLUT_ELAPSED_TIME);
//m_render_topo->updateData<PFP>(myMap,allDarts,position,coefTopoExplod[0],coefTopoExplod[1],coefTopoExplod[2]); //m_render_topo->updateData<PFP>(myMap,allDarts,position,coefTopoExplod[0],coefTopoExplod[1],coefTopoExplod[2]);
t2 = glutGet(GLUT_ELAPSED_TIME); t2 = glutGet(GLUT_ELAPSED_TIME);
seconds = (t2 - t1) / 1000.0f; seconds = (t2 - t1) / 1000.0f;
std::cout << "map update: "<< seconds << "sec" << std::endl; CGoGNout << "map update: "<< seconds << "sec" << CGoGNendl;
} }
void MyGlutWin::initGUI() void MyGlutWin::initGUI()
...@@ -354,18 +354,18 @@ int main(int argc, char **argv) ...@@ -354,18 +354,18 @@ int main(int argc, char **argv)
std::vector<std::string> attrNames ; std::vector<std::string> attrNames ;
if(argc < 2) if(argc < 2)
{ {
std::cerr << "usage : " << argv[0] << " -off" << std::endl; CGoGNerr << "usage : " << argv[0] << " -off" << CGoGNendl;
std::cerr << "or" << std::endl; CGoGNerr << "or" << CGoGNendl;
std::cerr << "usage : " << argv[0] << " -tet" << std::endl; CGoGNerr << "usage : " << argv[0] << " -tet" << CGoGNendl;
std::cerr << "or" << std::endl; CGoGNerr << "or" << CGoGNendl;
std::cerr << "usage : " << argv[0] << " -ts" << std::endl; CGoGNerr << "usage : " << argv[0] << " -ts" << CGoGNendl;
return 1; return 1;
} }
else if(std::string(argv[1]) == "-off") else if(std::string(argv[1]) == "-off")
{ {
std::cout << argv[1] << std::endl; CGoGNout << argv[1] << CGoGNendl;
if (argc != 4) { if (argc != 4) {
std::cerr << "usage : " << argv[0] << " -off <filename.off> <filename.ele>" << std::endl; CGoGNerr << "usage : " << argv[0] << " -off <filename.off> <filename.ele>" << CGoGNendl;
return 1; return 1;
} }
...@@ -375,7 +375,7 @@ int main(int argc, char **argv) ...@@ -375,7 +375,7 @@ int main(int argc, char **argv)
else if(std::string(argv[1]) == "-tet") else if(std::string(argv[1]) == "-tet")
{ {
if (argc != 3) { if (argc != 3) {
std::cerr << "usage : " << argv[0] << " -tet <filename.tet>" << std::endl; CGoGNerr << "usage : " << argv[0] << " -tet <filename.tet>" << CGoGNendl;
return 1; return 1;
} }
...@@ -385,7 +385,7 @@ int main(int argc, char **argv) ...@@ -385,7 +385,7 @@ int main(int argc, char **argv)
else if(std::string(argv[1]) == "-ts") else if(std::string(argv[1]) == "-ts")
{ {
if (argc != 3) { if (argc != 3) {
std::cerr << "usage : " << argv[0] << " -ts <filename.ts>" << std::endl; CGoGNerr << "usage : " << argv[0] << " -ts <filename.ts>" << CGoGNendl;
return 1; return 1;
} }
...@@ -399,9 +399,9 @@ int main(int argc, char **argv) ...@@ -399,9 +399,9 @@ int main(int argc, char **argv)
maillageTest(); maillageTest();
} }
//std::cout << "Nb Tetrahedron = " << myMap.getNbOrbits(VOLUME_ORBIT) << std::endl; //CGoGNout << "Nb Tetrahedron = " << myMap.getNbOrbits(VOLUME_ORBIT) << CGoGNendl;
// " / Nb Edges = " << myMap.getNbOrbits(EDGE_ORBIT) << // " / Nb Edges = " << myMap.getNbOrbits(EDGE_ORBIT) <<
// " / Nb Vertices = " << myMap.getNbOrbits(VERTEX_ORBIT) << std::endl; // " / Nb Vertices = " << myMap.getNbOrbits(VERTEX_ORBIT) << CGoGNendl;
// un peu d'interface // un peu d'interface
MyGlutWin* mgw = new MyGlutWin(&argc,argv,1200,800); MyGlutWin* mgw = new MyGlutWin(&argc,argv,1200,800);
......
...@@ -439,7 +439,7 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y) ...@@ -439,7 +439,7 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
GLint t2 = glutGet(GLUT_ELAPSED_TIME) ; GLint t2 = glutGet(GLUT_ELAPSED_TIME) ;
GLfloat seconds = (t2 - t1) / 1000.0f ; GLfloat seconds = (t2 - t1) / 1000.0f ;
std::cout << "loop: "<< seconds << "sec" << std::endl ; CGoGNout << "loop: "<< seconds << "sec" << CGoGNendl ;