Merge pull request #8658 from MaelRL/Tr-Document_point-GF

Document `point()` in all triangulations
This commit is contained in:
Sébastien Loriot 2025-02-12 21:18:27 +01:00
commit de1fb95d15
6 changed files with 85 additions and 28 deletions

View File

@ -201,6 +201,18 @@ public:
Returns the hyperbolic segment formed by the vertices of edge `e`.
*/
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;
///@}

View File

@ -740,6 +740,32 @@ public:
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); }
@ -825,32 +851,6 @@ public:
}
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())

View File

@ -35,6 +35,9 @@
- Add a the non-zero rule, as well as functions to compute the conservative inner and outer hull of similar polygons.
### Triangulations
- All triangulations now offer the functions `point(Vertex_handle)` and `point(Simplex, int)`, which enables users to access the geometric position of a vertex and of the i-th vertex of a simplex of a triangulation.
## [Release 6.0.1](https://github.com/CGAL/cgal/releases/tag/v6.0.1)
### [Poisson Surface Reconstruction](https://doc.cgal.org/6.0.1/Manual/packages.html#PkgPoissonSurfaceReconstruction3)

View File

@ -579,7 +579,7 @@ public:
/*!
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;
@ -593,6 +593,18 @@ public:
*/
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));`

View File

@ -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

View File

@ -1192,6 +1192,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