Do not insert the same point twice into edge set in EdgeProcessor - this improves performance in the case of manifold intersecions in one point. Also: added edge count API

This commit is contained in:
Matthias Koefferlein 2024-02-17 21:20:24 +01:00
parent b49153190c
commit 5187ddbfc0
4 changed files with 29 additions and 0 deletions

View File

@ -251,6 +251,13 @@ struct CutPoints
}
// do not insert points twice
for (auto c = cut_points.begin (); c != cut_points.end (); ++c) {
if (*c == p) {
return;
}
}
cut_points.push_back (p);
}
@ -1057,6 +1064,12 @@ EdgeProcessor::reserve (size_t n)
mp_work_edges->reserve (n);
}
size_t
EdgeProcessor::count () const
{
return mp_work_edges->size ();
}
void
EdgeProcessor::insert (const db::Edge &e, EdgeProcessor::property_type p)
{

View File

@ -695,6 +695,11 @@ public:
*/
void reserve (size_t n);
/**
* @brief Reports the number of edges stored in the processor
*/
size_t count () const;
/**
* @brief Insert an edge
*/

View File

@ -53,6 +53,12 @@ ShapeProcessor::reserve (size_t n)
m_processor.reserve (n);
}
size_t
ShapeProcessor::count () const
{
return m_processor.count ();
}
void
ShapeProcessor::process (db::EdgeSink &es, EdgeEvaluatorBase &op)
{

View File

@ -196,6 +196,11 @@ public:
*/
void reserve (size_t n);
/**
* @brief Reports the number of edges stored in the processor
*/
size_t count () const;
/**
* @brief Sets the base verbosity of the processor (see EdgeProcessor::set_base_verbosity for details)
*/