Triangulation_2: Document degree()

This commit is contained in:
Andreas Fabri 2025-07-09 15:09:42 +01:00
parent 0435766dcf
commit 8d4877b025
3 changed files with 23 additions and 2 deletions

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 /// \attention The responsibility of keeping a valid triangulation belongs to the
/// user when using advanced operations allowing a direct manipulation /// user when using advanced operations allowing a direct manipulation
/// of the `tds`. This method is mainly a help for users implementing /// of the `tds`. This method is mainly a help for users implementing
@ -528,6 +528,11 @@ is_infinite(Edge_circulator ec) const;
bool bool
is_infinite(All_edges_iterator ei) const; is_infinite(All_edges_iterator ei) const;
/*!
`true` if `v` is a vertex of the triangulation.
*/
bool is_vertex(Vertex_handle v);
/*! /*!
`true` if there is an edge having `va` and `vb` as `true` if there is an edge having `va` and `vb` as
vertices. vertices.
@ -1117,6 +1122,13 @@ in counterclockwise order around `v`.
*/ */
Vertex_circulator incident_vertices(Vertex_handle v, Face_handle f) ; 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 /// \name Traversal Between Adjacent Faces

View File

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

View File

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