Working on the documentation

This commit is contained in:
Nico Kruithof 2013-02-12 12:44:14 +01:00
parent 7e4e75798b
commit 6ecba6854d
17 changed files with 176 additions and 127 deletions

View File

@ -10,6 +10,7 @@ DOC:
TODO: TODO:
* Hierarchy * Hierarchy
* loading / saving a triangulation * loading / saving a triangulation
* all_vertices_iterator / vertices_iterator give the same vertices
* Documentation * Documentation
* obvious things (that Nico is certainly aware of) still TODOs left, and NGHKs * obvious things (that Nico is certainly aware of) still TODOs left, and NGHKs

View File

@ -2,7 +2,7 @@
namespace CGAL { namespace CGAL {
/*! /*!
\ingroup PkgPeriodic2Triangulation2 \ingroup PkgPeriodic2Triangulation2MainClasses
The class `Periodic_2_Delaunay_triangulation_2` represents a The class `Periodic_2_Delaunay_triangulation_2` represents a
Delaunay triangulation in two-dimensional periodic space. Delaunay triangulation in two-dimensional periodic space.
@ -280,7 +280,7 @@ Point& p, bool perturb ) const;
/// @} /// @}
/// \name Checking /// \name Checking
/// \advanced These methods are mainly a debugging help for the users of advanced features. /// \cgalAdvanced These methods are mainly a debugging help for the users of advanced features.
/// @{ /// @{
/*! /*!

View File

@ -18,7 +18,7 @@ predicates. This holds implicitly for
`CGAL::Exact_predicates_inexact_constructions_kernel`, as it is an `CGAL::Exact_predicates_inexact_constructions_kernel`, as it is an
instantiation of `CGAL::Filtered_kernel`. instantiation of `CGAL::Filtered_kernel`.
\models ::Periodic_2DelaunayTriangulationTraits_2 \alModels ::Periodic_2DelaunayTriangulationTraits_2
*/ */
template< typename Traits, typename Periodic_2Offset_2 > template< typename Traits, typename Periodic_2Offset_2 >
class Periodic_2_Delaunay_triangulation_traits_2 class Periodic_2_Delaunay_triangulation_traits_2

View File

@ -2,7 +2,7 @@
namespace CGAL { namespace CGAL {
/*! /*!
\ingroup PkgPeriodic2Triangulation2 \ingroup PkgPeriodic2Triangulation2MainClasses
The class `Periodic_2_triangulation_2` represents a 2-dimensional The class `Periodic_2_triangulation_2` represents a 2-dimensional
triangulation of a point set in \f$ \mathbb T_c^2\f$. triangulation of a point set in \f$ \mathbb T_c^2\f$.
@ -218,7 +218,7 @@ typedef Tds::difference_type difference_type;
\name Handles, Iterators and Circulators \name Handles, Iterators and Circulators
The vertices and faces of the triangulations are accessed through The vertices and faces of the triangulations are accessed through
`handles`, `iterators` and `circulators`. The handles are models of `handles`, `iterators` and `circulators`. The handles are alModels of
the concept `Handle` which basically offers the two dereference the concept `Handle` which basically offers the two dereference
operators and `->`. The iterators and circulators are all operators and `->`. The iterators and circulators are all
bidirectional and non-mutable. The circulators and iterators are bidirectional and non-mutable. The circulators and iterators are
@ -266,22 +266,22 @@ exactly one representative.
typedef Hidden_type Unique_vertex_iterator; typedef Hidden_type Unique_vertex_iterator;
/*! /*!
\advanced For compatibility with `Triangulation_2`. \cgalAdvanced For compatibility with `Triangulation_2`.
*/ */
typedef Face_iterator Finite_faces_iterator; typedef Face_iterator Finite_faces_iterator;
/*! /*!
\advanced For compatibility with `Triangulation_2`. \cgalAdvanced For compatibility with `Triangulation_2`.
*/ */
typedef Edge_iterator Finite_edges_iterator; typedef Edge_iterator Finite_edges_iterator;
/*! /*!
\advanced For compatibility with `Triangulation_2`. \cgalAdvanced For compatibility with `Triangulation_2`.
*/ */
typedef Vertex_iterator Finite_vertices_iterator; typedef Vertex_iterator Finite_vertices_iterator;
/*! /*!
\advanced For compatibility with `Triangulation_2`. \cgalAdvanced For compatibility with `Triangulation_2`.
*/ */
typedef Face_iterator All_faces_iterator; typedef Face_iterator All_faces_iterator;
@ -427,7 +427,7 @@ size_type number_of_stored_faces() const;
/// @} /// @}
/// \name Non const access /// \name Non const access
/// \advanced This method is mainly a help for users implementing /// \cgalAdvanced This method is mainly a help for users implementing
/// their own triangulation algorithms. /// their own triangulation algorithms.
/// @{ /// @{
@ -456,7 +456,7 @@ size_type number_of_stored_edges() const;
/// @} /// @}
/// \name Non-constant-time queries and conversions /// \name Non-constant-time queries and conversions
/// \advanced It is not recommended to interfere with the built-in /// \cgalAdvanced It is not recommended to interfere with the built-in
/// covering management. Especially a premature conversion to the /// covering management. Especially a premature conversion to the
/// 1-sheeted covering space might lead to problems when modifying the /// 1-sheeted covering space might lead to problems when modifying the
/// triangulation later. /// triangulation later.
@ -690,7 +690,6 @@ Locate_type& lt,
int& li, int& li,
Face_handle h =Face_handle() ) const; Face_handle h =Face_handle() ) const;
// TODO(NGHK): Check
/*! /*!
Returns on which side of the oriented boundary of `f` Returns on which side of the oriented boundary of `f`
the point `p` lies. the point `p` lies.
@ -772,7 +771,7 @@ const;
/// \image html it_STORED_small.png /// \image html it_STORED_small.png
/// \image html it_STORED_COVER_DOMAIN_small.jpg /// \image html it_STORED_COVER_DOMAIN_small.jpg
/// \image html it_UNIQUE_small.png /// \image html it_UNIQUE_small.png
/// \iamge html it_UNIQUE_COVER_DOMAIN_small.jpg /// \image html it_UNIQUE_COVER_DOMAIN_small.jpg
/// <center><b>NGHK: Change images. The four different modes of the /// <center><b>NGHK: Change images. The four different modes of the
/// geometric iterators: `STORED`, `STORED_COVER_DOMAIN`, `UNIQUE`, /// geometric iterators: `STORED`, `STORED_COVER_DOMAIN`, `UNIQUE`,
/// `UNIQUE_COVER_DOMAIN`. Note that in case of computing in the /// `UNIQUE_COVER_DOMAIN`. Note that in case of computing in the
@ -886,14 +885,13 @@ Vertex_circulator adjacent_vertices(Vertex_handle v, Face_handle f) ;
/*! /*!
returns the vertex of the \f$ i^{th}\f$ neighbor of `f` that is returns the vertex of the \f$ i^{th}\f$ neighbor of `f` that is
opposite to `f`. opposite to `f`.
\pre $0 \leq i \leq 2$. \pre $0 \\leqle i \\leqle 2$.
*/ */
Vertex_handle mirror_vertex(Face_handle f, int i) const; Vertex_handle mirror_vertex(Face_handle f, int i) const;
// TODO(NGHK): Check
/*! /*!
returns the index of `f` in its \f$ i^{th}\f$ neighbor. returns the index of `f` in its \f$ i^{th}\f$ neighbor.
\pre $0 \leq i \leq 2$. \pre $0 \\leqle i \\leqle 2$.
*/ */
int mirror_index(Face_handle f, int i) const; int mirror_index(Face_handle f, int i) const;
@ -904,7 +902,6 @@ int mirror_index(Face_handle f, int i) const;
/// triangulation when they are applied on a valid triangulation. /// triangulation when they are applied on a valid triangulation.
/// @{ /// @{
// TODO(NGHK): Check
/*! /*!
Exchanges the edge Exchanges the edge
incident to `f` and `f->neighbor(i)` with the other diagonal incident to `f` and `f->neighbor(i)` with the other diagonal
@ -915,7 +912,6 @@ the triangulation is on the 9-sheeted cover.
*/ */
void flip(Face_handle f, int i); void flip(Face_handle f, int i);
// TODO(NGHK): Check
/*! /*!
Inserts point `p` in the triangulation and returns the Inserts point `p` in the triangulation and returns the
corresponding vertex. corresponding vertex.
@ -938,7 +934,6 @@ indication to the underlying locate algorithm of where to start.
Vertex_handle insert(const Point& p, Face_handle f = Vertex_handle insert(const Point& p, Face_handle f =
Face_handle()); Face_handle());
// TODO(NGHK): Check
/*! /*!
Same as above except that the location Same as above except that the location
of the point `p` to be inserted is assumed to be given by of the point `p` to be inserted is assumed to be given by
@ -948,14 +943,12 @@ above.)
Vertex_handle insert(const Point& p, Locate_type lt, Vertex_handle insert(const Point& p, Locate_type lt,
Face_handle loc, int li ); Face_handle loc, int li );
// TODO(NGHK): Check
/*! /*!
Equivalent to Equivalent to
`insert(p)`. `insert(p)`.
*/ */
Vertex_handle push_back(const Point& p); Vertex_handle push_back(const Point& p);
// TODO(NGHK): Check
/*! /*!
Inserts the points in the range Inserts the points in the range
\f$ \left[\right.\f$`first`, `last`\f$ \left.\right)\f$. Returns the \f$ \left[\right.\f$`first`, `last`\f$ \left.\right)\f$. Returns the
@ -990,7 +983,7 @@ void remove(Vertex_handle v);
/// @} /// @}
/// \name /// \name
/// \advanced The following member functions offer more specialized /// \cgalAdvanced The following member functions offer more specialized
/// versions of the insertion or removal operations to be used when /// versions of the insertion or removal operations to be used when
/// one knows to be in the corresponding case. The following functions /// one knows to be in the corresponding case. The following functions
/// are mainly intended to be used in conjunction with the /// are mainly intended to be used in conjunction with the
@ -998,13 +991,11 @@ void remove(Vertex_handle v);
/// Delaunay triangulations to perform insertions. /// Delaunay triangulations to perform insertions.
/// @{ /// @{
// TODO(NGHK): Check
/*! /*!
Inserts the first vertex. Inserts the first vertex.
*/ */
Vertex_handle insert_first(const Point& p); Vertex_handle insert_first(const Point& p);
// TODO(NGHK): Check
/*! /*!
Inserts vertex `v` in face Inserts vertex `v` in face
`f`. Face `f` is modified, `f`. Face `f` is modified,
@ -1013,21 +1004,18 @@ two new faces are created. If the triangulation contains periodic copies, a poin
*/ */
Vertex_handle insert_in_face(const Point& p, Face_handle f); Vertex_handle insert_in_face(const Point& p, Face_handle f);
// TODO(NGHK): Check
/*! /*!
Inserts vertex v in edge `i` of `f`. If the triangulation contains periodic copies, a point is inserted in all periodic copies. Inserts vertex v in edge `i` of `f`. If the triangulation contains periodic copies, a point is inserted in all periodic copies.
\pre The point in vertex `v` lies on the edge opposite to the vertex `i` of face `f`. \pre The point in vertex `v` lies on the edge opposite to the vertex `i` of face `f`.
*/ */
Vertex_handle insert_in_edge(const Point& p, const Offset &o, Face_handle f, int i); Vertex_handle insert_in_edge(const Point& p, const Offset &o, Face_handle f, int i);
// TODO(NGHK): Check
/*! /*!
Removes a vertex of degree three. Two of the incident faces are Removes a vertex of degree three. Two of the incident faces are
destroyed, the third one is modified. \pre Vertex `v` is a vertex with degree three. destroyed, the third one is modified. \pre Vertex `v` is a vertex with degree three.
*/ */
void remove_degree_3(Vertex_handle v); void remove_degree_3(Vertex_handle v);
// TODO(NGHK): Check
/*! /*!
Removes the unique vertex in the Removes the unique vertex in the
triangulation. triangulation.
@ -1058,9 +1046,8 @@ EdgeIt edge_end,
FaceIt face_begin, FaceIt face_begin,
FaceIt face_end); FaceIt face_end);
// TODO(NGHK): Check
/*! /*!
\advanced Changes the domain. Note that this function calls `clear()`, \cgalAdvanced Changes the domain. Note that this function calls `clear()`,
i.e., it erases the existing triangulation. i.e., it erases the existing triangulation.
*/ */
void set_domain(const Iso_rectangle dom); void set_domain(const Iso_rectangle dom);
@ -1070,19 +1057,16 @@ void set_domain(const Iso_rectangle dom);
/// \name Miscellaneous /// \name Miscellaneous
/// @{ /// @{
// TODO(NGHK): Check
/*! /*!
Returns \f$ i+1\f$ modulo 3.\pre $0 \leq i \leq 2$. Returns \f$ i+1\f$ modulo 3.\pre $0 \\leqle i \\leqle 2$.
*/ */
int ccw(int i) const; int ccw(int i) const;
// TODO(NGHK): Check
/*! /*!
Returns \f$ i+2\f$ modulo 3.\pre $0 \leq i \leq 2$. Returns \f$ i+2\f$ modulo 3.\pre $0 \\leqle i \\leqle 2$.
*/ */
int cw(int i) const; int cw(int i) const;
// TODO(NGHK): Check
/*! /*!
Returns whether the Returns whether the
union of the faces `f` and `f->neighbor(i)` form a convex union of the faces `f` and `f->neighbor(i)` form a convex
@ -1090,7 +1074,6 @@ quadrilateral.
*/ */
void flippable(Face_handle f, int i); void flippable(Face_handle f, int i);
// TODO(NGHK): Check
/*! /*!
Returns the degree of the Returns the degree of the
vertex `v` vertex `v`
@ -1100,14 +1083,13 @@ size_t degree(Vertex_handle v);
/// @} /// @}
/// \name Checking /// \name Checking
/// \advanced The responsibility of keeping a valid triangulation /// \cgalAdvanced The responsibility of keeping a valid triangulation
/// belongs to the users if advanced operations are used. Obviously /// belongs to the users if advanced operations are used. Obviously
/// the advanced user, who implements higher levels operations may /// the advanced user, who implements higher levels operations may
/// have to make a triangulation invalid at some times. The following /// have to make a triangulation invalid at some times. The following
/// method is provided to help the debugging. /// method is provided to help the debugging.
/// @{ /// @{
// TODO(NGHK): Check
/*! /*!
Checks the combinatorial validity of the triangulation and Checks the combinatorial validity of the triangulation and
also the validity of its geometric embedding. also the validity of its geometric embedding.

View File

@ -20,7 +20,7 @@ the offset corresponding to vertex \f$ i\f$.
The implementation of `has_zero_offsets()` results in checking The implementation of `has_zero_offsets()` results in checking
whether all offsets are zero. whether all offsets are zero.
\models ::Periodic_2TriangulationDSFaceBase_2 \cgalModels ::Periodic_2TriangulationDSFaceBase_2
\sa `CGAL::Triangulation_face_base_2` \sa `CGAL::Triangulation_face_base_2`
\sa `CGAL::Triangulation_face_base_with_info_2` \sa `CGAL::Triangulation_face_base_with_info_2`

View File

@ -0,0 +1,26 @@
namespace CGAL {
/*!
\ingroup PkgPeriodic2Triangulation2MainClasses
The class `Periodic_2_triangulation_ds_vertex_base_2` is a model
of the concept `Periodic_2TriangulationDSVertexBase_2` to be used by
`Triangulation_data_structure_2` to represent vertices of a
periodic triangulation.
\cgalModels `Periodic_2TriangulationDSVertexBase_2`
\sa `CGAL::Periodic_2_triangulation_ds_face_base_2`
\sa `CGAL::Triangulation_vertex_base_2`
\sa `CGAL::Triangulation_vertex_base_with_info_2`
*/
template< >
class Periodic_2_triangulation_ds_vertex_base_2 {
public:
/// @}
}; /* end Periodic_2_triangulation_ds_vertex_base_2 */
} /* end namespace CGAL */

View File

@ -2,9 +2,9 @@
namespace CGAL { namespace CGAL {
/*! /*!
\ingroup PkgPeriodic2Triangulation2 \ingroup PkgPeriodic2Triangulation2TraitsClasses
The class `Periodic_2_triangulation_traits_2`is designed as a default The class `Periodic_2_triangulation_traits_2` is designed as a default
traits class for the class traits class for the class
`Periodic_2_triangulation_2<Periodic_2TriangulationTraits_2,TriangulationDataStructure_2>`. `Periodic_2_triangulation_2<Periodic_2TriangulationTraits_2,TriangulationDataStructure_2>`.
@ -19,8 +19,8 @@ predicates. This holds implicitly for
`CGAL::Exact_predicates_inexact_constructions_kernel`, as it is an `CGAL::Exact_predicates_inexact_constructions_kernel`, as it is an
instantiation of `CGAL::Filtered_kernel`. instantiation of `CGAL::Filtered_kernel`.
\models `Periodic_2TriangulationTraits_2` and \alModels `Periodic_2TriangulationTraits_2` and
\models `Periodic_2DelaunayTriangulationTraits_2` if the template parameter `Traits` is a model of the \alModels `Periodic_2DelaunayTriangulationTraits_2` if the template parameter `Traits` is a model of the
`DelaunayTriangulationTraits_2` concept. `DelaunayTriangulationTraits_2` concept.
*/ */

View File

@ -31,7 +31,7 @@ Figure \ref P2Triangulation2figorient.
In order to be able to specify the triangle that contain vertices both In order to be able to specify the triangle that contain vertices both
inside and outside the original domain we store offsets for each inside and outside the original domain we store offsets for each
vertex of a face within the face. These offsets are models of the vertex of a face within the face. These offsets are alModels of the
concept `Periodic_2Offset_2`. concept `Periodic_2Offset_2`.
# Classified Reference Pages # # Classified Reference Pages #

View File

@ -13,7 +13,7 @@ predicates from `DelaunayTriangulationTraits_2` can be used
directly. For efficiency reasons we maintain for each functor the directly. For efficiency reasons we maintain for each functor the
version without offsets. version without offsets.
\refines ::DelaunayTriangulationTraits_2 and ::Periodic_2TriangulationTraits_2 \cgalRefines ::DelaunayTriangulationTraits_2 and ::Periodic_2TriangulationTraits_2
In addition to the requirements of the concept In addition to the requirements of the concept
::Periodic_2TriangulationTraits_2, the concept ::Periodic_2DelaunayTriangulationTraits_2 provides a predicate to check the empty circle property. The ::Periodic_2TriangulationTraits_2, the concept ::Periodic_2DelaunayTriangulationTraits_2 provides a predicate to check the empty circle property. The
@ -25,8 +25,8 @@ dual functions are called. The additional predicate type
::Compare_distance_2 is required if calls to ::Compare_distance_2 is required if calls to
::nearest_vertex(..) are issued. ::nearest_vertex(..) are issued.
\hasModel `CGAL::Periodic_2_Delaunay_triangulation_traits_2<Traits, Offset>` \cgalHasModel `CGAL::Periodic_2_Delaunay_triangulation_traits_2<Traits, Offset>`
\hasModel `CGAL::Periodic_2_triangulation_traits_2<Traits, Offset>`, which implements \cgalHasModel `CGAL::Periodic_2_triangulation_traits_2<Traits, Offset>`, which implements
additional the Delaunay predicates as well if the template parameter Traits is a model of `DelaunayTriangulationTraits_2`. additional the Delaunay predicates as well if the template parameter Traits is a model of `DelaunayTriangulationTraits_2`.
\sa `DelaunayTriangulationTraits_2` \sa `DelaunayTriangulationTraits_2`

View File

@ -5,7 +5,7 @@
The concept `Periodic_2Offset_2` describes a two-/dimensional integer vector with some specialized access functions and operations. The concept `Periodic_2Offset_2` describes a two-/dimensional integer vector with some specialized access functions and operations.
\hasModel CGAL::Periodic_2_offset_2 \cgalHasModel CGAL::Periodic_2_offset_2
\sa `Periodic_2TriangulationTraits_2` \sa `Periodic_2TriangulationTraits_2`
\sa `Periodic_2DelaunayTriangulationTraits_2` \sa `Periodic_2DelaunayTriangulationTraits_2`
@ -18,13 +18,11 @@ public:
/// \name Creation /// \name Creation
/// @{ /// @{
// TODO(NGHK): Check
/*! /*!
Default constructor. Default constructor.
*/ */
Periodic_2Offset_2(); Periodic_2Offset_2();
// TODO(NGHK): Check
/*! /*!
Constructs the offset (x,y). Constructs the offset (x,y).
*/ */
@ -35,54 +33,46 @@ Periodic_2Offset_2(int x, int y);
/// \name Operations /// \name Operations
/// @{ /// @{
// TODO(NGHK): Check
/*! /*!
Return the vector sum of `this` and `o`. Return the vector sum of `this` and `o`.
*/ */
Periodic_2Offset_2 operator+(const Periodic_2Offset_2 & o) Periodic_2Offset_2 operator+(const Periodic_2Offset_2 & o)
const; const;
// TODO(NGHK): Check
/*! /*!
Return the vector difference of `this` and `o`. Return the vector difference of `this` and `o`.
*/ */
Periodic_2Offset_2 operator-(const Periodic_2Offset_2 & o) Periodic_2Offset_2 operator-(const Periodic_2Offset_2 & o)
const; const;
// TODO(NGHK): Check
/*! /*!
Return the negative vector of `this`. Return the negative vector of `this`.
*/ */
Periodic_2Offset_2 operator-() const; Periodic_2Offset_2 operator-() const;
// TODO(NGHK): Check
/*! /*!
Add `o` to `this` using vector addition. Add `o` to `this` using vector addition.
*/ */
void operator+=(const Periodic_2Offset_2 & o) void operator+=(const Periodic_2Offset_2 & o)
const; const;
// TODO(NGHK): Check
/*! /*!
Subtract `o` from `this` using vector subtraction. Subtract `o` from `this` using vector subtraction.
*/ */
void operator-=(const Periodic_2Offset_2 & o) void operator-=(const Periodic_2Offset_2 & o)
const; const;
// TODO(NGHK): Check
/*! /*!
Return `true` if `o` and `this` represent the same vector. Return `true` if `o` and `this` represent the same vector.
*/ */
bool operator==(const Periodic_2Offset_2 & o) const; bool operator==(const Periodic_2Offset_2 & o) const;
// TODO(NGHK): Check
/*! /*!
Return `true` if `o` and `this` do not represent the same Return `true` if `o` and `this` do not represent the same
vector. vector.
*/ */
bool operator!=(const Periodic_2Offset_2 & o) const; bool operator!=(const Periodic_2Offset_2 & o) const;
// TODO(NGHK): Check
/*! /*!
Compare `this` and `o` lexicographically. Compare `this` and `o` lexicographically.
*/ */
@ -93,32 +83,27 @@ bool operator<(const Periodic_2Offset_2 & o) const;
/// \name Access Functions /// \name Access Functions
/// @{ /// @{
// TODO(NGHK): Check
/*! /*!
Return the \f$ i\f$-th entry of `this`. Return the \f$ i\f$-th entry of `this`.
\pre \f$ i\in\{0,1\}\f$ \pre \f$ i\in\{0,1\}\f$
*/ */
int operator[](int i); int operator[](int i);
// TODO(NGHK): Check
/*! /*!
Return the \f$ x\f$-entry of `this`. Return the \f$ x\f$-entry of `this`.
*/ */
int x() const; int x() const;
// TODO(NGHK): Check
/*! /*!
Return the \f$ y\f$-entry of `this`. Return the \f$ y\f$-entry of `this`.
*/ */
int y() const; int y() const;
// TODO(NGHK): Check
/*! /*!
Returns `true` if `this` is equal to (0,0). Returns `true` if `this` is equal to (0,0).
*/ */
bool is_null() const; bool is_null() const;
// TODO(NGHK): Check
/*! /*!
Returns `true` if `this` is equal to (0,0). Returns `true` if `this` is equal to (0,0).
*/ */
@ -129,14 +114,12 @@ bool is_zero() const;
}; /* end Periodic_2Offset_2 */ }; /* end Periodic_2Offset_2 */
// TODO(NGHK): Check
/*! /*!
Inputs an offset from `is`. Inputs an offset from `is`.
\relates Periodic_2Offset_2 \relates Periodic_2Offset_2
*/ */
istream& operator>>(istream & is, Periodic_2Offset_2 & off); istream& operator>>(istream & is, Periodic_2Offset_2 & off);
// TODO(NGHK): Check
/*! /*!
Outputs an offset from `os`. Outputs an offset from `os`.
\relates Periodic_2Offset_2 \relates Periodic_2Offset_2

View File

@ -3,14 +3,15 @@
\ingroup PkgPeriodic2Triangulation2Concepts \ingroup PkgPeriodic2Triangulation2Concepts
\cgalConcept \cgalConcept
At the base level (see Sections \ref P2Triangulation2secdesign At the base level (see Section \ref
and \ref TDS2secdesign), a face stores handles to its four vertices Section_2D_Triangulations_Software_Design), a face stores handles to
and to its four neighbor faces. The vertices and neighbors are its four vertices and to its four neighbor faces. The vertices and
indexed 0, 1 and 2. Neighbor \f$ i\f$ lies opposite to vertex \f$ i\f$. neighbors are indexed 0, 1 and 2. Neighbor \f$ i\f$ lies opposite to
vertex \f$ i\f$.
\refines ::TriangulationDSFaceBase_2 \cgalRefines ::TriangulationDSFaceBase_2
\hasModel CGAL::Periodic_2_triangulation_ds_face_base_2 \cgalHasModel CGAL::Periodic_2_triangulation_ds_face_base_2
\sa `TriangulationDataStructure_2` \sa `TriangulationDataStructure_2`
\sa `TriangulationDSFaceBase_2` \sa `TriangulationDSFaceBase_2`

View File

@ -0,0 +1,67 @@
/*!
\ingroup PkgPeriodic2Triangulation2Concepts
\cgalConcept
A refinement of the concept `TriangulationDSVertexBase_2`
which adds an API for offset.
At the base level of 2D-triangulations (see Section \ref
Section_2D_Triangulations_Software_Design), a vertex provides access
to one of its incident faces through a handle.
The storage of the offset is only needed when a triangulation is copied.
\cgalRefines `TriangulationDSVertexBase_2`
\cgalHasModel CGAL::Periodic_2_triangulation_ds_vertex_base_2
\sa `TriangulationDataStructure_2`
\sa `TriangulationDSVertexBase_2`
\sa `Periodic_2TriangulationDSFaceBase_2`
*/
class Periodic_2TriangulationDSVertexBase_2 {
public:
/// \name Types
/// @{
/*!
A model of the concept
`Periodic_2Offset_2`
*/
typedef Hidden_type Periodic_2_offset_2;
/// @}
/// \name Access Functions
/// @{
/*!
Returns the offset stored in the vertex.
*/
Periodic_2_offset_2 offset() const;
/*!
Returns `true` if the offset has been set, `false` otherwise.
*/
bool get_offset_flag() const;
/*!
Sets the offset and sets the offset flag to `true`.
*/
void set_offset(Periodic_2_offset_2 o);
/*!
Sets the offset flag to `false` and clears the offset.
*/
void clear_offset();
/// @}
}; /* end Periodic_2TriangulationDSVertexBase_2 */

View File

@ -16,13 +16,13 @@ predicates from `TriangulationTraits_2` can be used
directly. For efficiency reasons we maintain for each functor the directly. For efficiency reasons we maintain for each functor the
version without offsets. version without offsets.
\refines ::TriangulationTraits_2 \cgalRefines ::TriangulationTraits_2
In addition to the requirements described for the traits class In addition to the requirements described for the traits class
::TriangulationTraits_2, the geometric traits class of a ::TriangulationTraits_2, the geometric traits class of a
Periodic triangulation must fulfill the following Periodic triangulation must fulfill the following
requirements: requirements:
\hasModel CGAL::Periodic_2_triangulation_traits_2 \cgalHasModel CGAL::Periodic_2_triangulation_traits_2
\sa `TriangulationTraits_2` \sa `TriangulationTraits_2`
\sa `CGAL::Periodic_2_triangulation_2<Traits,Tds>` \sa `CGAL::Periodic_2_triangulation_2<Traits,Tds>`

View File

@ -50,7 +50,7 @@ predicates and constructions that are needed by the functions in the
triangulation classes. triangulation classes.
The package uses `Triangulation_data_structure_2` to represent the The package uses `Triangulation_data_structure_2` to represent the
triangulation. The faces and vertices need to be models of the triangulation. The faces and vertices need to be alModels of the
concepts `Periodic_2TriangulationDSFaceBase_2` and concepts `Periodic_2TriangulationDSFaceBase_2` and
`TriangulationDSVertexBase_2`, respectively. `TriangulationDSVertexBase_2`, respectively.
A triangulation is stored as a collection of vertices and faces that A triangulation is stored as a collection of vertices and faces that
@ -68,36 +68,7 @@ Figure \cgalFigureRef{P2Triangulation2figorient}.
In order to be able to specify the triangle that contain vertices In order to be able to specify the triangle that contain vertices
both inside and outside the original domain we store additional both inside and outside the original domain we store additional
offset information for each vertex of a face. These offsets are models offset information for each vertex of a face. These offsets are alModels
of the concept `Periodic_2Offset_2`. of the concept `Periodic_2Offset_2`.
## Concepts ##
- `Periodic_2DelaunayTriangulationTraits_2`
- `TriangulationDataStructure_2`
- `Periodic_2TriangulationDSCellBase_2`
- `TriangulationDSVertexBase_2`
- `Periodic_2Offset_2`
## Classes ##
### Main Classes ###
- `CGAL::Periodic_2_triangulation_2<PT,TDS>`
- `CGAL::Periodic_2_Delaunay_triangulation_2<PT,TDS>`
// TODO(NGHK): - `CGAL::Periodic_2_triangulation_hierarchy_2<PTr>`
- `CGAL::Periodic_2_triangulation_ds_cell_base_2<>`
- `CGAL::Periodic_2_triangulation_ds_vertex_base_3<>`
- `CGAL::Periodic_2_offset_2`
### Traits Classes ###
- `CGAL::Periodic_2_triangulation_traits_2<Traits,Periodic_2Offset_2>`
## Enums ##
- `CGAL::Periodic_2_triangulation_2::Iterator_type`
- `CGAL::Periodic_2_triangulation_2::Locate_type`
*/ */

View File

@ -188,8 +188,7 @@ which stores their combinatorial structure. This separation between
the geometry and the combinatorics is reflected in the software design the geometry and the combinatorics is reflected in the software design
by the fact that the triangulation classes take two template by the fact that the triangulation classes take two template
parameters: parameters:
<UL> - the <B>geometric traits</B> class, which provides the type
<LI> the <B>geometric traits</B> class, which provides the type
of points to use as well as the elementary operations on them of points to use as well as the elementary operations on them
(predicates and constructions). Furthermore it contains the offset (predicates and constructions). Furthermore it contains the offset
type. The concept for this parameter is described in more detail in type. The concept for this parameter is described in more detail in
@ -200,15 +199,13 @@ be refined are `Periodic_2TriangulationTraits_2` (for
`Periodic_2_Delaunay_triangulation_2`) in the reference `Periodic_2_Delaunay_triangulation_2`) in the reference
manual and manual and
. .
- the <B>triangulation data structure</B> class, which stores
<LI> the <B>triangulation data structure</B> class, which stores
the combinatorial structure, described in the combinatorial structure, described in
Section \ref P2Triangulation2sectds and in more detail in Section \ref P2Triangulation2sectds and in more detail in
Chapter \ref Chapter_2D_Triangulation_Data_Structure. The Chapter \ref Chapter_2D_Triangulation_Data_Structure. The
triangulation data structure needs models of the concepts triangulation data structure needs alModels of the concepts
`Periodic_2TriangulationDSFaceBase_2` and `Periodic_2TriangulationDSFaceBase_2` and
`Periodic_2TriangulationDSVertexBase_2` as template parameters. `Periodic_2TriangulationDSVertexBase_2` as template parameters.
</UL>
\subsection P2Triangulation2secTraits The Geometric Traits Parameter \subsection P2Triangulation2secTraits The Geometric Traits Parameter
@ -236,7 +233,7 @@ is also a model for the concept `TriangulationTraits_2`.
The kernels `Cartesian`, `Homogeneous`, The kernels `Cartesian`, `Homogeneous`,
`Simple_cartesian`, `Simple_homogeneous` and `Simple_cartesian`, `Simple_homogeneous` and
`Filtered_kernel` can all be used as models for `Filtered_kernel` can all be used as alModels for
`Traits`. `Periodic_2_triangulation_traits_2` provides exact `Traits`. `Periodic_2_triangulation_traits_2` provides exact
predicates and exact constructions if `Traits` does. It provides predicates and exact constructions if `Traits` does. It provides
exact predicates but not exact constructions if exact predicates but not exact constructions if
@ -296,7 +293,7 @@ elementary operations on indices in a face. It uses the default
parameter of the `Periodic_2_Delaunay_triangulation_2` class for parameter of the `Periodic_2_Delaunay_triangulation_2` class for
the triangulation data structure. the triangulation data structure.
\cgalExample{simple_example.cpp} \cgalExample{Periodic_2_triangulation_2/p2t2_simple_example.cpp}
## Changing the Vertex Base ## ## Changing the Vertex Base ##
@ -312,7 +309,7 @@ the `TriangulationDataStructure_2` (e.g. a `Vertex_handle` or
information easily in the vertices. The example below shows how to information easily in the vertices. The example below shows how to
add a `CGAL::Color` this way. add a `CGAL::Color` this way.
\cgalExample{colored_vertices.cpp} \cgalExample{Periodic_2_triangulation_2/p2t2_colored_vertices.cpp}
## Adding Handles ## ## Adding Handles ##
@ -321,7 +318,7 @@ If the user needs to add a type in a vertex that depends on the
`Face_handle`), he has to derive his own vertex base class, as the `Face_handle`), he has to derive his own vertex base class, as the
following example shows. following example shows.
\cgalExample{periodic_adding_handles.cpp} \cgalExample{Periodic_2_triangulation_2/p2t2_periodic_adding_handles.cpp}
## 9-sheeted Covering ## ## 9-sheeted Covering ##
@ -336,7 +333,7 @@ the 1-sheeted covering. However, we can insert new points such that the
point set does not have a Delaunay triangulation in the 1-sheeted point set does not have a Delaunay triangulation in the 1-sheeted
covering anymore, so the triangulation is not <I>extensible</I>. covering anymore, so the triangulation is not <I>extensible</I>.
\cgalExample{covering.cpp} \cgalExample{Periodic_2_triangulation_2/p2t2_covering.cpp}
## Large Point Set ## ## Large Point Set ##
@ -356,7 +353,7 @@ triangulation in 1-sheeted covering.
It is recommended to run this example only when compiled in release It is recommended to run this example only when compiled in release
mode because of the relatively large number of points. mode because of the relatively large number of points.
\cgalExample{large_point_set.cpp} \cgalExample{Periodic_2_triangulation_2/p2t2_large_point_set.cpp}
## Geometric Access ## ## Geometric Access ##
@ -375,7 +372,7 @@ triangle whether the offset is (0,0,0) using the
method `is_null`. If so, we convert the periodic triangle to a method `is_null`. If so, we convert the periodic triangle to a
`PK::Triangle_2`, which requires <I>exact constructions</I>. `PK::Triangle_2`, which requires <I>exact constructions</I>.
\cgalExample{geometric_access.cpp} \cgalExample{Periodic_2_triangulation_2/p2t2_geometric_access.cpp}
# Design and Implementation History # # Design and Implementation History #

View File

@ -0,0 +1,12 @@
/*!
\example Periodic_2_triangulation_2/p2t2_simple_example.cpp
\example Periodic_2_triangulation_2/p2t2_adding_handles.cpp
\example Periodic_2_triangulation_2/p2t2_colored_vertices.cpp
\example Periodic_2_triangulation_2/p2t2_covering.cpp
\example Periodic_2_triangulation_2/p2t2_find_conflicts.cpp
\example Periodic_2_triangulation_2/p2t2_geometric_access.cpp
\example Periodic_2_triangulation_2/p2t2_info_insert_with_pair_iterator_2.cpp
\example Periodic_2_triangulation_2/p2t2_info_insert_with_transform_iterator_2.cpp
\example Periodic_2_triangulation_2/p2t2_info_insert_with_zip_iterator_2.cpp
\example Periodic_2_triangulation_2/p2t2_large_point_set.cpp
*/

View File

@ -198,11 +198,6 @@ public:
/// Functor that returns the point given a vertex /// Functor that returns the point given a vertex
/// \n NGHK: implemented /// \n NGHK: implemented
typedef Project_point<Vertex> Proj_point; typedef Project_point<Vertex> Proj_point;
/// Iterator over the points in the triangulation
/// \n NGHK: implemented
typedef Iterator_project<Vertex_iterator, Proj_point, const Point&,
const Point*, std::ptrdiff_t, std::bidirectional_iterator_tag>
Point_iterator;
/// \name STL types /// \name STL types
// \{ // \{
@ -448,8 +443,8 @@ public:
Periodic_segment periodic_segment(const Face_handle &f, int i) const { Periodic_segment periodic_segment(const Face_handle &f, int i) const {
CGAL_triangulation_precondition( number_of_vertices() != 0 ); CGAL_triangulation_precondition( number_of_vertices() != 0 );
CGAL_triangulation_precondition( i >= 0 && i <= 2); CGAL_triangulation_precondition( i >= 0 && i <= 2);
return make_array(periodic_point(f, (i + 1) % 3), return make_array(periodic_point(f, ccw(i) % 3),
periodic_point(f, (i + 2) % 3)); periodic_point(f, cw(i) % 3));
} }
/// Same as the previous method for edge e. /// Same as the previous method for edge e.
@ -472,6 +467,9 @@ public:
Point point(const Periodic_point & pp) const { Point point(const Periodic_point & pp) const {
return construct_point(pp.first, pp.second); return construct_point(pp.first, pp.second);
} }
Point point(const Vertex_handle &v) const {
return point(periodic_point(v));
}
/// Converts the Periodic_segment ps to a Segment in \f$R^2\f$. /// Converts the Periodic_segment ps to a Segment in \f$R^2\f$.
/// NGHK: Implemented /// NGHK: Implemented
Segment segment(const Periodic_segment &ps) const { Segment segment(const Periodic_segment &ps) const {
@ -512,6 +510,19 @@ public:
} }
//\} //\}
Point move_in_domain(const Point &p) {
typename Gt::FT x = p.x();
typename Gt::FT y = p.y();
while (x < _domain.xmin()) x += _domain.xmax()-_domain.xmin();
while (x >= _domain.xmax()) x -= _domain.xmax()-_domain.xmin();
while (y < _domain.ymin()) y += _domain.ymax()-_domain.ymin();
while (y >= _domain.ymax()) y -= _domain.ymax()-_domain.ymin();
return Point(x,y);
}
/// \name Queries on simplices /// \name Queries on simplices
// \{ // \{
/// NGHK: Implemented /// NGHK: Implemented
@ -553,7 +564,6 @@ public:
/// Returns the oriented side of the point p with respect to the /// Returns the oriented side of the point p with respect to the
/// triangle defined by the face f /// triangle defined by the face f
/// \n NGHK: Not yet implemented
Oriented_side oriented_side(Face_handle f, const Point& p) const { Oriented_side oriented_side(Face_handle f, const Point& p) const {
return oriented_side(f, p, Offset()); return oriented_side(f, p, Offset());
} }
@ -795,7 +805,6 @@ public:
//\{ //\{
/// Insert the first vertex in the triangulation and creates the 9-cover. /// Insert the first vertex in the triangulation and creates the 9-cover.
/// NGHK: updates the too long edge list.
Vertex_handle insert_first(const Point& p); Vertex_handle insert_first(const Point& p);
/// Inserts p in the face f and sets the offsets of the newly created faces /// Inserts p in the face f and sets the offsets of the newly created faces
/// Insert periodic copies in all periodic copies of the domain /// Insert periodic copies in all periodic copies of the domain
@ -807,11 +816,9 @@ public:
Vertex_handle insert_in_edge(const Point& p, Face_handle f, int i); Vertex_handle insert_in_edge(const Point& p, Face_handle f, int i);
/// Remove a degree 3 vertex from a 2D triangulation /// Remove a degree 3 vertex from a 2D triangulation
/// \n NGHK: not implemented
void remove_degree_3(Vertex_handle v); void remove_degree_3(Vertex_handle v);
/// Remove a vertex from a 2D triangulation with number_of_vertices() == 1 /// Remove a vertex from a 2D triangulation with number_of_vertices() == 1
/// \n NGHK: implemented
void remove_first(Vertex_handle v); void remove_first(Vertex_handle v);
/// Remove a vertex from a 2D triangulation with more than one vertex /// Remove a vertex from a 2D triangulation with more than one vertex
/// \n NGHK: not implemented /// \n NGHK: not implemented
@ -820,12 +827,14 @@ public:
/// creates a new vertex v and use it to star the hole whose /// creates a new vertex v and use it to star the hole whose
/// boundary is described by the sequence of edges [edge_begin, /// boundary is described by the sequence of edges [edge_begin,
/// edge_end). Returns a handle to the new vertex. /// edge_end). Returns a handle to the new vertex.
/// \n NGHK: not implemented
template<class EdgeIt> template<class EdgeIt>
Vertex_handle star_hole(Point p, EdgeIt edge_begin, EdgeIt edge_end); Vertex_handle star_hole(Point p, EdgeIt edge_begin, EdgeIt edge_end);
/// same as above, except that the algorithm first recycles faces in /// same as above, except that the algorithm first recycles faces in
/// the sequence [face_begin, face_end) and create new ones /// the sequence [face_begin, face_end) and create new ones
/// only when the sequence is exhausted. /// only when the sequence is exhausted.
/// \n NGHK: not implemented
template<class EdgeIt, class FaceIt> template<class EdgeIt, class FaceIt>
Vertex_handle star_hole(Point p, EdgeIt edge_begin, EdgeIt edge_end, Vertex_handle star_hole(Point p, EdgeIt edge_begin, EdgeIt edge_end,
FaceIt face_begin, FaceIt face_end); FaceIt face_begin, FaceIt face_end);