CGAL 6.0 - 2D Hyperbolic Surface Triangulations
|
#include <CGAL/Hyperbolic_surface_triangulation_2.h>
Represents a triangulation of a closed orientable hyperbolic surface.
Offers facilities such as the generation of the triangulation from a convex fundamental domain, the Delaunay flip algorithm, and the construction of a portion of the lift of the triangulation in the hyperbolic plane.
Traits | is the traits class and must be a model of HyperbolicSurfaceTraits_2 (default model: Hyperbolic_surface_traits_2 ). |
Attributes | must be a model of GenericMapItems (default model: Combinatorial_map_with_cross_ratios_item<Traits> ). |
Classes | |
struct | Anchor |
stores a dart \( d \) of the combinatorial map, belonging to a triangle \( t \), and stores the three vertices of a lift of \( t \) in the hyperbolic plane. More... | |
Types | |
typedef Combinatorial_map< 2, Attributes > | Combinatorial_map_with_cross_ratios |
Type of combinatorial map whose edges are decorated with complex numbers. | |
typedef Combinatorial_map_with_cross_ratios::Dart_handle | Dart_handle |
Combinatorial map dart handle type. | |
typedef Combinatorial_map_with_cross_ratios::Dart_const_handle | Dart_const_handle |
Combinatorial map dart const handle type. | |
typedef Traits::Hyperbolic_point_2 | Point |
Point type. | |
Creation | |
Hyperbolic_surface_triangulation_2 () | |
Default constructor. | |
Hyperbolic_surface_triangulation_2 (const Hyperbolic_fundamental_domain_2< Traits > &domain) | |
Constructor from a convex fundamental domain: triangulates the polygon of the domain, and identifies the paired sides of the domain. | |
Hyperbolic_surface_triangulation_2 (Combinatorial_map_with_cross_ratios &cmap) | |
Constructor from a decorated combinatorial map. | |
Hyperbolic_surface_triangulation_2 (Combinatorial_map_with_cross_ratios &cmap, Anchor &anchor) | |
Constructor from a decorated combinatorial map and an anchor. | |
Assignment | |
Hyperbolic_surface_triangulation_2 & | operator= (Hyperbolic_surface_triangulation_2 other) |
Access Functions | |
Combinatorial_map_with_cross_ratios & | combinatorial_map () |
returns the decorated combinatorial map. | |
bool | has_anchor () const |
tells if the triangulation has an anchor. | |
Anchor & | anchor () |
returns the anchor. | |
const Anchor & | const_anchor () |
constant version of the getter. | |
Delaunay Flip Algorithm | |
bool | is_Delaunay_flippable (Dart_handle dart) const |
tells if if the edge supported by the dart is Delaunay flippable. | |
void | flip (Dart_handle dart) |
flips the edge supported by the dart. | |
bool | is_Delaunay () const |
determines if the triangulation is a valid Delaunay triangulation. | |
int | make_Delaunay () |
applies the Delaunay flip algorithm: flips Delaunay flippable edges until there is no such edge anymore. | |
Lifting | |
std::vector< std::tuple< Dart_const_handle, Point, Point, Point > > | lift (bool center=true) const |
lifts the triangulation in the hyperbolic plane. | |
Validity | |
bool | is_valid () const |
Validity test. | |
Input/Output | |
std::ostream & | operator<< (std::ostream &s, Hyperbolic_surface_triangulation_2< Traits > &Hyperbolic_surface_triangulation_2) |
writes the triangulation in a stream. | |
std::istream & | operator>> (std::istream &s, Hyperbolic_surface_triangulation_2< Traits > &triangulation) |
reads the triangulation from a stream. | |
Anchor & CGAL::Hyperbolic_surface_triangulation_2< Traits, Attributes >::anchor | ( | ) |
returns the anchor.
is_valid() && has_anchor()
Combinatorial_map_with_cross_ratios & CGAL::Hyperbolic_surface_triangulation_2< Traits, Attributes >::combinatorial_map | ( | ) |
returns the decorated combinatorial map.
is_valid()
const Anchor & CGAL::Hyperbolic_surface_triangulation_2< Traits, Attributes >::const_anchor | ( | ) |
constant version of the getter.
is_valid() && has_anchor()
void CGAL::Hyperbolic_surface_triangulation_2< Traits, Attributes >::flip | ( | Dart_handle | dart | ) |
flips the edge supported by the dart.
is_valid()
bool CGAL::Hyperbolic_surface_triangulation_2< Traits, Attributes >::has_anchor | ( | ) | const |
tells if the triangulation has an anchor.
is_valid()
bool CGAL::Hyperbolic_surface_triangulation_2< Traits, Attributes >::is_Delaunay_flippable | ( | Dart_handle | dart | ) | const |
tells if if the edge supported by the dart is Delaunay flippable.
is_valid()
bool CGAL::Hyperbolic_surface_triangulation_2< Traits, Attributes >::is_valid | ( | ) | const |
Validity test.
Checks that the underlying combinatorial map \( M \) has no boundary and calls the is_valid method of \( M \). If there is an anchor, then checks that the dart handle of the anchor does indeed point to a dart of \( M \), and checks that the three vertices of the anchor lie within the open unit disk.
std::vector< std::tuple< Dart_const_handle, Point, Point, Point > > CGAL::Hyperbolic_surface_triangulation_2< Traits, Attributes >::lift | ( | bool | center = true | ) | const |
lifts the triangulation in the hyperbolic plane.
Returns, for every triangle \( t \) of the triangulation, one of the darts of \( t \) in the combinatorial map of the triangulation, together with a triple \( p,q,r \) of points in the hyperbolic plane. The points \( p,q,r \) are the vertices of a lift of \( t \) in the hyperbolic plane. If the center parameter is set to true, then one of the lifted triangles admits the origin \( 0 \) as a vertex.
is_valid() && has_anchor()
int CGAL::Hyperbolic_surface_triangulation_2< Traits, Attributes >::make_Delaunay | ( | ) |
applies the Delaunay flip algorithm: flips Delaunay flippable edges until there is no such edge anymore.
is_valid()
std::ostream & CGAL::Hyperbolic_surface_triangulation_2< Traits, Attributes >::operator<< | ( | std::ostream & | s, |
Hyperbolic_surface_triangulation_2< Traits > & | Hyperbolic_surface_triangulation_2 | ||
) |
writes the triangulation in a stream.
The format of the output is the following. Each dart of the triangulation is given an index between \( 0 \) and \( n-1 \), where \( n \) is the number of darts of the triangulation. The first line contains the number \( n \) of darts. The next line contains either 'yes' or 'no' and tells whether the triangulation has an anchor. If the triangulation has an anchor, then the four next lines print the index of the dart of the anchor, and the three vertices of the anchor. Then, for every triangle \( t \), the indices of the three darts of \( t \) are printed on three distinct lines. Finally, for every edge \( e \), the indices of the two darts of \( e \) are printed on two distinct lines, followed by a third line on which the cross ratio of \( e \) is printed.
is_valid()
Hyperbolic_surface_triangulation_2 & CGAL::Hyperbolic_surface_triangulation_2< Traits, Attributes >::operator= | ( | Hyperbolic_surface_triangulation_2< Traits, Attributes > | other | ) |
other.is_valid()
std::istream & CGAL::Hyperbolic_surface_triangulation_2< Traits, Attributes >::operator>> | ( | std::istream & | s, |
Hyperbolic_surface_triangulation_2< Traits > & | triangulation | ||
) |
reads the triangulation from a stream.
The format of the input should be the same as the format of the output of the '<<' operator.