Commit f3132155 by untereiner

### some changes to implicit MR management

parent 10e52114
This diff is collapsed.
 ... ... @@ -37,15 +37,34 @@ namespace Surface namespace Geometry { //! \brief Compute triangle area //! @param map //! @param d //! @param position //! @return template typename PFP::REAL triangleArea(typename PFP::MAP& map, Dart d, const VertexAttribute& position) ; //! \brief Compute convex polygonal face area //! @param map //! @param d //! @param position //! @return template 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) ; //! \brief Compute the area of the faces around a vertex. //! @param map //! @param d //! @param position //! @return template typename PFP::REAL vertexOneRingArea(typename PFP::MAP& map, Dart d, const VertexAttribute& position) ; ... ...
 ... ... @@ -25,7 +25,7 @@ #ifndef __MAP2MR_PRIMAL_ADAPT__ #define __MAP2MR_PRIMAL_ADAPT__ #include "Topology/map/embeddedMap2.h" #include "Topology/ihmap/ihm2.h" #include "Topology/generic/traversorCell.h" #include "Topology/generic/traversor2.h" ... ... @@ -52,8 +52,6 @@ class IHM2 public: typedef typename PFP::MAP MAP ; typedef typename PFP::VEC3 VEC3 ; typedef typename PFP::REAL REAL ; protected: MAP& m_map; ... ... @@ -67,6 +65,59 @@ public: IHM2(MAP& map) ; /*************************************************** * CELLS INFORMATION * ***************************************************/ /** * Return the level of the edge of d in the current level map */ unsigned int edgeLevel(Dart d) ; /** * Return the level of the face of d in the current level map */ unsigned int faceLevel(Dart d) ; /** * Given the face of d in the current level map, * return a level 0 dart of its origin face */ Dart faceOrigin(Dart d) ; /** * Return the oldest dart of the face of d in the current level map */ Dart faceOldestDart(Dart d) ; /** * Return true if the edge of d in the current level map * has already been subdivided to the next level */ bool edgeIsSubdivided(Dart d) ; /** * Return true if the edge of d in the current level map * is subdivided to the next level, * none of its resulting edges is in turn subdivided to the next level * and the middle vertex is of degree 2 */ bool edgeCanBeCoarsened(Dart d) ; /** * Return true if the face of d in the current level map * has already been subdivided to the next level */ bool faceIsSubdivided(Dart d) ; /** * Return true if the face of d in the current level map * is subdivided to the next level * and none of its resulting faces is in turn subdivided to the next level */ bool faceIsSubdividedOnce(Dart d) ; protected: /*************************************************** * SUBDIVISION * ... ... @@ -88,11 +139,6 @@ public: */ unsigned int subdivideFace(Dart d, bool triQuad = true, bool OneLevelDifference = true); /** * */ unsigned int subdivideFaceSqrt3(Dart d); /** * coarsen the face of d from the next level */ ... ...
This diff is collapsed.
 ... ... @@ -79,7 +79,8 @@ public: ef += m_position[m_map.phi1(dit)]; m_map.decCurrentLevel(); ++count; } } ef /= count; ef *= 2.0; ... ... @@ -89,6 +90,7 @@ public: Dart midF = m_map.phi1(m_map.phi1(d)); m_position[midF] += vf + ef ; m_map.decCurrentLevel() ; break; } TraversorE travE(m_map) ; ... ... @@ -213,7 +215,7 @@ public: m_map.incCurrentLevel() ; Dart midF = m_map.phi1(m_map.phi1(d)); m_position[midF] -= vf + ef ; m_position[midF] -= vf + ef ; m_map.decCurrentLevel() ; } } ... ...
 ... ... @@ -105,8 +105,8 @@ public: bool operator() (Dart d) { //Dart df = m_map.phi1(m_map.phi1(d)) ; Dart df = m_map.phi1(d) ; Dart df = m_map.phi1(m_map.phi1(d)) ; //Dart df = m_map.phi1(d) ; m_map.decCurrentLevel() ; ... ...
 ... ... @@ -64,9 +64,8 @@ void Grid::grid(unsigned int x, unsigned int y, bool close) // store last row of vertices for (unsigned int i = 0; i < x; ++i) { //this->m_tableVertDarts.push_back(this->m_map.phi_1(this->m_tableVertDarts[(y-1)*(x+1) + i]) ); } //this-> m_tableVertDarts.push_back(this->m_map.phi1(this->m_tableVertDarts[(y-1)*(x+1) +x]) ); this->m_tableVertDarts.push_back(this->m_map.phi_1(this->m_tableVertDarts[(y-1)*(x+1) + i]) ); } //sewing the triangles for (unsigned int i = 0; i < y; ++i) ... ... @@ -75,11 +74,11 @@ void Grid::grid(unsigned int x, unsigned int y, bool close) { if (i > 0) // sew with preceeding row { int pos = i*(x+1)+j; Dart d = this->m_tableVertDarts[pos]; Dart e = this->m_tableVertDarts[pos-(x+1)]; e = this->m_map.phi1(this->m_map.phi1(e)); this->m_map.sewFaces(d, e, false); // int pos = i*(x+1)+j; // Dart d = this->m_tableVertDarts[pos]; // Dart e = this->m_tableVertDarts[pos-(x+1)]; // e = this->m_map.phi_1(e); // this->m_map.sewFaces(d, e, false); } if (j > 0) // sew with preceeding column { ... ... @@ -107,7 +106,7 @@ void Grid::embedIntoGrid(VertexAttribute& position, float x, float y, { for(unsigned int j = 0; j <= this->m_nx;++j) { position[this->m_tableVertDarts[i*(this->m_nx+1)+j] ] = VEC3(-x/2 + dx*float(j), -y/2 + dy*float(i), z); position[this->m_tableVertDarts[i*(this->m_nx+1)+j] ] = VEC3(dx*float(j) + 0.5f*float(i), dy*float(i) * sqrtf(3.0f)/2.0f, z); } } } ... ...
 ... ... @@ -504,11 +504,11 @@ template Dart Traversor2FV::next() { if(m_QLT != NULL) { { return *m_ItDarts++; } if(current != NIL) { { current = m.phi1(current) ; if(current == start) current = NIL ; ... ...
 ... ... @@ -121,6 +121,8 @@ public: void splitFace(Dart d, Dart e) ; unsigned int vertexDegree(Dart d); /*************************************************** * LEVELS MANAGEMENT * ***************************************************/ ... ... @@ -161,58 +163,65 @@ public: * CELLS INFORMATION * ***************************************************/ /** * @brief faceDegree * @param d * @return */ unsigned int faceDegree(Dart d); /** * Return the level of insertion of the vertex of d */ unsigned int vertexInsertionLevel(Dart d) ; /** * Return the level of the edge of d in the current level map */ unsigned int edgeLevel(Dart d) ; /** * Return the level of the face of d in the current level map */ unsigned int faceLevel(Dart d) ; /** * Given the face of d in the current level map, * return a level 0 dart of its origin face */ Dart faceOrigin(Dart d) ; /** * Return the oldest dart of the face of d in the current level map */ Dart faceOldestDart(Dart d) ; /** * Return true if the edge of d in the current level map * has already been subdivided to the next level */ bool edgeIsSubdivided(Dart d) ; /** * Return true if the edge of d in the current level map * is subdivided to the next level, * none of its resulting edges is in turn subdivided to the next level * and the middle vertex is of degree 2 */ bool edgeCanBeCoarsened(Dart d) ; /** * Return true if the face of d in the current level map * has already been subdivided to the next level */ bool faceIsSubdivided(Dart d) ; /** * Return true if the face of d in the current level map * is subdivided to the next level * and none of its resulting faces is in turn subdivided to the next level */ bool faceIsSubdividedOnce(Dart d) ; // /** // * Return the level of the edge of d in the current level map // */ // unsigned int edgeLevel(Dart d) ; // /** // * Return the level of the face of d in the current level map // */ // unsigned int faceLevel(Dart d) ; // /** // * Given the face of d in the current level map, // * return a level 0 dart of its origin face // */ // Dart faceOrigin(Dart d) ; // /** // * Return the oldest dart of the face of d in the current level map // */ // Dart faceOldestDart(Dart d) ; // /** // * Return true if the edge of d in the current level map // * has already been subdivided to the next level // */ // bool edgeIsSubdivided(Dart d) ; // /** // * Return true if the edge of d in the current level map // * is subdivided to the next level, // * none of its resulting edges is in turn subdivided to the next level // * and the middle vertex is of degree 2 // */ // bool edgeCanBeCoarsened(Dart d) ; // /** // * Return true if the face of d in the current level map // * has already been subdivided to the next level // */ // bool faceIsSubdivided(Dart d) ; // /** // * Return true if the face of d in the current level map // * is subdivided to the next level // * and none of its resulting faces is in turn subdivided to the next level // */ // bool faceIsSubdividedOnce(Dart d) ; } ; template ... ...
 ... ... @@ -84,7 +84,7 @@ inline Dart ImplicitHierarchicalMap2::newDart() inline Dart ImplicitHierarchicalMap2::phi1(Dart d) { assert(m_dartLevel[d] <= m_curLevel || !"Access to a dart introduced after current level") ; bool finished = false ; bool finished = false ; unsigned int edgeId = m_edgeId[d] ; Dart it = d ; do ... ... @@ -95,7 +95,7 @@ inline Dart ImplicitHierarchicalMap2::phi1(Dart d) else { while(m_edgeId[it] != edgeId) it = Map2::alpha_1(it) ; it = Map2::phi1(Map2::phi2(it)) ; } } while(!finished) ; return it ; ... ... @@ -126,7 +126,7 @@ inline Dart ImplicitHierarchicalMap2::phi2(Dart d) assert(m_dartLevel[d] <= m_curLevel || !"Access to a dart introduced after current level") ; if(Map2::phi2(d) == d) return d ; return Map2::alpha1(phi1(d)) ; return Map2::phi2(Map2::phi_1(phi1(d))) ; } inline Dart ImplicitHierarchicalMap2::alpha0(Dart d) ... ... @@ -337,21 +337,35 @@ inline void ImplicitHierarchicalMap2::setEdgeId(Dart d, unsigned int i) * CELLS INFORMATION * ***************************************************/ inline unsigned int ImplicitHierarchicalMap2::vertexInsertionLevel(Dart d) inline unsigned int ImplicitHierarchicalMap2::faceDegree(Dart d) { assert(m_dartLevel[d] <= m_curLevel || !"Access to a dart introduced after current level") ; return m_dartLevel[d] ; unsigned int count = 0 ; Dart it = d ; do { ++count ; it = phi1(it) ; } while (it != d) ; return count ; } inline unsigned int ImplicitHierarchicalMap2::edgeLevel(Dart d) inline unsigned int ImplicitHierarchicalMap2::vertexInsertionLevel(Dart d) { assert(m_dartLevel[d] <= m_curLevel || !"Access to a dart introduced after current level") ; unsigned int ld = m_dartLevel[d] ; // unsigned int ldd = m_dartLevel[phi2(d)] ; // the level of an edge is the maximum of the unsigned int ldd = m_dartLevel[phi1(d)] ; return ld < ldd ? ldd : ld ; // insertion levels of its two darts return m_dartLevel[d] ; } //inline unsigned int ImplicitHierarchicalMap2::edgeLevel(Dart d) //{ // assert(m_dartLevel[d] <= m_curLevel || !"Access to a dart introduced after current level") ; // unsigned int ld = m_dartLevel[d] ; //// unsigned int ldd = m_dartLevel[phi2(d)] ; // the level of an edge is the maximum of the // unsigned int ldd = m_dartLevel[phi1(d)] ; // return ld < ldd ? ldd : ld ; // insertion levels of its two darts //} /*************************************************** * ATTRIBUTE HANDLER * ***************************************************/ ... ...
 ... ... @@ -224,7 +224,7 @@ inline unsigned int Map1::cycleDegree(Dart d) unsigned int count = 0 ; Dart it = d ; do { { ++count ; it = phi1(it) ; } while (it != d) ; ... ...
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!