Commit 4670bae0 authored by Pierre Kraemer's avatar Pierre Kraemer
Browse files

no more virtual foreach_dart / no more MAP_IMPL parameter in AttributeHandler

parent a3be313e
......@@ -798,7 +798,7 @@ void Clipping::importMesh(std::string& filename)
return;
}
else
position = myMap.getAttribute<VEC3, VERTEX>("position") ;
position = myMap.getAttribute<VEC3, VERTEX ,MAP>("position") ;
}
else
{
......@@ -808,10 +808,9 @@ void Clipping::importMesh(std::string& filename)
return ;
}
else
position = myMap.getAttribute<PFP::VEC3,VERTEX>(attrNames[0]) ;
position = myMap.getAttribute<VEC3, VERTEX, MAP>(attrNames[0]) ;
}
updateVBOprimitives(Algo::Render::GL2::TRIANGLES | Algo::Render::GL2::LINES | Algo::Render::GL2::POINTS) ;
m_render_topo->updateData(myMap, position, m_coeffTopoExplod[0], m_coeffTopoExplod[1], m_coeffTopoExplod[2]);
......@@ -1114,7 +1113,7 @@ int main(int argc, char** argv)
}
else
{
sqt.position = sqt.myMap.addAttribute<PFP::VEC3, VERTEX>("position");
sqt.position = sqt.myMap.addAttribute<VEC3, VERTEX, MAP>("position");
Algo::Volume::Tilings::Cubic::Grid<PFP> cubic(sqt.myMap, 10,10,10);
cubic.embedIntoGrid(sqt.position, 1.0f, 1.0f, 1.0f);
......
......@@ -71,7 +71,6 @@ struct PFP: public PFP_STANDARD
};
typedef PFP::MAP MAP;
typedef PFP::MAP::IMPL MAP_IMPL;
typedef PFP::VEC3 VEC3;
class Clipping: public Utils::QT::SimpleQT
......@@ -81,7 +80,7 @@ class Clipping: public Utils::QT::SimpleQT
public:
//Manip Carte
MAP myMap ;
VertexAttribute<VEC3, MAP_IMPL> position;
VertexAttribute<VEC3, MAP> position;
Dart dglobal;
//Render
......
......@@ -128,13 +128,12 @@ struct PFP: public PFP_STANDARD
};
typedef PFP::MAP MAP ;
typedef PFP::MAP::IMPL MAP_IMPL ;
typedef PFP::VEC3 VEC3 ;
// declaration of the map
MAP myMap;
// and attribute of position
VertexAttribute<VEC3, MAP_IMPL> position;
VertexAttribute<VEC3, MAP> position;
unsigned int nb_ears;
......@@ -245,7 +244,7 @@ void MyQT::cb_keyPress(int code)
int main(int argc, char **argv)
{
position = myMap.addAttribute<VEC3, VERTEX>("position");
position = myMap.addAttribute<VEC3, VERTEX, MAP>("position");
Dart d0 = myMap.newFace(12);
position[d0] = PFP::VEC3(0, 20, 0);
......
......@@ -53,7 +53,6 @@ struct PFP: public PFP_STANDARD
};
typedef PFP::MAP MAP ;
typedef PFP::MAP::IMPL MAP_IMPL ;
typedef PFP::VEC3 VEC3 ;
MAP myMap;
......@@ -104,7 +103,7 @@ int main(int argc, char **argv)
QApplication app(argc, argv);
MyQT sqt;
VertexAttribute<VEC3, MAP_IMPL> position = myMap.addAttribute<VEC3, VERTEX>("position") ;
VertexAttribute<VEC3, MAP> position = myMap.addAttribute<VEC3, VERTEX, MAP>("position") ;
// define the face extruded (here a cross)
std::vector<PFP::VEC3> objV;
......@@ -134,7 +133,7 @@ int main(int argc, char **argv)
}
// extrusion
Algo::Surface::Modelisation::extrusion_scale<PFP>(myMap, position, objV, PFP::VEC3(0.0,0.0,0.0), PFP::VEC3(0.0,1.0,0.0),true, pathV, false, pathRadius);
Algo::Surface::Modelisation::extrusion_scale<PFP>(myMap, position, objV, PFP::VEC3(0.0,0.0,0.0), PFP::VEC3(0.0,1.0,0.0), true, pathV, false, pathRadius);
// bounding box
Geom::BoundingBox<PFP::VEC3> bb = Algo::Geometry::computeBoundingBox<PFP>(myMap, position);
......
......@@ -138,9 +138,9 @@ void MCMesh::MC()
SAlgo::MC::WindowingGreater<DATATYPE> myWindFunc;
myWindFunc.setIsoValue(DATATYPE(127));
position = myMap.getAttribute<VEC3, VERTEX>("position");
position = myMap.getAttribute<VEC3, VERTEX, MAP>("position");
if (!position.isValid())
position = myMap.addAttribute<VEC3, VERTEX>("position");
position = myMap.addAttribute<VEC3, VERTEX, MAP>("position");
// instanciation du mc
SAlgo::MC::MarchingCube<DATATYPE, SAlgo::MC::WindowingGreater,PFP> mc(myImgFr, &myMap, position, myWindFunc, false);
......
......@@ -54,7 +54,6 @@ struct PFP: public PFP_STANDARD
};
typedef PFP::MAP MAP ;
typedef PFP::MAP::IMPL MAP_IMPL ;
typedef PFP::VEC3 VEC3 ;
typedef unsigned char DATATYPE;
......@@ -75,7 +74,7 @@ public:
bool m_drawEdges ;
bool m_drawFaces ;
VertexAttribute<VEC3, MAP_IMPL> position ;
VertexAttribute<VEC3, MAP> position ;
Algo::Render::GL2::MapRender* m_render ;
......
......@@ -30,7 +30,7 @@
SimpleGMap2::SimpleGMap2()
{
position = myMap.addAttribute<VEC3, VERTEX>("position");
position = myMap.addAttribute<VEC3, VERTEX, MAP>("position");
Dart d = Algo::Surface::Modelisation::createTetrahedron<PFP>(myMap);
position[d] = VEC3(0,0,0);
......@@ -62,7 +62,7 @@ void SimpleGMap2::cb_initGL()
{
Utils::GLSLShader::setCurrentOGLVersion(1) ;
Geom::BoundingBox<PFP::VEC3> bb = Algo::Geometry::computeBoundingBox<PFP>(myMap, position) ;
Geom::BoundingBox<VEC3> bb = Algo::Geometry::computeBoundingBox<PFP>(myMap, position) ;
VEC3 gPosObj = bb.center() ;
float tailleX = bb.size(0) ;
float tailleY = bb.size(1) ;
......
......@@ -42,7 +42,6 @@ struct PFP: public PFP_STANDARD
};
typedef PFP::MAP MAP ;
typedef PFP::MAP::IMPL MAP_IMPL ;
typedef PFP::VEC3 VEC3 ;
class SimpleGMap2 : public Utils::QT::SimpleQT
......@@ -52,7 +51,7 @@ class SimpleGMap2 : public Utils::QT::SimpleQT
public:
MAP myMap ;
VertexAttribute<VEC3, MAP_IMPL> position ;
VertexAttribute<VEC3, MAP> position ;
SimpleGMap2() ;
......@@ -61,4 +60,3 @@ public:
void cb_initGL() ;
void cb_redraw() ;
};
......@@ -30,8 +30,8 @@
SimpleGMap3::SimpleGMap3()
{
position = myMap.addAttribute<VEC3, VERTEX>("position");
volume = myMap.addAttribute<VEC3, VOLUME>("volume");
position = myMap.addAttribute<VEC3, VERTEX, MAP>("position");
volume = myMap.addAttribute<VEC3, VOLUME, MAP>("volume");
// CellMarker<EDGE> mE(myMap);
......
......@@ -43,7 +43,6 @@ struct PFP: public PFP_STANDARD
};
typedef PFP::MAP MAP ;
typedef PFP::MAP::IMPL MAP_IMPL ;
typedef PFP::VEC3 VEC3 ;
class SimpleGMap3 : public Utils::QT::SimpleQT
......@@ -53,8 +52,8 @@ class SimpleGMap3 : public Utils::QT::SimpleQT
public:
MAP myMap ;
VertexAttribute<VEC3, MAP_IMPL> position ;
VolumeAttribute<VEC3, MAP_IMPL> volume ;
VertexAttribute<VEC3, MAP> position ;
VolumeAttribute<VEC3, MAP> volume ;
Algo::Render::GL2::Topo3Render<PFP>* m_render_topo;
......
......@@ -30,63 +30,62 @@
SimpleMap3::SimpleMap3()
{
position = myMap.addAttribute<VEC3, VERTEX>("position");
position = myMap.addAttribute<VEC3, VERTEX, MAP>("position");
Algo::Volume::Tilings::Cubic::Grid<PFP> cubic(myMap, 1, 1, 1);
cubic.embedIntoGrid(position, 1.0f, 1.0f, 1.0f);
myMap.check();
// Dart dp = Algo::Surface::Modelisation::createQuadrangularPyramid<PFP>(myMap);
// Dart dp = Algo::Surface::Modelisation::createQuadrangularPyramid<PFP>(myMap);
// position[dp] = typename PFP::VEC3(0.5,0.5,-0.5);
// position[myMap.phi1(dp)] = typename PFP::VEC3(0.5,0.5,0.5);
// position[myMap.phi1(myMap.phi1(dp))] = typename PFP::VEC3(0.5,-0.5,0.5);
// position[myMap.phi_1(dp)] = typename PFP::VEC3(0.5,-0.5,-0.5);
// position[myMap.phi_1(myMap.phi2(dp))] = typename PFP::VEC3(1.5f, 0.0f, 0.0f);
// position[dp] = typename PFP::VEC3(0.5,0.5,-0.5);
// position[myMap.phi1(dp)] = typename PFP::VEC3(0.5,0.5,0.5);
// position[myMap.phi1(myMap.phi1(dp))] = typename PFP::VEC3(0.5,-0.5,0.5);
// position[myMap.phi_1(dp)] = typename PFP::VEC3(0.5,-0.5,-0.5);
// position[myMap.phi_1(myMap.phi2(dp))] = typename PFP::VEC3(1.5f, 0.0f, 0.0f);
// Dart dtemp = myMap.phi_1(myMap.phi2(myMap.phi_1(myMap.phi_1(myMap.phi2(d)))));
// Dart dtemp = myMap.phi_1(myMap.phi2(myMap.phi_1(myMap.phi_1(myMap.phi2(d)))));
// myMap.sewVolumes(dtemp,dp);
// myMap.sewVolumes(dtemp,dp);
// Algo::Volume::Tilings::Cubic::Grid<PFP> cubic(myMap, 2, 1, 1);
// cubic.embedIntoGrid(position, 1.0f, 1.0f, 1.0f);
// myMap.check();
// Algo::Volume::Tilings::Cubic::Grid<PFP> cubic(myMap, 2, 1, 1);
// cubic.embedIntoGrid(position, 1.0f, 1.0f, 1.0f);
// myMap.check();
// unsigned int nb=0;
// for(unsigned int i = position.begin(); i!=position.end(); position.next(i))
// nb++;
// unsigned int nb=0;
// for(unsigned int i = position.begin(); i!=position.end(); position.next(i))
// nb++;
// std::cout << "Nb vertices (equals 12) : " << nb << std::endl;
// assert(nb==12);
// std::cout << "Nb vertices (equals 12) : " << nb << std::endl;
// assert(nb==12);
// d = myMap.phi2(myMap.phi1(myMap.phi1(myMap.phi2(d))));
// d = myMap.phi2(myMap.phi1(myMap.phi1(myMap.phi2(d))));
// Dart dd = myMap.phi3(d);
// Dart dd = myMap.phi3(d);
// myMap.unsewVolumes(d);
// myMap.unsewVolumes(d);
// myMap.check();
// myMap.check();
// nb=0;
// for(unsigned int i = position.begin(); i!=position.end(); position.next(i))
// nb++;
// nb=0;
// for(unsigned int i = position.begin(); i!=position.end(); position.next(i))
// nb++;
// std::cout << "Nb vertices after unsew (equals 16) : " << nb << std::endl;
// assert(nb==16);
// std::cout << "Nb vertices after unsew (equals 16) : " << nb << std::endl;
// assert(nb==16);
// myMap.sewVolumes(d,dd);
// myMap.sewVolumes(d,dd);
// myMap.check();
// myMap.check();
// nb=0;
// for(unsigned int i = position.begin(); i!=position.end(); position.next(i))
// nb++;
// nb=0;
// for(unsigned int i = position.begin(); i!=position.end(); position.next(i))
// nb++;
// std::cout << "Nb vertices after resew (equals 12) : " << nb << std::endl;
// assert(nb==12);
// std::cout << "Nb vertices after resew (equals 12) : " << nb << std::endl;
// assert(nb==12);
}
......
......@@ -45,7 +45,6 @@ struct PFP: public PFP_STANDARD
};
typedef PFP::MAP MAP ;
typedef PFP::MAP::IMPL MAP_IMPL ;
typedef PFP::VEC3 VEC3 ;
class SimpleMap3 : public Utils::QT::SimpleQT
......@@ -56,7 +55,7 @@ public:
MAP myMap ;
SelectorTrue allDarts ;
VertexAttribute<VEC3, MAP_IMPL> position ;
VertexAttribute<VEC3, MAP> position ;
Algo::Render::GL2::Topo3RenderMap<PFP>* m_render_topo;
Algo::Render::GL2::TopoRenderMap<PFP>* m_render_topo_boundary;
......
......@@ -89,9 +89,9 @@ void TexView::cb_initGL()
if (!m_obj.hasNormals())
{
VertexAttribute<Geom::Vec3f, MAP_IMPL> normal = myMap.getAttribute<VEC3, VERTEX>("normal") ;
VertexAttribute<Geom::Vec3f, MAP> normal = myMap.getAttribute<VEC3, VERTEX, MAP>("normal") ;
if(!normal.isValid())
normal = myMap.addAttribute<VEC3, VERTEX>("normal") ;
normal = myMap.addAttribute<VEC3, VERTEX, MAP>("normal") ;
Algo::Surface::Geometry::computeNormalVertices<PFP>(myMap, m_obj.m_positions, normal) ;
m_obj.setNormalAttribute(normal);
......@@ -206,8 +206,8 @@ void TexView::computeTore()
{
#define NB 96
VertexAttribute<VEC3, MAP_IMPL> position = myMap.addAttribute<VEC3, VERTEX>("position");
VertexAttribute<Geom::Vec2f, MAP_IMPL> texcoord = myMap.addAttribute<Geom::Vec2f, VERTEX>("texcoord");
VertexAttribute<VEC3, MAP> position = myMap.addAttribute<VEC3, VERTEX, MAP>("position");
VertexAttribute<Geom::Vec2f, MAP> texcoord = myMap.addAttribute<Geom::Vec2f, VERTEX, MAP>("texcoord");
//Algo::Surface::Modelisation::Polyhedron<PFP> prim(myMap, position);
Algo::Surface::Tilings::Square::Tore<PFP> prim(myMap, NB, NB);
prim.embedIntoTore(position, 40.0f,20.0f);
......
......@@ -50,7 +50,6 @@ struct PFP: public PFP_STANDARD
};
typedef PFP::MAP MAP ;
typedef PFP::MAP::IMPL MAP_IMPL ;
typedef PFP::VEC3 VEC3 ;
/**
......
......@@ -198,14 +198,13 @@ void Viewer::cb_keyPress(int keycode)
myMap.check();
break;
case 'a':
{
Utils::Chrono ch;
ch.start();
VertexAttribute<VEC3,MAP_IMPL> pos2 = myMap.getAttribute<VEC3, VERTEX>("pos2") ;
VertexAttribute<VEC3, MAP> pos2 = myMap.getAttribute<VEC3, VERTEX, MAP>("pos2") ;
if(!pos2.isValid())
pos2 = myMap.addAttribute<VEC3, VERTEX>("pos2") ;
pos2 = myMap.addAttribute<VEC3, VERTEX, MAP>("pos2") ;
for (int i=0; i< 10; ++i)
{
......@@ -222,7 +221,7 @@ void Viewer::cb_keyPress(int keycode)
}
pos2[d]/=nb;
}
myMap.swapAttributes(position,pos2);
myMap.swapAttributes(position, pos2);
}
std::cout << "Traversor "<< ch.elapsed()<< " ms "<< std::endl;
Algo::Surface::Geometry::computeNormalVertices<PFP>(myMap, position, normal) ;
......@@ -237,9 +236,9 @@ void Viewer::cb_keyPress(int keycode)
Utils::Chrono ch;
ch.start();
VertexAttribute<VEC3,MAP_IMPL> pos2 = myMap.getAttribute<VEC3, VERTEX>("pos2") ;
VertexAttribute<VEC3,MAP> pos2 = myMap.getAttribute<VEC3, VERTEX, MAP>("pos2") ;
if(!pos2.isValid())
pos2 = myMap.addAttribute<VEC3, VERTEX>("pos2") ;
pos2 = myMap.addAttribute<VEC3, VERTEX, MAP>("pos2") ;
for (int i=0; i< 6; ++i)
{
......@@ -268,35 +267,35 @@ void Viewer::cb_keyPress(int keycode)
Utils::Chrono ch;
ch.start();
VertexAttribute<VEC3,MAP_IMPL> pos2 = myMap.getAttribute<VEC3, VERTEX>("pos2") ;
VertexAttribute<VEC3,MAP> pos2 = myMap.getAttribute<VEC3, VERTEX, MAP>("pos2") ;
if(!pos2.isValid())
pos2 = myMap.addAttribute<VEC3, VERTEX>("pos2") ;
// foreach_cell_EvenOddd<VERTEX>(myMap, [&] (Vertex d)
// {
// pos2[d] = VEC3(0,0,0);
// int nb=0;
// foreach_adjacent2<FACE>(myMap,d,[&](Vertex e)
// {
// pos2[d] += position[e];
// nb++;
// });
// pos2[d]/=nb;
// },
// [&] (Vertex d)
// {
// position[d] = VEC3(0,0,0);
// int nb=0;
// foreach_adjacent2<FACE>(myMap,d,[&](Vertex e)
// {
// position[d] += pos2[e];
// nb++;
// });
// position[d]/=nb;
// },
// 3);
// std::cout << "Even/Odd "<< ch.elapsed()<< " ms "<< std::endl;
pos2 = myMap.addAttribute<VEC3, VERTEX, MAP>("pos2") ;
// foreach_cell_EvenOddd<VERTEX>(myMap, [&] (Vertex d)
// {
// pos2[d] = VEC3(0,0,0);
// int nb=0;
// foreach_adjacent2<FACE>(myMap,d,[&](Vertex e)
// {
// pos2[d] += position[e];
// nb++;
// });
// pos2[d]/=nb;
// },
// [&] (Vertex d)
// {
// position[d] = VEC3(0,0,0);
// int nb=0;
// foreach_adjacent2<FACE>(myMap,d,[&](Vertex e)
// {
// position[d] += pos2[e];
// nb++;
// });
// position[d]/=nb;
// },
// 3);
// std::cout << "Even/Odd "<< ch.elapsed()<< " ms "<< std::endl;
Algo::Surface::Geometry::computeNormalVertices<PFP>(myMap, position, normal) ;
m_positionVBO->updateData(position) ;
m_normalVBO->updateData(normal) ;
......@@ -308,9 +307,9 @@ void Viewer::cb_keyPress(int keycode)
{
Utils::Chrono ch;
ch.start();
VertexAttribute<VEC3,MAP_IMPL> pos2 = myMap.getAttribute<VEC3, VERTEX>("pos2") ;
VertexAttribute<VEC3,MAP> pos2 = myMap.getAttribute<VEC3, VERTEX, MAP>("pos2") ;
if(!pos2.isValid())
pos2 = myMap.addAttribute<VEC3, VERTEX>("pos2") ;
pos2 = myMap.addAttribute<VEC3, VERTEX, MAP>("pos2") ;
for (int i=0; i< 10; ++i)
{
......@@ -342,9 +341,9 @@ void Viewer::cb_keyPress(int keycode)
Utils::Chrono ch;
ch.start();
VertexAttribute<VEC3,MAP_IMPL> pos2 = myMap.getAttribute<VEC3, VERTEX>("pos2") ;
VertexAttribute<VEC3,MAP> pos2 = myMap.getAttribute<VEC3, VERTEX, MAP>("pos2") ;
if(!pos2.isValid())
pos2 = myMap.addAttribute<VEC3, VERTEX>("pos2") ;
pos2 = myMap.addAttribute<VEC3, VERTEX, MAP>("pos2") ;
for (int i=0; i< 10; ++i)
{
......@@ -376,7 +375,7 @@ void Viewer::cb_keyPress(int keycode)
Utils::Chrono ch;
ch.start();
{
TraversorCell<MAP, VERTEX,FORCE_CELL_MARKING> trav(myMap,true);
TraversorCell<MAP, VERTEX, FORCE_CELL_MARKING> trav(myMap,true);
for(unsigned int i=0; i<NBLOOP; ++i)
{
for (Cell<VERTEX> v = trav.begin(), e = trav.end(); v.dart != e.dart; v = trav.next())
......@@ -415,7 +414,7 @@ void Viewer::cb_keyPress(int keycode)
ch.start();
{
TraversorCell<MAP, VERTEX,FORCE_DART_MARKING> trav(myMap,true);
TraversorCell<MAP, VERTEX, FORCE_DART_MARKING> trav(myMap,true);
for(unsigned int i=0; i<NBLOOP; ++i)
{
for (Cell<VERTEX> v = trav.begin(), e = trav.end(); v.dart != e.dart; v = trav.next())
......@@ -425,7 +424,7 @@ void Viewer::cb_keyPress(int keycode)
}
std::cout << "FORCE_DART_MARKING "<< ch.elapsed()<< " ms "<< std::endl;
}
myMap.enableQuickTraversal<VERTEX>() ;
myMap.enableQuickTraversal<MAP, VERTEX>() ;
ch.start();
{
TraversorCell<MAP, VERTEX> trav(myMap);
......@@ -441,7 +440,7 @@ void Viewer::cb_keyPress(int keycode)
ch.start();
{
TraversorCell<MAP, VERTEX,FORCE_QUICK_TRAVERSAL> trav(myMap);
TraversorCell<MAP, VERTEX, FORCE_QUICK_TRAVERSAL> trav(myMap);
for(unsigned int i=0; i<NBLOOP; ++i)
{
for (Cell<VERTEX> v = trav.begin(), e = trav.end(); v.dart != e.dart; v = trav.next())
......@@ -500,27 +499,27 @@ void Viewer::cb_keyPress(int keycode)
Algo::Surface::Geometry::Parallel::computeNormalVertices<PFP>(myMap, position, normal) ;
std::cout << "Algo::Surface::Geometry::Parallel::computeNormalVertices8 "<< ch.elapsed()<< " ms "<< std::endl;
ch.start();
for (unsigned int i=0; i<4; ++i)
Parallel::foreach_cell<VERTEX>(myMap,[&](Vertex v, unsigned int th)
Parallel::foreach_cell<VERTEX>(myMap, [&] (Vertex v, unsigned int th)
{
normal[v] = Algo::Surface::Geometry::vertexNormal<PFP>(myMap,v,position);
},false,FORCE_CELL_MARKING);
}, false, FORCE_CELL_MARKING);
std::cout << "Parallel::foreach_cell "<< ch.elapsed()<< " ms "<< std::endl;
// ch.start();
// Parallel::foreach_cell_EO<VERTEX>(myMap,[&](Vertex v, unsigned int thr)
// {
// normal[v] = Algo::Surface::Geometry::vertexNormal<PFP>(myMap,v,position);
// },
// [&](Vertex v, unsigned int th)
// {
// normal[v] = Algo::Surface::Geometry::vertexNormal<PFP>(myMap,v,position);
// },2,4,false,FORCE_CELL_MARKING);
// ch.start();
// Parallel::foreach_cell_EO<VERTEX>(myMap,[&](Vertex v, unsigned int thr)
// {
// normal[v] = Algo::Surface::Geometry::vertexNormal<PFP>(myMap,v,position);
// },
// [&](Vertex v, unsigned int th)
// {
// normal[v] = Algo::Surface::Geometry::vertexNormal<PFP>(myMap,v,position);
// },2,4,false,FORCE_CELL_MARKING);
// std::cout << "Parallel::foreach_cell_EO "<< ch.elapsed()<< " ms "<< std::endl;
// std::cout << "Parallel::foreach_cell_EO "<< ch.elapsed()<< " ms "<< std::endl;
}
......@@ -542,7 +541,7 @@ void Viewer::importMesh(std::string& filename)
if (extension == std::string(".map"))
{
myMap.loadMapBin(filename);
position = myMap.getAttribute<VEC3, VERTEX>("position") ;
position = myMap.getAttribute<VEC3, VERTEX, MAP>("position") ;
}
else
{
......@@ -552,10 +551,10 @@ void Viewer::importMesh(std::string& filename)
CGoGNerr << "could not import " << filename << CGoGNendl ;
return;
}
position = myMap.getAttribute<PFP::VEC3, VERTEX>(attrNames[0]) ;
position = myMap.getAttribute<PFP::VEC3, VERTEX, MAP>(attrNames[0]) ;
}
// myMap.enableQuickTraversal<VERTEX>() ;
// myMap.enableQuickTraversal<VERTEX>() ;
m_render->initPrimitives<PFP>(myMap, Algo::Render::GL2::POINTS) ;
m_render->initPrimitives<PFP>(myMap, Algo::Render::GL2::LINES) ;
......@@ -565,11 +564,11 @@ void Viewer::importMesh(std::string& filename)
bb = Algo::Geometry::computeBoundingBox<PFP>(myMap, position) ;
normalBaseSize = bb.diagSize() / 100.0f ;
// vertexBaseSize = normalBaseSize / 5.0f ;
// vertexBaseSize = normalBaseSize / 5.0f ;
normal = myMap.getAttribute<VEC3, VERTEX>("normal") ;
normal = myMap.getAttribute<VEC3, VERTEX, MAP>("normal") ;
if(!normal.isValid())
normal = myMap.addAttribute<VEC3, VERTEX>("normal") ;
normal = myMap.addAttribute<VEC3, VERTEX, MAP>("normal") ;
Utils::Chrono c;
c.start();
......@@ -598,7 +597,7 @@ void Viewer::exportMesh(std::string& filename, bool askExportMode)
if (askExportMode)
Utils::QT::inputValues(Utils::QT::VarCombo("binary mode;ascii mode",ascii,"Save in")) ;
std::vector<VertexAttribute<VEC3, MAP_IMPL>*> attributes ;
std::vector<VertexAttribute<VEC3, MAP>*> attributes ;
attributes.push_back(&position) ;
Algo::Surface::Export::exportPLYnew<PFP>(myMap, attributes, filename.c_str(), !ascii) ;
}
......
......@@ -64,7 +64,6 @@ struct PFP: public PFP_STANDARD
};
typedef PFP::MAP MAP ;
typedef PFP::MAP::IMPL MAP_IMPL ;
typedef PFP::VEC3 VEC3 ;
//class Viewer : public Utils::QT::SimpleQT
......@@ -101,8 +100,8 @@ public:
bool m_drawTopo ;
bool m_drawBoundaryTopo;
VertexAttribute<VEC3, MAP_IMPL> position ;
VertexAttribute<VEC3, MAP_IMPL> normal ;
VertexAttribute<VEC3, MAP> position ;
VertexAttribute<VEC3, MAP> normal ;