Commit 7085f8c9 authored by Thomas's avatar Thomas

particleCell3D

parents 539f92e2 2a524b67
......@@ -16,4 +16,3 @@ ELSE(WIN32)
add_subdirectory(Tuto)
ENDIF(WIN32)
......@@ -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,34 +33,6 @@ 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
......@@ -72,13 +43,9 @@ 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)
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} )
......@@ -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
......@@ -79,6 +47,9 @@ 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} )
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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;
......
......@@ -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.0f ;
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.0f ;
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) ;
......
......@@ -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);
......
......@@ -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.0f,20.0f,50.0f);
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.0f);
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.0f,10.0f);
CellMarker mark3(myMap,VERTEX_CELL);
CellMarker mark3(myMap,VERTEX);
prim3.mark(mark3);
......
......@@ -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;
......
......@@ -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) ;
......
......@@ -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
......
......@@ -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);
}
}
......
......@@ -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);
......
/*******************************************************************************
* 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.0f ;
vertexScaleFactor = 1.0f ;
faceShrinkage = 1.0f ;
colClear = Geom::Vec4f(0.2f, 0.2f, 0.2f, 0.1f) ;
colDif = Geom::Vec4f(0.8f, 0.9f, 0.7f, 1.0f) ;
colSpec = Geom::Vec4f(0.9f, 0.9f, 0.9f, 1.0f) ;
colNormal = Geom::Vec4f(1.0f, 0.0f, 0.0f, 1.0f) ;
shininess = 80.0f ;
}
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)) ) ;
setCallBack( dock.combo_faceLighting, SIGNAL(currentIndexChanged(int)), SLOT(slot_faceLighting(int)) ) ;
setCallBack( dock.check_drawNormals, SIGNAL(toggled(bool)), SLOT(slot_drawNormals(bool)) ) ;
setCallBack( dock.slider_normalsSize, SIGNAL(valueChanged(int)), SLOT(slot_normalsSize(int)) ) ;