removed concept for hyperbolic translaitons; imposed translation type; changed Point_2 to Hyperbolic_point_2; added missing constructor objects

This commit is contained in:
Iordan Iordanov 2018-09-10 10:41:46 +02:00
parent 0c5f5c64d1
commit 5b94910e40
4 changed files with 29 additions and 197 deletions

View File

@ -1,145 +0,0 @@
// Copyright (c) 2016-2017 INRIA Nancy - Grand Est (France).
// All rights reserved.
/*!
\ingroup PkgPeriodic4HyperbolicTriangulation2Concepts
\cgalConcept
\cgalModifBegin
The concept `HyperbolicOctagonTranslation` describes the requirements for an object that represents
a hyperbolic translation in the fundamental group \f$\mathcal G\f$ of the the Bolza surface.
Generally, a hyperbolic translation \f$g\f$ is an orientation-preserving isometry acting
on the hyperbolic plane, and is specified by two complex numbers \f$\alpha\f$ and \f$\beta\f$:
\f[
g(z) = \frac{\alpha \cdot z + \beta}{\overline{\beta} \cdot z + \overline{\alpha}},
\qquad |\alpha|^2 - |\beta|^2 = 1,
\f]
where \f$\overline{a}\f$ and \f$\overline{b}\f$ denote the complex conjugates of \f$a\f$
and \f$b\f$ respectively. A hyperbolic translation is also a word on the generators of the
fundamental group of a hyperbolic surface.
Specifically for the group \f$\mathcal G\f$, let \f$[g_0, g_1, \ldots, g_7]\f$ be the set of its
generators, ordered counter-clockwise around the origin, with \f$g_k\f$ translating the origin
\f$O\f$ along the real axis in the positive direction. The coefficients \f$\alpha_k\f$ and \f$\beta_k\f$
of each generator of this ordered set are given as
\f[
\alpha_k = 1 + \sqrt{2}, \qquad \beta_k = \exp\left(\tfrac{ik\pi}{4}\right)\sqrt{2}\sqrt{1+\sqrt{2}}.
\f]
Note that with the notation given in Section \ref P4HT2_thespace of the User manual, the ordered
set of generators can be written also as
\f[
[g_k, k = 0, \ldots, 7] = [ a, \overline{b}, c, \overline{d}, \overline{a}, b, \overline{c}, d ].
\f]
\cgalModifEnd
\cgalHasModel CGAL::Hyperbolic_octagon_translation
*/
class HyperbolicOctagonTranslation {
public:
/// \name Types
/// Number type of the coefficients of \f$\alpha\f$ and \f$\beta\f$.
/// This number type must be compatible with the field type `FT` of the concept
/// `Periodic_4HyperbolicDelaunayTriangulationTraits_2`.
typedef unspecified_type NT;
/// \cgalModifBegin Represents a single letter of the word corresponding to the translation. \cgalModifEnd
typedef unsigned short int Word_letter;
/// Word representation of the translation, a sequence of elements of type `Word_letter`.
typedef std::vector<Word_letter> Word;
/// \cgalModifBegin Represents a complex number with coefficients of type `NT`.\cgalModifEnd
typedef std::pair<NT,NT> Complex;
/// \cgalModifBegin Represents the coefficients \f$\alpha\f$ and \f$\beta\f$ of a hyperbolic translation.\cgalModifEnd
typedef std::pair<Complex,Complex> Coefficients;
/// \name Creation
/// Default constructor. Creates the identity translation.
HyperbolicOctagonTranslation();
/// Creates the translation described by the word `w`.
HyperbolicOctagonTranslation(Word w);
/// Creates the translation described by the one-letter word `l`.
HyperbolicOctagonTranslation(Word_letter l);
/// Creates the translation described by the two-letter word `lm`.
HyperbolicOctagonTranslation(Word_letter l, Word_letter m);
/// Creates the translation described by the three-letter word `lmn`.
HyperbolicOctagonTranslation(Word_letter l, Word_letter m, Word_letter n);
/// Creates the translation described by the four-letter word `lmno`.
HyperbolicOctagonTranslation(Word_letter l, Word_letter m, Word_letter n, Word_letter o);
/// \name Operations
/// Multiplication operator; composes the current translation with `other`.
HyperbolicOctagonTranslation operator*(const HyperbolicOctagonTranslation& other) const;
/// Difference operator; the difference of two translations \f$v\f$ and \f$w\f$ is defined as \f$v * w^{-1}\f$.
HyperbolicOctagonTranslation operator-(const HyperbolicOctagonTranslation& other) const;
/// Assignment operator; modifying the translation after the assignment leaves `other` unaffected.
HyperbolicOctagonTranslation& operator=(const HyperbolicOctagonTranslation& other);
/// Equality operator.
bool operator==(const Hyperbolic_octagon_translation<NT>& other) const;
/// Inequality operator.
bool operator!=(const Hyperbolic_octagon_translation<NT>& other) const;
/// Comparison operator.
/// The comparison is done on the ordering of the translations around the original domain.
bool operator<(const Hyperbolic_octagon_translation<NT>& other) const;
/// Returns the inverse of the current translation.
HyperbolicOctagonTranslation inverse() const;
/// \name Access Functions
/// Returns the coefficient \f$\alpha\f$ of the translation's matrix. The first element of the returned `pair`
/// contains the real part of \f$\alpha\f$. The second element contains its imaginary part.
Complex alpha() const;
/// Returns the coefficient \f$\beta\f$ of the translation's matrix. The first element of the returned `pair`
/// contains the real part of \f$\beta\f$. The second element contains its imaginary part.
Complex beta() const;
/// Returns `true` if the current translation represents the identity element of the group.
bool is_identity();
/// \name Static Access Functions
/*!
\cgalModifBegin
Returns a vector containing the coefficients of the generators of \f$\mathcal G\f$ and of their inverses.
The translations must be given in the order:
\f[ [g_0, g_1, \ldots, g_7]. \f]
\cgalModifEnd
*/
static void get_generator_coefficients(std::vector< Coefficients >& gens);
/*!
\cgalModifBegin
Returns a vector containing the generators of \f$\mathcal G\f$ and their inverses.
The translations must be given in the order:
\f[ [g_0, g_1, \ldots, g_7]. \f]
\cgalModifEnd
*/
static void get_generators(std::vector<HyperbolicOctagonTranslation>& gens);
}; // end of class HyperbolicOctagonTranslation

