This commit is contained in:
Matthias Koefferlein 2022-06-26 01:00:33 +02:00
parent 4ad9e98b7b
commit 43b63923a7
2 changed files with 33 additions and 11 deletions

View File

@ -1038,6 +1038,7 @@ AsIfFlatRegion::run_check (db::edge_relation_type rel, bool different_polygons,
#if defined(USE_LOCAL_PROCESSOR)
bool needs_merged_primary = different_polygons || options.needs_merged ();
needs_merged_primary = true; // @@@
db::RegionIterator polygons (needs_merged_primary ? begin_merged () : begin ());
bool primary_is_merged = ! merged_semantics () || needs_merged_primary || is_merged ();

View File

@ -252,8 +252,15 @@ namespace std
h = hfunc_coord (o.bgn_ext (), h);
h = hfunc_coord (o.end_ext (), h);
h = hfunc_coord (o.width (), h);
// NOTE: using too many points for the hash function just slows down the code.
unsigned int n = 20;
for (typename db::path<C>::iterator p = o.begin (); p != o.end (); ++p) {
h = hfunc (*p, h);
if (--n == 0) {
h = hfunc (o.points (), h);
break;
} else {
h = hfunc (*p, h);
}
}
return h;
}
@ -280,8 +287,15 @@ namespace std
template <class C>
size_t hfunc (const db::polygon_contour<C> &o, size_t h)
{
// NOTE: using too many points for the hash function just slows down the code.
unsigned int n = 20;
for (typename db::polygon_contour<C>::simple_iterator i = o.begin (); i != o.end (); ++i) {
h = hfunc (*i, h);
if (--n == 0) {
h = hfunc (o.size (), h);
break;
} else {
h = hfunc (*i, h);
}
}
return h;
}
@ -309,8 +323,15 @@ namespace std
size_t hfunc (const db::polygon<C> &o, size_t h)
{
h = hfunc (o.hull (), h);
// NOTE: using too many points for the hash function just slows down the code.
unsigned int n = 20;
for (size_t i = 0; i < o.holes (); ++i) {
h = hfunc (o.hole (int (i)), h);
if (--n == 0) {
h = hfunc (o.holes (), h);
break;
} else {
h = hfunc (o.hole (int (i)), h);
}
}
return h;
}
@ -514,13 +535,13 @@ namespace std
template <class Shape, class Trans>
size_t hfunc (const db::shape_ref<Shape, Trans> &o, size_t h)
{
return hfunc ((size_t) o.ptr (), hfunc (o.trans (), h));
return hfunc (*o.ptr (), hfunc (o.trans (), h));
}
template <class Shape, class Trans>
size_t hfunc (const db::shape_ref<Shape, Trans> &o)
{
return hfunc ((size_t) o.ptr (), hfunc (o.trans ()));
return hfunc (*o.ptr (), hfunc (o.trans ()));
}
template <class Shape, class Trans>
@ -539,13 +560,13 @@ namespace std
template <class Shape, class Trans>
size_t hfunc (const db::polygon_ref<Shape, Trans> &o, size_t h)
{
return hfunc ((size_t) o.ptr (), hfunc (o.trans (), h));
return hfunc (*o.ptr (), hfunc (o.trans (), h));
}
template <class Shape, class Trans>
size_t hfunc (const db::polygon_ref<Shape, Trans> &o)
{
return hfunc ((size_t) o.ptr (), hfunc (o.trans ()));
return hfunc (*o.ptr (), hfunc (o.trans ()));
}
template <class Shape, class Trans>
@ -564,13 +585,13 @@ namespace std
template <class Shape, class Trans>
size_t hfunc (const db::path_ref<Shape, Trans> &o, size_t h)
{
return hfunc ((size_t) o.ptr (), hfunc (o.trans (), h));
return hfunc (*o.ptr (), hfunc (o.trans (), h));
}
template <class Shape, class Trans>
size_t hfunc (const db::path_ref<Shape, Trans> &o)
{
return hfunc ((size_t) o.ptr (), hfunc (o.trans ()));
return hfunc (*o.ptr (), hfunc (o.trans ()));
}
template <class Shape, class Trans>
@ -589,13 +610,13 @@ namespace std
template <class Shape, class Trans>
size_t hfunc (const db::text_ref<Shape, Trans> &o, size_t h)
{
return hfunc ((size_t) o.ptr (), hfunc (o.trans (), h));
return hfunc (*o.ptr (), hfunc (o.trans (), h));
}
template <class Shape, class Trans>
size_t hfunc (const db::text_ref<Shape, Trans> &o)
{
return hfunc ((size_t) o.ptr (), hfunc (o.trans ()));
return hfunc (*o.ptr (), hfunc (o.trans ()));
}
template <class Shape, class Trans>