Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document point() in all triangulations #8658

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,19 @@ class Hyperbolic_Delaunay_triangulation_2: private Delaunay_triangulation_2<Gt,T
/*!
Returns the hyperbolic segment formed by the vertices of edge `e`.
*/
Hyperbolic_segment hyperbolic_segment (const Edge& e) const;
Hyperbolic_segment hyperbolic_segment(const Edge& e) const;

/*!
Returns the hyperbolic point given by the finite vertex `vh`.
*/
Point point(const Vertex_handle vh) const;

/*!
Returns the point given by vertex `i` of face `fh`.
\pre `t.dimension()` \f$ \geq0\f$ and \f$ i \in\{0,1,2\}\f$ in dimension 2, \f$ i \in\{0,1\}\f$ in dimension 1, \f$ i = 0\f$ in dimension 0, and the vertex is finite.
*/
Point point(const Face_handle fh, const int i) const;

///@}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,32 @@ class Hyperbolic_Delaunay_triangulation_2
Hyperbolic_segment segment(const Edge& e) const { return hyperbolic_segment(e); }
Hyperbolic_segment segment(const Edge_circulator& e) const { return hyperbolic_segment(e); }

const Point& point(const Vertex_handle vh) const
{
CGAL_precondition(!is_infinite(vh));
return vh->point();
}

const Point& point(const Face_handle fh, const int i) const
{
CGAL_precondition(!is_infinite(fh->vertex(i)));
CGAL_precondition(0 <= i && i <= 2);
return fh->vertex(i)->point();
}

Point& point(const Vertex_handle vh)
{
CGAL_precondition(!is_infinite(vh));
return vh->point();
}

Point& point(const Face_handle fh, const int i)
{
CGAL_precondition(!is_infinite(fh->vertex(i)));
CGAL_precondition(0 <= i && i <= 2);
return fh->vertex(i)->point();
}

size_type number_of_vertices() const { return Base::number_of_vertices(); }
Vertex_circulator adjacent_vertices(Vertex_handle v) const { return Vertex_circulator(v, *this); }

Expand Down Expand Up @@ -825,32 +851,6 @@ class Hyperbolic_Delaunay_triangulation_2
}

public:
const Point& point(const Vertex_handle vh) const
{
CGAL_precondition(!is_infinite(vh));
return vh->point();
}

const Point& point(const Face_handle fh, const int i) const
{
CGAL_precondition(!is_infinite(fh->vertex(i)));
CGAL_precondition(0 <= i && i <= 2);
return fh->vertex(i)->point();
}

Point& point(const Vertex_handle vh)
{
CGAL_precondition(!is_infinite(vh));
return vh->point();
}

Point& point(const Face_handle fh, const int i)
{
CGAL_precondition(!is_infinite(fh->vertex(i)));
CGAL_precondition(0 <= i && i <= 2);
return fh->vertex(i)->point();
}

bool is_valid()
{
if (!Base::is_valid())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ class Periodic_2_triangulation_2 : public Triangulation_cw_ccw_2

/*!
Converts the `Periodic_point` `pp` (point-offset pair) to the
corresponding `Point` in \f$ \mathbb R^3\f$.
corresponding `Point` in \f$ \mathbb R^2\f$.
*/
Point point(const Periodic_point & pp ) const;

Expand All @@ -593,6 +593,18 @@ class Periodic_2_triangulation_2 : public Triangulation_cw_ccw_2
*/
Triangle triangle(const Periodic_triangle & t) const;

/*!
Equivalent to
the call `t.point(t.periodic_point(fh,i));`
*/
Point point(Face_handle fh, int i) const;

/*!
Equivalent to
the call `t.point(t.periodic_point(v));`
*/
Point point(Vertex_handle v) const;

/*!
Equivalent to
the call `t.segment(t.periodic_segment(f,i));`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,24 @@ size_type number_of_stored_facets() const;
/// `Periodic_triangle`, and `Periodic_tetrahedron`, which have inner type `Point`.
/// @{

/*!
Converts the `Periodic_point` `pp` (point-offset pair) to the
corresponding `Point` in \f$ \mathbb R^3\f$.
*/
Point point(const Periodic_point& pp) const;

/*!
Equivalent to
the call `t.point(t.periodic_point(v));`
*/
Point point(Vertex_handle v) const;

/*!
Equivalent to
the call `t.point(t.periodic_point(c,idx));`
*/
Point point(Cell_handle c, int idx) const;

/*!
Returns the periodic point given by vertex `v`. If `t` is
represented in the 1-sheeted covering space, the offset is always
Expand Down
12 changes: 12 additions & 0 deletions Triangulation_2/doc/Triangulation_2/CGAL/Triangulation_2.h
Original file line number Diff line number Diff line change
Expand Up @@ -1191,6 +1191,18 @@ Returns the line segment corresponding to edge `*ei`.
Segment
segment(const Edge_iterator& ei) const;

/*!
Returns the point given by vertex `i` of face `f`.
\pre `t.dimension()` \f$ \geq0\f$ and \f$ i \in\{0,1,2\}\f$ in dimension 2, \f$ i \in\{0,1\}\f$ in dimension 1, \f$ i = 0\f$ in dimension 0, and the vertex is finite.
*/
const Point& point(Face_handle f, int i) const;

/*!
Same as the previous method for vertex `v`.
\pre `t.dimension()` \f$ \geq0\f$ and the vertex is finite.
*/
const Point& point(Vertex_handle v) const;

/*!
Compute the circumcenter of the face pointed to by f. This function
is available only if the corresponding function is provided in the
Expand Down
Loading