View File

@ -7,23 +7,13 @@
\cgalRefines Periodic_4HyperbolicTriangulationTraits_2
The concept `Periodic_4HyperbolicDelaunayTriangulationTraits_2` refines the concept
`Periodic_4HyperbolicDelaunayTriangulationTraits_2`. It adds a requirement that needs
to be fulfilled by any class used to instantiate the first template parameter of the class
The concept `Periodic_4HyperbolicDelaunayTriangulationTraits_2` adds a requirement
to `Periodic_4HyperbolicDelaunayTriangulationTraits_2` that needs to be fulfilled
by any class used to instantiate the first template parameter of the class
`CGAL::Periodic_4_hyperbolic_Delaunay_triangulation_2`. The added requirement is
essential for the removal of existing vertices in a Delaunay triangulation of the
Bolza surface.
\cgalModifBegin
The concept requires that two nested types are provided:
<ul>
<li> A field number type `FT` that must support exact computations with algebraic
numbers, in particular with nested square roots;
<li> A `Hyperbolic_translation` type, which satisfies the requirements described
in the concept `HyperbolicOctagonTranslation`.
</ul>
\cgalModifEnd
\cgalHasModel CGAL::Periodic_4_hyperbolic_Delaunay_triangulation_traits_2
*/
@ -36,13 +26,15 @@ public:
/// \name Computation Types
/// @{
/*!
\cgalModifBegin
Type that permits to compute the hyperbolic diameter of a circle.
Must provide the function operator
`double operator()(Circle_2 c),`
`double operator()(Hyperbolic_point_2 p1, Hyperbolic_point_2 p2, Hyperbolic_point_2 p3),`
which returns a floating-point approximation of the hyperbolic diameter
of the circle `c`.
of the circle defined by the points `p1, p2,` and `p3`.
\cgalModifEnd
*/
typedef unspecified_type Compute_approximate_hyperbolic_diameter;
/// @}

View File

