Commit 3997f4cc authored by Pierre Kraemer's avatar Pierre Kraemer

Algo Geometry with Traversors..

parent 7e4bfc8d
...@@ -173,6 +173,13 @@ void Viewer::cb_Open() ...@@ -173,6 +173,13 @@ void Viewer::cb_Open()
updateGL() ; updateGL() ;
} }
void Viewer::cb_Save()
{
std::string filters("off (*.off)") ;
std::string filename = selectFileSave("Save Mesh", "", filters) ;
Algo::Export::exportOFF<PFP>(myMap, position, filename.c_str(), allDarts) ;
}
void Viewer::importMesh(std::string& filename) void Viewer::importMesh(std::string& filename)
{ {
myMap.clear(true) ; myMap.clear(true) ;
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include "Geometry/matrix.h" #include "Geometry/matrix.h"
#include "Algo/Import/import.h" #include "Algo/Import/import.h"
#include "Algo/Export/export.h"
#include "Algo/Render/GL2/mapRender.h" #include "Algo/Render/GL2/mapRender.h"
...@@ -110,6 +111,7 @@ public: ...@@ -110,6 +111,7 @@ public:
void cb_initGL() ; void cb_initGL() ;
void cb_redraw() ; void cb_redraw() ;
void cb_Open() ; void cb_Open() ;
void cb_Save() ;
void importMesh(std::string& filename) ; void importMesh(std::string& filename) ;
......
...@@ -61,7 +61,7 @@ bool exportOFF(typename PFP::MAP& map, const typename PFP::TVEC3& position, cons ...@@ -61,7 +61,7 @@ bool exportOFF(typename PFP::MAP& map, const typename PFP::TVEC3& position, cons
* @return true * @return true
*/ */
template <typename PFP> template <typename PFP>
bool exportTrian(typename PFP::MAP& the_map, const typename PFP::TVEC3& position, char* filename, const FunctorSelect& good = SelectorTrue()) ; bool exportTrian(typename PFP::MAP& map, const typename PFP::TVEC3& position, char* filename, const FunctorSelect& good = SelectorTrue()) ;
/** /**
* export the map into a Trian file * export the map into a Trian file
...@@ -70,7 +70,7 @@ bool exportTrian(typename PFP::MAP& the_map, const typename PFP::TVEC3& position ...@@ -70,7 +70,7 @@ bool exportTrian(typename PFP::MAP& the_map, const typename PFP::TVEC3& position
* @return true * @return true
*/ */
template <typename PFP> template <typename PFP>
bool exportCTM(typename PFP::MAP& the_map, const typename PFP::TVEC3& position, const std::string& filename, const FunctorSelect& good = SelectorTrue()) ; bool exportCTM(typename PFP::MAP& map, const typename PFP::TVEC3& position, const std::string& filename, const FunctorSelect& good = SelectorTrue()) ;
/** /**
* export the map into a PLYPTMgeneric file (K. Vanhoey generic format). * export the map into a PLYPTMgeneric file (K. Vanhoey generic format).
......
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
#include "Topology/generic/attributeHandler.h" #include "Topology/generic/attributeHandler.h"
#include "Topology/generic/autoAttributeHandler.h" #include "Topology/generic/autoAttributeHandler.h"
#include "Topology/generic/traversorCell.h"
#include "Topology/generic/traversor2.h"
#include "Topology/generic/cellmarker.h" #include "Topology/generic/cellmarker.h"
#include "openctm.h" #include "openctm.h"
...@@ -60,28 +62,28 @@ bool exportPLY(typename PFP::MAP& map, const typename PFP::TVEC3& position, cons ...@@ -60,28 +62,28 @@ bool exportPLY(typename PFP::MAP& map, const typename PFP::TVEC3& position, cons
vertices.reserve(nbDarts/6) ; vertices.reserve(nbDarts/6) ;
CellMarker markV(map, VERTEX) ; CellMarker markV(map, VERTEX) ;
DartMarker markF(map) ; TraversorF<MAP> t(map) ;
for(Dart d = map.begin(); d != map.end(); map.next(d)) for(Dart d = t.begin(); d != t.end(); d = t.next())
{ {
if(good(d) && !markF.isMarked(d)) if(good(d))
{ {
markF.markOrbit(FACE, d) ;
std::vector<unsigned int> fidx ; std::vector<unsigned int> fidx ;
fidx.reserve(4) ; fidx.reserve(8) ;
Dart dd = d ; unsigned int degree = 0 ;
do Traversor2FV<typename PFP::MAP> tfv(map, d) ;
for(Dart it = tfv.begin(); it != tfv.end(); it = tfv.next())
{ {
unsigned int vNum = map.getEmbedding(VERTEX, dd) ; ++degree ;
if(!markV.isMarked(dd)) unsigned int vNum = map.getEmbedding(VERTEX, it) ;
if(!markV.isMarked(it))
{ {
markV.mark(dd) ; markV.mark(it) ;
vIndex[vNum] = vCpt++ ; vIndex[vNum] = vCpt++ ;
vertices.push_back(vNum) ; vertices.push_back(vNum) ;
} }
fidx.push_back(vIndex[vNum]) ; fidx.push_back(vIndex[vNum]) ;
dd = map.phi1(dd) ; }
} while(dd != d) ; facesSize.push_back(degree) ;
facesSize.push_back(map.faceDegree(d)) ;
facesIdx.push_back(fidx) ; facesIdx.push_back(fidx) ;
} }
} }
...@@ -138,28 +140,28 @@ bool exportOFF(typename PFP::MAP& map, const typename PFP::TVEC3& position, cons ...@@ -138,28 +140,28 @@ bool exportOFF(typename PFP::MAP& map, const typename PFP::TVEC3& position, cons
vertices.reserve(nbDarts/6) ; vertices.reserve(nbDarts/6) ;
CellMarker markV(map, VERTEX) ; CellMarker markV(map, VERTEX) ;
DartMarker markF(map) ; TraversorF<MAP> t(map) ;
for(Dart d = map.begin(); d != map.end(); map.next(d)) for(Dart d = t.begin(); d != t.end(); d = t.next())
{ {
if(good(d) && !markF.isMarked(d)) if(good(d))
{ {
markF.markOrbit(FACE, d) ;
std::vector<unsigned int> fidx ; std::vector<unsigned int> fidx ;
fidx.reserve(4) ; fidx.reserve(8) ;
Dart dd = d ; unsigned int degree = 0 ;
do Traversor2FV<typename PFP::MAP> tfv(map, d) ;
for(Dart it = tfv.begin(); it != tfv.end(); it = tfv.next())
{ {
unsigned int vNum = map.getEmbedding(VERTEX, dd) ; ++degree ;
if(!markV.isMarked(dd)) unsigned int vNum = map.getEmbedding(VERTEX, it) ;
if(!markV.isMarked(it))
{ {
markV.mark(dd) ; markV.mark(it) ;
vIndex[vNum] = vCpt++ ; vIndex[vNum] = vCpt++ ;
vertices.push_back(vNum) ; vertices.push_back(vNum) ;
} }
fidx.push_back(vIndex[vNum]) ; fidx.push_back(vIndex[vNum]) ;
dd = map.phi1(dd) ; }
} while(dd != d) ; facesSize.push_back(degree) ;
facesSize.push_back(map.faceDegree(d)) ;
facesIdx.push_back(fidx) ; facesIdx.push_back(fidx) ;
} }
} }
...@@ -185,44 +187,41 @@ bool exportOFF(typename PFP::MAP& map, const typename PFP::TVEC3& position, cons ...@@ -185,44 +187,41 @@ bool exportOFF(typename PFP::MAP& map, const typename PFP::TVEC3& position, cons
} }
template <typename PFP> template <typename PFP>
bool exportCTM(typename PFP::MAP& the_map, const typename PFP::TVEC3& position, const std::string& filename, const FunctorSelect& good) bool exportCTM(typename PFP::MAP& map, const typename PFP::TVEC3& position, const std::string& filename, const FunctorSelect& good)
{ {
typedef typename PFP::MAP MAP; typedef typename PFP::MAP MAP;
typedef typename PFP::VEC3 VEC3; typedef typename PFP::VEC3 VEC3;
AutoAttributeHandler<unsigned int> tableVertLab(the_map, VERTEX); AutoAttributeHandler<unsigned int> tableVertLab(map, VERTEX);
CellMarker markV(the_map,VERTEX);
unsigned int nbDarts = the_map.getNbDarts() ; unsigned int nbDarts = map.getNbDarts() ;
std::vector<CTMfloat> verticesBuffer; std::vector<CTMfloat> verticesBuffer;
std::vector<CTMuint> indicesBuffer; std::vector<CTMuint> indicesBuffer;
verticesBuffer.reserve(nbDarts/5); // TODO non optimal reservation verticesBuffer.reserve(nbDarts/5); // TODO non optimal reservation
indicesBuffer.reserve(nbDarts/3); indicesBuffer.reserve(nbDarts/3);
DartMarker markF(the_map); CellMarker markV(map,VERTEX);
unsigned int lab=0; TraversorF<MAP> t(map) ;
for(Dart d = the_map.begin(); d != the_map.end(); the_map.next(d)) unsigned int lab = 0;
for(Dart d = t.begin(); d != t.end(); d = t.next())
{ {
if(good(d) && !markF.isMarked(d)) if(good(d))
{ {
markF.markOrbit(FACE, d) ; Traversor2FV<typename PFP::MAP> tfv(map, d) ;
Dart e = d; for(Dart it = tfv.begin(); it != tfv.end(); it = tfv.next())
do
{ {
if (!markV.isMarked(e)) if (!markV.isMarked(it))
{ {
tableVertLab[e] = lab++; markV.mark(it);
markV.mark(e); tableVertLab[it] = lab++;
const VEC3& vert = position[e]; const VEC3& vert = position[it];
verticesBuffer.push_back(vert[0]); verticesBuffer.push_back(vert[0]);
verticesBuffer.push_back(vert[1]); verticesBuffer.push_back(vert[1]);
verticesBuffer.push_back(vert[2]); verticesBuffer.push_back(vert[2]);
} }
indicesBuffer.push_back(tableVertLab[e]); indicesBuffer.push_back(tableVertLab[it]);
e = the_map.phi1(e); }
} while (e!=d);
} }
} }
...@@ -265,7 +264,6 @@ bool exportPlyPTMgeneric(typename PFP::MAP& map, const char* filename, const typ ...@@ -265,7 +264,6 @@ bool exportPlyPTMgeneric(typename PFP::MAP& map, const char* filename, const typ
AutoAttributeHandler<unsigned int> tableVertLab(map, VERTEX); AutoAttributeHandler<unsigned int> tableVertLab(map, VERTEX);
CellMarker markV(map,VERTEX);
unsigned int nbDarts = map.getNbDarts() ; unsigned int nbDarts = map.getNbDarts() ;
...@@ -275,28 +273,26 @@ bool exportPlyPTMgeneric(typename PFP::MAP& map, const char* filename, const typ ...@@ -275,28 +273,26 @@ bool exportPlyPTMgeneric(typename PFP::MAP& map, const char* filename, const typ
vertices.reserve(nbDarts/5); // TODO non optimal reservation vertices.reserve(nbDarts/5); // TODO non optimal reservation
faces.reserve(nbDarts/3); faces.reserve(nbDarts/3);
DartMarker markF(map); CellMarker markV(map, VERTEX);
TraversorF<MAP> t(map) ;
unsigned int lab = 0; unsigned int lab = 0;
unsigned int nbf = 0; unsigned int nbf = 0;
for(Dart d = map.begin(); d != map.end(); map.next(d)) for(Dart d = t.begin(); d != t.end(); d = t.next())
{ {
if(good(d) && !markF.isMarked(d)) if(good(d))
{ {
markF.markOrbit(FACE, d) ;
Dart e = d;
std::vector<unsigned int> face ; std::vector<unsigned int> face ;
do Traversor2FV<typename PFP::MAP> tfv(map, d) ;
for(Dart it = tfv.begin(); it != tfv.end(); it = tfv.next())
{ {
if (!markV.isMarked(e)) if (!markV.isMarked(it))
{ {
vertices.push_back(map.getEmbedding(VERTEX, e)); markV.mark(it);
tableVertLab[e] = lab++; tableVertLab[it] = lab++;
vertices.push_back(map.getEmbedding(VERTEX, it));
markV.mark(e);
} }
face.push_back(tableVertLab[e]); face.push_back(tableVertLab[it]);
e = map.phi1(e); }
} while (e!=d) ;
faces.push_back(face.size()) ; faces.push_back(face.size()) ;
for (unsigned int i = 0 ; i < face.size() ; ++i) for (unsigned int i = 0 ; i < face.size() ; ++i)
...@@ -410,8 +406,6 @@ bool exportPLYPTM(typename PFP::MAP& map, const char* filename, const typename P ...@@ -410,8 +406,6 @@ bool exportPLYPTM(typename PFP::MAP& map, const char* filename, const typename P
AutoAttributeHandler<unsigned int> tableVertLab(map, VERTEX); AutoAttributeHandler<unsigned int> tableVertLab(map, VERTEX);
CellMarker markV(map,VERTEX);
unsigned int nbDarts = map.getNbDarts() ; unsigned int nbDarts = map.getNbDarts() ;
std::vector<unsigned int> vertices; std::vector<unsigned int> vertices;
...@@ -420,28 +414,26 @@ bool exportPLYPTM(typename PFP::MAP& map, const char* filename, const typename P ...@@ -420,28 +414,26 @@ bool exportPLYPTM(typename PFP::MAP& map, const char* filename, const typename P
vertices.reserve(nbDarts/5); // TODO non optimal reservation vertices.reserve(nbDarts/5); // TODO non optimal reservation
faces.reserve(nbDarts/3); faces.reserve(nbDarts/3);
DartMarker markF(map); CellMarker markV(map, VERTEX);
TraversorF<MAP> t(map) ;
unsigned int lab = 0; unsigned int lab = 0;
unsigned int nbf = 0; unsigned int nbf = 0;
for(Dart d = map.begin(); d != map.end(); map.next(d)) for(Dart d = t.begin(); d != t.end(); d = t.next())
{ {
if(good(d) && !markF.isMarked(d)) if(good(d))
{ {
markF.markOrbit(FACE, d) ;
Dart e = d;
std::vector<unsigned int> face ; std::vector<unsigned int> face ;
do Traversor2FV<typename PFP::MAP> tfv(map, d) ;
for(Dart it = tfv.begin(); it != tfv.end(); it = tfv.next())
{ {
if (!markV.isMarked(e)) if (!markV.isMarked(it))
{ {
vertices.push_back(map.getEmbedding(VERTEX, e)); markV.mark(it);
tableVertLab[e] = lab++; tableVertLab[it] = lab++;
vertices.push_back(map.getEmbedding(VERTEX, it));
markV.mark(e);
} }
face.push_back(tableVertLab[e]); face.push_back(tableVertLab[it]);
e = map.phi1(e); }
} while (e!=d) ;
faces.push_back(face.size()) ; faces.push_back(face.size()) ;
for (unsigned int i = 0 ; i < face.size() ; ++i) for (unsigned int i = 0 ; i < face.size() ; ++i)
...@@ -515,7 +507,6 @@ bool exportPLYPTM(typename PFP::MAP& map, const char* filename, const typename P ...@@ -515,7 +507,6 @@ bool exportPLYPTM(typename PFP::MAP& map, const char* filename, const typename P
return true ; return true ;
} }
template <typename PFP> template <typename PFP>
bool exportInESS(typename PFP::MAP& map, const char *filename, const typename PFP::TVEC3& position) bool exportInESS(typename PFP::MAP& map, const char *filename, const typename PFP::TVEC3& position)
{ {
...@@ -528,8 +519,6 @@ bool exportInESS(typename PFP::MAP& map, const char *filename, const typename PF ...@@ -528,8 +519,6 @@ bool exportInESS(typename PFP::MAP& map, const char *filename, const typename PF
CGoGNerr << "Unable to open file " << CGoGNendl ; CGoGNerr << "Unable to open file " << CGoGNendl ;
return false ; return false ;
} }
} }
} // namespace Export } // namespace Export
......
#ifndef EXPORT_POV_H #ifndef EXPORT_POV_H
#define EXPORT_POV #define EXPORT_POV_H
#include "Topology/generic/attributeHandler.h" #include "Topology/generic/attributeHandler.h"
#include "Utils/cgognStream.h" #include "Utils/cgognStream.h"
...@@ -40,26 +40,30 @@ void exportMeshPlain(std::ofstream& out, typename PFP::MAP& map, typename PFP::T ...@@ -40,26 +40,30 @@ void exportMeshPlain(std::ofstream& out, typename PFP::MAP& map, typename PFP::T
DartMarkerStore traite(map); DartMarkerStore traite(map);
for(Dart d = map.begin() ; d!= map.end() ; map.next(d)) { for(Dart d = map.begin() ; d!= map.end() ; map.next(d))
if(good(d) && !traite.isMarked(d)) { {
if(good(d) && !traite.isMarked(d))
{
unsigned int nb=0; unsigned int nb=0;
Dart dd=d; Dart dd=d;
do { do
{
traite.markOrbit(DART,dd); traite.markOrbit(DART,dd);
dd = map.phi1(dd); dd = map.phi1(dd);
nb++; nb++;
} while(dd!=d); } while(dd!=d);
if(nb==3) { if(nb == 3)
Algo::ExportPov::exportTrianglePlain<PFP>(out,position[dd],position[map.phi1(dd)],position[map.phi1(map.phi1(dd))]); Algo::ExportPov::exportTrianglePlain<PFP>(out,position[dd],position[map.phi1(dd)],position[map.phi1(map.phi1(dd))]);
} else
else { {
out << "polygon{ " << nb+1 << std::endl; out << "polygon{ " << nb+1 << std::endl;
dd=d; dd = d;
do { do
{
out << "<" << position[dd][0] << "," << position[dd][2] << "," << position[dd][1] << ">," << std::endl; out << "<" << position[dd][0] << "," << position[dd][2] << "," << position[dd][1] << ">," << std::endl;
dd = map.phi1(dd); dd = map.phi1(dd);
}while(dd!=d); } while(dd!=d);
out << "<" << position[d][0] << "," << position[d][2] << "," << position[d][1] << ">" << std::endl; out << "<" << position[d][0] << "," << position[d][2] << "," << position[d][1] << ">" << std::endl;
out << "}" << std::endl; out << "}" << std::endl;
} }
...@@ -76,30 +80,35 @@ void exportMeshWire(std::ofstream& out, typename PFP::MAP& map, typename PFP::TV ...@@ -76,30 +80,35 @@ void exportMeshWire(std::ofstream& out, typename PFP::MAP& map, typename PFP::TV
DartMarkerStore traite(map); DartMarkerStore traite(map);
for(Dart d = map.begin() ; d!= map.end() ; map.next(d)) { for(Dart d = map.begin() ; d!= map.end() ; map.next(d))
if(good(d) && !traite.isMarked(d)) { {
unsigned int nb=0; if(good(d) && !traite.isMarked(d))
Dart dd=d; {
do { unsigned int nb = 0;
traite.markOrbit(DART,dd); Dart dd = d;
do
{
traite.markOrbit(DART, dd);
dd = map.phi1(dd); dd = map.phi1(dd);
nb++; nb++;
} while(dd!=d); } while(dd != d);
if(nb==3) { if(nb == 3)
Algo::ExportPov::exportTriangleWire<PFP>(out,position[dd],position[map.phi1(dd)],position[map.phi1(map.phi1(dd))]); Algo::ExportPov::exportTriangleWire<PFP>(out,position[dd],position[map.phi1(dd)],position[map.phi1(map.phi1(dd))]);
} else
else { {
dd=d; dd = d;
do { do
if(position[dd][0]!=position[map.phi1(dd)][0] || position[dd][1]!=position[map.phi1(dd)][1] || position[dd][2]!=position[map.phi1(dd)][2]) { {
if(position[dd][0]!=position[map.phi1(dd)][0] || position[dd][1]!=position[map.phi1(dd)][1] || position[dd][2]!=position[map.phi1(dd)][2])
{
out << "cylinder{ " << std::endl; out << "cylinder{ " << std::endl;
out << "<" << position[dd][0] << "," << position[dd][2] << "," << position[dd][1] << ">," << std::endl; out << "<" << position[dd][0] << "," << position[dd][2] << "," << position[dd][1] << ">," << std::endl;
out << "<" << position[map.phi1(dd)][0] << "," << position[map.phi1(dd)][2] << "," << position[map.phi1(dd)][1] << ">, 0.5" << std::endl; out << "<" << position[map.phi1(dd)][0] << "," << position[map.phi1(dd)][2] << "," << position[map.phi1(dd)][1] << ">, 0.5" << std::endl;
out << "}" << std::endl; out << "}" << std::endl;
} }
dd = map.phi1(dd); dd = map.phi1(dd);
}while(dd!=d); } while(dd != d);
} }
} }
} }
...@@ -111,7 +120,8 @@ template <typename PFP> ...@@ -111,7 +120,8 @@ template <typename PFP>
bool exportScenePov(typename PFP::MAP& map, typename PFP::TVEC3& position, const std::string& filename, typename PFP::VEC3 cameraPos, typename PFP::VEC3 cameraLook, typename PFP::VEC3 translate, float angle_X, float angle_Y, float angle_Z,const FunctorSelect& good = SelectorTrue()) bool exportScenePov(typename PFP::MAP& map, typename PFP::TVEC3& position, const std::string& filename, typename PFP::VEC3 cameraPos, typename PFP::VEC3 cameraLook, typename PFP::VEC3 translate, float angle_X, float angle_Y, float angle_Z,const FunctorSelect& good = SelectorTrue())
{ {
std::ofstream out(filename.c_str(), std::ios::out); std::ofstream out(filename.c_str(), std::ios::out);
if (!out.good()) { if (!out.good())
{
CGoGNerr << "(export) Unable to open file " << filename << CGoGNendl; CGoGNerr << "(export) Unable to open file " << filename << CGoGNendl;
return false; return false;
} }
...@@ -147,10 +157,10 @@ bool exportScenePov(typename PFP::MAP& map, typename PFP::TVEC3& position, const ...@@ -147,10 +157,10 @@ bool exportScenePov(typename PFP::MAP& map, typename PFP::TVEC3& position, const
return true; return true;
} }
} } // namespace ExportPov
} } // namespace Algo
} } // namespace CGoGN
#endif #endif
...@@ -58,7 +58,6 @@ void filterTaubin(typename PFP::MAP& map, typename PFP::TVEC3& position, typenam ...@@ -58,7 +58,6 @@ void filterTaubin(typename PFP::MAP& map, typename PFP::TVEC3& position, typenam
c.applyOnBorder(fa1) ; c.applyOnBorder(fa1) ;
VEC3 p = position[d] ; VEC3 p = position[d] ;
VEC3 displ = fa1.getAverage() - p ; VEC3 displ = fa1.getAverage() - p ;
// VEC3 displ = (fa1.getSum() - p * fa1.getCount()) / fa1.getCount() ;
displ *= lambda ; displ *= lambda ;
position2[d] = p + displ ; position2[d] = p + displ ;
} }
...@@ -77,7 +76,6 @@ void filterTaubin(typename PFP::MAP& map, typename PFP::TVEC3& position, typenam ...@@ -77,7 +76,6 @@ void filterTaubin(typename PFP::MAP& map, typename PFP::TVEC3& position, typenam
c.applyOnBorder(fa2) ; c.applyOnBorder(fa2) ;
VEC3 p = position2[d] ; VEC3 p = position2[d] ;
VEC3 displ = fa2.getAverage() - p ; VEC3 displ = fa2.getAverage() - p ;
// VEC3 displ = (fa2.getSum() - p * fa2.getCount()) / fa2.getCount() ;
displ *= mu ; displ *= mu ;
position[d] = p + displ ; position[d] = p + displ ;
} }
...@@ -92,7 +90,6 @@ void filterTaubin_modified(typename PFP::MAP& map, typename PFP::TVEC3& position ...@@ -92,7 +90,6 @@ void filterTaubin_modified(typename PFP::MAP& map, typename PFP::TVEC3& position
{ {
typedef typename PFP::VEC3 VEC3 ; typedef typename PFP::VEC3 VEC3 ;
const float lambda = 0.6307 ; const float lambda = 0.6307 ;
const float mu = -0.6732 ; const float mu = -0.6732 ;
......
...@@ -115,7 +115,6 @@ typename PFP::VEC3 vertexNeighborhoodCentroid(typename PFP::MAP& map, Dart d, co ...@@ -115,7 +115,6 @@ typename PFP::VEC3 vertexNeighborhoodCentroid(typename PFP::MAP& map, Dart d, co
return vertexNeighborhoodCentroidGen<PFP, typename PFP::TVEC3, typename PFP::VEC3>(map, d, position); return vertexNeighborhoodCentroidGen<PFP, typename PFP::TVEC3, typename PFP::VEC3>(map, d, position);
} }
template <typename PFP> template <typename PFP>
void computeCentroidVolumes(typename PFP::MAP& map, const typename PFP::TVEC3& position, typename PFP::TVEC3& vol_centroid, const FunctorSelect& select = SelectorTrue()) ; void computeCentroidVolumes(typename PFP::MAP& map, const typename PFP::TVEC3& position, typename PFP::TVEC3& vol_centroid, const FunctorSelect& select = SelectorTrue()) ;
......
...@@ -24,7 +24,8 @@ ...@@ -24,7 +24,8 @@
#include "Algo/Geometry/localFrame.h" #include "Algo/Geometry/localFrame.h"
#include "Geometry/matrix.h" #include "Geometry/matrix.h"
#include "Topology/generic/cellmarker.h" #include "Topology/generic/traversorCell.h"
#include "Topology/generic/traversor2.h"
#include "Algo/Selection/collector.h" #include "Algo/Selection/collector.h"
extern "C" extern "C"
...@@ -55,14 +56,11 @@ void computeCurvatureVertices_QuadraticFitting( ...@@ -55,14 +56,11 @@ void computeCurvatureVertices_QuadraticFitting(
typename PFP::TVEC3& Kmin, typename PFP::TVEC3& Kmin,
const FunctorSelect& select) const FunctorSelect& select)
{ {
CellMarker marker(map, VERTEX); TraversorV<typename PFP::MAP> t(map) ;
for(Dart d = map.begin(); d != map.end(); map.next(d)) for(Dart d = t.begin(); d != t.end(); d = t.next())
{