Commit cb65f5ab by Pierre Kraemer

### suite du newMR..

parent 4e878d8e
 ... ... @@ -43,7 +43,7 @@ namespace Geometry //! @param position //! @return template typename PFP::REAL triangleArea(typename PFP::MAP& map, Dart d, const VertexAttribute& position) ; typename PFP::REAL triangleArea(typename PFP::MAP& map, Dart d, const VertexAttribute& 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::REAL convexFaceArea(typename PFP::MAP& map, Dart d, const VertexAttribute& position) ; typename PFP::REAL convexFaceArea(typename PFP::MAP& map, Dart d, const VertexAttribute& position) ; //! \brief Compute the total area of a mesh by summing all face areas. //! @param map //! @param position //! @return template typename PFP::REAL totalArea(typename PFP::MAP& map, const VertexAttribute& position, unsigned int thread = 0) ; typename PFP::REAL totalArea(typename PFP::MAP& map, const VertexAttribute& 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 typename PFP::REAL vertexOneRingArea(typename PFP::MAP& map, Dart d, const VertexAttribute& position) ; typename PFP::REAL vertexOneRingArea(typename PFP::MAP& map, Dart d, const VertexAttribute& position) ; template typename PFP::REAL vertexBarycentricArea(typename PFP::MAP& map, Dart d, const VertexAttribute& position) ; typename PFP::REAL vertexBarycentricArea(typename PFP::MAP& map, Dart d, const VertexAttribute& position) ; template typename PFP::REAL vertexVoronoiArea(typename PFP::MAP& map, Dart d, const VertexAttribute& position) ; typename PFP::REAL vertexVoronoiArea(typename PFP::MAP& map, Dart d, const VertexAttribute& position) ; template void computeAreaFaces(typename PFP::MAP& map, const VertexAttribute& position, FaceAttribute& face_area) ; void computeAreaFaces(typename PFP::MAP& map, const VertexAttribute& position, FaceAttribute& face_area) ; template void computeOneRingAreaVertices(typename PFP::MAP& map, const VertexAttribute& position, VertexAttribute& vertex_area) ; void computeOneRingAreaVertices(typename PFP::MAP& map, const VertexAttribute& position, VertexAttribute& vertex_area) ; template void computeBarycentricAreaVertices(typename PFP::MAP& map, const VertexAttribute& position, VertexAttribute& vertex_area) ; void computeBarycentricAreaVertices(typename PFP::MAP& map, const VertexAttribute& position, VertexAttribute& vertex_area) ; template void computeVoronoiAreaVertices(typename PFP::MAP& map, const VertexAttribute& position, VertexAttribute& vertex_area) ; void computeVoronoiAreaVertices(typename PFP::MAP& map, const VertexAttribute& position, VertexAttribute& vertex_area) ; } // namespace Geometry ... ...
 ... ... @@ -40,7 +40,7 @@ namespace Geometry { template typename PFP::REAL triangleArea(typename PFP::MAP& map, Dart d, const VertexAttribute& position) typename PFP::REAL triangleArea(typename PFP::MAP& map, Dart d, const VertexAttribute& 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::REAL convexFaceArea(typename PFP::MAP& map, Dart d, const VertexAttribute& position) typename PFP::REAL convexFaceArea(typename PFP::MAP& map, Dart d, const VertexAttribute& 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::REAL totalArea(typename PFP::MAP& map, const VertexAttribute& position, unsigned int thread) typename PFP::REAL totalArea(typename PFP::MAP& map, const VertexAttribute& position, unsigned int thread) { typename PFP::REAL area(0) ; TraversorF t(map) ; ... ... @@ -82,7 +82,7 @@ typename PFP::REAL totalArea(typename PFP::MAP& map, const VertexAttribute typename PFP::REAL vertexOneRingArea(typename PFP::MAP& map, Dart d, const VertexAttribute& position) typename PFP::REAL vertexOneRingArea(typename PFP::MAP& map, Dart d, const VertexAttribute& position) { typename PFP::REAL area(0) ; Traversor2VF t(map, d) ; ... ... @@ -92,7 +92,7 @@ typename PFP::REAL vertexOneRingArea(typename PFP::MAP& map, Dart d, const Verte } template typename PFP::REAL vertexBarycentricArea(typename PFP::MAP& map, Dart d, const VertexAttribute& position) typename PFP::REAL vertexBarycentricArea(typename PFP::MAP& map, Dart d, const VertexAttribute& position) { typename PFP::REAL area(0) ; Traversor2VF t(map, d) ; ... ... @@ -102,7 +102,7 @@ typename PFP::REAL vertexBarycentricArea(typename PFP::MAP& map, Dart d, const V } template typename PFP::REAL vertexVoronoiArea(typename PFP::MAP& map, Dart d, const VertexAttribute& position) typename PFP::REAL vertexVoronoiArea(typename PFP::MAP& map, Dart d, const VertexAttribute& position) { typename PFP::REAL area(0) ; Traversor2VF t(map, d) ; ... ... @@ -130,7 +130,7 @@ typename PFP::REAL vertexVoronoiArea(typename PFP::MAP& map, Dart d, const Verte } template void computeAreaFaces(typename PFP::MAP& map, const VertexAttribute& position, FaceAttribute& face_area) void computeAreaFaces(typename PFP::MAP& map, const VertexAttribute& position, FaceAttribute& face_area) { TraversorF 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 void computeOneRingAreaVertices(typename PFP::MAP& map, const VertexAttribute& position, VertexAttribute& vertex_area) void computeOneRingAreaVertices(typename PFP::MAP& map, const VertexAttribute& position, VertexAttribute& vertex_area) { TraversorV 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 void computeBarycentricAreaVertices(typename PFP::MAP& map, const VertexAttribute& position, VertexAttribute& vertex_area) void computeBarycentricAreaVertices(typename PFP::MAP& map, const VertexAttribute& position, VertexAttribute& vertex_area) { TraversorV 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 void computeVoronoiAreaVertices(typename PFP::MAP& map, const VertexAttribute& position, VertexAttribute& vertex_area) void computeVoronoiAreaVertices(typename PFP::MAP& map, const VertexAttribute& position, VertexAttribute& vertex_area) { TraversorV 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 class FunctorConvexFaceArea: public FunctorMapThreaded { const VertexAttribute& m_position; FaceAttribute& m_area; const VertexAttribute& m_position; FaceAttribute& m_area; public: FunctorConvexFaceArea( typename PFP::MAP& map, const VertexAttribute& position, FaceAttribute& area): FunctorConvexFaceArea( typename PFP::MAP& map, const VertexAttribute& position, FaceAttribute& area): FunctorMapThreaded(map), m_position(position), m_area(area) { } ... ... @@ -181,20 +183,19 @@ public: }; template void computeAreaFaces(typename PFP::MAP& map, const VertexAttribute& position, FaceAttribute& area, unsigned int nbth) void computeAreaFaces(typename PFP::MAP& map, const VertexAttribute& position, FaceAttribute& area, unsigned int nbth) { FunctorConvexFaceArea funct(map,position,area); Algo::Parallel::foreach_cell(map, funct, nbth, false); } template class FunctorVertexOneRingArea: public FunctorMapThreaded { const VertexAttribute& m_position; VertexAttribute& m_area; const VertexAttribute& m_position; VertexAttribute& m_area; public: FunctorVertexOneRingArea( typename PFP::MAP& map, const VertexAttribute& position, VertexAttribute& area): FunctorVertexOneRingArea( typename PFP::MAP& map, const VertexAttribute& position, VertexAttribute& area): FunctorMapThreaded(map), m_position(position), m_area(area) { } ... ... @@ -205,21 +206,19 @@ public: }; template void computeOneRingAreaVertices(typename PFP::MAP& map, const VertexAttribute& position, VertexAttribute& area, unsigned int nbth) void computeOneRingAreaVertices(typename PFP::MAP& map, const VertexAttribute& position, VertexAttribute& area, unsigned int nbth) { FunctorConvexFaceArea funct(map,position,area); Algo::Parallel::foreach_cell(map, funct, nbth, false); } template class FunctorVertexVoronoiArea: public FunctorMapThreaded { const VertexAttribute& m_position; VertexAttribute& m_area; const VertexAttribute& m_position; VertexAttribute& m_area; public: FunctorVertexVoronoiArea( typename PFP::MAP& map, const VertexAttribute& position, VertexAttribute& area): FunctorVertexVoronoiArea( typename PFP::MAP& map, const VertexAttribute& position, VertexAttribute& area): FunctorMapThreaded(map), m_position(position), m_area(area) { } ... ... @@ -230,24 +229,19 @@ public: }; template void computeVoronoiAreaVertices(typename PFP::MAP& map, const VertexAttribute& position, VertexAttribute& area, unsigned int nbth) void computeVoronoiAreaVertices(typename PFP::MAP& map, const VertexAttribute& position, VertexAttribute& area, unsigned int nbth) { FunctorConvexFaceArea funct(map,position,area); Algo::Parallel::foreach_cell(map, funct, nbth, false); Algo::Parallel::foreach_cell(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 inline typename PFP::VEC3 vectorOutOfDart(typename PFP::MAP& map, Dart d, const VertexAttribute& position) inline typename PFP::VEC3 vectorOutOfDart(typename PFP::MAP& map, Dart d, const VertexAttribute& 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 inline typename PFP::REAL edgeLength(typename PFP::MAP& map, Dart d, const VertexAttribute& position) inline typename PFP::REAL edgeLength(typename PFP::MAP& map, Dart d, const VertexAttribute& position) { typename PFP::VEC3 v = vectorOutOfDart(map, d, position) ; return v.norm() ; } template inline float angle(typename PFP::MAP& map, Dart d1, Dart d2, const VertexAttribute& position) inline float angle(typename PFP::MAP& map, Dart d1, Dart d2, const VertexAttribute& position) { typename PFP::VEC3 v1 = vectorOutOfDart(map, d1, position) ; typename PFP::VEC3 v2 = vectorOutOfDart(map, d2, position) ; ... ... @@ -66,7 +66,7 @@ inline float angle(typename PFP::MAP& map, Dart d1, Dart d2, const VertexAttribu } template bool isTriangleObtuse(typename PFP::MAP& map, Dart d, const VertexAttribute& position) bool isTriangleObtuse(typename PFP::MAP& map, Dart d, const VertexAttribute& 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 faces; CellMarker f(map); CellMarker 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 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 class AttributeHandler_IHM ; typedef EmbeddedMap3::IMPL EMap3_IMPL; class ImplicitHierarchicalMap3 : public EmbeddedMap3 { template 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 m_dartLevel ; DartAttribute m_edgeId ; DartAttribute m_faceId ; DartAttribute m_dartLevel ; DartAttribute m_edgeId ; DartAttribute m_faceId ; AttributeMultiVector* m_nextLevelCell[NB_ORBITS] ; ... ... @@ -404,25 +404,25 @@ public: } ; template class AttributeHandler_IHM : public AttributeHandler class AttributeHandler_IHM : public AttributeHandler { public: typedef T DATA_TYPE ; AttributeHandler_IHM() : AttributeHandler() AttributeHandler_IHM() : AttributeHandler() {} AttributeHandler_IHM(GenericMap* m, AttributeMultiVector* amv) : AttributeHandler(m, amv) AttributeHandler_IHM(ImplicitHierarchicalMap3* m, AttributeMultiVector* amv) : AttributeHandler(m, amv) {} AttributeMultiVector* getDataVector() const { return AttributeHandler::getDataVector() ; return AttributeHandler::getDataVector() ; } bool isValid() const { return AttributeHandler::isValid() ; return AttributeHandler::isValid() ; } virtual T& operator[](Dart d) ; ... ... @@ -431,12 +431,12 @@ public: T& operator[](unsigned int a) { return AttributeHandler::operator[](a) ; return AttributeHandler::operator[](a) ; } const T& operator[](unsigned int a) const { return AttributeHandler::operator[](a) ; return AttributeHandler::operator[](a) ; } } ; ... ... @@ -447,14 +447,16 @@ class VertexAttribute_IHM : public IHM::AttributeHandler_IHM public: VertexAttribute_IHM() : IHM::AttributeHandler_IHM() {} VertexAttribute_IHM(const IHM::AttributeHandler_IHM& ah) : IHM::AttributeHandler_IHM(ah) {} VertexAttribute_IHM& operator=(const IHM::AttributeHandler_IHM& ah) { this->IHM::AttributeHandler_IHM::operator=(ah); return *this; } // VertexAttribute_IHM& operator=(const IHM::AttributeHandler_IHM& ah) { this->IHM::AttributeHandler_IHM::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);