mirror of https://github.com/CGAL/cgal
Surface_mesh: Add exact_num_faces(const SM&) (#8215)
## Summary of Changes Add a partial specialization for `CGAL::internal::exact_num_faces(const Surface_mesh&)` to have an `O(1)` time. This was pointed out as important for the `Face_count_stop_predicate` in Issue #8158 ## Release Management * Affected package(s): Surface_mesh * Issue(s) solved (if any): fix #5720 * License and copyright ownership: unchanged
This commit is contained in:
commit
94b9726a46
|
|
@ -26,6 +26,7 @@
|
|||
#include <CGAL/boost/graph/Euler_operations.h>
|
||||
#include <CGAL/boost/graph/iterator.h>
|
||||
#include <CGAL/boost/graph/named_params_helper.h>
|
||||
#include <CGAL/boost/graph/internal/helpers.h>
|
||||
#include <CGAL/Named_function_parameters.h>
|
||||
#include <CGAL/circulator.h>
|
||||
#include <CGAL/Handle_hash_function.h>
|
||||
|
|
@ -2802,6 +2803,37 @@ namespace internal{
|
|||
}
|
||||
}
|
||||
|
||||
namespace internal {
|
||||
|
||||
template <typename P>
|
||||
std::size_t
|
||||
exact_num_faces(const CGAL::Surface_mesh<P>& sm)
|
||||
{
|
||||
return sm.number_of_faces();
|
||||
}
|
||||
|
||||
template <typename P>
|
||||
std::size_t
|
||||
exact_num_edges(const CGAL::Surface_mesh<P>& sm)
|
||||
{
|
||||
return sm.number_of_edges();
|
||||
}
|
||||
|
||||
template <typename P>
|
||||
std::size_t
|
||||
exact_num_halfedges(const CGAL::Surface_mesh<P>& sm)
|
||||
{
|
||||
return sm.number_of_halfedges();
|
||||
}
|
||||
|
||||
template <typename P>
|
||||
std::size_t
|
||||
exact_num_vertices(const CGAL::Surface_mesh<P>& sm)
|
||||
{
|
||||
return sm.number_of_vertices();
|
||||
}
|
||||
|
||||
} // namespace internal
|
||||
} // namespace CGAL
|
||||
|
||||
#ifndef DOXYGEN_RUNNING
|
||||
|
|
|
|||
Loading…
Reference in New Issue