diff --git a/Packages/Triangulation_3/TODO b/Packages/Triangulation_3/TODO index 8279f27842d..e9b2c2ad616 100644 --- a/Packages/Triangulation_3/TODO +++ b/Packages/Triangulation_3/TODO @@ -1,8 +1,5 @@ -------------- POUR LA RELEASE -- .triangle(Facet) devrait retourner un triangle oriente - (cf mail sur cgal-discuss-l). - - bien tester le output_stream de T_3 et le copy_tds (ordre de creation des sommets). - Verifier qu'il n'y a pas d'autres operations du meme style a modifier. diff --git a/Packages/Triangulation_3/changes.txt b/Packages/Triangulation_3/changes.txt index 0964ada82f5..f92bb5e3379 100644 --- a/Packages/Triangulation_3/changes.txt +++ b/Packages/Triangulation_3/changes.txt @@ -1,3 +1,7 @@ +Version 1.110 (10 April 02) +- method Triangulation_3::triangle returns a triangle oriented +towards the outside of the cell c for facet (c,i) + Version 1.109 (9 April 02) - SunPro can't eat the automatic conversion iterator -> handle in some cases, so fix example_color.C. diff --git a/Packages/Triangulation_3/doc_tex/Triangulation_3_ref/Triangulation_3.tex b/Packages/Triangulation_3/doc_tex/Triangulation_3_ref/Triangulation_3.tex index 189cd7d89b4..bc45d725cee 100644 --- a/Packages/Triangulation_3/doc_tex/Triangulation_3_ref/Triangulation_3.tex +++ b/Packages/Triangulation_3/doc_tex/Triangulation_3_ref/Triangulation_3.tex @@ -218,14 +218,16 @@ an edge (resp. facet) \ccc{infinite} if it is incident to the infinite vertex. {Returns the tetrahedron formed by the four vertices of \ccc{c}. \ccPrecond{\ccVar.\ccc{dimension()} $=3$ and the cell is finite.}} \ccGlue -\ccMethod{Triangle triangle(const Facet & f) const;} -{Returns the triangle formed by the three vertices of \ccc{f}. -\ccPrecond{\ccVar.\ccc{dimension()} $\geq 2$ and the facet is finite.}} -\ccGlue \ccMethod{Triangle triangle(const Cell_handle c, int i) const;} -{Same as the previous method for facet \ccc{(c,i)}. -\ccPrecond{As above and $i \in \{0,1,2,3\}$ in dimension~3, $i = 3$ in -dimension~2.}} +{Returns the triangle formed by the three vertices of facet +\ccc{(c,i)}. The triangle is oriented so that its normal points to the +outside of cell \ccc{c}. +\ccPrecond{\ccVar.\ccc{dimension()} $\geq 2$ and $i \in \{0,1,2,3\}$ +in dimension~3, $i = 3$ in dimension~2, and the facet is finite.}} +\ccGlue +\ccMethod{Triangle triangle(const Facet & f) const;} +{Same as the previous method for facet \ccc{f}. +\ccPrecond{\ccVar.\ccc{dimension()} $\geq 2$ and the facet is finite.}} \ccGlue \ccMethod{Segment segment(const Edge & e) const;} {Returns the line segment formed by the vertices of \ccc{e}. diff --git a/Packages/Triangulation_3/doc_tex/basic/Triangulation_3_ref/Triangulation_3.tex b/Packages/Triangulation_3/doc_tex/basic/Triangulation_3_ref/Triangulation_3.tex index 189cd7d89b4..bc45d725cee 100644 --- a/Packages/Triangulation_3/doc_tex/basic/Triangulation_3_ref/Triangulation_3.tex +++ b/Packages/Triangulation_3/doc_tex/basic/Triangulation_3_ref/Triangulation_3.tex @@ -218,14 +218,16 @@ an edge (resp. facet) \ccc{infinite} if it is incident to the infinite vertex. {Returns the tetrahedron formed by the four vertices of \ccc{c}. \ccPrecond{\ccVar.\ccc{dimension()} $=3$ and the cell is finite.}} \ccGlue -\ccMethod{Triangle triangle(const Facet & f) const;} -{Returns the triangle formed by the three vertices of \ccc{f}. -\ccPrecond{\ccVar.\ccc{dimension()} $\geq 2$ and the facet is finite.}} -\ccGlue \ccMethod{Triangle triangle(const Cell_handle c, int i) const;} -{Same as the previous method for facet \ccc{(c,i)}. -\ccPrecond{As above and $i \in \{0,1,2,3\}$ in dimension~3, $i = 3$ in -dimension~2.}} +{Returns the triangle formed by the three vertices of facet +\ccc{(c,i)}. The triangle is oriented so that its normal points to the +outside of cell \ccc{c}. +\ccPrecond{\ccVar.\ccc{dimension()} $\geq 2$ and $i \in \{0,1,2,3\}$ +in dimension~3, $i = 3$ in dimension~2, and the facet is finite.}} +\ccGlue +\ccMethod{Triangle triangle(const Facet & f) const;} +{Same as the previous method for facet \ccc{f}. +\ccPrecond{\ccVar.\ccc{dimension()} $\geq 2$ and the facet is finite.}} \ccGlue \ccMethod{Segment segment(const Edge & e) const;} {Returns the line segment formed by the vertices of \ccc{e}. diff --git a/Packages/Triangulation_3/include/CGAL/Triangulation_3.h b/Packages/Triangulation_3/include/CGAL/Triangulation_3.h index e9606d7aeba..e5a932ce5ea 100644 --- a/Packages/Triangulation_3/include/CGAL/Triangulation_3.h +++ b/Packages/Triangulation_3/include/CGAL/Triangulation_3.h @@ -99,8 +99,9 @@ public: Finite_vertices_iterator_base; typedef Triangulation_iterator_handle_adaptor_3 Finite_cells_iterator; - typedef Triangulation_iterator_handle_adaptor_3 Finite_vertices_iterator; + typedef Triangulation_iterator_handle_adaptor_3 + Finite_vertices_iterator; typedef Filter_iterator Finite_edges_iterator; typedef Filter_iterator @@ -1193,11 +1194,15 @@ triangle(const Cell_handle c, int i) const { CGAL_triangulation_precondition( dimension() == 2 || dimension() == 3 ); CGAL_triangulation_precondition( (dimension() == 2 && i == 3) - || (dimension() == 3 && i >= 0 && i <= 3) ); + || (dimension() == 3 && i >= 0 && i <= 3) ); CGAL_triangulation_precondition( ! is_infinite(Facet(c, i)) ); - return construct_triangle(c->vertex(i<=0 ? 1 : 0)->point(), - c->vertex(i<=1 ? 2 : 1)->point(), - c->vertex(i<=2 ? 3 : 2)->point()); + if ( (i&1)==0 ) + return construct_triangle(c->vertex( (i+2)&3 )->point(), + c->vertex( (i+1)&3 )->point(), + c->vertex( (i+3)&3 )->point()); + return construct_triangle(c->vertex( (i+1)&3 )->point(), + c->vertex( (i+2)&3 )->point(), + c->vertex( (i+3)&3 )->point()); } template < class GT, class Tds >