Commit dfe198e1 authored by Pierre Kraemer's avatar Pierre Kraemer

explicit Dart constructor + some debug

parent 399679f2
...@@ -65,7 +65,7 @@ struct Dart ...@@ -65,7 +65,7 @@ struct Dart
static Dart create(unsigned int i) { Dart d; d.index = i; return d; } static Dart create(unsigned int i) { Dart d; d.index = i; return d; }
Dart(unsigned int v): index(v) {} explicit Dart(unsigned int v): index(v) {}
bool isNil() const { return index == 0xffffffff ; } bool isNil() const { return index == 0xffffffff ; }
......
...@@ -248,7 +248,7 @@ inline AttributeMultiVector<Dart>* GenericMap::addRelation(const std::string& na ...@@ -248,7 +248,7 @@ inline AttributeMultiVector<Dart>* GenericMap::addRelation(const std::string& na
// set new relation to fix point for all the darts of the map // set new relation to fix point for all the darts of the map
for(unsigned int i = cont.begin(); i < cont.end(); cont.next(i)) for(unsigned int i = cont.begin(); i < cont.end(); cont.next(i))
(*amv)[i] = i ; (*amv)[i] = Dart(i) ;
return amv ; return amv ;
} }
......
...@@ -46,29 +46,29 @@ public: ...@@ -46,29 +46,29 @@ public:
/** /**
* create a new face with managed embeddings * create a new face with managed embeddings
*/ */
virtual Dart newFace(unsigned int nbEdges, bool withBoundary = true) ; Dart newFace(unsigned int nbEdges, bool withBoundary = true) ;
/** /**
* The attributes attached to the old vertex are duplicated on both resulting vertices * The attributes attached to the old vertex are duplicated on both resulting vertices
* No attribute is attached to the new edge * No attribute is attached to the new edge
*/ */
virtual void splitVertex(Dart d, Dart e) ; void splitVertex(Dart d, Dart e) ;
/** /**
* The attributes attached to the face of d are kept on the resulting face * The attributes attached to the face of d are kept on the resulting face
*/ */
virtual Dart deleteVertex(Dart d) ; Dart deleteVertex(Dart d) ;
/** /**
* No attribute is attached to the new vertex * No attribute is attached to the new vertex
* The attributes attached to the old edge are duplicated on both resulting edges * The attributes attached to the old edge are duplicated on both resulting edges
*/ */
virtual Dart cutEdge(Dart d) ; Dart cutEdge(Dart d) ;
/** /**
* The attributes attached to the edge of d are kept on the resulting edge * The attributes attached to the edge of d are kept on the resulting edge
*/ */
virtual bool uncutEdge(Dart d) ; bool uncutEdge(Dart d) ;
/** /**
* Check if the edge of d can be collapsed or not based on some topological conditions * Check if the edge of d can be collapsed or not based on some topological conditions
...@@ -82,17 +82,17 @@ public: ...@@ -82,17 +82,17 @@ public:
* See 'collapseDegeneratedFace' to see what can happen to edges attributes * See 'collapseDegeneratedFace' to see what can happen to edges attributes
* Nothing has to be done for the faces (some degenerate ones can be deleted) * Nothing has to be done for the faces (some degenerate ones can be deleted)
*/ */
virtual Dart collapseEdge(Dart d, bool delDegenerateFaces = true) ; Dart collapseEdge(Dart d, bool delDegenerateFaces = true) ;
/** /**
* No cell is created or deleted * No cell is created or deleted
*/ */
virtual bool flipEdge(Dart d) ; bool flipEdge(Dart d) ;
/** /**
* No cell is created or deleted * No cell is created or deleted
*/ */
virtual bool flipBackEdge(Dart d) ; bool flipBackEdge(Dart d) ;
// /** // /**
// * The attributes attached to the vertex of dart d are kept on the resulting vertex // * The attributes attached to the vertex of dart d are kept on the resulting vertex
...@@ -110,42 +110,42 @@ public: ...@@ -110,42 +110,42 @@ public:
* The attributes attached to the vertices of the edge of d are kept on the vertices of the resulting edge * The attributes attached to the vertices of the edge of d are kept on the vertices of the resulting edge
* The attributes attached to the edge of d are kept on the resulting edge * The attributes attached to the edge of d are kept on the resulting edge
*/ */
virtual void sewFaces(Dart d, Dart e, bool withBoundary = true) ; void sewFaces(Dart d, Dart e, bool withBoundary = true) ;
/** /**
* The attributes attached to the vertices of the old edge of d are duplicated on the vertices of both resulting edges * The attributes attached to the vertices of the old edge of d are duplicated on the vertices of both resulting edges
* The attributes attached to the old edge are duplicated on both resulting edges * The attributes attached to the old edge are duplicated on both resulting edges
*/ */
virtual void unsewFaces(Dart d) ; void unsewFaces(Dart d) ;
/** /**
* The attributes attached to the edge of d are kept on the resulting edge * The attributes attached to the edge of d are kept on the resulting edge
*/ */
virtual bool collapseDegeneratedFace(Dart d); bool collapseDegeneratedFace(Dart d);
/** /**
* No attribute is attached to the new edge * No attribute is attached to the new edge
* The attributes attached to the old face are duplicated on both resulting faces * The attributes attached to the old face are duplicated on both resulting faces
*/ */
virtual void splitFace(Dart d, Dart e) ; void splitFace(Dart d, Dart e) ;
/** /**
* The attributes attached to the face of dart d are kept on the resulting face * The attributes attached to the face of dart d are kept on the resulting face
*/ */
virtual bool mergeFaces(Dart d) ; bool mergeFaces(Dart d) ;
/** /**
* The attributes attached to the vertices of the face of d are kept on the resulting vertices * The attributes attached to the vertices of the face of d are kept on the resulting vertices
* The attributes attached to the edges of the face of d are kept on the resulting edges * The attributes attached to the edges of the face of d are kept on the resulting edges
*/ */
virtual bool mergeVolumes(Dart d, Dart e) ; bool mergeVolumes(Dart d, Dart e) ;
/** /**
* No attribute is attached to the new face * No attribute is attached to the new face
*/ */
virtual unsigned int closeHole(Dart d, bool forboundary = true); unsigned int closeHole(Dart d, bool forboundary = true);
virtual bool check() ; bool check() ;
} ; } ;
} // namespace CGoGN } // namespace CGoGN
......
...@@ -99,23 +99,23 @@ public: ...@@ -99,23 +99,23 @@ public:
* @param withBoudary create the face and its boundary (default true) * @param withBoudary create the face and its boundary (default true)
* @return return a dart of the face * @return return a dart of the face
*/ */
virtual Dart newFace(unsigned int nbEdges, bool withBoundary = true) ; Dart newFace(unsigned int nbEdges, bool withBoundary = true) ;
//! Delete a face erasing all its darts //! Delete a face erasing all its darts
/*! @param d a dart of the face /*! @param d a dart of the face
*/ */
virtual void deleteFace(Dart d); void deleteFace(Dart d);
//! Delete a connected component of the map //! Delete a connected component of the map
/*! @param d a dart of the connected component /*! @param d a dart of the connected component
*/ */
virtual void deleteCC(Dart d) ; void deleteCC(Dart d) ;
//! Fill a hole with a face //! Fill a hole with a face
/*! \pre Dart d is boundary marked /*! \pre Dart d is boundary marked
* @param d a dart of the face to fill * @param d a dart of the face to fill
*/ */
virtual void fillHole(Dart d) ; void fillHole(Dart d) ;
//@} //@}
/*! @name Topological Operators /*! @name Topological Operators
...@@ -128,7 +128,7 @@ public: ...@@ -128,7 +128,7 @@ public:
* @param d first dart in vertex v * @param d first dart in vertex v
* @param e second dart in vertex v * @param e second dart in vertex v
*/ */
virtual void splitVertex(Dart d, Dart e); void splitVertex(Dart d, Dart e);
//! Delete the vertex of d (works only for internal vertices) //! Delete the vertex of d (works only for internal vertices)
/*! Does not create a hole -> all the faces /*! Does not create a hole -> all the faces
...@@ -136,19 +136,19 @@ public: ...@@ -136,19 +136,19 @@ public:
* @param d a dart of the vertex to delete * @param d a dart of the vertex to delete
* @return a dart of the resulting face (NIL if the deletion has not been executed) * @return a dart of the resulting face (NIL if the deletion has not been executed)
*/ */
virtual Dart deleteVertex(Dart d) ; Dart deleteVertex(Dart d) ;
//! Cut the edge of d by inserting a new vertex //! Cut the edge of d by inserting a new vertex
/*! @param d a dart of the edge to cut /*! @param d a dart of the edge to cut
* @return a dart of the new vertex * @return a dart of the new vertex
*/ */
virtual Dart cutEdge(Dart d); Dart cutEdge(Dart d);
//! Undo the cut of the edge of d //! Undo the cut of the edge of d
/*! @param d a dart of the edge to uncut /*! @param d a dart of the edge to uncut
* @return true if the uncut has been executed, false otherwise * @return true if the uncut has been executed, false otherwise
*/ */
virtual bool uncutEdge(Dart d); bool uncutEdge(Dart d);
//! Collapse an edge (that is deleted) possibly merging its vertices //! Collapse an edge (that is deleted) possibly merging its vertices
/*! If delDegenerateFaces is true, the method checks that no degenerate /*! If delDegenerateFaces is true, the method checks that no degenerate
...@@ -160,7 +160,7 @@ public: ...@@ -160,7 +160,7 @@ public:
* @param delDegenerateFaces a boolean (default to true) * @param delDegenerateFaces a boolean (default to true)
* @return a dart of the resulting vertex * @return a dart of the resulting vertex
*/ */
virtual Dart collapseEdge(Dart d, bool delDegenerateFaces = true); Dart collapseEdge(Dart d, bool delDegenerateFaces = true);
/** /**
* Flip the edge of d (rotation in phi1 order) * Flip the edge of d (rotation in phi1 order)
...@@ -168,7 +168,7 @@ public: ...@@ -168,7 +168,7 @@ public:
* @param d a dart of the edge to flip * @param d a dart of the edge to flip
* @return true if the flip has been executed, false otherwise * @return true if the flip has been executed, false otherwise
*/ */
virtual bool flipEdge(Dart d); bool flipEdge(Dart d);
/** /**
* Flip the edge of d (rotation in phi_1 order) * Flip the edge of d (rotation in phi_1 order)
...@@ -176,7 +176,7 @@ public: ...@@ -176,7 +176,7 @@ public:
* @param d a dart of the edge to flip * @param d a dart of the edge to flip
* @return true if the flipBack has been executed, false otherwise * @return true if the flipBack has been executed, false otherwise
*/ */
virtual bool flipBackEdge(Dart d); bool flipBackEdge(Dart d);
// //! Insert an edge after a dart in the vertex orbit // //! Insert an edge after a dart in the vertex orbit
// /*! \pre Dart d and e MUST be different and belong to distinct face // /*! \pre Dart d and e MUST be different and belong to distinct face
...@@ -198,7 +198,7 @@ public: ...@@ -198,7 +198,7 @@ public:
* @param e a dart of the second face * @param e a dart of the second face
* @param withBoundary: if false, faces must have beta2 fixed points (only for construction: import/primitives) * @param withBoundary: if false, faces must have beta2 fixed points (only for construction: import/primitives)
*/ */
virtual void sewFaces(Dart d, Dart e, bool withBoundary = true); void sewFaces(Dart d, Dart e, bool withBoundary = true);
//! Unsew two faces //! Unsew two faces
/*! \pre Edge of dart d MUST NOT be a boundary edge /*! \pre Edge of dart d MUST NOT be a boundary edge
...@@ -219,7 +219,7 @@ public: ...@@ -219,7 +219,7 @@ public:
* @param d first dart in face f * @param d first dart in face f
* @param e second dart in face f * @param e second dart in face f
*/ */
virtual void splitFace(Dart d, Dart e); void splitFace(Dart d, Dart e);
//! Merge the two faces incident to the edge of d. //! Merge the two faces incident to the edge of d.
/*! Works only for non-boundary edges. /*! Works only for non-boundary edges.
...@@ -227,7 +227,7 @@ public: ...@@ -227,7 +227,7 @@ public:
* @param d a dart in the first face * @param d a dart in the first face
* @return true if the merge has been executed, false otherwise * @return true if the merge has been executed, false otherwise
*/ */
virtual bool mergeFaces(Dart d); bool mergeFaces(Dart d);
/** /**
* Extract a pair of sewed triangles and sew their adjacent faces * Extract a pair of sewed triangles and sew their adjacent faces
...@@ -252,13 +252,13 @@ public: ...@@ -252,13 +252,13 @@ public:
* @param e a dart of the second face * @param e a dart of the second face
* @return true if the merge has been executed, false otherwise * @return true if the merge has been executed, false otherwise
*/ */
virtual bool mergeVolumes(Dart d, Dart e); bool mergeVolumes(Dart d, Dart e);
//! //!
/*! /*!
* *
*/ */
virtual void splitSurface(std::vector<Dart>& vd, bool firstSideClosed = true, bool secondSideClosed = true); void splitSurface(std::vector<Dart>& vd, bool firstSideClosed = true, bool secondSideClosed = true);
//@} //@}
......
...@@ -102,11 +102,11 @@ void EmbeddedGMap2::splitVertex(Dart d, Dart e) ...@@ -102,11 +102,11 @@ void EmbeddedGMap2::splitVertex(Dart d, Dart e)
if(isOrbitEmbedded<FACE>()) if(isOrbitEmbedded<FACE>())
{ {
unsigned int f1Emb = getEmbedding<FACE>(dd) ; unsigned int f1Emb = getEmbedding<FACE>(dd) ;
copyDartEmbedding<FACE>(phi1(dd), f1Emb) ; setDartEmbedding<FACE>(phi1(dd), f1Emb) ;
copyDartEmbedding<FACE>(beta0(phi1(dd)), f1Emb) ; setDartEmbedding<FACE>(beta0(phi1(dd)), f1Emb) ;
unsigned int f2Emb = getEmbedding<FACE>(ee) ; unsigned int f2Emb = getEmbedding<FACE>(ee) ;
copyDartEmbedding<FACE>(phi1(ee), f2Emb) ; setDartEmbedding<FACE>(phi1(ee), f2Emb) ;
copyDartEmbedding<FACE>(beta0(phi1(ee)), f2Emb) ; setDartEmbedding<FACE>(beta0(phi1(ee)), f2Emb) ;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment