mirror of https://github.com/KLayout/klayout.git
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:
parent
b49153190c
commit
5187ddbfc0
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in New Issue