Commit 70b2a513 authored by Pierre Kraemer's avatar Pierre Kraemer

orbit as template -> viewer OK

parent cb1ede68
......@@ -201,7 +201,7 @@ void Viewer::importMesh(std::string& filename)
if (extension == std::string(".map"))
{
myMap.loadMapBin(filename);
position = myMap.getAttribute<PFP::VEC3>(VERTEX, "position") ;
position = myMap.getAttribute<PFP::VEC3, VERTEX>("position") ;
}
else
{
......@@ -211,7 +211,7 @@ 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>(attrNames[0]) ;
}
m_render->initPrimitives<PFP>(myMap, allDarts, Algo::Render::GL2::POINTS) ;
......@@ -224,9 +224,9 @@ void Viewer::importMesh(std::string& filename)
normalBaseSize = bb.diagSize() / 100.0f ;
// vertexBaseSize = normalBaseSize / 5.0f ;
normal = myMap.getAttribute<PFP::VEC3>(VERTEX, "normal") ;
normal = myMap.getAttribute<PFP::VEC3, VERTEX>("normal") ;
if(!normal.isValid())
normal = myMap.addAttribute<PFP::VEC3>(VERTEX, "normal") ;
normal = myMap.addAttribute<PFP::VEC3, VERTEX>("normal") ;
Algo::Geometry::computeNormalVertices<PFP>(myMap, position, normal) ;
......@@ -246,7 +246,7 @@ void Viewer::exportMesh(std::string& filename)
Algo::Export::exportOFF<PFP>(myMap, position, filename.c_str(), allDarts) ;
else if (extension.compare(0, 4, std::string(".ply")) == 0)
{
std::vector<PFP::TVEC3*> attributes ;
std::vector<AttributeHandler<VEC3, VERTEX>*> attributes ;
attributes.push_back(&position) ;
Algo::Export::exportPLYnew<PFP>(myMap, attributes, filename.c_str(), true, allDarts) ;
}
......
......@@ -59,6 +59,7 @@ struct PFP: public PFP_STANDARD
};
typedef PFP::MAP MAP ;
typedef PFP::VEC3 VEC3 ;
class Viewer : public Utils::QT::SimpleQT
{
......@@ -92,8 +93,8 @@ public:
bool m_drawNormals ;
bool m_drawTopo ;
PFP::TVEC3 position ;
PFP::TVEC3 normal ;
AttributeHandler<VEC3, VERTEX> position ;
AttributeHandler<VEC3, VERTEX> normal ;
Algo::Render::GL2::MapRender* m_render ;
Algo::Render::GL2::TopoRender* m_topoRender ;
......
......@@ -46,7 +46,7 @@ namespace Export
* @return true
*/
template <typename PFP>
bool exportPLY(typename PFP::MAP& map, const typename PFP::TVEC3& position, const char* filename, const bool binary, const FunctorSelect& good = allDarts) ;
bool exportPLY(typename PFP::MAP& map, const AttributeHandler<typename PFP::VEC3, VERTEX>& position, const char* filename, const bool binary, const FunctorSelect& good = allDarts) ;
/**
* export the map into a PLY file
......@@ -57,7 +57,7 @@ bool exportPLY(typename PFP::MAP& map, const typename PFP::TVEC3& position, cons
* @return true
*/
template <typename PFP>
bool exportPLYnew(typename PFP::MAP& map, const std::vector<typename PFP::TVEC3* >& attributeHandlers, const char* filename, const bool binary, const FunctorSelect& good = allDarts) ;
bool exportPLYnew(typename PFP::MAP& map, const std::vector<AttributeHandler<typename PFP::VEC3, VERTEX>* >& attributeHandlers, const char* filename, const bool binary, const FunctorSelect& good = allDarts) ;
/**
* export the map into a OFF file
......@@ -66,7 +66,7 @@ bool exportPLYnew(typename PFP::MAP& map, const std::vector<typename PFP::TVEC3*
* @return true
*/
template <typename PFP>
bool exportOFF(typename PFP::MAP& map, const typename PFP::TVEC3& position, const char* filename, const FunctorSelect& good = allDarts) ;
bool exportOFF(typename PFP::MAP& map, const AttributeHandler<typename PFP::VEC3, VERTEX>& position, const char* filename, const FunctorSelect& good = allDarts) ;
/**
* export the map into a Trian file
......@@ -75,7 +75,7 @@ bool exportOFF(typename PFP::MAP& map, const typename PFP::TVEC3& position, cons
* @return true
*/
template <typename PFP>
bool exportTrian(typename PFP::MAP& map, const typename PFP::TVEC3& position, char* filename, const FunctorSelect& good = allDarts) ;
bool exportTrian(typename PFP::MAP& map, const AttributeHandler<typename PFP::VEC3, VERTEX>& position, char* filename, const FunctorSelect& good = allDarts) ;
/**
* export the map into a PLYPTMgeneric file (K. Vanhoey generic format).
......@@ -90,7 +90,7 @@ bool exportTrian(typename PFP::MAP& map, const typename PFP::TVEC3& position, ch
* @return true
*/
//template <typename PFP>
//bool exportPlySLFgeneric(typename PFP::MAP& map, const typename PFP::TVEC3& position, const char* filename, const FunctorSelect& good = allDarts) ;
//bool exportPlySLFgeneric(typename PFP::MAP& map, const AttributeHandler<typename PFP::VEC3, VERTEX>& position, const char* filename, const FunctorSelect& good = allDarts) ;
/**
* export the map into a PLYPTMgeneric file (K. Vanhoey generic format).
......@@ -105,7 +105,7 @@ bool exportTrian(typename PFP::MAP& map, const typename PFP::TVEC3& position, ch
* @return true
*/
//template <typename PFP>
//bool exportPlySLFgenericBin(typename PFP::MAP& map, const typename PFP::TVEC3& position, const char* filename, const FunctorSelect& good = allDarts) ;
//bool exportPlySLFgenericBin(typename PFP::MAP& map, const AttributeHandler<typename PFP::VEC3, VERTEX>& position, const char* filename, const FunctorSelect& good = allDarts) ;
/**
* export the map into a PLYSLF file (K. Vanhoey generic format).
......@@ -120,7 +120,7 @@ bool exportTrian(typename PFP::MAP& map, const typename PFP::TVEC3& position, ch
* @return true
*/
template <typename PFP>
bool exportPlyPTMgeneric(typename PFP::MAP& map, const typename PFP::TVEC3& position, const char* filename, const FunctorSelect& good = allDarts) ;
bool exportPlyPTMgeneric(typename PFP::MAP& map, const AttributeHandler<typename PFP::VEC3, VERTEX>& position, const char* filename, const FunctorSelect& good = allDarts) ;
/**
* export the map into a PLYPTMgeneric file (K. Vanhoey generic format)
......@@ -132,7 +132,7 @@ bool exportPlyPTMgeneric(typename PFP::MAP& map, const typename PFP::TVEC3& posi
* @return true
*/
template <typename PFP>
bool exportPLYPTM(typename PFP::MAP& map, const char* filename, const typename PFP::TVEC3& position, const typename PFP::TVEC3 frame[3], const typename PFP::TVEC3 colorPTM[6], const FunctorSelect& good = allDarts) ;
bool exportPLYPTM(typename PFP::MAP& map, const char* filename, const AttributeHandler<typename PFP::VEC3, VERTEX>& position, const AttributeHandler<typename PFP::VEC3, VERTEX> frame[3], const AttributeHandler<typename PFP::VEC3, VERTEX> colorPTM[6], const FunctorSelect& good = allDarts) ;
} // namespace Export
......
......@@ -38,7 +38,7 @@ namespace Export
{
template <typename PFP>
bool exportPLY(typename PFP::MAP& map, const typename PFP::TVEC3& position, const char* filename, bool binary, const FunctorSelect& good)
bool exportPLY(typename PFP::MAP& map, const AttributeHandler<typename PFP::VEC3, VERTEX>& position, const char* filename, bool binary, const FunctorSelect& good)
{
typedef typename PFP::MAP MAP;
typedef typename PFP::VEC3 VEC3;
......@@ -67,7 +67,7 @@ bool exportPLY(typename PFP::MAP& map, const typename PFP::TVEC3& position, cons
vertices.reserve(nbDarts/6) ;
// Go over all faces
CellMarker markV(map, VERTEX) ;
CellMarker<VERTEX> markV(map) ;
TraversorF<MAP> t(map, good) ;
for(Dart d = t.begin(); d != t.end(); d = t.next())
{
......@@ -78,7 +78,7 @@ bool exportPLY(typename PFP::MAP& map, const typename PFP::TVEC3& position, cons
for(Dart it = tfv.begin(); it != tfv.end(); it = tfv.next())
{
++degree ;
unsigned int vNum = map.getEmbedding<VERTEX>(it) ;
unsigned int vNum = map.template getEmbedding<VERTEX>(it) ;
if(!markV.isMarked(it))
{
markV.mark(it) ;
......@@ -165,7 +165,7 @@ bool exportPLY(typename PFP::MAP& map, const typename PFP::TVEC3& position, cons
}
template <typename PFP>
bool exportPLYnew(typename PFP::MAP& map, const std::vector<typename PFP::TVEC3*>& attributeHandlers, const char* filename, bool binary, const FunctorSelect& good)
bool exportPLYnew(typename PFP::MAP& map, const std::vector<AttributeHandler<typename PFP::VEC3, VERTEX>*>& attributeHandlers, const char* filename, bool binary, const FunctorSelect& good)
{
typedef typename PFP::MAP MAP;
typedef typename PFP::VEC3 VEC3;
......@@ -194,7 +194,7 @@ bool exportPLYnew(typename PFP::MAP& map, const std::vector<typename PFP::TVEC3*
vertices.reserve(nbDarts/6) ;
// Go over all faces
CellMarker markV(map, VERTEX) ;
CellMarker<VERTEX> markV(map) ;
TraversorF<MAP> t(map, good) ;
for(Dart d = t.begin(); d != t.end(); d = t.next())
{
......@@ -205,7 +205,7 @@ bool exportPLYnew(typename PFP::MAP& map, const std::vector<typename PFP::TVEC3*
for(Dart it = tfv.begin(); it != tfv.end(); it = tfv.next())
{
++degree ;
unsigned int vNum = map.getEmbedding<VERTEX>(it) ;
unsigned int vNum = map.template getEmbedding<VERTEX>(it) ;
if(!markV.isMarked(it))
{
markV.mark(it) ;
......@@ -241,7 +241,7 @@ bool exportPLYnew(typename PFP::MAP& map, const std::vector<typename PFP::TVEC3*
out << "comment or contact : cgogn@unistra.fr" << std::endl ;
// Vertex elements
out << "element vertex " << vertices.size() << std::endl ;
for (typename std::vector<typename PFP::TVEC3* >::const_iterator attrHandler = attributeHandlers.begin() ; attrHandler != attributeHandlers.end() ; ++attrHandler)
for (typename std::vector<AttributeHandler<typename PFP::VEC3, VERTEX>* >::const_iterator attrHandler = attributeHandlers.begin() ; attrHandler != attributeHandlers.end() ; ++attrHandler)
{
if ((*attrHandler)->isValid() && ((*attrHandler)->getOrbit() == VERTEX) )
{
......@@ -281,7 +281,7 @@ bool exportPLYnew(typename PFP::MAP& map, const std::vector<typename PFP::TVEC3*
{
// ascii vertices
for(unsigned int i = 0; i < vertices.size(); ++i)
for (typename std::vector<typename PFP::TVEC3* >::const_iterator attrHandler = attributeHandlers.begin() ; attrHandler != attributeHandlers.end() ; ++attrHandler)
for (typename std::vector<AttributeHandler<typename PFP::VEC3, VERTEX>* >::const_iterator attrHandler = attributeHandlers.begin() ; attrHandler != attributeHandlers.end() ; ++attrHandler)
if ((*attrHandler)->isValid() && (*attrHandler)->getOrbit() == VERTEX)
out << (*(*attrHandler))[vertices[i]] << std::endl ;
......@@ -298,7 +298,7 @@ bool exportPLYnew(typename PFP::MAP& map, const std::vector<typename PFP::TVEC3*
{
// binary vertices
for(unsigned int i = 0; i < vertices.size(); ++i)
for (typename std::vector<typename PFP::TVEC3*>::const_iterator attrHandler = attributeHandlers.begin() ; attrHandler != attributeHandlers.end() ; ++attrHandler)
for (typename std::vector<AttributeHandler<typename PFP::VEC3, VERTEX>*>::const_iterator attrHandler = attributeHandlers.begin() ; attrHandler != attributeHandlers.end() ; ++attrHandler)
if ((*attrHandler)->isValid() && (*attrHandler)->getOrbit() == VERTEX)
{
const typename PFP::VEC3& v = (*(*attrHandler))[vertices[i]] ;
......@@ -320,7 +320,7 @@ bool exportPLYnew(typename PFP::MAP& map, const std::vector<typename PFP::TVEC3*
}
template <typename PFP>
bool exportOFF(typename PFP::MAP& map, const typename PFP::TVEC3& position, const char* filename, const FunctorSelect& good)
bool exportOFF(typename PFP::MAP& map, const AttributeHandler<typename PFP::VEC3, VERTEX>& position, const char* filename, const FunctorSelect& good)
{
typedef typename PFP::MAP MAP;
typedef typename PFP::VEC3 VEC3;
......@@ -342,7 +342,7 @@ bool exportOFF(typename PFP::MAP& map, const typename PFP::TVEC3& position, cons
std::vector<unsigned int> vertices ;
vertices.reserve(nbDarts/6) ;
CellMarker markV(map, VERTEX) ;
CellMarker<VERTEX> markV(map) ;
TraversorF<MAP> t(map, good) ;
for(Dart d = t.begin(); d != t.end(); d = t.next())
{
......@@ -353,7 +353,7 @@ bool exportOFF(typename PFP::MAP& map, const typename PFP::TVEC3& position, cons
for(Dart it = tfv.begin(); it != tfv.end(); it = tfv.next())
{
++degree ;
unsigned int vNum = map.getEmbedding<VERTEX>(it) ;
unsigned int vNum = map.template getEmbedding<VERTEX>(it) ;
if(!markV.isMarked(it))
{
markV.mark(it) ;
......@@ -387,13 +387,11 @@ bool exportOFF(typename PFP::MAP& map, const typename PFP::TVEC3& position, cons
}
template <typename PFP>
bool exportPlyPTMgeneric(typename PFP::MAP& map, const typename PFP::TVEC3& position, const char* filename, const FunctorSelect& good)
bool exportPlyPTMgeneric(typename PFP::MAP& map, const AttributeHandler<typename PFP::VEC3, VERTEX>& position, const char* filename, const FunctorSelect& good)
{
typedef typename PFP::MAP MAP;
typedef typename PFP::VEC3 VEC3;
typedef typename PFP::TVEC3 TVEC3;
typedef typename PFP::REAL REAL;
typedef typename PFP::TREAL TREAL;
std::ofstream out(filename, std::ios::out) ;
if (!out.good())
......@@ -402,8 +400,7 @@ bool exportPlyPTMgeneric(typename PFP::MAP& map, const typename PFP::TVEC3& posi
return false ;
}
AutoAttributeHandler<unsigned int> tableVertLab(map, VERTEX);
AutoAttributeHandler<unsigned int, VERTEX> tableVertLab(map);
unsigned int nbDarts = map.getNbDarts() ;
......@@ -413,7 +410,7 @@ bool exportPlyPTMgeneric(typename PFP::MAP& map, const typename PFP::TVEC3& posi
vertices.reserve(nbDarts/5); // TODO non optimal reservation
faces.reserve(nbDarts/3);
CellMarker markV(map, VERTEX);
CellMarker<VERTEX> markV(map);
TraversorF<MAP> t(map, good) ;
unsigned int lab = 0;
unsigned int nbf = 0;
......@@ -427,7 +424,7 @@ bool exportPlyPTMgeneric(typename PFP::MAP& map, const typename PFP::TVEC3& posi
{
markV.mark(it);
tableVertLab[it] = lab++;
vertices.push_back(map.getEmbedding<VERTEX>(it));
vertices.push_back(map.template getEmbedding<VERTEX>(it));
}
face.push_back(tableVertLab[it]);
}
......@@ -439,13 +436,13 @@ bool exportPlyPTMgeneric(typename PFP::MAP& map, const typename PFP::TVEC3& posi
++nbf;
}
TVEC3 frame[3] ;
TVEC3 colorPTM[15] ;
AttributeHandler<VEC3, VERTEX> frame[3] ;
AttributeHandler<VEC3, VERTEX> colorPTM[15] ;
frame[0] = map.template getAttribute<VEC3>(VERTEX, "frame_T") ;
frame[1] = map.template getAttribute<VEC3>(VERTEX, "frame_B") ;
frame[2] = map.template getAttribute<VEC3>(VERTEX, "frame_N") ;
for (unsigned i = 0 ; i < 15 ; ++i)
for (unsigned int i = 0 ; i < 15 ; ++i)
{
std::stringstream name ;
name << "colorPTM_a" << i ;
......@@ -476,9 +473,9 @@ bool exportPlyPTMgeneric(typename PFP::MAP& map, const typename PFP::TVEC3& posi
for(unsigned int coefI = 0 ; coefI < nbCoefs ; ++coefI)
out << "property float C2_a" << coefI << std::endl ;
TREAL errL2 = map.template getAttribute<REAL>(VERTEX,"errL2") ;
TREAL errLmax = map.template getAttribute<REAL>(VERTEX,"errLmax") ;
TREAL stdDev = map.template getAttribute<REAL>(VERTEX,"stdDev") ;
AttributeHandler<REAL, VERTEX> errL2 = map.template getAttribute<REAL>(VERTEX, "errL2") ;
AttributeHandler<REAL, VERTEX> errLmax = map.template getAttribute<REAL>(VERTEX, "errLmax") ;
AttributeHandler<REAL, VERTEX> stdDev = map.template getAttribute<REAL>(VERTEX, "stdDev") ;
if (errL2.isValid())
out << "property float errL2" << std::endl ;
if (errLmax.isValid())
......@@ -529,13 +526,11 @@ bool exportPlyPTMgeneric(typename PFP::MAP& map, const typename PFP::TVEC3& posi
}
/*
template <typename PFP>
bool exportPlySLFgeneric(typename PFP::MAP& map, const typename PFP::TVEC3& position, const char* filename, const FunctorSelect& good)
bool exportPlySLFgeneric(typename PFP::MAP& map, const AttributeHandler<typename PFP::VEC3, VERTEX>& position, const char* filename, const FunctorSelect& good)
{
typedef typename PFP::MAP MAP;
typedef typename PFP::VEC3 VEC3;
typedef typename PFP::TVEC3 TVEC3;
typedef typename PFP::REAL REAL;
typedef typename PFP::TREAL TREAL;
std::ofstream out(filename, std::ios::out) ;
if (!out.good())
......@@ -546,7 +541,6 @@ bool exportPlySLFgeneric(typename PFP::MAP& map, const typename PFP::TVEC3& posi
AutoAttributeHandler<unsigned int> tableVertLab(map, VERTEX);
unsigned int nbDarts = map.getNbDarts() ;
std::vector<unsigned int> vertices;
......@@ -581,7 +575,7 @@ bool exportPlySLFgeneric(typename PFP::MAP& map, const typename PFP::TVEC3& posi
++nbf;
}
TVEC3 frame[3] ;
AttributeHandler<typename PFP::VEC3, VERTEX> frame[3] ;
std::vector<TVEC3> coefs ;
frame[0] = map.template getAttribute<VEC3>(VERTEX, "frame_T") ;
......@@ -663,13 +657,11 @@ bool exportPlySLFgeneric(typename PFP::MAP& map, const typename PFP::TVEC3& posi
}
template <typename PFP>
bool exportPlySLFgenericBin(typename PFP::MAP& map, const typename PFP::TVEC3& position, const char* filename, const FunctorSelect& good)
bool exportPlySLFgenericBin(typename PFP::MAP& map, const AttributeHandler<typename PFP::VEC3, VERTEX>& position, const char* filename, const FunctorSelect& good)
{
typedef typename PFP::MAP MAP;
typedef typename PFP::VEC3 VEC3;
typedef typename PFP::TVEC3 TVEC3;
typedef typename PFP::REAL REAL;
typedef typename PFP::TREAL TREAL;
std::ofstream out(filename, std::ios::out) ;
if (!out.good())
......@@ -806,7 +798,7 @@ bool exportPlySLFgenericBin(typename PFP::MAP& map, const typename PFP::TVEC3& p
*/
template <typename PFP>
bool exportPLYPTM(typename PFP::MAP& map, const char* filename, const typename PFP::TVEC3& position, const typename PFP::TVEC3 frame[3], const typename PFP::TVEC3 colorPTM[6], const FunctorSelect& good)
bool exportPLYPTM(typename PFP::MAP& map, const char* filename, const AttributeHandler<typename PFP::VEC3, VERTEX>& position, const AttributeHandler<typename PFP::VEC3, VERTEX> frame[3], const AttributeHandler<typename PFP::VEC3, VERTEX> colorPTM[6], const FunctorSelect& good)
{
typedef typename PFP::MAP MAP;
typedef typename PFP::VEC3 VEC3;
......@@ -818,7 +810,7 @@ bool exportPLYPTM(typename PFP::MAP& map, const char* filename, const typename P
return false ;
}
AutoAttributeHandler<unsigned int> tableVertLab(map, VERTEX);
AutoAttributeHandler<unsigned int, VERTEX> tableVertLab(map);
unsigned int nbDarts = map.getNbDarts() ;
......@@ -828,7 +820,7 @@ bool exportPLYPTM(typename PFP::MAP& map, const char* filename, const typename P
vertices.reserve(nbDarts/5); // TODO non optimal reservation
faces.reserve(nbDarts/3);
CellMarker markV(map, VERTEX);
CellMarker<VERTEX> markV(map);
TraversorF<MAP> t(map, good) ;
unsigned int lab = 0;
unsigned int nbf = 0;
......@@ -842,7 +834,7 @@ bool exportPLYPTM(typename PFP::MAP& map, const char* filename, const typename P
{
markV.mark(it);
tableVertLab[it] = lab++;
vertices.push_back(map.getEmbedding<VERTEX>(it));
vertices.push_back(map.template getEmbedding<VERTEX>(it));
}
face.push_back(tableVertLab[it]);
}
......
......@@ -35,34 +35,34 @@ namespace Geometry
{
template <typename PFP>
typename PFP::REAL triangleArea(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position) ;
typename PFP::REAL triangleArea(typename PFP::MAP& map, Dart d, const AttributeHandler<typename PFP::VEC3, VERTEX>& position) ;
template <typename PFP>
typename PFP::REAL convexFaceArea(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position) ;
typename PFP::REAL convexFaceArea(typename PFP::MAP& map, Dart d, const AttributeHandler<typename PFP::VEC3, VERTEX>& position) ;
template <typename PFP>
typename PFP::REAL totalArea(typename PFP::MAP& map, const typename PFP::TVEC3& position, const FunctorSelect& select = allDarts, unsigned int thread = 0) ;
typename PFP::REAL totalArea(typename PFP::MAP& map, const AttributeHandler<typename PFP::VEC3, VERTEX>& position, const FunctorSelect& select = allDarts, unsigned int thread = 0) ;
template <typename PFP>
typename PFP::REAL vertexOneRingArea(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position) ;
typename PFP::REAL vertexOneRingArea(typename PFP::MAP& map, Dart d, const AttributeHandler<typename PFP::VEC3, VERTEX>& position) ;
template <typename PFP>
typename PFP::REAL vertexBarycentricArea(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position) ;
typename PFP::REAL vertexBarycentricArea(typename PFP::MAP& map, Dart d, const AttributeHandler<typename PFP::VEC3, VERTEX>& position) ;
template <typename PFP>
typename PFP::REAL vertexVoronoiArea(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position) ;
typename PFP::REAL vertexVoronoiArea(typename PFP::MAP& map, Dart d, const AttributeHandler<typename PFP::VEC3, VERTEX>& position) ;
template <typename PFP>
void computeAreaFaces(typename PFP::MAP& map, const typename PFP::TVEC3& position, typename PFP::TREAL& face_area, const FunctorSelect& select = allDarts) ;
void computeAreaFaces(typename PFP::MAP& map, const AttributeHandler<typename PFP::VEC3, VERTEX>& position, AttributeHandler<typename PFP::REAL, FACE>& face_area, const FunctorSelect& select = allDarts) ;
template <typename PFP>
void computeOneRingAreaVertices(typename PFP::MAP& map, const typename PFP::TVEC3& position, typename PFP::TREAL& vertex_area, const FunctorSelect& select = allDarts) ;
void computeOneRingAreaVertices(typename PFP::MAP& map, const AttributeHandler<typename PFP::VEC3, VERTEX>& position, AttributeHandler<typename PFP::REAL, VERTEX>& vertex_area, const FunctorSelect& select = allDarts) ;
template <typename PFP>
void computeBarycentricAreaVertices(typename PFP::MAP& map, const typename PFP::TVEC3& position, typename PFP::TREAL& vertex_area, const FunctorSelect& select = allDarts) ;
void computeBarycentricAreaVertices(typename PFP::MAP& map, const AttributeHandler<typename PFP::VEC3, VERTEX>& position, AttributeHandler<typename PFP::REAL, VERTEX>& vertex_area, const FunctorSelect& select = allDarts) ;
template <typename PFP>
void computeVoronoiAreaVertices(typename PFP::MAP& map, const typename PFP::TVEC3& position, typename PFP::TREAL& vertex_area, const FunctorSelect& select = allDarts) ;
void computeVoronoiAreaVertices(typename PFP::MAP& map, const AttributeHandler<typename PFP::VEC3, VERTEX>& position, AttributeHandler<typename PFP::REAL, VERTEX>& vertex_area, const FunctorSelect& select = allDarts) ;
} // namespace Geometry
......
......@@ -37,7 +37,7 @@ namespace Geometry
{
template <typename PFP>
typename PFP::REAL triangleArea(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position)
typename PFP::REAL triangleArea(typename PFP::MAP& map, Dart d, const AttributeHandler<typename PFP::VEC3, VERTEX>& position)
{
typename PFP::VEC3 p1 = position[d] ;
typename PFP::VEC3 p2 = position[map.phi1(d)] ;
......@@ -47,7 +47,7 @@ typename PFP::REAL triangleArea(typename PFP::MAP& map, Dart d, const typename P
}
template <typename PFP>
typename PFP::REAL convexFaceArea(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position)
typename PFP::REAL convexFaceArea(typename PFP::MAP& map, Dart d, const AttributeHandler<typename PFP::VEC3, VERTEX>& position)
{
typedef typename PFP::VEC3 VEC3 ;
......@@ -69,7 +69,7 @@ typename PFP::REAL convexFaceArea(typename PFP::MAP& map, Dart d, const typename
}
template <typename PFP>
typename PFP::REAL totalArea(typename PFP::MAP& map, const typename PFP::TVEC3& position, const FunctorSelect& select, unsigned int thread)
typename PFP::REAL totalArea(typename PFP::MAP& map, const AttributeHandler<typename PFP::VEC3, VERTEX>& position, const FunctorSelect& select, unsigned int thread)
{
typename PFP::REAL area(0) ;
TraversorF<typename PFP::MAP> t(map, select) ;
......@@ -79,7 +79,7 @@ typename PFP::REAL totalArea(typename PFP::MAP& map, const typename PFP::TVEC3&
}
template <typename PFP>
typename PFP::REAL vertexOneRingArea(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position)
typename PFP::REAL vertexOneRingArea(typename PFP::MAP& map, Dart d, const AttributeHandler<typename PFP::VEC3, VERTEX>& position)
{
typename PFP::REAL area(0) ;
Traversor2VF<typename PFP::MAP> t(map, d) ;
......@@ -89,7 +89,7 @@ typename PFP::REAL vertexOneRingArea(typename PFP::MAP& map, Dart d, const typen
}
template <typename PFP>
typename PFP::REAL vertexBarycentricArea(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position)
typename PFP::REAL vertexBarycentricArea(typename PFP::MAP& map, Dart d, const AttributeHandler<typename PFP::VEC3, VERTEX>& position)
{
typename PFP::REAL area(0) ;
Traversor2VF<typename PFP::MAP> t(map, d) ;
......@@ -99,7 +99,7 @@ typename PFP::REAL vertexBarycentricArea(typename PFP::MAP& map, Dart d, const t
}
template <typename PFP>
typename PFP::REAL vertexVoronoiArea(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position)
typename PFP::REAL vertexVoronoiArea(typename PFP::MAP& map, Dart d, const AttributeHandler<typename PFP::VEC3, VERTEX>& position)
{
typename PFP::REAL area(0) ;
Traversor2VF<typename PFP::MAP> t(map, d) ;
......@@ -127,7 +127,7 @@ typename PFP::REAL vertexVoronoiArea(typename PFP::MAP& map, Dart d, const typen
}
template <typename PFP>
void computeAreaFaces(typename PFP::MAP& map, const typename PFP::TVEC3& position, typename PFP::TREAL& face_area, const FunctorSelect& select)
void computeAreaFaces(typename PFP::MAP& map, const AttributeHandler<typename PFP::VEC3, VERTEX>& position, AttributeHandler<typename PFP::REAL, FACE>& face_area, const FunctorSelect& select)
{
TraversorF<typename PFP::MAP> t(map, select) ;
for(Dart d = t.begin(); d != t.end(); d = t.next())
......@@ -135,7 +135,7 @@ void computeAreaFaces(typename PFP::MAP& map, const typename PFP::TVEC3& positio
}
template <typename PFP>
void computeOneRingAreaVertices(typename PFP::MAP& map, const typename PFP::TVEC3& position, typename PFP::TREAL& vertex_area, const FunctorSelect& select)
void computeOneRingAreaVertices(typename PFP::MAP& map, const AttributeHandler<typename PFP::VEC3, VERTEX>& position, AttributeHandler<typename PFP::REAL, VERTEX>& vertex_area, const FunctorSelect& select)
{
TraversorV<typename PFP::MAP> t(map, select) ;
for(Dart d = t.begin(); d != t.end(); d = t.next())
......@@ -143,7 +143,7 @@ void computeOneRingAreaVertices(typename PFP::MAP& map, const typename PFP::TVEC
}
template <typename PFP>
void computeBarycentricAreaVertices(typename PFP::MAP& map, const typename PFP::TVEC3& position, typename PFP::TREAL& vertex_area, const FunctorSelect& select)
void computeBarycentricAreaVertices(typename PFP::MAP& map, const AttributeHandler<typename PFP::VEC3, VERTEX>& position, AttributeHandler<typename PFP::REAL, VERTEX>& vertex_area, const FunctorSelect& select)
{
TraversorV<typename PFP::MAP> t(map, select) ;
for(Dart d = t.begin(); d != t.end(); d = t.next())
......@@ -151,7 +151,7 @@ void computeBarycentricAreaVertices(typename PFP::MAP& map, const typename PFP::
}
template <typename PFP>
void computeVoronoiAreaVertices(typename PFP::MAP& map, const typename PFP::TVEC3& position, typename PFP::TREAL& vertex_area, const FunctorSelect& select)
void computeVoronoiAreaVertices(typename PFP::MAP& map, const AttributeHandler<typename PFP::VEC3, VERTEX>& position, AttributeHandler<typename PFP::REAL, VERTEX>& vertex_area, const FunctorSelect& select)
{
TraversorV<typename PFP::MAP> t(map, select) ;
for(Dart d = t.begin(); d != t.end(); d = t.next())
......
......@@ -40,7 +40,7 @@ namespace Geometry
* vectorOutOfDart return a dart from the position of vertex attribute of d to the position of vertex attribute of phi1(d)
*/
template <typename PFP>
inline typename PFP::VEC3 vectorOutOfDart(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position)
inline typename PFP::VEC3 vectorOutOfDart(typename PFP::MAP& map, Dart d, const AttributeHandler<typename PFP::VEC3, VERTEX>& position)
{
typename PFP::VEC3 vec = position[map.phi1(d)] ;
vec -= position[d] ;
......@@ -48,14 +48,14 @@ inline typename PFP::VEC3 vectorOutOfDart(typename PFP::MAP& map, Dart d, const
}
template <typename PFP>
inline typename PFP::REAL edgeLength(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position)
inline typename PFP::REAL edgeLength(typename PFP::MAP& map, Dart d, const AttributeHandler<typename PFP::VEC3, VERTEX>& position)
{
typename PFP::VEC3 v = vectorOutOfDart<PFP>(map, d, position) ;
return v.norm() ;
}
template <typename PFP>
inline float angle(typename PFP::MAP& map, Dart d1, Dart d2, const typename PFP::TVEC3& position)
inline float angle(typename PFP::MAP& map, Dart d1, Dart d2, const AttributeHandler<typename PFP::VEC3, VERTEX>& position)
{
typename PFP::VEC3 v1 = vectorOutOfDart<PFP>(map, d1, position) ;
typename PFP::VEC3 v2 = vectorOutOfDart<PFP>(map, d2, position) ;
......@@ -63,7 +63,7 @@ inline float angle(typename PFP::MAP& map, Dart d1, Dart d2, const typename PFP:
}
template <typename PFP>
bool isTriangleObtuse(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position)
bool isTriangleObtuse(typename PFP::MAP& map, Dart d, const AttributeHandler<typename PFP::VEC3, VERTEX>& position)
{
return Geom::isTriangleObtuse(position[d], position[map.phi1(d)], position[map.phi_1(d)]) ;
}
......
......@@ -39,7 +39,7 @@ namespace Geometry
{
template <typename PFP>
Geom::BoundingBox<typename PFP::VEC3> computeBoundingBox(typename PFP::MAP& map, const typename PFP::TVEC3& position, const FunctorSelect& select = allDarts)
Geom::BoundingBox<typename PFP::VEC3> computeBoundingBox(typename PFP::MAP& map, const AttributeHandler<typename PFP::VEC3, VERTEX>& position, const FunctorSelect& select = allDarts)
{
Geom::BoundingBox<typename PFP::VEC3> bb ;
TraversorV<typename PFP::MAP> t(map, select) ;
......
......@@ -59,9 +59,9 @@ EMB volumeCentroidGen(typename PFP::MAP& map, Dart d, const EMBV& attributs);
* @param position the vector of attribute
*/
template <typename PFP>
typename PFP::VEC3 volumeCentroid(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position)
typename PFP::VEC3 volumeCentroid(typename PFP::MAP& map, Dart d, const AttributeHandler<typename PFP::VEC3, VERTEX>& position)
{
return volumeCentroidGen<PFP, typename PFP::TVEC3, typename PFP::VEC3>(map, d, position);
return volumeCentroidGen<PFP, AttributeHandler<typename PFP::VEC3, VERTEX>, typename PFP::VEC3>(map, d, position);
}
/**
......@@ -85,9 +85,9 @@ EMB faceCentroidGen(typename PFP::MAP& map, Dart d, const EMBV& attributs);
* @param position the vector of attribute
*/
template <typename PFP>
typename PFP::VEC3 faceCentroid(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position)
typename PFP::VEC3 faceCentroid(typename PFP::MAP& map, Dart d, const AttributeHandler<typename PFP::VEC3, VERTEX>& position)
{
return faceCentroidGen<PFP, typename PFP::TVEC3, typename PFP::VEC3>(map, d, position);
return faceCentroidGen<PFP, AttributeHandler<typename PFP::VEC3, VERTEX>, typename PFP::VEC3>(map, d, position);
}
/**
......@@ -110,19 +110,19 @@ EMB vertexNeighborhoodCentroidGen(typename PFP::MAP& map, Dart d, const EMBV& at
* @param position the vector of attribute
*/
template <typename PFP>
typename PFP::VEC3 vertexNeighborhoodCentroid(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position)
typename PFP::VEC3 vertexNeighborhoodCentroid(typename PFP::MAP& map, Dart d, const AttributeHandler<typename PFP::VEC3, VERTEX>& position)
{
return vertexNeighborhoodCentroidGen<PFP, typename PFP::TVEC3, typename PFP::VEC3>(map, d, position);
return vertexNeighborhoodCentroidGen<PFP, AttributeHandler<typename PFP::VEC3, VERTEX>, typename PFP::VEC3>(map, d, position);
}
template <typename PFP>
void computeCentroidVolumes(typename PFP::MAP& map, const typename PFP::TVEC3& position, typename PFP::TVEC3& vol_centroid, const FunctorSelect& select = allDarts) ;
void computeCentroidVolumes(typename PFP::MAP& map, const AttributeHandler<typename PFP::VEC3, VERTEX>& position, AttributeHandler<typename PFP::VEC3, VOLUME>& vol_centroid, const FunctorSelect& select = allDarts) ;
template <typename PFP>
void computeCentroidFaces(typename PFP::MAP& map, const typename PFP::TVEC3& position, typename PFP::TVEC3& face_centroid, const FunctorSelect& select = allDarts) ;
void computeCentroidFaces(typename PFP::MAP& map, const AttributeHandler<typename PFP::VEC3, VERTEX>& position, AttributeHandler<typename PFP::VEC3, FACE>& face_centroid, const FunctorSelect& select = allDarts) ;
template <typename PFP>
void computeNeighborhoodCentroidVertices(typename PFP::MAP& map, const typename PFP::TVEC3& position, typename PFP::TVEC3& vertex_centroid, const FunctorSelect& select = allDarts) ;
void computeNeighborhoodCentroidVertices(typename PFP::MAP& map, const AttributeHandler<typename PFP::VEC3, VERTEX>& position, AttributeHandler<typename PFP::VEC3, VERTEX>& vertex_centroid, const FunctorSelect& select = allDarts) ;
} // namespace Geometry
......
......@@ -86,7 +86,7 @@ EMB vertexNeighborhoodCentroidGen(typename PFP::MAP& map, Dart d, const EMBV& at
}
template <typename PFP>