CGAL 6.0 - 2D Hyperbolic Surface Triangulations
Loading...
Searching...
No Matches
CGAL::Hyperbolic_surface_triangulation_2< Traits, Attributes > Class Template Reference

#include <CGAL/Hyperbolic_surface_triangulation_2.h>

Definition

template<class Traits, class Attributes = Combinatorial_map_with_cross_ratios_item<Traits>>
class CGAL::Hyperbolic_surface_triangulation_2< Traits, Attributes >

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.

Template Parameters
Traitsis the traits class and must be a model of HyperbolicSurfaceTraits_2 (default model: Hyperbolic_surface_traits_2).
Attributesmust be a model of GenericMapItems (default model: Combinatorial_map_with_cross_ratios_item<Traits>).
Examples
Hyperbolic_surface_triangulation_2/hyperbolic_surface_triangulation.cpp.

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_2operator= (Hyperbolic_surface_triangulation_2 other)
 

Access Functions

Combinatorial_map_with_cross_ratioscombinatorial_map ()
 returns the decorated combinatorial map.
 
bool has_anchor () const
 tells if the triangulation has an anchor.
 
Anchoranchor ()
 returns the anchor.
 
const Anchorconst_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.
 

Member Function Documentation

◆ anchor()

template<class Traits , class Attributes = Combinatorial_map_with_cross_ratios_item<Traits>>
Anchor & CGAL::Hyperbolic_surface_triangulation_2< Traits, Attributes >::anchor ( )

returns the anchor.

Precondition
is_valid() && has_anchor()

◆ combinatorial_map()

template<class Traits , class Attributes = Combinatorial_map_with_cross_ratios_item<Traits>>
Combinatorial_map_with_cross_ratios & CGAL::Hyperbolic_surface_triangulation_2< Traits, Attributes >::combinatorial_map ( )

returns the decorated combinatorial map.

Precondition
is_valid()

◆ const_anchor()

template<class Traits , class Attributes = Combinatorial_map_with_cross_ratios_item<Traits>>
const Anchor & CGAL::Hyperbolic_surface_triangulation_2< Traits, Attributes >::const_anchor ( )

constant version of the getter.

Precondition
is_valid() && has_anchor()

◆ flip()

template<class Traits , class Attributes = Combinatorial_map_with_cross_ratios_item<Traits>>
void CGAL::Hyperbolic_surface_triangulation_2< Traits, Attributes >::flip ( Dart_handle  dart)

flips the edge supported by the dart.

Precondition
is_valid()

◆ has_anchor()

template<class Traits , class Attributes = Combinatorial_map_with_cross_ratios_item<Traits>>
bool CGAL::Hyperbolic_surface_triangulation_2< Traits, Attributes >::has_anchor ( ) const

tells if the triangulation has an anchor.

Precondition
is_valid()

◆ is_Delaunay_flippable()

template<class Traits , class Attributes = Combinatorial_map_with_cross_ratios_item<Traits>>
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.

Precondition
is_valid()

◆ is_valid()

template<class Traits , class Attributes = Combinatorial_map_with_cross_ratios_item<Traits>>
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.

◆ lift()

template<class Traits , class Attributes = Combinatorial_map_with_cross_ratios_item<Traits>>
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.

Precondition
is_valid() && has_anchor()

◆ make_Delaunay()

template<class Traits , class Attributes = Combinatorial_map_with_cross_ratios_item<Traits>>
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.

Precondition
is_valid()

◆ operator<<()

template<class Traits , class Attributes = Combinatorial_map_with_cross_ratios_item<Traits>>
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.

Precondition
is_valid()

◆ operator=()

template<class Traits , class Attributes = Combinatorial_map_with_cross_ratios_item<Traits>>
Hyperbolic_surface_triangulation_2 & CGAL::Hyperbolic_surface_triangulation_2< Traits, Attributes >::operator= ( Hyperbolic_surface_triangulation_2< Traits, Attributes >  other)
Precondition
other.is_valid()

◆ operator>>()

template<class Traits , class Attributes = Combinatorial_map_with_cross_ratios_item<Traits>>
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.