Commit cb65f5ab authored by Pierre Kraemer's avatar Pierre Kraemer

suite du newMR..

parent 4e878d8e
......@@ -43,7 +43,7 @@ namespace Geometry
//! @param position
//! @return
template <typename PFP>
typename PFP::REAL triangleArea(typename PFP::MAP& map, Dart d, const VertexAttribute<typename PFP::VEC3>& position) ;
typename PFP::REAL triangleArea(typename PFP::MAP& map, Dart d, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& position) ;
//! \brief Compute convex polygonal face area
//! @param map
......@@ -51,14 +51,14 @@ typename PFP::REAL triangleArea(typename PFP::MAP& map, Dart d, const VertexAttr
//! @param position
//! @return
template <typename PFP>
typename PFP::REAL convexFaceArea(typename PFP::MAP& map, Dart d, const VertexAttribute<typename PFP::VEC3>& position) ;
typename PFP::REAL convexFaceArea(typename PFP::MAP& map, Dart d, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& position) ;
//! \brief Compute the total area of a mesh by summing all face areas.
//! @param map
//! @param position
//! @return
template <typename PFP>
typename PFP::REAL totalArea(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3>& position, unsigned int thread = 0) ;
typename PFP::REAL totalArea(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& position, unsigned int thread = 0) ;
//! \brief Compute the area of the faces around a vertex.
//! @param map
......@@ -66,25 +66,25 @@ typename PFP::REAL totalArea(typename PFP::MAP& map, const VertexAttribute<typen
//! @param position
//! @return
template <typename PFP>
typename PFP::REAL vertexOneRingArea(typename PFP::MAP& map, Dart d, const VertexAttribute<typename PFP::VEC3>& position) ;
typename PFP::REAL vertexOneRingArea(typename PFP::MAP& map, Dart d, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& position) ;
template <typename PFP>
typename PFP::REAL vertexBarycentricArea(typename PFP::MAP& map, Dart d, const VertexAttribute<typename PFP::VEC3>& position) ;
typename PFP::REAL vertexBarycentricArea(typename PFP::MAP& map, Dart d, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& position) ;
template <typename PFP>
typename PFP::REAL vertexVoronoiArea(typename PFP::MAP& map, Dart d, const VertexAttribute<typename PFP::VEC3>& position) ;
typename PFP::REAL vertexVoronoiArea(typename PFP::MAP& map, Dart d, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& position) ;
template <typename PFP>
void computeAreaFaces(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3>& position, FaceAttribute<typename PFP::REAL>& face_area) ;
void computeAreaFaces(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& position, FaceAttribute<typename PFP::REAL, typename PFP::MAP::IMPL>& face_area) ;
template <typename PFP>
void computeOneRingAreaVertices(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3>& position, VertexAttribute<typename PFP::REAL>& vertex_area) ;
void computeOneRingAreaVertices(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& position, VertexAttribute<typename PFP::REAL, typename PFP::MAP::IMPL>& vertex_area) ;
template <typename PFP>
void computeBarycentricAreaVertices(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3>& position, VertexAttribute<typename PFP::REAL>& vertex_area) ;
void computeBarycentricAreaVertices(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& position, VertexAttribute<typename PFP::REAL, typename PFP::MAP::IMPL>& vertex_area) ;
template <typename PFP>
void computeVoronoiAreaVertices(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3>& position, VertexAttribute<typename PFP::REAL>& vertex_area) ;
void computeVoronoiAreaVertices(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& position, VertexAttribute<typename PFP::REAL, typename PFP::MAP::IMPL>& vertex_area) ;
} // namespace Geometry
......
......@@ -40,7 +40,7 @@ namespace Geometry
{
template <typename PFP>
typename PFP::REAL triangleArea(typename PFP::MAP& map, Dart d, const VertexAttribute<typename PFP::VEC3>& position)
typename PFP::REAL triangleArea(typename PFP::MAP& map, Dart d, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& position)
{
typename PFP::VEC3 p1 = position[d] ;
typename PFP::VEC3 p2 = position[map.phi1(d)] ;
......@@ -50,7 +50,7 @@ typename PFP::REAL triangleArea(typename PFP::MAP& map, Dart d, const VertexAttr
}
template <typename PFP>
typename PFP::REAL convexFaceArea(typename PFP::MAP& map, Dart d, const VertexAttribute<typename PFP::VEC3>& position)
typename PFP::REAL convexFaceArea(typename PFP::MAP& map, Dart d, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& position)
{
typedef typename PFP::VEC3 VEC3 ;
......@@ -72,7 +72,7 @@ typename PFP::REAL convexFaceArea(typename PFP::MAP& map, Dart d, const VertexAt
}
template <typename PFP>
typename PFP::REAL totalArea(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3>& position, unsigned int thread)
typename PFP::REAL totalArea(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& position, unsigned int thread)
{
typename PFP::REAL area(0) ;
TraversorF<typename PFP::MAP> t(map) ;
......@@ -82,7 +82,7 @@ typename PFP::REAL totalArea(typename PFP::MAP& map, const VertexAttribute<typen
}
template <typename PFP>
typename PFP::REAL vertexOneRingArea(typename PFP::MAP& map, Dart d, const VertexAttribute<typename PFP::VEC3>& position)
typename PFP::REAL vertexOneRingArea(typename PFP::MAP& map, Dart d, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& position)
{
typename PFP::REAL area(0) ;
Traversor2VF<typename PFP::MAP> t(map, d) ;
......@@ -92,7 +92,7 @@ typename PFP::REAL vertexOneRingArea(typename PFP::MAP& map, Dart d, const Verte
}
template <typename PFP>
typename PFP::REAL vertexBarycentricArea(typename PFP::MAP& map, Dart d, const VertexAttribute<typename PFP::VEC3>& position)
typename PFP::REAL vertexBarycentricArea(typename PFP::MAP& map, Dart d, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& position)
{
typename PFP::REAL area(0) ;
Traversor2VF<typename PFP::MAP> t(map, d) ;
......@@ -102,7 +102,7 @@ typename PFP::REAL vertexBarycentricArea(typename PFP::MAP& map, Dart d, const V
}
template <typename PFP>
typename PFP::REAL vertexVoronoiArea(typename PFP::MAP& map, Dart d, const VertexAttribute<typename PFP::VEC3>& position)
typename PFP::REAL vertexVoronoiArea(typename PFP::MAP& map, Dart d, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& position)
{
typename PFP::REAL area(0) ;
Traversor2VF<typename PFP::MAP> t(map, d) ;
......@@ -130,7 +130,7 @@ typename PFP::REAL vertexVoronoiArea(typename PFP::MAP& map, Dart d, const Verte
}
template <typename PFP>
void computeAreaFaces(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3>& position, FaceAttribute<typename PFP::REAL>& face_area)
void computeAreaFaces(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& position, FaceAttribute<typename PFP::REAL, typename PFP::MAP::IMPL>& face_area)
{
TraversorF<typename PFP::MAP> t(map) ;
for(Dart d = t.begin(); d != t.end(); d = t.next())
......@@ -138,7 +138,7 @@ void computeAreaFaces(typename PFP::MAP& map, const VertexAttribute<typename PFP
}
template <typename PFP>
void computeOneRingAreaVertices(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3>& position, VertexAttribute<typename PFP::REAL>& vertex_area)
void computeOneRingAreaVertices(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& position, VertexAttribute<typename PFP::REAL, typename PFP::MAP::IMPL>& vertex_area)
{
TraversorV<typename PFP::MAP> t(map) ;
for(Dart d = t.begin(); d != t.end(); d = t.next())
......@@ -146,7 +146,7 @@ void computeOneRingAreaVertices(typename PFP::MAP& map, const VertexAttribute<ty
}
template <typename PFP>
void computeBarycentricAreaVertices(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3>& position, VertexAttribute<typename PFP::REAL>& vertex_area)
void computeBarycentricAreaVertices(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& position, VertexAttribute<typename PFP::REAL, typename PFP::MAP::IMPL>& vertex_area)
{
TraversorV<typename PFP::MAP> t(map) ;
for(Dart d = t.begin(); d != t.end(); d = t.next())
......@@ -154,7 +154,7 @@ void computeBarycentricAreaVertices(typename PFP::MAP& map, const VertexAttribut
}
template <typename PFP>
void computeVoronoiAreaVertices(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3>& position, VertexAttribute<typename PFP::REAL>& vertex_area)
void computeVoronoiAreaVertices(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& position, VertexAttribute<typename PFP::REAL, typename PFP::MAP::IMPL>& vertex_area)
{
TraversorV<typename PFP::MAP> t(map) ;
for(Dart d = t.begin(); d != t.end(); d = t.next())
......@@ -162,15 +162,17 @@ void computeVoronoiAreaVertices(typename PFP::MAP& map, const VertexAttribute<ty
}
namespace Parallel
{
template <typename PFP>
class FunctorConvexFaceArea: public FunctorMapThreaded<typename PFP::MAP >
{
const VertexAttribute<typename PFP::VEC3>& m_position;
FaceAttribute<typename PFP::REAL>& m_area;
const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& m_position;
FaceAttribute<typename PFP::REAL, typename PFP::MAP::IMPL>& m_area;
public:
FunctorConvexFaceArea<PFP>( typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3>& position, FaceAttribute<typename PFP::REAL>& area):
FunctorConvexFaceArea<PFP>( typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& position, FaceAttribute<typename PFP::REAL, typename PFP::MAP::IMPL>& area):
FunctorMapThreaded<typename PFP::MAP>(map), m_position(position), m_area(area)
{ }
......@@ -181,20 +183,19 @@ public:
};
template <typename PFP>
void computeAreaFaces(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3>& position, FaceAttribute<typename PFP::REAL>& area, unsigned int nbth)
void computeAreaFaces(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& position, FaceAttribute<typename PFP::REAL, typename PFP::MAP::IMPL>& area, unsigned int nbth)
{
FunctorConvexFaceArea<PFP> funct(map,position,area);
Algo::Parallel::foreach_cell<typename PFP::MAP,FACE>(map, funct, nbth, false);
}
template <typename PFP>
class FunctorVertexOneRingArea: public FunctorMapThreaded<typename PFP::MAP >
{
const VertexAttribute<typename PFP::VEC3>& m_position;
VertexAttribute<typename PFP::REAL>& m_area;
const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& m_position;
VertexAttribute<typename PFP::REAL, typename PFP::MAP::IMPL>& m_area;
public:
FunctorVertexOneRingArea<PFP>( typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3>& position, VertexAttribute<typename PFP::REAL>& area):
FunctorVertexOneRingArea<PFP>( typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& position, VertexAttribute<typename PFP::REAL, typename PFP::MAP::IMPL>& area):
FunctorMapThreaded<typename PFP::MAP>(map), m_position(position), m_area(area)
{ }
......@@ -205,21 +206,19 @@ public:
};
template <typename PFP>
void computeOneRingAreaVertices(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3>& position, VertexAttribute<typename PFP::REAL>& area, unsigned int nbth)
void computeOneRingAreaVertices(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& position, VertexAttribute<typename PFP::REAL, typename PFP::MAP::IMPL>& area, unsigned int nbth)
{
FunctorConvexFaceArea<PFP> funct(map,position,area);
Algo::Parallel::foreach_cell<typename PFP::MAP,VERTEX>(map, funct, nbth, false);
}
template <typename PFP>
class FunctorVertexVoronoiArea: public FunctorMapThreaded<typename PFP::MAP >
{
const VertexAttribute<typename PFP::VEC3>& m_position;
VertexAttribute<typename PFP::REAL>& m_area;
const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& m_position;
VertexAttribute<typename PFP::REAL, typename PFP::MAP::IMPL>& m_area;
public:
FunctorVertexVoronoiArea<PFP>( typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3>& position, VertexAttribute<typename PFP::REAL>& area):
FunctorVertexVoronoiArea<PFP>( typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& position, VertexAttribute<typename PFP::REAL, typename PFP::MAP::IMPL>& area):
FunctorMapThreaded<typename PFP::MAP>(map), m_position(position), m_area(area)
{ }
......@@ -230,24 +229,19 @@ public:
};
template <typename PFP>
void computeVoronoiAreaVertices(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3>& position, VertexAttribute<typename PFP::REAL>& area, unsigned int nbth)
void computeVoronoiAreaVertices(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position, VertexAttribute<typename PFP::REAL, typename PFP::MAP>& area, unsigned int nbth)
{
FunctorConvexFaceArea<PFP> funct(map,position,area);
Algo::Parallel::foreach_cell<typename PFP::MAP,VERTEX>(map, funct, nbth, false);
Algo::Parallel::foreach_cell<typename PFP::MAP, VERTEX>(map, funct, nbth, false);
}
}
} // namespace Parallel
} // namespace Geometry
}
} // namespace Surface
} // namespace Algo
......
......@@ -43,7 +43,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 VertexAttribute<typename PFP::VEC3>& position)
inline typename PFP::VEC3 vectorOutOfDart(typename PFP::MAP& map, Dart d, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& position)
{
typename PFP::VEC3 vec = position[map.phi1(d)] ;
vec -= position[d] ;
......@@ -51,14 +51,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 VertexAttribute<typename PFP::VEC3>& position)
inline typename PFP::REAL edgeLength(typename PFP::MAP& map, Dart d, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& 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 VertexAttribute<typename PFP::VEC3>& position)
inline float angle(typename PFP::MAP& map, Dart d1, Dart d2, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& position)
{
typename PFP::VEC3 v1 = vectorOutOfDart<PFP>(map, d1, position) ;
typename PFP::VEC3 v2 = vectorOutOfDart<PFP>(map, d2, position) ;
......@@ -66,7 +66,7 @@ inline float angle(typename PFP::MAP& map, Dart d1, Dart d2, const VertexAttribu
}
template <typename PFP>
bool isTriangleObtuse(typename PFP::MAP& map, Dart d, const VertexAttribute<typename PFP::VEC3>& position)
bool isTriangleObtuse(typename PFP::MAP& map, Dart d, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP::IMPL>& position)
{
return Geom::isTriangleObtuse(position[d], position[map.phi1(d)], position[map.phi_1(d)]) ;
}
......
......@@ -212,7 +212,7 @@ typename V_ATT::DATA_TYPE vertexBorderNormal(typename PFP::MAP& map, Dart d, con
VEC3 N(0) ;
std::vector<Dart> faces;
CellMarker<FACE> f(map);
CellMarker<typename PFP::MAP, FACE> f(map);
FunctorStore fs(faces);
map.foreach_dart_of_vertex(d,fs);
......@@ -237,8 +237,6 @@ typename V_ATT::DATA_TYPE vertexBorderNormal(typename PFP::MAP& map, Dart d, con
return N ;
}
template <typename PFP, typename V_ATT, typename F_ATT>
void computeNormalFaces(typename PFP::MAP& map, const V_ATT& position, F_ATT& face_normal, unsigned int thread)
{
......
......@@ -40,15 +40,15 @@ namespace Volume
namespace IHM
{
template<typename T, unsigned int ORBIT> class AttributeHandler_IHM ;
typedef EmbeddedMap3::IMPL EMap3_IMPL;
class ImplicitHierarchicalMap3 : public EmbeddedMap3
{
template<typename T, unsigned int ORBIT> friend class AttributeHandler_IHM ;
public:
FunctorType* vertexVertexFunctor ;
FunctorType* edgeVertexFunctor ;
FunctorType* faceVertexFunctor ;
......@@ -59,9 +59,9 @@ public:
unsigned int m_edgeIdCount ;
unsigned int m_faceIdCount;
DartAttribute<unsigned int> m_dartLevel ;
DartAttribute<unsigned int> m_edgeId ;
DartAttribute<unsigned int> m_faceId ;
DartAttribute<unsigned int, EMap3_IMPL> m_dartLevel ;
DartAttribute<unsigned int, EMap3_IMPL> m_edgeId ;
DartAttribute<unsigned int, EMap3_IMPL> m_faceId ;
AttributeMultiVector<unsigned int>* m_nextLevelCell[NB_ORBITS] ;
......@@ -404,25 +404,25 @@ public:
} ;
template <typename T, unsigned int ORBIT>
class AttributeHandler_IHM : public AttributeHandler<T, ORBIT>
class AttributeHandler_IHM : public AttributeHandler<T, ORBIT, EMap3_IMPL>
{
public:
typedef T DATA_TYPE ;
AttributeHandler_IHM() : AttributeHandler<T, ORBIT>()
AttributeHandler_IHM() : AttributeHandler<T, ORBIT, EMap3_IMPL>()
{}
AttributeHandler_IHM(GenericMap* m, AttributeMultiVector<T>* amv) : AttributeHandler<T, ORBIT>(m, amv)
AttributeHandler_IHM(ImplicitHierarchicalMap3* m, AttributeMultiVector<T>* amv) : AttributeHandler<T, ORBIT, EMap3_IMPL>(m, amv)
{}
AttributeMultiVector<T>* getDataVector() const
{
return AttributeHandler<T, ORBIT>::getDataVector() ;
return AttributeHandler<T, ORBIT, EMap3_IMPL>::getDataVector() ;
}
bool isValid() const
{
return AttributeHandler<T, ORBIT>::isValid() ;
return AttributeHandler<T, ORBIT, EMap3_IMPL>::isValid() ;
}
virtual T& operator[](Dart d) ;
......@@ -431,12 +431,12 @@ public:
T& operator[](unsigned int a)
{
return AttributeHandler<T, ORBIT>::operator[](a) ;
return AttributeHandler<T, ORBIT, EMap3_IMPL>::operator[](a) ;
}
const T& operator[](unsigned int a) const
{
return AttributeHandler<T, ORBIT>::operator[](a) ;
return AttributeHandler<T, ORBIT, EMap3_IMPL>::operator[](a) ;
}
} ;
......@@ -447,14 +447,16 @@ class VertexAttribute_IHM : public IHM::AttributeHandler_IHM<T, VERTEX>
public:
VertexAttribute_IHM() : IHM::AttributeHandler_IHM<T, VERTEX>() {}
VertexAttribute_IHM(const IHM::AttributeHandler_IHM<T, VERTEX>& ah) : IHM::AttributeHandler_IHM<T, VERTEX>(ah) {}
VertexAttribute_IHM<T>& operator=(const IHM::AttributeHandler_IHM<T, VERTEX>& ah) { this->IHM::AttributeHandler_IHM<T, VERTEX>::operator=(ah); return *this; }
// VertexAttribute_IHM<T>& operator=(const IHM::AttributeHandler_IHM<T, VERTEX>& ah) { this->IHM::AttributeHandler_IHM<T, VERTEX>::operator=(ah); return *this; }
};
} //namespace IHM
} // Volume
} //namespace Algo
} // namespace IHM
} //namespace CGoGN
} // namespace Volume
} // namespace Algo
} // namespace CGoGN
#include "Algo/ImplicitHierarchicalMesh/ihm3.hpp"
......@@ -464,4 +466,3 @@ public:
///*!
// */
//bool faceIsSubdividedOnce(Dart d);
......@@ -45,7 +45,7 @@ AttributeHandler_IHM<T, ORBIT> ImplicitHierarchicalMap3::addAttribute(const std:
if(!isOrbitEmbedded<ORBIT>())
addNextLevelCell = true ;
AttributeHandler<T, ORBIT> h = Map3::addAttribute<T, ORBIT>(nameAttr) ;
AttributeHandler<T, ORBIT, EMap3_IMPL> h = Map3::addAttribute<T, ORBIT>(nameAttr) ;
if(addNextLevelCell)
{
......@@ -62,11 +62,10 @@ AttributeHandler_IHM<T, ORBIT> ImplicitHierarchicalMap3::addAttribute(const std:
template <typename T, unsigned int ORBIT>
AttributeHandler_IHM<T, ORBIT> ImplicitHierarchicalMap3::getAttribute(const std::string& nameAttr)
{
AttributeHandler<T, ORBIT> h = Map3::getAttribute<T, ORBIT>(nameAttr) ;
AttributeHandler<T, ORBIT, EMap3_IMPL> h = Map3::getAttribute<T, ORBIT>(nameAttr) ;
return AttributeHandler_IHM<T, ORBIT>(this, h.getDataVector()) ;
}
inline void ImplicitHierarchicalMap3::update_topo_shortcuts()
{
Map3::update_topo_shortcuts();
......@@ -227,7 +226,7 @@ inline void ImplicitHierarchicalMap3::next(Dart& d) const
inline bool ImplicitHierarchicalMap3::foreach_dart_of_vertex(Dart d, FunctorType& f, unsigned int thread) const
{
DartMarkerStore mv(*this, thread); // Lock a marker
DartMarkerStore<Map3> mv(*this, thread); // Lock a marker
bool found = false; // Last functor return value
std::vector<Dart> darts; // Darts that are traversed
......@@ -288,7 +287,7 @@ inline bool ImplicitHierarchicalMap3::foreach_dart_of_face(Dart d, FunctorType&
inline bool ImplicitHierarchicalMap3::foreach_dart_of_oriented_volume(Dart d, FunctorType& f, unsigned int thread) const
{
DartMarkerStore mark(*this, thread); // Lock a marker
DartMarkerStore<Map3> mark(*this, thread); // Lock a marker
bool found = false; // Last functor return value
std::vector<Dart> visitedFaces; // Faces that are traversed
......@@ -329,7 +328,7 @@ inline bool ImplicitHierarchicalMap3::foreach_dart_of_volume(Dart d, FunctorType
inline bool ImplicitHierarchicalMap3::foreach_dart_of_cc(Dart d, FunctorType& f, unsigned int thread) const
{
DartMarkerStore mark(*this, thread); // Lock a marker
DartMarkerStore<Map3> mark(*this, thread); // Lock a marker
bool found = false; // Last functor return value
std::vector<Dart> visitedFaces; // Faces that are traversed
......
......@@ -27,7 +27,6 @@
#include <cmath>
namespace CGoGN
{
......@@ -77,7 +76,7 @@ unsigned int vertexLevel(typename PFP::MAP& map, Dart d)
template <typename PFP, typename T>
void filterLowPass(typename PFP::MAP& map, VertexAttribute<T>& attIn, unsigned int cutoffLevel)
void filterLowPass(typename PFP::MAP& map, VertexAttribute<T, typename PFP::MAP>& attIn, unsigned int cutoffLevel)
{
unsigned int cur = map.getCurrentLevel();
unsigned int max = map.getMaxLevel();
......@@ -95,7 +94,7 @@ void filterLowPass(typename PFP::MAP& map, VertexAttribute<T>& attIn, unsigned i
}
template <typename PFP, typename T>
void filterHighPass(typename PFP::MAP& map, VertexAttribute<T>& attIn, unsigned int cutoffLevel)
void filterHighPass(typename PFP::MAP& map, VertexAttribute<T, typename PFP::MAP>& attIn, unsigned int cutoffLevel)
{
unsigned int cur = map.getCurrentLevel();
unsigned int max = map.getMaxLevel();
......@@ -113,7 +112,7 @@ void filterHighPass(typename PFP::MAP& map, VertexAttribute<T>& attIn, unsigned
}
template <typename PFP, typename T>
void filterBandPass(typename PFP::MAP& map, VertexAttribute<T>& attIn, unsigned int cutoffLevelLow, unsigned int cutoffLevelHigh)
void filterBandPass(typename PFP::MAP& map, VertexAttribute<T, typename PFP::MAP>& attIn, unsigned int cutoffLevelLow, unsigned int cutoffLevelHigh)
{
unsigned int cur = map.getCurrentLevel();
unsigned int max = map.getMaxLevel();
......@@ -149,7 +148,7 @@ typename PFP::VEC3 doTwist(typename PFP::VEC3 pos, float t )
}
template <typename PFP>
void frequencyDeformation(typename PFP::MAP& map, VertexAttribute<typename PFP::VEC3>& attIn, unsigned int cutoffLevel)
void frequencyDeformation(typename PFP::MAP& map, VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& attIn, unsigned int cutoffLevel)
{
float time = 1.0;
//float angle_deg_max = 0.4;
......@@ -162,7 +161,6 @@ void frequencyDeformation(typename PFP::MAP& map, VertexAttribute<typename PFP::
TraversorV<typename PFP::MAP> tv(map);
for (Dart d = tv.begin(); d != tv.end(); d = tv.next())
{
typename PFP::VEC3 p = attIn[d];
float dist = std::sqrt(p[0]*p[0] + p[2]*p[2]);
......@@ -178,10 +176,6 @@ void frequencyDeformation(typename PFP::MAP& map, VertexAttribute<typename PFP::
}
}
} // namespace MR
} // namespace Algo
......@@ -189,4 +183,3 @@ void frequencyDeformation(typename PFP::MAP& map, VertexAttribute<typename PFP::
} // namespace CGoGN
#endif
......@@ -169,8 +169,8 @@ void foreach_cell(MAP& map, std::vector<FunctorMapThreaded<MAP>*>& funcs, bool n
vd[i].reserve(SIZE_BUFFER_THREAD);
AttributeContainer* cont = NULL;
DartMarker* dmark = NULL;
CellMarker<ORBIT>* cmark = NULL;
DartMarker<MAP>* dmark = NULL;
CellMarker<MAP, ORBIT>* cmark = NULL;
const AttributeMultiVector<Dart>* quickTraversal = map.template getQuickTraversal<ORBIT>() ;
// fill each vd buffers with SIZE_BUFFER_THREAD darts
......@@ -197,7 +197,7 @@ void foreach_cell(MAP& map, std::vector<FunctorMapThreaded<MAP>*>& funcs, bool n
{
if(map.template isOrbitEmbedded<ORBIT>())
{
cmark = new CellMarker<ORBIT>(map) ;
cmark = new CellMarker<MAP, ORBIT>(map) ;
d = map.begin();
unsigned int nb = 0;
......@@ -214,7 +214,7 @@ void foreach_cell(MAP& map, std::vector<FunctorMapThreaded<MAP>*>& funcs, bool n
}
else
{
dmark = new DartMarker(map) ;
dmark = new DartMarker<MAP>(map) ;
d = map.begin();
unsigned int nb = 0;
while ((d != map.end()) && (nb < nbth*SIZE_BUFFER_THREAD) )
......@@ -486,7 +486,7 @@ void foreach_cell2Pass(MAP& map, std::vector<FunctorMapThreaded<MAP>*>& funcsFro
map.addThreadMarker(nbth+1-nbth_prec);
}
CellMarkerNoUnmark<CELL> cm(map); // for 2 pass front mark / back unmark
CellMarkerNoUnmark<MAP, CELL> cm(map); // for 2 pass front mark / back unmark
boost::barrier sync1(nbth+1);
boost::barrier sync2(nbth+1);
......@@ -663,8 +663,8 @@ void foreach_cell_all_thread(MAP& map, std::vector<FunctorMapThreaded<MAP>*>& fu
vd.reserve(SIZE_BUFFER_THREAD);
AttributeContainer* cont = NULL;
DartMarker* dmark = NULL;
CellMarker<ORBIT>* cmark = NULL;
DartMarker<MAP>* dmark = NULL;
CellMarker<MAP, ORBIT>* cmark = NULL;
AttributeMultiVector<Dart>* quickTraversal = map.template getQuickTraversal<ORBIT>() ;
// fill each vd buffers with SIZE_BUFFER_THREAD darts
......@@ -688,7 +688,7 @@ void foreach_cell_all_thread(MAP& map, std::vector<FunctorMapThreaded<MAP>*>& fu
{
if(map.template isOrbitEmbedded<ORBIT>())
{
cmark = new CellMarker<ORBIT>(map) ;
cmark = new CellMarker<MAP, ORBIT>(map) ;
d = map.begin();
unsigned int nb=0;
while ((d != map.end()) && (nb < SIZE_BUFFER_THREAD) )
......@@ -704,7 +704,7 @@ void foreach_cell_all_thread(MAP& map, std::vector<FunctorMapThreaded<MAP>*>& fu
}
else
{
dmark = new DartMarker(map) ;
dmark = new DartMarker<MAP>(map) ;
d = map.begin();
unsigned int nb=0;
while ((d != map.end()) && (nb < SIZE_BUFFER_THREAD) )
......@@ -818,13 +818,6 @@ void foreach_cell_all_thread(MAP& map, std::vector<FunctorMapThreaded<MAP>*>& fu
delete dmark;
}
} // namespace Parallel
} // namespace Algo
......
......@@ -40,7 +40,6 @@
#include "Container/convert.h"
#include "Geometry/vector_gen.h"
// forward definition
namespace CGoGN { namespace Utils { class GLSLShader; } }
......@@ -155,16 +154,16 @@ protected:
void addTri(typename PFP::MAP& map, Dart d, std::vector<GLuint>& tableIndices) ;
template<typename PFP>
inline void addEarTri(typename PFP::MAP& map, Dart d, std::vector<GLuint>& tableIndices, const VertexAttribute<typename PFP::VEC3>* position);
inline void addEarTri(typename PFP::MAP& map, Dart d, std::vector<GLuint>& tableIndices, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP>* position);
template<typename PFP>
float computeEarAngle(const typename PFP::VEC3& P1, const typename PFP::VEC3& P2, const typename PFP::VEC3& P3, const typename PFP::VEC3& normalPoly);
template<typename PFP>
bool computeEarIntersection(const VertexAttribute<typename PFP::VEC3>& position, VertexPoly* vp, const typename PFP::VEC3& normalPoly);
bool computeEarIntersection(const VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position, VertexPoly* vp, const typename PFP::VEC3& normalPoly);
template<typename PFP>
void recompute2Ears(const VertexAttribute<typename PFP::VEC3>& position, VertexPoly* vp, const typename PFP::VEC3& normalPoly, VPMS& ears, bool convex);
void recompute2Ears(const VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position, VertexPoly* vp, const typename PFP::VEC3& normalPoly, VPMS& ears, bool convex);
template<typename VEC3>
bool inTriangle(const VEC3& P, const VEC3& normal, const VEC3& Ta, const VEC3& Tb, const VEC3& Tc);
......@@ -175,9 +174,9 @@ public:
* @param tableIndices the table where indices are stored
*/
template <typename PFP>
void initTriangles(typename PFP::MAP& map, std::vector<GLuint>& tableIndices, const VertexAttribute<typename PFP::VEC3>* position, unsigned int thread = 0) ;
void initTriangles(typename PFP::MAP& map, std::vector<GLuint>& tableIndices, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP>* position, unsigned int thread = 0) ;
template <typename PFP>
void initTrianglesOptimized(typename PFP::MAP& map, std::vector<GLuint>& tableIndices, const VertexAttribute<typename PFP::VEC3>* position, unsigned int thread = 0) ;
void initTrianglesOptimized(typename PFP::MAP& map, std::vector<GLuint>& tableIndices, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP>* position, unsigned int thread = 0) ;
/**
* creation of indices table of lines (optimized order)
......@@ -210,13 +209,13 @@ public:
void initPrimitives(typename PFP::MAP& map, int prim, bool optimized = true, unsigned int thread = 0) ;
template <typename PFP>
void initPrimitives(typename PFP::MAP& map, int prim, const VertexAttribute<typename PFP::VEC3>* position, bool optimized = true, unsigned int thread = 0) ;
void initPrimitives(typename PFP::MAP& map, int prim, const VertexAttribute<typename PFP::VEC3, typename PFP::MAP>* position, bool optimized = true, unsigned int thread = 0) ;
/**
* add primitives to the VBO of indices
*/
template <typename PFP>