Commit 22b6e6b6 authored by Pierre Kraemer's avatar Pierre Kraemer

orbit as template...

parent 3128828e
......@@ -65,18 +65,17 @@ add_executable( tuto_oper3 tuto_oper3.cpp ${tuto_oper3_ui} ${tuto_oper3_moc})
target_link_libraries( tuto_oper3
${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS} )
QT4_WRAP_UI( tuto_orbits_ui tuto_orbits.ui )
QT4_WRAP_CPP(tuto_orbits_moc tuto_orbits.h)
add_executable( tuto_orbits tuto_orbits.cpp ${tuto_orbits_ui} ${tuto_orbits_moc})
target_link_libraries( tuto_orbits
${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS} )
QT4_WRAP_UI( show_traversors_ui show_traversors.ui )
QT4_WRAP_CPP(show_traversors_moc show_traversors.h)
add_executable( show_traversors show_traversors.cpp ${show_traversors_ui} ${show_traversors_moc})
target_link_libraries( show_traversors
${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS} )
#QT4_WRAP_UI( tuto_orbits_ui tuto_orbits.ui )
#QT4_WRAP_CPP(tuto_orbits_moc tuto_orbits.h)
#add_executable( tuto_orbits tuto_orbits.cpp ${tuto_orbits_ui} ${tuto_orbits_moc})
#target_link_libraries( tuto_orbits
# ${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS} )
#QT4_WRAP_UI( show_traversors_ui show_traversors.ui )
#QT4_WRAP_CPP(show_traversors_moc show_traversors.h)
#add_executable( show_traversors show_traversors.cpp ${show_traversors_ui} ${show_traversors_moc})
#target_link_libraries( show_traversors
# ${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS} )
add_executable( tuto_subdivision tuto_subdivision.cpp)
target_link_libraries( tuto_subdivision
......@@ -93,8 +92,8 @@ target_link_libraries( tp_master
# exemple: BOOST_LIBS(boost_lib_lists "boost_thread-mt;boost_iostreams-mt")
#BOOST_LIBS(boost_lib_lists "boost_thread-mt")
QT4_WRAP_CPP(tuto_mt_moc tuto_mt.h)
add_executable( tuto_mt tuto_mt.cpp ${tuto_mt_moc})
target_link_libraries( tuto_mt
${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS} ${Boost_THREAD_LIBRARY})
#QT4_WRAP_CPP(tuto_mt_moc tuto_mt.h)
#add_executable( tuto_mt tuto_mt.cpp ${tuto_mt_moc})
#target_link_libraries( tuto_mt
# ${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS} ${Boost_THREAD_LIBRARY})
......@@ -22,11 +22,9 @@
* *
*******************************************************************************/
#include "show_traversors.h"
#include <iostream>
#include "Algo/Modelisation/primitives3d.h"
#include "Algo/Modelisation/polyhedron.h"
#include "Algo/Modelisation/subdivision.h"
......@@ -40,12 +38,10 @@
#include "Algo/Render/GL2/drawerCells.h"
PFP::MAP myMap;
PFP::TVEC3 position ;
MAP myMap;
AttributeHandler<VEC3, VERTEX> position ;
Dart dglobal;
void MyQT::cb_checkTopo(bool b)
{
m_showTopo = b;
......@@ -126,7 +122,6 @@ void MyQT::cb_initGL()
SelectorDartNoBoundary<PFP::MAP> nb(myMap);
m_render_topo->updateData<PFP>(myMap, position, 0.95f, 0.9f, 0.8f, nb);
m_dm_topo = new DartMarker(myMap);
}
void MyQT::cb_redraw()
......@@ -145,7 +140,6 @@ void MyQT::cb_redraw()
}
m_drawer.callList();
}
void MyQT::cb_mousePress(int button, int x, int y)
......@@ -153,17 +147,16 @@ void MyQT::cb_mousePress(int button, int x, int y)
if (Shift())
{
SelectorDartNoBoundary<PFP::MAP> nb(myMap);
Dart d = m_render_topo->picking<PFP>(myMap, x,y, nb);
Dart d = m_render_topo->picking<PFP>(myMap, x, y, nb);
if (d != Dart::nil())
{
CGoGNout << "Dart "<< d << " clicked" << CGoGNendl;
CGoGNout << "Dart " << d << " clicked" << CGoGNendl;
m_selected = d;
}
updateGL();
}
}
void MyQT::cb_Save()
{
// std::string filename = selectFileSave("Export SVG file ",".","(*.svg)");
......@@ -171,13 +164,13 @@ void MyQT::cb_Save()
// m_drawer.toSVG(svg);
// m_render_topo->toSVG(svg);
Utils::SVG::SVGOut svg1(modelViewMatrix(),projectionMatrix());
Utils::SVG::SVGOut svg1(modelViewMatrix(), projectionMatrix());
m_drawer.toSVG(svg1);
svg1.addOpacityAnimation(1.0f);
svg1.addOpacityAnimation(1.0f);
svg1.addOpacityAnimation(0.0f);
Utils::SVG::SVGOut svg2(modelViewMatrix(),projectionMatrix());
Utils::SVG::SVGOut svg2(modelViewMatrix(), projectionMatrix());
m_render_topo->toSVG(svg2);
svg2.addOpacityAnimation(1.0f);
svg2.addOpacityAnimation(0.0f);
......@@ -191,18 +184,16 @@ void MyQT::cb_Save()
std::string filename = selectFileSave("Export SVG file ",".","(*.svg)");
anim.write(filename, 2.0f);
}
void MyQT::colorizeCell(Dart d, unsigned int orbit, float r,float g, float b)
template <unsigned int ORBIT>
void MyQT::colorizeCell(Dart d, float r,float g, float b)
{
TraversorDartsOfOrbit<PFP::MAP>doo (myMap,orbit,d);
for (Dart e = doo.begin(); e!=doo.end(); e = doo.next())
m_render_topo->setDartColor(e,r,g,b);
TraversorDartsOfOrbit<PFP::MAP, ORBIT>doo (myMap, d);
for (Dart e = doo.begin(); e != doo.end(); e = doo.next())
m_render_topo->setDartColor(e, r, g, b);
}
void MyQT::traverse2()
{
if (m_selected == NIL)
......@@ -220,36 +211,33 @@ void MyQT::traverse2()
if (m_ajd_or_inci2 == 0) // incident
{
Algo::Render::drawerCell<PFP>(VERTEX+m_second2, m_drawer,myMap,m_selected,position,m_expl);
Algo::Render::drawerCell<PFP>(VERTEX+m_second2, m_drawer, myMap, m_selected, position, m_expl);
m_drawer.color3f(1.0f,0.0f,0.0f);
Traversor2<PFP::MAP>* tra = Traversor2<PFP::MAP>::createIncident(myMap,m_selected,VERTEX+m_second2,VERTEX+m_first2);
Traversor2<PFP::MAP>* tra = Traversor2<PFP::MAP>::createIncident(myMap, m_selected, VERTEX+m_second2, VERTEX+m_first2);
for (Dart d=tra->begin(); d != tra->end(); d= tra->next())
m_affDarts.push_back(d);
Algo::Render::drawerCells<PFP>(VERTEX+m_first2, m_drawer, myMap,m_affDarts,position,m_expl);
Algo::Render::drawerCells<PFP>(VERTEX+m_first2, m_drawer, myMap, m_affDarts, position, m_expl);
}
else // adjacent
{
Algo::Render::drawerCell<PFP>(VERTEX+m_first2, m_drawer,myMap,m_selected,position,m_expl);
Algo::Render::drawerCell<PFP>(VERTEX+m_first2, m_drawer, myMap, m_selected, position, m_expl);
m_drawer.color3f(1.0f,0.0f,0.0f);
Traversor2<PFP::MAP>* tra = Traversor2<PFP::MAP>::createAdjacent(myMap,m_selected,VERTEX+m_first2,VERTEX+m_second2);
Traversor2<PFP::MAP>* tra = Traversor2<PFP::MAP>::createAdjacent(myMap, m_selected, VERTEX+m_first2, VERTEX+m_second2);
for (Dart d=tra->begin(); d != tra->end(); d= tra->next())
for (Dart d = tra->begin(); d != tra->end(); d = tra->next())
m_affDarts.push_back(d);
Algo::Render::drawerCells<PFP>(VERTEX+m_first2, m_drawer, myMap,m_affDarts,position,m_expl);
Algo::Render::drawerCells<PFP>(VERTEX+m_first2, m_drawer, myMap, m_affDarts, position, m_expl);
}
m_drawer.endList();
SelectorMarked sm(*m_dm_topo);
m_render_topo->updateData<PFP>(myMap, position, 0.95f, 0.9f, 0.8f, sm );
m_render_topo->updateData<PFP>(myMap, position, 0.95f, 0.9f, 0.8f, sm);
updateGL();
}
void MyQT::traverse3()
{
if (m_selected == NIL)
......@@ -268,35 +256,34 @@ void MyQT::traverse3()
m_dm_topo->unmarkAll();
SelectorMarked sm(*m_dm_topo);
if (m_ajd_or_inci3 == 0) // incident
{
Algo::Render::drawerCell<PFP>(VERTEX+m_second3, m_drawer,myMap,m_selected,position,m_expl);
m_dm_topo->markOrbit(VERTEX+m_second3,m_selected);
m_dm_topo->markOrbit<VERTEX+m_second3>(m_selected);
m_drawer.color3f(1.0f,0.0f,0.0f);
Traversor3XY<PFP::MAP> tra(myMap,m_selected,VERTEX+m_second3,VERTEX+m_first3);
for (Dart d=tra.begin(); d != tra.end(); d= tra.next())
Traversor3XY<PFP::MAP, VERTEX+m_second3, VERTEX+m_first3> tra(myMap, m_selected);
for (Dart d = tra.begin(); d != tra.end(); d = tra.next())
{
m_affDarts.push_back(d);
m_dm_topo->markOrbit(VERTEX+m_first3,d);
m_dm_topo->markOrbit<VERTEX+m_first3>(d);
}
Algo::Render::drawerCells<PFP>(VERTEX+m_first3, m_drawer, myMap,m_affDarts,position,m_expl);
Algo::Render::drawerCells<PFP>(VERTEX+m_first3, m_drawer, myMap, m_affDarts, position, m_expl);
m_render_topo->updateData<PFP>(myMap, position, 0.95f, 0.9f, 0.8f, sm);
for (std::vector<Dart>::iterator id=m_affDarts.begin(); id != m_affDarts.end(); ++id)
for (std::vector<Dart>::iterator id = m_affDarts.begin(); id != m_affDarts.end(); ++id)
m_render_topo->setDartColor(*id,0.7f,0.0f,0.0f);
m_render_topo->setDartColor(m_selected,0.0f,0.7f,0.0f);
}
else // adjacent
{
Algo::Render::drawerCell<PFP>(VERTEX+m_first3, m_drawer,myMap,m_selected,position,m_expl);
m_dm_topo->markOrbit(VERTEX+m_first3,m_selected);
Algo::Render::drawerCell<PFP>(VERTEX+m_first3, m_drawer, myMap, m_selected, position, m_expl);
m_dm_topo->markOrbit<VERTEX+m_first3>(m_selected);
m_drawer.color3f(1.0f,0.0f,0.0f);
Traversor3XXaY<PFP::MAP> tra(myMap,m_selected,VERTEX+m_first3,VERTEX+m_second3);
for (Dart d=tra.begin(); d != tra.end(); d= tra.next())
Traversor3XXaY<PFP::MAP, VERTEX+m_first3, VERTEX+m_second3> tra(myMap,m_selected);
for (Dart d = tra.begin(); d != tra.end(); d = tra.next())
{
m_affDarts.push_back(d);
m_dm_topo->markOrbit(VERTEX+m_first3,d);
m_dm_topo->markOrbit<VERTEX+m_first3>(d);
}
Algo::Render::drawerCells<PFP>(VERTEX+m_first3, m_drawer, myMap,m_affDarts,position,m_expl);
......@@ -308,16 +295,12 @@ void MyQT::traverse3()
m_drawer.endList();
updateGL();
}
int main(int argc, char **argv)
{
position = myMap.addAttribute<PFP::VEC3>(VERTEX, "position");
position = myMap.addAttribute<VEC3, VERTEX>( "position");
Algo::Modelisation::Primitive3D<PFP> prim(myMap, position);
dglobal = prim.hexaGrid_topo(4,4,4);
......@@ -334,8 +317,6 @@ int main(int argc, char **argv)
// message d'aide
sqt.setHelpMsg("shit click to select a dart\nand select a traversor\nif keyboard focus problem\nundock");
// bounding box
Geom::BoundingBox<PFP::VEC3> bb = Algo::Geometry::computeBoundingBox<PFP>(myMap, position);
float lWidthObj = std::max<PFP::REAL>(std::max<PFP::REAL>(bb.size(0), bb.size(1)), bb.size(2));
......@@ -359,7 +340,6 @@ int main(int argc, char **argv)
sqt.show();
// et on attend la fin.
return app.exec();
}
......@@ -71,8 +71,8 @@ struct PFP: public PFP_STANDARD
#endif
};
using namespace CGoGN ;
typedef PFP::MAP MAP ;
typedef PFP::VEC3 VEC3 ;
/**
......@@ -89,7 +89,6 @@ class MyQT: public Utils::QT::SimpleQT
Algo::Render::GL2::Topo3Render* m_render_topo;
bool m_showTopo;
unsigned int m_first3;
unsigned int m_ajd_or_inci3;
unsigned int m_second3;
......@@ -112,7 +111,6 @@ public:
m_last(2),
m_selected(NIL),
m_dm_topo(NULL)
{}
Dart m_selected;
......@@ -133,7 +131,8 @@ protected:
void cb_mousePress(int button, int x, int y);
void colorizeCell(Dart d, unsigned int orbit, float r,float g, float b);
template <unsigned int ORBIT>
void colorizeCell(Dart d, float r,float g, float b);
void traverse2();
void traverse3();
......@@ -149,7 +148,6 @@ public slots:
void cb_combo6(int x);
void cb_checkTopo(bool b);
void cb_explode(int x);
};
#endif
......@@ -62,9 +62,9 @@ typedef PFP::VEC3 Point3D;
// Variables pour la gestion des plongements
// handler d'attribut de position par sommet
AttributeHandler<Point3D> position;
AttributeHandler<Point3D, VERTEX> position;
// handler d'attribut de normale par sommet
AttributeHandler<PFP::VEC3> normal;
AttributeHandler<PFP::VEC3, VERTEX> normal;
/// Fonctions a connaitre:
......@@ -92,7 +92,7 @@ private:
// Assigne un nouveau plongement au sommet. Les anciens plongements sont libérés.
void newVertex(Dart d) {
embedNewCell(VERTEX,d);
embedNewCell<VERTEX>(d);
}
public:
......@@ -522,7 +522,7 @@ void MyQT::cb_keyPress(int keycode)
if (!d_vertices.empty())
{
std::stringstream ss;
ss << "Sommet: dart: " << d_vertices[0].index << ": " << position[d_vertices[0]]<< "( id emb:"<< myMap.getEmbedding(VERTEX,d_vertices[0])<<")"<< std::endl; ;
ss << "Sommet: dart: " << d_vertices[0].index << ": " << position[d_vertices[0]]<< "( id emb:"<< myMap.getEmbedding<VERTEX>(d_vertices[0])<<")"<< std::endl;
statusMsg(ss.str().c_str());
}
break;
......@@ -600,13 +600,13 @@ int main(int argc, char **argv)
if (argc == 2) {
std::vector<std::string> attrNames ;
Algo::Import::importMesh<PFP>(myMap, argv[1], attrNames) ;
position = myMap.getAttribute<Point3D>(VERTEX, attrNames[0]) ;
normal = myMap.addAttribute<PFP::VEC3>(VERTEX, "normal");
position = myMap.getAttribute<Point3D, VERTEX>(attrNames[0]) ;
normal = myMap.addAttribute<PFP::VEC3, VERTEX>("normal");
Algo::Geometry::computeNormalVertices<PFP>(myMap, position, normal) ;
}
else {
position = myMap.addAttribute<Point3D>(VERTEX, "position");
normal = myMap.addAttribute<PFP::VEC3>(VERTEX, "normal");
position = myMap.addAttribute<Point3D, VERTEX>("position");
normal = myMap.addAttribute<PFP::VEC3, VERTEX>("normal");
myMap.createMap();
Algo::Geometry::computeNormalVertices<PFP>(myMap, position, normal) ;
}
......
......@@ -36,10 +36,9 @@
#include "Algo/Import/import.h"
PFP::MAP myMap;
PFP::TVEC3 position ;
PFP::TVEC3 middleDarts;
MAP myMap;
AttributeHandler<VEC3, VERTEX> position ;
AttributeHandler<VEC3, DART> middleDarts;
void MyQT::text_onoff(bool x)
......@@ -49,14 +48,12 @@ void MyQT::text_onoff(bool x)
CGoGNerr << " text_onoff " << CGoGNflush;
}
void MyQT::slider_text(int x)
{
m_strings->setScale(0.02f*x);
updateGL();
}
void MyQT::orbit_list(int x)
{
storeVerticesInfo<int>(m_att_orbits[x]);
......@@ -64,11 +61,11 @@ void MyQT::orbit_list(int x)
if (m_clicked != Dart::nil())
{
unsigned int orbs[9] ={VERTEX,EDGE,FACE,VOLUME,PFP::MAP::ORBIT_IN_PARENT(VERTEX),PFP::MAP::ORBIT_IN_PARENT(EDGE),PFP::MAP::ORBIT_IN_PARENT(FACE),PFP::MAP::ORBIT_IN_PARENT2(VERTEX),PFP::MAP::ORBIT_IN_PARENT2(EDGE)};
unsigned int orbs[9] = {VERTEX,EDGE,FACE,VOLUME,PFP::MAP::ORBIT_IN_PARENT(VERTEX),PFP::MAP::ORBIT_IN_PARENT(EDGE),PFP::MAP::ORBIT_IN_PARENT(FACE),PFP::MAP::ORBIT_IN_PARENT2(VERTEX),PFP::MAP::ORBIT_IN_PARENT2(EDGE)};
m_selected.clear();
// easy way to traverse darts of orbit
TraversorDartsOfOrbit<PFP::MAP> tra(myMap,orbs[current_orbit],m_clicked);
TraversorDartsOfOrbit<MAP> tra(myMap, orbs[current_orbit], m_clicked);
for (Dart e = tra.begin(); e != tra.end(); e = tra.next())
m_selected.push_back(e);
}
......@@ -77,21 +74,20 @@ void MyQT::orbit_list(int x)
updateGL();
}
template<typename T>
void MyQT::storeVerticesInfo(const AttributeHandler<T>& attrib)
template<typename T, unsigned int ORBIT>
void MyQT::storeVerticesInfo(const AttributeHandler<T, ORBIT>& attrib)
{
SelectorDartNoBoundary<PFP::MAP> nb(myMap);
m_render_topo->computeDartMiddlePositions<PFP>(myMap,middleDarts,nb);
m_render_topo->computeDartMiddlePositions<PFP>(myMap, middleDarts, nb);
m_strings->clear();
for (Dart d=myMap.begin(); d!=myMap.end(); myMap.next(d))
for (Dart d = myMap.begin(); d != myMap.end(); myMap.next(d))
{
if (nb(d))
{
std::stringstream ss;
ss << attrib[d];
m_strings->addString(ss.str(),middleDarts[d]);
m_strings->addString(ss.str(), middleDarts[d]);
}
}
m_strings->sendToVBO();
......@@ -109,10 +105,7 @@ void MyQT::cb_initGL()
m_strings = new Utils::Strings3D(true, Geom::Vec3f(0.1f,0.0f,0.3f));
registerShader(m_strings);
storeVerticesInfo<int>(m_att_orbits[0]);
}
void MyQT::cb_redraw()
......@@ -135,11 +128,11 @@ void MyQT::cb_mousePress(int button, int x, int y)
m_clicked = m_render_topo->picking<PFP>(myMap, x,y, nb);
if (m_clicked != Dart::nil())
{
unsigned int orbs[9] ={VERTEX,EDGE,FACE,VOLUME,PFP::MAP::ORBIT_IN_PARENT(VERTEX),PFP::MAP::ORBIT_IN_PARENT(EDGE),PFP::MAP::ORBIT_IN_PARENT(FACE),PFP::MAP::ORBIT_IN_PARENT2(VERTEX),PFP::MAP::ORBIT_IN_PARENT2(EDGE)};
unsigned int orbs[9] = {VERTEX,EDGE,FACE,VOLUME,PFP::MAP::ORBIT_IN_PARENT(VERTEX),PFP::MAP::ORBIT_IN_PARENT(EDGE),PFP::MAP::ORBIT_IN_PARENT(FACE),PFP::MAP::ORBIT_IN_PARENT2(VERTEX),PFP::MAP::ORBIT_IN_PARENT2(EDGE)};
m_selected.clear();
// easy way to traverse darts of orbit
TraversorDartsOfOrbit<PFP::MAP> tra(myMap,orbs[current_orbit],m_clicked);
TraversorDartsOfOrbit<PFP::MAP> tra(myMap, orbs[current_orbit], m_clicked);
for (Dart e = tra.begin(); e != tra.end(); e = tra.next())
m_selected.push_back(e);
}
......@@ -147,97 +140,94 @@ void MyQT::cb_mousePress(int button, int x, int y)
}
}
void MyQT::initMap()
{
std::cout << "INIT MAP"<< std::endl;
position = myMap.addAttribute<PFP::VEC3>(VERTEX, "position");
position = myMap.addAttribute<VEC3, VERTEX>("position");
Algo::Modelisation::Primitive3D<PFP> prim(myMap, position);
int nb=2;
prim.hexaGrid_topo(nb,nb,nb);
prim.embedHexaGrid(1.0f,1.0f,1.0f);
m_att_orbits[0] = myMap.addAttribute<int>(VERTEX,"vertex");
m_att_orbits[1] = myMap.addAttribute<int>(EDGE,"edge");
m_att_orbits[2] = myMap.addAttribute<int>(FACE,"face");
m_att_orbits[3] = myMap.addAttribute<int>(VOLUME,"volume");
m_att_orbits[4] = myMap.addAttribute<int>(PFP::MAP::ORBIT_IN_PARENT(VERTEX),"vertex2");
m_att_orbits[5] = myMap.addAttribute<int>(PFP::MAP::ORBIT_IN_PARENT(EDGE),"edge2");
m_att_orbits[6] = myMap.addAttribute<int>(PFP::MAP::ORBIT_IN_PARENT(FACE),"face2");
m_att_orbits[7] = myMap.addAttribute<int>(PFP::MAP::ORBIT_IN_PARENT2(VERTEX),"vertex1");
m_att_orbits[8] = myMap.addAttribute<int>(PFP::MAP::ORBIT_IN_PARENT2(EDGE),"face1");
m_att_orbits[0] = myMap.addAttribute<int, VERTEX>("vertex");
m_att_orbits[1] = myMap.addAttribute<int, EDGE>("edge");
m_att_orbits[2] = myMap.addAttribute<int, FACE>("face");
m_att_orbits[3] = myMap.addAttribute<int, VOLUME>("volume");
m_att_orbits[4] = myMap.addAttribute<int, VERTEX + PFP::MAP::IN_PARENT>("vertex2");
m_att_orbits[5] = myMap.addAttribute<int, EDGE + PFP::MAP::IN_PARENT>("edge2");
m_att_orbits[6] = myMap.addAttribute<int, FACE + PFP::MAP::IN_PARENT>("face2");
m_att_orbits[7] = myMap.addAttribute<int, VERTEX + PFP::MAP::IN_PARENT2>("vertex1");
m_att_orbits[8] = myMap.addAttribute<int, EDGE + PFP::MAP::IN_PARENT2>("face1");
int i=0;
TraversorCell<PFP::MAP> tra0(myMap, VERTEX);
TraversorV<MAP> tra0(myMap);
for (Dart d = tra0.begin(); d != tra0.end(); d = tra0.next())
{
m_att_orbits[0][d] = i++;
}
i=0;
TraversorCell<PFP::MAP> tra1(myMap, EDGE);
TraversorE<MAP> tra1(myMap);
for (Dart d = tra1.begin(); d != tra1.end(); d = tra1.next())
{
m_att_orbits[1][d] = i++;
}
i=0;
TraversorCell<PFP::MAP> tra2(myMap, FACE);
TraversorF<MAP> tra2(myMap);
for (Dart d = tra2.begin(); d != tra2.end(); d = tra2.next())
{
m_att_orbits[2][d] = i++;
}
i=0;
TraversorCell<PFP::MAP> tra3(myMap, VOLUME);
TraversorW<PFP::MAP> tra3(myMap);
for (Dart d = tra3.begin(); d != tra3.end(); d = tra3.next())
{
m_att_orbits[3][d] = i++;
}
i=0;
TraversorCell<PFP::MAP> tra02(myMap, PFP::MAP::ORBIT_IN_PARENT(VERTEX));
TraversorCell<MAP, VERTEX + PFP::MAP::IN_PARENT> tra02(myMap);
for (Dart d = tra02.begin(); d != tra02.end(); d = tra02.next())
{
m_att_orbits[4][d] = i++;
}
i=0;
TraversorCell<PFP::MAP> tra12(myMap, PFP::MAP::ORBIT_IN_PARENT(EDGE));
TraversorCell<MAP, EDGE + PFP::MAP::IN_PARENT> tra12(myMap);
for (Dart d = tra12.begin(); d != tra12.end(); d = tra12.next())
{
m_att_orbits[5][d] = i++;
}
i=0;
TraversorCell<PFP::MAP> tra22(myMap, PFP::MAP::ORBIT_IN_PARENT(FACE));
TraversorCell<MAP, FACE + PFP::MAP::IN_PARENT> tra22(myMap);
for (Dart d = tra22.begin(); d != tra22.end(); d = tra22.next())
{
m_att_orbits[6][d] = i++;
}
i=0;
TraversorCell<PFP::MAP> tra01(myMap, PFP::MAP::ORBIT_IN_PARENT2(VERTEX));
TraversorCell<MAP, VERTEX + PFP::MAP::IN_PARENT2> tra01(myMap);
for (Dart d = tra01.begin(); d != tra01.end(); d = tra01.next())
{
m_att_orbits[7][d] = i++;
}
i=0;
TraversorCell<PFP::MAP> tra11(myMap, PFP::MAP::ORBIT_IN_PARENT2(EDGE));
TraversorCell<MAP, EDGE + PFP::MAP::IN_PARENT2> tra11(myMap);
for (Dart d = tra11.begin(); d != tra11.end(); d = tra11.next())
{
m_att_orbits[8][d] = i++;
}
middleDarts = myMap.addAttribute<PFP::VEC3>(DART, "middle");
middleDarts = myMap.addAttribute<VEC3, DART>("middle");
}
int main(int argc, char **argv)
{
// un peu d'interface
QApplication app(argc, argv);
MyQT sqt;
......
......@@ -72,8 +72,8 @@ struct PFP: public PFP_STANDARD
#endif
};
using namespace CGoGN ;
typedef PFP::MAP MAP ;
typedef PFP::VEC3 VEC3 ;
/**
......@@ -136,8 +136,8 @@ public:
void initMap();
protected:
template <typename T>
void storeVerticesInfo(const AttributeHandler<T>& attrib);
template <typename T, unsigned int ORBIT>
void storeVerticesInfo(const AttributeHandler<T, ORBIT>& attrib);
void cb_redraw();
void cb_initGL();
......
......@@ -67,7 +67,7 @@ int main(int argc, char **argv)
Algo::Import::importMesh<PFP>(myMap, argv[1], attrNames);
// get a handler to the 3D vector attribute created by the import
AttributeHandler<PFP::VEC3> position = myMap.getAttribute<PFP::VEC3>(VERTEX, attrNames[0]);
AttributeHandler<PFP::VEC3, VERTEX> position = myMap.getAttribute<PFP::VEC3, VERTEX>(attrNames[0]);
for(unsigned int i = 0; i < nbSteps; ++i)
Algo::Modelisation::LoopSubdivision<PFP>(myMap, position);
......
......@@ -52,7 +52,7 @@ template <typename PFP, typename EMBV, typename EMB>
void trianguleFaces(typename PFP::MAP& map, EMBV& attributs, const FunctorSelect& selected = allDarts) ;
template <typename PFP>
void trianguleFaces(typename PFP::MAP& map, typename PFP::TVEC3& position, const FunctorSelect& selected = allDarts) ;