method Triangulation_3<GT,Tds>::triangle returns a triangle oriented

towards the outside of the cell c for facet (c,i)
This commit is contained in:
Monique Teillaud 2002-04-10 07:27:04 +00:00
parent 41c42fe1e3
commit b2cfcd1993
5 changed files with 33 additions and 23 deletions

View File

@ -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.

View File

@ -1,3 +1,7 @@
Version 1.110 (10 April 02)
- method Triangulation_3<GT,Tds>::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.

View File

@ -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}.

View File

@ -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}.

View File

@ -99,8 +99,9 @@ public:
Finite_vertices_iterator_base;
typedef Triangulation_iterator_handle_adaptor_3<Finite_cells_iterator_base,
Cell_handle> Finite_cells_iterator;
typedef Triangulation_iterator_handle_adaptor_3<Finite_vertices_iterator_base,
Vertex_handle> Finite_vertices_iterator;
typedef Triangulation_iterator_handle_adaptor_3
<Finite_vertices_iterator_base,
Vertex_handle> Finite_vertices_iterator;
typedef Filter_iterator<Edge_iterator, Infinite_tester>
Finite_edges_iterator;
typedef Filter_iterator<Facet_iterator, Infinite_tester>
@ -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 >