Commit f3132155 by untereiner

### some changes to implicit MR management

parent 10e52114
This diff is collapsed.
 ... @@ -37,15 +37,34 @@ namespace Surface ... @@ -37,15 +37,34 @@ namespace Surface namespace Geometry namespace Geometry { { //! \brief Compute triangle area //! @param map //! @param d //! @param position //! @return template 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 //! @param d //! @param position //! @return template 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 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 //! @param d //! @param position //! @return template template 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) ; ... ...
 ... @@ -25,7 +25,7 @@ ... @@ -25,7 +25,7 @@ #ifndef __MAP2MR_PRIMAL_ADAPT__ #ifndef __MAP2MR_PRIMAL_ADAPT__ #define __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/traversorCell.h" #include "Topology/generic/traversor2.h" #include "Topology/generic/traversor2.h" ... @@ -52,8 +52,6 @@ class IHM2 ... @@ -52,8 +52,6 @@ class IHM2 public: public: typedef typename PFP::MAP MAP ; typedef typename PFP::MAP MAP ; typedef typename PFP::VEC3 VEC3 ; typedef typename PFP::REAL REAL ; protected: protected: MAP& m_map; MAP& m_map; ... @@ -67,6 +65,59 @@ public: ... @@ -67,6 +65,59 @@ public: IHM2(MAP& map) ; 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: protected: /*************************************************** /*************************************************** * SUBDIVISION * * SUBDIVISION * ... @@ -88,11 +139,6 @@ public: ... @@ -88,11 +139,6 @@ public: */ */ unsigned int subdivideFace(Dart d, bool triQuad = true, bool OneLevelDifference = true); 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 * coarsen the face of d from the next level */ */ ... ...
This diff is collapsed.
 ... @@ -79,7 +79,8 @@ public: ... @@ -79,7 +79,8 @@ public: ef += m_position[m_map.phi1(dit)]; ef += m_position[m_map.phi1(dit)]; m_map.decCurrentLevel(); m_map.decCurrentLevel(); ++count; ++count; } } ef /= count; ef /= count; ef *= 2.0; ef *= 2.0; ... @@ -89,6 +90,7 @@ public: ... @@ -89,6 +90,7 @@ public: Dart midF = m_map.phi1(m_map.phi1(d)); Dart midF = m_map.phi1(m_map.phi1(d)); m_position[midF] += vf + ef ; m_position[midF] += vf + ef ; m_map.decCurrentLevel() ; m_map.decCurrentLevel() ; break; } } TraversorE travE(m_map) ; TraversorE travE(m_map) ; ... @@ -213,7 +215,7 @@ public: ... @@ -213,7 +215,7 @@ public: m_map.incCurrentLevel() ; m_map.incCurrentLevel() ; Dart midF = m_map.phi1(m_map.phi1(d)); Dart midF = m_map.phi1(m_map.phi1(d)); m_position[midF] -= vf + ef ; m_position[midF] -= vf + ef ; m_map.decCurrentLevel() ; m_map.decCurrentLevel() ; } } } } ... ...
 ... @@ -105,8 +105,8 @@ public: ... @@ -105,8 +105,8 @@ public: bool operator() (Dart d) bool operator() (Dart d) { { //Dart df = m_map.phi1(m_map.phi1(d)) ; Dart df = m_map.phi1(m_map.phi1(d)) ; Dart df = m_map.phi1(d) ; //Dart df = m_map.phi1(d) ; m_map.decCurrentLevel() ; m_map.decCurrentLevel() ; ... ...
 ... @@ -64,9 +64,8 @@ void Grid::grid(unsigned int x, unsigned int y, bool close) ... @@ -64,9 +64,8 @@ void Grid::grid(unsigned int x, unsigned int y, bool close) // store last row of vertices // store last row of vertices for (unsigned int i = 0; i < x; ++i) 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.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]) ); //sewing the triangles //sewing the triangles for (unsigned int i = 0; i < y; ++i) for (unsigned int i = 0; i < y; ++i) ... @@ -75,11 +74,11 @@ void Grid::grid(unsigned int x, unsigned int y, bool close) ... @@ -75,11 +74,11 @@ void Grid::grid(unsigned int x, unsigned int y, bool close) { { if (i > 0) // sew with preceeding row if (i > 0) // sew with preceeding row { { int pos = i*(x+1)+j; // int pos = i*(x+1)+j; Dart d = this->m_tableVertDarts[pos]; // Dart d = this->m_tableVertDarts[pos]; Dart e = this->m_tableVertDarts[pos-(x+1)]; // Dart e = this->m_tableVertDarts[pos-(x+1)]; e = this->m_map.phi1(this->m_map.phi1(e)); // e = this->m_map.phi_1(e); this->m_map.sewFaces(d, e, false); // this->m_map.sewFaces(d, e, false); } } if (j > 0) // sew with preceeding column if (j > 0) // sew with preceeding column { { ... @@ -107,7 +106,7 @@ void Grid::embedIntoGrid(VertexAttribute& position, float x, float y, ... @@ -107,7 +106,7 @@ void Grid::embedIntoGrid(VertexAttribute& position, float x, float y, { { for(unsigned int j = 0; j <= this->m_nx;++j) 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 ... @@ -504,11 +504,11 @@ template Dart Traversor2FV::next() Dart Traversor2FV::next() { { if(m_QLT != NULL) if(m_QLT != NULL) { { return *m_ItDarts++; return *m_ItDarts++; } } if(current != NIL) if(current != NIL) { { current = m.phi1(current) ; current = m.phi1(current) ; if(current == start) if(current == start) current = NIL ; current = NIL ; ... ...
 ... @@ -121,6 +121,8 @@ public: ... @@ -121,6 +121,8 @@ public: void splitFace(Dart d, Dart e) ; void splitFace(Dart d, Dart e) ; unsigned int vertexDegree(Dart d); /*************************************************** /*************************************************** * LEVELS MANAGEMENT * * LEVELS MANAGEMENT * ***************************************************/ ***************************************************/ ... @@ -161,58 +163,65 @@ public: ... @@ -161,58 +163,65 @@ public: * CELLS INFORMATION * * CELLS INFORMATION * ***************************************************/ ***************************************************/ /** * @brief faceDegree * @param d * @return */ unsigned int faceDegree(Dart d); /** /** * Return the level of insertion of the vertex of d * Return the level of insertion of the vertex of d */ */ unsigned int vertexInsertionLevel(Dart d) ; unsigned int vertexInsertionLevel(Dart d) ; /** // /** * Return the level of the edge of d in the current level map // * Return the level of the edge of d in the current level map */ // */ unsigned int edgeLevel(Dart d) ; // unsigned int edgeLevel(Dart d) ; /** // /** * Return the level of the face of d in the current level map // * Return the level of the face of d in the current level map */ // */ unsigned int faceLevel(Dart d) ; // unsigned int faceLevel(Dart d) ; /** // /** * Given the face of d in the current level map, // * Given the face of d in the current level map, * return a level 0 dart of its origin face // * return a level 0 dart of its origin face */ // */ Dart faceOrigin(Dart d) ; // Dart faceOrigin(Dart d) ; /** // /** * Return the oldest dart of the face of d in the current level map // * Return the oldest dart of the face of d in the current level map */ // */ Dart faceOldestDart(Dart d) ; // Dart faceOldestDart(Dart d) ; /** // /** * Return true if the edge of d in the current level map // * Return true if the edge of d in the current level map * has already been subdivided to the next level // * has already been subdivided to the next level */ // */ bool edgeIsSubdivided(Dart d) ; // bool edgeIsSubdivided(Dart d) ; /** // /** * Return true if the edge of d in the current level map // * Return true if the edge of d in the current level map * is subdivided to the next level, // * is subdivided to the next level, * none of its resulting edges is in turn 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 // * and the middle vertex is of degree 2 */ // */ bool edgeCanBeCoarsened(Dart d) ; // bool edgeCanBeCoarsened(Dart d) ; /** // /** * Return true if the face of d in the current level map // * Return true if the face of d in the current level map * has already been subdivided to the next level // * has already been subdivided to the next level */ // */ bool faceIsSubdivided(Dart d) ; // bool faceIsSubdivided(Dart d) ; /** // /** * Return true if the face of d in the current level map // * Return true if the face of d in the current level map * is subdivided to the next level // * is subdivided to the next level * and none of its resulting faces is in turn subdivided to the next level // * and none of its resulting faces is in turn subdivided to the next level */ // */ bool faceIsSubdividedOnce(Dart d) ; // bool faceIsSubdividedOnce(Dart d) ; } ; } ; template template ... ...