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
......
This diff is collapsed.
......@@ -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>
void computeCentroidVolumes(typename PFP::MAP& map, const typename PFP::TVEC3& position, typename PFP::TVEC3& vol_centroid, const FunctorSelect& select)
void computeCentroidVolumes(typename PFP::MAP& map, const AttributeHandler<typename PFP::VEC3, VERTEX>& position, AttributeHandler<typename PFP::VEC3, VOLUME>& vol_centroid, const FunctorSelect& select)
{
TraversorW<typename PFP::MAP> t(map, select) ;
for(Dart d = t.begin(); d != t.end(); d = t.next())
......@@ -94,7 +94,7 @@ void computeCentroidVolumes(typename PFP::MAP& map, const typename PFP::TVEC3& p
}
template <typename PFP>
void computeCentroidFaces(typename PFP::MAP& map, const typename PFP::TVEC3& position, typename PFP::TVEC3& face_centroid, const FunctorSelect& select)
void computeCentroidFaces(typename PFP::MAP& map, const AttributeHandler<typename PFP::VEC3, VERTEX>& position, AttributeHandler<typename PFP::VEC3, FACE>& face_centroid, const FunctorSelect& select)
{
TraversorF<typename PFP::MAP> t(map, select) ;
for(Dart d = t.begin(); d != t.end(); d = t.next())
......@@ -102,7 +102,7 @@ void computeCentroidFaces(typename PFP::MAP& map, const typename PFP::TVEC3& pos
}
template <typename PFP>
void computeNeighborhoodCentroidVertices(typename PFP::MAP& map, const typename PFP::TVEC3& position, typename PFP::TVEC3& vertex_centroid, const FunctorSelect& select)
void computeNeighborhoodCentroidVertices(typename PFP::MAP& map, const AttributeHandler<typename PFP::VEC3, VERTEX>& position, AttributeHandler<typename PFP::VEC3, VERTEX>& vertex_centroid, const FunctorSelect& select)
{
TraversorV<typename PFP::MAP> t(map, select) ;
for(Dart d = t.begin(); d != t.end(); d = t.next())
......
......@@ -37,22 +37,22 @@ namespace Geometry
{
template <typename PFP>
typename PFP::VEC3 triangleNormal(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position) ;
typename PFP::VEC3 triangleNormal(typename PFP::MAP& map, Dart d, const AttributeHandler<typename PFP::VEC3, VERTEX>& position) ;
template <typename PFP>
typename PFP::VEC3 newellNormal(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position);
typename PFP::VEC3 newellNormal(typename PFP::MAP& map, Dart d, const AttributeHandler<typename PFP::VEC3, VERTEX>& position);
template <typename PFP>
typename PFP::VEC3 faceNormal(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position) ;
typename PFP::VEC3 faceNormal(typename PFP::MAP& map, Dart d, const AttributeHandler<typename PFP::VEC3, VERTEX>& position) ;
template <typename PFP>
typename PFP::VEC3 vertexNormal(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position) ;
typename PFP::VEC3 vertexNormal(typename PFP::MAP& map, Dart d, const AttributeHandler<typename PFP::VEC3, VERTEX>& position) ;
template <typename PFP>
typename PFP::VEC3 vertexBorderNormal(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position) ;
typename PFP::VEC3 vertexBorderNormal(typename PFP::MAP& map, Dart d, const AttributeHandler<typename PFP::VEC3, VERTEX>& position) ;
template <typename PFP>
void computeNormalFaces(typename PFP::MAP& map, const typename PFP::TVEC3& position, typename PFP::TVEC3& face_normal, const FunctorSelect& select = allDarts, unsigned int thread = 0) ;
void computeNormalFaces(typename PFP::MAP& map, const AttributeHandler<typename PFP::VEC3, VERTEX>& position, AttributeHandler<typename PFP::VEC3, FACE>& face_normal, const FunctorSelect& select = allDarts, unsigned int thread = 0) ;
/**
* compute normals of vertices
......@@ -63,13 +63,13 @@ void computeNormalFaces(typename PFP::MAP& map, const typename PFP::TVEC3& posit
* @ param th the thread number
*/
template <typename PFP>
void computeNormalVertices(typename PFP::MAP& map, const typename PFP::TVEC3& position, typename PFP::TVEC3& normal, const FunctorSelect& select = allDarts, unsigned int thread = 0) ;
void computeNormalVertices(typename PFP::MAP& map, const AttributeHandler<typename PFP::VEC3, VERTEX>& position, AttributeHandler<typename PFP::VEC3, VERTEX>& normal, const FunctorSelect& select = allDarts, unsigned int thread = 0) ;
template <typename PFP>
typename PFP::REAL computeAngleBetweenNormalsOnEdge(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& position) ;
typename PFP::REAL computeAngleBetweenNormalsOnEdge(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX>& position) ;
template <typename PFP>
void computeAnglesBetweenNormalsOnEdges(typename PFP::MAP& map, const typename PFP::TVEC3& position, typename PFP::TREAL& angles, const FunctorSelect& select = allDarts, unsigned int thread = 0) ;
void computeAnglesBetweenNormalsOnEdges(typename PFP::MAP& map, const AttributeHandler<typename PFP::VEC3, VERTEX>& position, AttributeHandler<typename PFP::REAL, VERTEX>& angles, const FunctorSelect& select = allDarts, unsigned int thread = 0) ;
} // namespace Geometry
......
......@@ -40,7 +40,7 @@ namespace Geometry
{
template <typename PFP>
typename PFP::VEC3 triangleNormal(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position)
typename PFP::VEC3 triangleNormal(typename PFP::MAP& map, Dart d, const AttributeHandler<typename PFP::VEC3, VERTEX>& position)
{
typename PFP::VEC3 N = Geom::triangleNormal(position[d], position[map.phi1(d)], position[map.phi_1(d)]) ;
N.normalize() ;
......@@ -48,7 +48,7 @@ typename PFP::VEC3 triangleNormal(typename PFP::MAP& map, Dart d, const typename
}
template<typename PFP>
typename PFP::VEC3 newellNormal(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position)
typename PFP::VEC3 newellNormal(typename PFP::MAP& map, Dart d, const AttributeHandler<typename PFP::VEC3, VERTEX>& position)
{
typename PFP::VEC3 N(0);
......@@ -67,7 +67,7 @@ typename PFP::VEC3 newellNormal(typename PFP::MAP& map, Dart d, const typename P
}
template <typename PFP>
typename PFP::VEC3 faceNormal(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position)
typename PFP::VEC3 faceNormal(typename PFP::MAP& map, Dart d, const AttributeHandler<typename PFP::VEC3, VERTEX>& position)
{
if(map.faceDegree(d) == 3)
return triangleNormal<PFP>(map, d, position) ;
......@@ -90,7 +90,7 @@ typename PFP::VEC3 faceNormal(typename PFP::MAP& map, Dart d, const typename PFP
}
template <typename PFP>
typename PFP::VEC3 vertexNormal(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position)
typename PFP::VEC3 vertexNormal(typename PFP::MAP& map, Dart d, const AttributeHandler<typename PFP::VEC3, VERTEX>& position)
{
typedef typename PFP::VEC3 VEC3 ;
......@@ -114,7 +114,7 @@ typename PFP::VEC3 vertexNormal(typename PFP::MAP& map, Dart d, const typename P
}
template <typename PFP>
typename PFP::VEC3 vertexBorderNormal(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position)
typename PFP::VEC3 vertexBorderNormal(typename PFP::MAP& map, Dart d, const AttributeHandler<typename PFP::VEC3, VERTEX>& position)
{
assert(map.dimension() == 3);
......@@ -148,7 +148,7 @@ typename PFP::VEC3 vertexBorderNormal(typename PFP::MAP& map, Dart d, const type
}
template <typename PFP>
void computeNormalFaces(typename PFP::MAP& map, const typename PFP::TVEC3& position, typename PFP::TVEC3& face_normal, const FunctorSelect& select, unsigned int thread)
void computeNormalFaces(typename PFP::MAP& map, const AttributeHandler<typename PFP::VEC3, VERTEX>& position, AttributeHandler<typename PFP::VEC3, FACE>& face_normal, const FunctorSelect& select, unsigned int thread)
{
TraversorF<typename PFP::MAP> trav(map, select, thread);
for (Dart d = trav.begin(); d != trav.end(); d = trav.next())
......@@ -156,7 +156,7 @@ void computeNormalFaces(typename PFP::MAP& map, const typename PFP::TVEC3& posit
}
template <typename PFP>
void computeNormalVertices(typename PFP::MAP& map, const typename PFP::TVEC3& position, typename PFP::TVEC3& normal, const FunctorSelect& select, unsigned int thread)
void computeNormalVertices(typename PFP::MAP& map, const AttributeHandler<typename PFP::VEC3, VERTEX>& position, AttributeHandler<typename PFP::VEC3, VERTEX>& normal, const FunctorSelect& select, unsigned int thread)
{
TraversorV<typename PFP::MAP> trav(map, select, thread);
for (Dart d = trav.begin(); d != trav.end(); d = trav.next())
......@@ -164,7 +164,7 @@ void computeNormalVertices(typename PFP::MAP& map, const typename PFP::TVEC3& po
}
template <typename PFP>
typename PFP::REAL computeAngleBetweenNormalsOnEdge(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position)
typename PFP::REAL computeAngleBetweenNormalsOnEdge(typename PFP::MAP& map, Dart d, const AttributeHandler<typename PFP::VEC3, VERTEX>& position)
{
typedef typename PFP::VEC3 VEC3 ;
......@@ -195,7 +195,7 @@ typename PFP::REAL computeAngleBetweenNormalsOnEdge(typename PFP::MAP& map, Dart
}
template <typename PFP>
void computeAnglesBetweenNormalsOnEdges(typename PFP::MAP& map, const typename PFP::TVEC3& position, typename PFP::TREAL& angles, const FunctorSelect& select, unsigned int thread)
void computeAnglesBetweenNormalsOnEdges(typename PFP::MAP& map, const AttributeHandler<typename PFP::VEC3, VERTEX>& position, AttributeHandler<typename PFP::REAL, VERTEX>& angles, const FunctorSelect& select, unsigned int thread)
{
TraversorE<typename PFP::MAP> trav(map, select, thread);
for (Dart d = trav.begin(); d != trav.end(); d = trav.next())
......
......@@ -86,7 +86,7 @@ protected:
static ImportSurfacique::ImportType getFileType(const std::string& filename);
#ifdef WITH_ASSIMP
void extractMeshRec(AttributeContainer& container, AttributeHandler<typename PFP::VEC3>& positions, const struct aiScene* scene, const struct aiNode* nd, struct aiMatrix4x4* trafo);
void extractMeshRec(AttributeContainer& container, AttributeHandler<typename PFP::VEC3, VERTEX>& positions, const struct aiScene* scene, const struct aiNode* nd, struct aiMatrix4x4* trafo);
#endif
public:
......
......@@ -144,14 +144,14 @@ bool MeshTablesSurface<PFP>::importMesh(const std::string& filename, std::vector
template<typename PFP>
bool MeshTablesSurface<PFP>::importTrian(const std::string& filename, std::vector<std::string>& attrNames)
{
AttributeHandler<typename PFP::VEC3> positions = m_map.template getAttribute<typename PFP::VEC3>(VERTEX, "position") ;
AttributeHandler<typename PFP::VEC3, VERTEX> positions = m_map.template getAttribute<typename PFP::VEC3, VERTEX>("position") ;
if (!positions.isValid())
positions = m_map.template addAttribute<typename PFP::VEC3>(VERTEX, "position") ;
positions = m_map.template addAttribute<typename PFP::VEC3, VERTEX>("position") ;
attrNames.push_back(positions.name()) ;
AttributeContainer& container = m_map.getAttributeContainer(VERTEX) ;
AttributeContainer& container = m_map.template getAttributeContainer<VERTEX>() ;
// open file
std::ifstream fp(filename.c_str(), std::ios::in);
......@@ -211,14 +211,14 @@ bool MeshTablesSurface<PFP>::importTrian(const std::string& filename, std::vecto
template<typename PFP>
bool MeshTablesSurface<PFP>::importTrianBinGz(const std::string& filename, std::vector<std::string>& attrNames)
{
AttributeHandler<typename PFP::VEC3> positions = m_map.template getAttribute<typename PFP::VEC3>(VERTEX, "position") ;
AttributeHandler<typename PFP::VEC3, VERTEX> positions = m_map.template getAttribute<typename PFP::VEC3, VERTEX>("position") ;
if (!positions.isValid())
positions = m_map.template addAttribute<typename PFP::VEC3>(VERTEX, "position") ;
positions = m_map.template addAttribute<typename PFP::VEC3, VERTEX>("position") ;
attrNames.push_back(positions.name()) ;
AttributeContainer& container = m_map.getAttributeContainer(VERTEX) ;
AttributeContainer& container = m_map.template getAttributeContainer<VERTEX>() ;
// open file
igzstream fs(filename.c_str(), std::ios::in|std::ios::binary);
......@@ -281,14 +281,14 @@ bool MeshTablesSurface<PFP>::importTrianBinGz(const std::string& filename, std::
template<typename PFP>
bool MeshTablesSurface<PFP>::importOff(const std::string& filename, std::vector<std::string>& attrNames)
{
AttributeHandler<typename PFP::VEC3> positions = m_map.template getAttribute<typename PFP::VEC3>(VERTEX, "position") ;
AttributeHandler<typename PFP::VEC3, VERTEX>