Triangulation_2: Document degree() (#8976)

## Summary of Changes

Add the documentation of `degree()`  and also of `is_vertex()`. 

## Release Management

* Affected package(s): 2D Triangulations
* Issue(s) solved (if any): fix #8975
* License and copyright ownership: unchanged
This commit is contained in:
Sebastien Loriot 2025-08-05 16:03:06 +02:00 committed by GitHub
commit a712bd69a0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 26 additions and 4 deletions

View File

@ -1312,7 +1312,7 @@ OutputIterator
adjacent_vertices(Vertex_handle v, OutputIterator vertices) const;
/*!
Returns the degree of a vertex, that is, the number of adjacent vertices.
Returns the degree of `v`, that is, the number of adjacent vertices.
\pre `v` \f$ \neq\f$ `Vertex_handle()`, `t`.`is_vertex(v)`.
*/
size_type degree(Vertex_handle v) const;

View File

@ -960,7 +960,7 @@ OutputIterator
adjacent_vertices(Vertex_handle v, OutputIterator vertices) const;
/*!
Returns the degree of a vertex, that is, the number of incident vertices.
Returns the degree of `v`, that is, the number of incident vertices.
\pre `v` \f$ \neq\f$ `Vertex_handle()`, `tds.is_vertex(v)`.
*/
size_type degree(Vertex_handle v) const;

View File

@ -472,7 +472,7 @@ const TriangulationDataStructure_2 & tds() const;
/// @}
/// \name Non const access
/// \name Non-Const Access
/// \attention The responsibility of keeping a valid triangulation belongs to the
/// user when using advanced operations allowing a direct manipulation
/// of the `tds`. This method is mainly a help for users implementing
@ -528,6 +528,11 @@ is_infinite(Edge_circulator ec) const;
bool
is_infinite(All_edges_iterator ei) const;
/*!
`true` if `v` is a vertex of the triangulation.
*/
bool is_vertex(Vertex_handle v) const;
/*!
`true` if there is an edge having `va` and `vb` as
vertices.
@ -1117,6 +1122,13 @@ in counterclockwise order around `v`.
*/
Vertex_circulator incident_vertices(Vertex_handle v, Face_handle f) ;
/*!
Returns the degree of `v`, that is, the number of incident vertices.
The infinite vertex is counted.
\pre `v != Vertex_handle()`, `t.is_vertex(v)`.
*/
size_type degree(Vertex_handle v) const;
/// @}
/// \name Traversal Between Adjacent Faces

View File

@ -294,6 +294,7 @@ public:
bool is_infinite(const Edge& e) const;
bool is_infinite(const Edge_circulator& ec) const;
bool is_infinite(const All_edges_iterator& ei) const;
bool is_vertex(Vertex_handle va) const;
bool is_edge(Vertex_handle va, Vertex_handle vb) const;
bool is_edge(Vertex_handle va, Vertex_handle vb, Face_handle& fr,
int & i) const;
@ -1096,6 +1097,14 @@ is_infinite(const All_edges_iterator& ei) const
return is_infinite(*ei);
}
template <class Gt, class Tds >
inline bool
Triangulation_2<Gt, Tds>::
is_vertex(Vertex_handle va) const
{
return _tds.is_vertex(va);
}
template <class Gt, class Tds >
inline bool
Triangulation_2<Gt, Tds>::

View File

@ -182,6 +182,7 @@ _test_cls_triangulation_2( const Triangul & )
Triangul T0_2;
Vertex_handle v0_2_0 = T0_2.insert_first(p0);
assert( v0_2_0 != nullptr );
assert( T0_2.is_vertex(v0_2_0) );
assert( T0_2.dimension() == 0 );
assert( T0_2.number_of_vertices() == 1 );
assert( T0_2.number_of_faces() == 0);

View File

@ -1669,7 +1669,7 @@ OutputIterator
finite_adjacent_vertices(Vertex_handle v, OutputIterator vertices) const;
/*!
Returns the degree of a vertex, that is, the number of incident vertices.
Returns the degree of `v`, that is, the number of incident vertices.
The infinite vertex is counted.
\pre `v != Vertex_handle()`, `t.is_vertex(v)`.
*/