@ -16,9 +16,11 @@ Compare with Section \ref Section_2D_Triangulations_Software_Design of the 2D Tr
package. The vertices and neighbors are indexed counter-clockwise 0, 1, and 2. Neighbor `i` lies
opposite to vertex `i`.
For periodic hyperbolic triangulations, the face base class needs to store three hyperbolic translations,
one for each vertex. Applying each translation to the point stored in the corresponding vertex produces
the canonical representative of the face in the hyperbolic plane.
For periodic hyperbolic triangulations, the face base class needs to store three hyperbolic
translations, one for each vertex. Applying each translation to the point stored in the
corresponding vertex produces the canonical representative of the face in the hyperbolic plane.
Hyperbolic translations are represented by a nested type which is provided by the concept
`Periodic_4HyperbolicDelaunayTriangulationTraits_2`.
\cgalHasModel CGAL::Periodic_4_hyperbolic_triangulation_face_base_2
@ -33,11 +35,8 @@ public:
/// \name Types
/// @{
/*!
This must be a model of the concept HyperbolicOctagonTranslation.
*/
typedef undefined_type Hyperbolic_translation;
typedef Periodic_4HyperbolicDelaunayTriangulationTraits_2 Geometric_traits;
typedef Geometric_traits::Hyperbolic_translation Hyperbolic_translation;
///@}

View File

@ -7,22 +7,16 @@
\cgalRefines HyperbolicDelaunayTriangulationTraits_2
The concept `Periodic_4HyperbolicTriangulationTraits_2` refines the concept
`HyperbolicDelaunayTriangulationTraits_2`. It describes the set of requirements to be
fulfilled by any class used to instantiate the first template parameter of the class
`CGAL::Periodic_4_hyperbolic_triangulation_2`. In addition to the geometric
types and the operations defined on them in `HyperbolicDelaunayTriangulationTraits_2`,
it defines the hyperbolic translations that allow to encode the periodicity of the
triangulation.
The concept `Periodic_4HyperbolicTriangulationTraits_2` describes the set of requirements
to be fulfilled by any class used to instantiate the first template parameter of the class
`CGAL::Periodic_4_hyperbolic_triangulation_2`. In addition to the geometric types and the
operations defined on them in `HyperbolicDelaunayTriangulationTraits_2`, it defines the
hyperbolic translations that allow to encode the periodicity of the triangulation.
\cgalModifBegin
The concept requires that two nested types are provided:
<ul>
<li> A field number type `FT` that must support exact computations with algebraic
numbers, in particular with nested square roots;
<li> A `Hyperbolic_translation` type, which satisfies the requirements described
in the concept `HyperbolicOctagonTranslation`.
</ul>
The concept requires that a nested field number type `FT` is provided. The type `FT`
must support exact computations with algebraic numbers, in particular with nested
square roots.
\cgalModifEnd
*/
@ -37,18 +31,10 @@ public:
/// \name Types
/// @{
/*!
\cgalModifBegin
Represents a hyperbolic circle, i.e., a circle contained in the unit disk.
\cgalModifEnd
*/
typedef unspecified_type Circle_2;
/*!
Represents a hyperbolic translation.
Must be a model of the concept `HyperbolicOctagonTranslation`.
*/
typedef unspecified_type Hyperbolic_translation;
typedef CGAL::Hyperbolic_octagon_translation<FT> Hyperbolic_translation;
/// @}
@ -57,7 +43,7 @@ public:
/*!
Predicate type. Must provide the function operator
`Bounded_side operator()(Point_2 p),`
`Bounded_side operator()(Hyperbolic_point_2 p),`
which returns the position of point `p` relative to the half-open
regular hyperbolic octagon.
@ -71,12 +57,12 @@ public:
/*!
Construction type. Must provide the function operator
`Point_2 operator() ( const Point_2& pt, const HyperbolicOctagonTranslation& tr ) const,`
`Hyperbolic_point_2 operator() ( const Hyperbolic_point_2& pt, const Hyperbolic_translation& tr ) const,`
which returns the image of the point `pt` under the action of the
hyperbolic translation `tr`.
*/
typedef unspecified_type Construct_point_2;
typedef unspecified_type Construct_hyperbolic_point_2;
/// @}
@ -92,8 +78,8 @@ public:
/// \name
/// The following functions give access to the construction objects:
/// @{
Construct_point_2
construct_point_2_object() const;
Construct_hyperbolic_point_2
construct_hyperbolic_point_2_object() const;
/// @}
};