diff --git a/Triangulation/doc_tex/Triangulation_ref/TriangulationDataStructure.tex b/Triangulation/doc_tex/Triangulation_ref/TriangulationDataStructure.tex index 5dbdaec15e6..5d90a8ba447 100644 --- a/Triangulation/doc_tex/Triangulation_ref/TriangulationDataStructure.tex +++ b/Triangulation/doc_tex/Triangulation_ref/TriangulationDataStructure.tex @@ -52,9 +52,9 @@ Two full cells are {\em adjacent} if they share a facet. Two faces are \ccc{CGAL::Triangulation_data_structure} -\ccTypes -\ccThree{typedef std::pair}{Facet;}{} -\ccThreeToTwo +%\ccTypes +%\ccThree{typedef std::pair}{Facet;}{} +%\ccThreeToTwo \ccNestedType{Vertex} { @@ -70,13 +70,13 @@ The concept \ccRefName\ also defines a type for describing facets of the triangulation with codimension~1: -\ccThree{typedef std::pair}{Facet;}{} -\ccTypedef{typedef std::pair Facet;} -%\ccNestedType{Facet} +%\ccThree{typedef std::pair}{Facet;}{} +%\ccTypedef{typedef std::pair Facet;} +\ccNestedType{Facet} { -\ccc{Facet f(c,i)} represents the facet of -full cell \ccc{c} opposite to its \ccc{i}-th vertex. - Its dimension is \ccc{current_dimension()-1}. +The constructor \ccc{Facet(c,i)} constructs a \ccc{Facet} representing the facet of +full cell \ccc{c} opposite to its \ccc{i}-th vertex. Its dimension is +\ccc{current_dimension()-1}. } \ccThreeToTwo diff --git a/Triangulation/include/CGAL/Delaunay_triangulation.h b/Triangulation/include/CGAL/Delaunay_triangulation.h index f77e260fadb..80dc4d96d0c 100644 --- a/Triangulation/include/CGAL/Delaunay_triangulation.h +++ b/Triangulation/include/CGAL/Delaunay_triangulation.h @@ -121,19 +121,24 @@ public: // A co-dimension 2 sub-simplex. called a Rotor because we can rotate // the two "covertices" around the sub-simplex. Useful for traversing the // boundary of a hole. NOT DOCUMENTED - typedef cpp0x::tuple Rotor; - // NOT DOCUMENTED - // A Rotor has two covertices - int index_of_second_covertex(const Rotor & f) const + typedef cpp11::tuple Rotor; + Full_cell_handle full_cell(const Rotor & r) const // NOT DOCUMENTED { - return cpp0x::get<2>(f); + return cpp11::get<0>(r); } - // NOT DOCUMENTED... - Rotor rotate_rotor(Rotor & f) + int index_of_covertex(const Rotor & r) const // NOT DOCUMENTED { - int opposite = full_cell(f)->mirror_index(index_of_covertex(f)); - Full_cell_handle s = full_cell(f)->neighbor(index_of_covertex(f)); - int new_second = s->index(full_cell(f)->vertex(index_of_second_covertex(f))); + return cpp11::get<1>(r); + } + int index_of_second_covertex(const Rotor & r) const // NOT DOCUMENTED + { + return cpp11::get<2>(r); + } + Rotor rotate_rotor(Rotor & r) // NOT DOCUMENTED... + { + int opposite = full_cell(r)->mirror_index(index_of_covertex(r)); + Full_cell_handle s = full_cell(r)->neighbor(index_of_covertex(r)); + int new_second = s->index(full_cell(r)->vertex(index_of_second_covertex(r))); return Rotor(s, new_second, opposite); } diff --git a/Triangulation/include/CGAL/Triangulation.h b/Triangulation/include/CGAL/Triangulation.h index f595b03debd..56067b60410 100644 --- a/Triangulation/include/CGAL/Triangulation.h +++ b/Triangulation/include/CGAL/Triangulation.h @@ -138,20 +138,14 @@ public: // FACETS OPERATIONS - // works for Face_ = Facet and Face_ = Rotor. - // NOT DOCUMENTED for the Rotor case... - template< typename Face_ > - Full_cell_handle full_cell(const Face_ & f) const + Full_cell_handle full_cell(const Facet & f) const { return tds().full_cell(f); } - // works for Face_ = Facet and Face_ = Rotor. - // NOT DOCUMENTED for the Rotor case... - template< class Face_ > - int index_of_covertex(const Face_ & f) const + int index_of_covertex(const Facet & f) const { - return tds().index_of_covertex(f); + return tds().index_of_covertex(f); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CREATION diff --git a/Triangulation/include/CGAL/Triangulation_data_structure.h b/Triangulation/include/CGAL/Triangulation_data_structure.h index 3a048919f5a..081c694a6a2 100644 --- a/Triangulation/include/CGAL/Triangulation_data_structure.h +++ b/Triangulation/include/CGAL/Triangulation_data_structure.h @@ -111,12 +111,28 @@ public: |rotate_rotor| and |insert_in_tagged_hole|) */ // A co-dimension 1 sub-simplex. - typedef cpp0x::tuple Facet; /* Concept */ + class Facet /* Concept */ + { + Full_cell_handle full_cell_; + int index_of_covertex_; + public: + Facet() : full_cell_(), index_of_covertex_(0) {} + Facet(Full_cell_handle f, int i) : full_cell_(f), index_of_covertex_(i) {} + Full_cell_handle full_cell() const { return full_cell_; } + int index_of_covertex() const { return index_of_covertex_; } + }; // A co-dimension 2 sub-simplex. called a Rotor because we can rotate // the two "covertices" around the sub-simplex. Useful for traversing the // boundary of a hole. NOT DOCUMENTED - typedef cpp0x::tuple Rotor; + class Rotor : public Facet + { + int index_of_second_covertex_; + public: + Rotor() : Facet(), index_of_second_covertex_(0) {} + Rotor(Full_cell_handle f, int first, int second) : Facet(f, first), index_of_second_covertex_(second) {} + int index_of_second_covertex() const { return index_of_second_covertex_; } + }; typedef Triangulation_face Face; /* Concept */ @@ -306,7 +322,7 @@ public: template< typename Face_ > Full_cell_handle full_cell(const Face_ & f) const /* Concept */ { - return cpp0x::get<0>(f); + return f.full_cell(); } // works for Face_ = Facet and Face_ = Rotor. @@ -314,14 +330,14 @@ public: template< class Face_ > int index_of_covertex(const Face_ & f) const /* Concept */ { - return cpp0x::get<1>(f); + return f.index_of_covertex(); } // NOT DOCUMENTED // A Rotor has two covertices int index_of_second_covertex(const Rotor & f) const { - return cpp0x::get<2>(f); + return f.index_of_second_covertex(); } // works for Face_ = Facet and Face_ = Rotor. diff --git a/Triangulation/include/CGAL/internal/Triangulation/Triangulation_ds_iterators.h b/Triangulation/include/CGAL/internal/Triangulation/Triangulation_ds_iterators.h index d5ca010f2e2..7927048dc46 100644 --- a/Triangulation/include/CGAL/internal/Triangulation/Triangulation_ds_iterators.h +++ b/Triangulation/include/CGAL/internal/Triangulation/Triangulation_ds_iterators.h @@ -86,7 +86,9 @@ public: bool operator==(const Facet_iterator & fi) const { - return (&tds_ == &fi.tds_) && (ft_ == fi.ft_); + return (&tds_ == &fi.tds_) && + (tds_.index_of_covertex(ft_) == fi.tds_.index_of_covertex(fi.ft_)) && + (tds_.full_cell(ft_) == fi.tds_.full_cell(fi.ft_)); } bool operator!=(const Facet_iterator & fi) const