WIP: bug fixing, test for GSI binding of checks with property constraints

This commit is contained in:
Matthias Koefferlein 2023-01-19 23:27:31 +01:00
parent 4cd6c5e03b
commit f329f91300
11 changed files with 102 additions and 28 deletions

View File

@ -1088,25 +1088,25 @@ AsIfFlatRegion::notch_check (db::Coord d, const RegionCheckOptions &options) con
EdgePairsDelegate *
AsIfFlatRegion::enclosing_check (const Region &other, db::Coord d, const RegionCheckOptions &options) const
{
return run_check (db::OverlapRelation, true, &other, d, options);
return run_check (db::OverlapRelation, true /*@@@false?*/, &other, d, options);
}
EdgePairsDelegate *
AsIfFlatRegion::overlap_check (const Region &other, db::Coord d, const RegionCheckOptions &options) const
{
return run_check (db::WidthRelation, true, &other, d, options);
return run_check (db::WidthRelation, true /*@@@false?*/, &other, d, options);
}
EdgePairsDelegate *
AsIfFlatRegion::separation_check (const Region &other, db::Coord d, const RegionCheckOptions &options) const
{
return run_check (db::SpaceRelation, true, &other, d, options);
return run_check (db::SpaceRelation, true /*@@@false?*/, &other, d, options);
}
EdgePairsDelegate *
AsIfFlatRegion::inside_check (const Region &other, db::Coord d, const RegionCheckOptions &options) const
{
return run_check (db::InsideRelation, true, &other, d, options);
return run_check (db::InsideRelation, true /*@@@false?*/, &other, d, options);
}
EdgePairsDelegate *

View File

@ -457,6 +457,9 @@ DeepEdges::iter () const
void DeepEdges::apply_property_translator (const db::PropertiesTranslator &pt)
{
DeepShapeCollectionDelegateBase::apply_property_translator (pt);
m_merged_edges_valid = false;
m_merged_edges = db::DeepLayer ();
}
db::PropertiesRepository *DeepEdges::properties_repository ()
@ -641,6 +644,7 @@ DeepEdges::set_is_merged (bool f)
{
m_is_merged = f;
m_merged_edges_valid = false;
m_merged_edges = db::DeepLayer ();
}
void

View File

@ -484,6 +484,9 @@ DeepRegion::iter () const
void DeepRegion::apply_property_translator (const db::PropertiesTranslator &pt)
{
DeepShapeCollectionDelegateBase::apply_property_translator (pt);
m_merged_polygons_valid = false;
m_merged_polygons = db::DeepLayer ();
}
db::PropertiesRepository *DeepRegion::properties_repository ()
@ -740,6 +743,7 @@ DeepRegion::set_is_merged (bool f)
{
m_is_merged = f;
m_merged_polygons_valid = false;
m_merged_polygons = db::DeepLayer ();
}
void

View File

@ -193,6 +193,8 @@ void FlatEdgePairs::apply_property_translator (const db::PropertiesTranslator &p
db::Shapes new_edge_pairs (mp_edge_pairs->is_editable ());
new_edge_pairs.assign (*mp_edge_pairs, pt);
mp_edge_pairs->swap (new_edge_pairs);
invalidate_cache ();
}
db::PropertiesRepository *FlatEdgePairs::properties_repository ()

View File

@ -350,6 +350,8 @@ void FlatEdges::apply_property_translator (const db::PropertiesTranslator &pt)
db::Shapes new_edges (mp_edges->is_editable ());
new_edges.assign (*mp_edges, pt);
mp_edges->swap (new_edges);
invalidate_cache ();
}
db::PropertiesRepository *FlatEdges::properties_repository ()

View File

@ -424,6 +424,8 @@ void FlatRegion::apply_property_translator (const db::PropertiesTranslator &pt)
db::Shapes new_polygons (mp_polygons->is_editable ());
new_polygons.assign (*mp_polygons, pt);
mp_polygons->swap (new_polygons);
invalidate_cache ();
}
db::PropertiesRepository *FlatRegion::properties_repository ()

View File

@ -193,6 +193,8 @@ void FlatTexts::apply_property_translator (const db::PropertiesTranslator &pt)
db::Shapes new_texts (mp_texts->is_editable ());
new_texts.assign (*mp_texts, pt);
mp_texts->swap (new_texts);
invalidate_cache ();
}
db::PropertiesRepository *FlatTexts::properties_repository ()

View File

@ -255,6 +255,9 @@ void
OriginalLayerEdges::apply_property_translator (const db::PropertiesTranslator &pt)
{
m_iter.apply_property_translator (pt);
m_merged_edges_valid = false;
m_merged_edges.clear ();
}
db::PropertiesRepository *

View File

@ -373,6 +373,9 @@ void
OriginalLayerRegion::apply_property_translator (const db::PropertiesTranslator &pt)
{
m_iter.apply_property_translator (pt);
m_merged_polygons_valid = false;
m_merged_polygons.clear ();
}
db::PropertiesRepository *

View File

@ -524,7 +524,7 @@ static db::EdgePairs width2 (const db::Region *r, db::Region::distance_type d, b
);
}
static db::EdgePairs space2 (const db::Region *r, db::Region::distance_type d, bool whole_edges, db::metrics_type metrics, const tl::Variant &ignore_angle, const tl::Variant &min_projection, const tl::Variant &max_projection, bool shielded, db::OppositeFilter opposite, db::RectFilter rect_filter, bool negative)
static db::EdgePairs space2 (const db::Region *r, db::Region::distance_type d, bool whole_edges, db::metrics_type metrics, const tl::Variant &ignore_angle, const tl::Variant &min_projection, const tl::Variant &max_projection, bool shielded, db::OppositeFilter opposite, db::RectFilter rect_filter, bool negative, db::PropertyConstraint prop_constraint)
{
return r->space_check (d, db::RegionCheckOptions (whole_edges,
metrics,
@ -534,11 +534,12 @@ static db::EdgePairs space2 (const db::Region *r, db::Region::distance_type d, b
shielded,
opposite,
rect_filter,
negative)
negative,
prop_constraint)
);
}
static db::EdgePairs notch2 (const db::Region *r, db::Region::distance_type d, bool whole_edges, db::metrics_type metrics, const tl::Variant &ignore_angle, const tl::Variant &min_projection, const tl::Variant &max_projection, bool shielded, bool negative)
static db::EdgePairs notch2 (const db::Region *r, db::Region::distance_type d, bool whole_edges, db::metrics_type metrics, const tl::Variant &ignore_angle, const tl::Variant &min_projection, const tl::Variant &max_projection, bool shielded, bool negative, db::PropertyConstraint prop_constraint)
{
return r->notch_check (d, db::RegionCheckOptions (whole_edges,
metrics,
@ -548,11 +549,12 @@ static db::EdgePairs notch2 (const db::Region *r, db::Region::distance_type d, b
shielded,
db::NoOppositeFilter,
db::NoRectFilter,
negative)
negative,
prop_constraint)
);
}
static db::EdgePairs isolated2 (const db::Region *r, db::Region::distance_type d, bool whole_edges, db::metrics_type metrics, const tl::Variant &ignore_angle, const tl::Variant &min_projection, const tl::Variant &max_projection, bool shielded, db::OppositeFilter opposite, db::RectFilter rect_filter, bool negative)
static db::EdgePairs isolated2 (const db::Region *r, db::Region::distance_type d, bool whole_edges, db::metrics_type metrics, const tl::Variant &ignore_angle, const tl::Variant &min_projection, const tl::Variant &max_projection, bool shielded, db::OppositeFilter opposite, db::RectFilter rect_filter, bool negative, db::PropertyConstraint prop_constraint)
{
return r->isolated_check (d, db::RegionCheckOptions (whole_edges,
metrics,
@ -562,11 +564,12 @@ static db::EdgePairs isolated2 (const db::Region *r, db::Region::distance_type d
shielded,
opposite,
rect_filter,
negative)
negative,
prop_constraint)
);
}
static db::EdgePairs inside2 (const db::Region *r, const db::Region &other, db::Region::distance_type d, bool whole_edges, db::metrics_type metrics, const tl::Variant &ignore_angle, const tl::Variant &min_projection, const tl::Variant &max_projection, bool shielded, db::OppositeFilter opposite, db::RectFilter rect_filter, bool negative)
static db::EdgePairs inside2 (const db::Region *r, const db::Region &other, db::Region::distance_type d, bool whole_edges, db::metrics_type metrics, const tl::Variant &ignore_angle, const tl::Variant &min_projection, const tl::Variant &max_projection, bool shielded, db::OppositeFilter opposite, db::RectFilter rect_filter, bool negative, db::PropertyConstraint prop_constraint)
{
return r->inside_check (other, d, db::RegionCheckOptions (whole_edges,
metrics,
@ -576,11 +579,12 @@ static db::EdgePairs inside2 (const db::Region *r, const db::Region &other, db::
shielded,
opposite,
rect_filter,
negative)
negative,
prop_constraint)
);
}
static db::EdgePairs overlap2 (const db::Region *r, const db::Region &other, db::Region::distance_type d, bool whole_edges, db::metrics_type metrics, const tl::Variant &ignore_angle, const tl::Variant &min_projection, const tl::Variant &max_projection, bool shielded, db::OppositeFilter opposite, db::RectFilter rect_filter, bool negative)
static db::EdgePairs overlap2 (const db::Region *r, const db::Region &other, db::Region::distance_type d, bool whole_edges, db::metrics_type metrics, const tl::Variant &ignore_angle, const tl::Variant &min_projection, const tl::Variant &max_projection, bool shielded, db::OppositeFilter opposite, db::RectFilter rect_filter, bool negative, db::PropertyConstraint prop_constraint)
{
return r->overlap_check (other, d, db::RegionCheckOptions (whole_edges,
metrics,
@ -590,11 +594,12 @@ static db::EdgePairs overlap2 (const db::Region *r, const db::Region &other, db:
shielded,
opposite,
rect_filter,
negative)
negative,
prop_constraint)
);
}
static db::EdgePairs enclosing2 (const db::Region *r, const db::Region &other, db::Region::distance_type d, bool whole_edges, db::metrics_type metrics, const tl::Variant &ignore_angle, const tl::Variant &min_projection, const tl::Variant &max_projection, bool shielded, db::OppositeFilter opposite, db::RectFilter rect_filter, bool negative)
static db::EdgePairs enclosing2 (const db::Region *r, const db::Region &other, db::Region::distance_type d, bool whole_edges, db::metrics_type metrics, const tl::Variant &ignore_angle, const tl::Variant &min_projection, const tl::Variant &max_projection, bool shielded, db::OppositeFilter opposite, db::RectFilter rect_filter, bool negative, db::PropertyConstraint prop_constraint)
{
return r->enclosing_check (other, d, db::RegionCheckOptions (whole_edges,
metrics,
@ -604,11 +609,12 @@ static db::EdgePairs enclosing2 (const db::Region *r, const db::Region &other, d
shielded,
opposite,
rect_filter,
negative)
negative,
prop_constraint)
);
}
static db::EdgePairs separation2 (const db::Region *r, const db::Region &other, db::Region::distance_type d, bool whole_edges, db::metrics_type metrics, const tl::Variant &ignore_angle, const tl::Variant &min_projection, const tl::Variant &max_projection, bool shielded, db::OppositeFilter opposite, db::RectFilter rect_filter, bool negative)
static db::EdgePairs separation2 (const db::Region *r, const db::Region &other, db::Region::distance_type d, bool whole_edges, db::metrics_type metrics, const tl::Variant &ignore_angle, const tl::Variant &min_projection, const tl::Variant &max_projection, bool shielded, db::OppositeFilter opposite, db::RectFilter rect_filter, bool negative, db::PropertyConstraint prop_constraint)
{
return r->separation_check (other, d, db::RegionCheckOptions (whole_edges,
metrics,
@ -618,7 +624,8 @@ static db::EdgePairs separation2 (const db::Region *r, const db::Region &other,
shielded,
opposite,
rect_filter,
negative)
negative,
prop_constraint)
);
}
@ -2547,7 +2554,7 @@ Class<db::Region> decl_Region (decl_dbShapeCollection, "db", "Region",
"\n"
"The 'shielded' and 'negative' options have been introduced in version 0.27."
) +
method_ext ("space_check", &space2, gsi::arg ("d"), gsi::arg ("whole_edges", false), gsi::arg ("metrics", db::metrics_type::Euclidian, "Euclidian"), gsi::arg ("ignore_angle", tl::Variant (), "default"), gsi::arg ("min_projection", tl::Variant (), "0"), gsi::arg ("max_projection", tl::Variant (), "max"), gsi::arg ("shielded", true), gsi::arg ("opposite_filter", db::NoOppositeFilter, "NoOppositeFilter"), gsi::arg ("rect_filter", db::NoRectFilter, "NoRectFilter"), gsi::arg ("negative", false),
method_ext ("space_check", &space2, gsi::arg ("d"), gsi::arg ("whole_edges", false), gsi::arg ("metrics", db::metrics_type::Euclidian, "Euclidian"), gsi::arg ("ignore_angle", tl::Variant (), "default"), gsi::arg ("min_projection", tl::Variant (), "0"), gsi::arg ("max_projection", tl::Variant (), "max"), gsi::arg ("shielded", true), gsi::arg ("opposite_filter", db::NoOppositeFilter, "NoOppositeFilter"), gsi::arg ("rect_filter", db::NoRectFilter, "NoRectFilter"), gsi::arg ("negative", false), gsi::arg ("property_constraint", db::IgnoreProperties),
"@brief Performs a space check with options\n"
"@param d The minimum space for which the polygons are checked\n"
"@param whole_edges If true, deliver the whole edges\n"
@ -2558,6 +2565,7 @@ Class<db::Region> decl_Region (decl_dbShapeCollection, "db", "Region",
"@param opposite_filter Specifies a filter mode for errors happening on opposite sides of inputs shapes\n"
"@param rect_filter Specifies an error filter for rectangular input shapes\n"
"@param negative If true, edges not violation the condition will be output as pseudo-edge pairs\n"
"@param property_constraint Specifies whether to consider only shapes with a certain property relation\n"
"\n"
"If \"whole_edges\" is true, the resulting \\EdgePairs collection will receive the whole "
"edges which contribute in the width check.\n"
@ -2586,9 +2594,10 @@ Class<db::Region> decl_Region (decl_dbShapeCollection, "db", "Region",
"\n"
"Merged semantics applies for the input of this method (see \\merged_semantics= for a description of this concept)\n"
"\n"
"The 'shielded', 'negative', 'not_opposite' and 'rect_sides' options have been introduced in version 0.27."
"The 'shielded', 'negative', 'not_opposite' and 'rect_sides' options have been introduced in version 0.27.\n"
"'property_constraint' has been added in version 0.28.4."
) +
method_ext ("notch_check", &notch2, gsi::arg ("d"), gsi::arg ("whole_edges", false), gsi::arg ("metrics", db::metrics_type::Euclidian, "Euclidian"), gsi::arg ("ignore_angle", tl::Variant (), "default"), gsi::arg ("min_projection", tl::Variant (), "0"), gsi::arg ("max_projection", tl::Variant (), "max"), gsi::arg ("shielded", true), gsi::arg ("negative", false),
method_ext ("notch_check", &notch2, gsi::arg ("d"), gsi::arg ("whole_edges", false), gsi::arg ("metrics", db::metrics_type::Euclidian, "Euclidian"), gsi::arg ("ignore_angle", tl::Variant (), "default"), gsi::arg ("min_projection", tl::Variant (), "0"), gsi::arg ("max_projection", tl::Variant (), "max"), gsi::arg ("shielded", true), gsi::arg ("negative", false), gsi::arg ("property_constraint", db::IgnoreProperties),
"@brief Performs a space check between edges of the same polygon with options\n"
"@param d The minimum space for which the polygons are checked\n"
"@param whole_edges If true, deliver the whole edges\n"
@ -2598,6 +2607,7 @@ Class<db::Region> decl_Region (decl_dbShapeCollection, "db", "Region",
"@param max_projection The upper limit of the projected length of one edge onto another\n"
"@param shielded Enables shielding\n"
"@param negative If true, edges not violation the condition will be output as pseudo-edge pairs\n"
"@param property_constraint Specifies whether to consider only shapes with a certain property relation\n"
"\n"
"This version is similar to the simple version with one parameter. In addition, it allows "
"to specify many more options.\n"
@ -2626,9 +2636,10 @@ Class<db::Region> decl_Region (decl_dbShapeCollection, "db", "Region",
"\n"
"Merged semantics applies for the input of this method (see \\merged_semantics= for a description of this concept)\n"
"\n"
"The 'shielded' and 'negative' options have been introduced in version 0.27."
"The 'shielded' and 'negative' options have been introduced in version 0.27.\n"
"'property_constraint' has been added in version 0.28.4."
) +
method_ext ("isolated_check", &isolated2, gsi::arg ("d"), gsi::arg ("whole_edges", false), gsi::arg ("metrics", db::metrics_type::Euclidian, "Euclidian"), gsi::arg ("ignore_angle", tl::Variant (), "default"), gsi::arg ("min_projection", tl::Variant (), "0"), gsi::arg ("max_projection", tl::Variant (), "max"), gsi::arg ("shielded", true), gsi::arg ("opposite_filter", db::NoOppositeFilter, "NoOppositeFilter"), gsi::arg ("rect_filter", db::NoRectFilter, "NoRectFilter"), gsi::arg ("negative", false),
method_ext ("isolated_check", &isolated2, gsi::arg ("d"), gsi::arg ("whole_edges", false), gsi::arg ("metrics", db::metrics_type::Euclidian, "Euclidian"), gsi::arg ("ignore_angle", tl::Variant (), "default"), gsi::arg ("min_projection", tl::Variant (), "0"), gsi::arg ("max_projection", tl::Variant (), "max"), gsi::arg ("shielded", true), gsi::arg ("opposite_filter", db::NoOppositeFilter, "NoOppositeFilter"), gsi::arg ("rect_filter", db::NoRectFilter, "NoRectFilter"), gsi::arg ("negative", false), gsi::arg ("property_constraint", db::IgnoreProperties),
"@brief Performs a space check between edges of different polygons with options\n"
"@param d The minimum space for which the polygons are checked\n"
"@param whole_edges If true, deliver the whole edges\n"
@ -2639,6 +2650,7 @@ Class<db::Region> decl_Region (decl_dbShapeCollection, "db", "Region",
"@param opposite_filter Specifies a filter mode for errors happening on opposite sides of inputs shapes\n"
"@param rect_filter Specifies an error filter for rectangular input shapes\n"
"@param negative If true, edges not violation the condition will be output as pseudo-edge pairs\n"
"@param property_constraint Specifies whether to consider only shapes with a certain property relation\n"
"\n"
"If \"whole_edges\" is true, the resulting \\EdgePairs collection will receive the whole "
"edges which contribute in the width check.\n"
@ -2667,9 +2679,10 @@ Class<db::Region> decl_Region (decl_dbShapeCollection, "db", "Region",
"\n"
"Merged semantics applies for the input of this method (see \\merged_semantics= for a description of this concept)\n"
"\n"
"The 'shielded', 'negative', 'not_opposite' and 'rect_sides' options have been introduced in version 0.27."
"The 'shielded', 'negative', 'not_opposite' and 'rect_sides' options have been introduced in version 0.27.\n"
"'property_constraint' has been added in version 0.28.4."
) +
method_ext ("inside_check|enclosed_check", &inside2, gsi::arg ("other"), gsi::arg ("d"), gsi::arg ("whole_edges", false), gsi::arg ("metrics", db::metrics_type::Euclidian, "Euclidian"), gsi::arg ("ignore_angle", tl::Variant (), "default"), gsi::arg ("min_projection", tl::Variant (), "0"), gsi::arg ("max_projection", tl::Variant (), "max"), gsi::arg ("shielded", true), gsi::arg ("opposite_filter", db::NoOppositeFilter, "NoOppositeFilter"), gsi::arg ("rect_filter", db::NoRectFilter, "NoRectFilter"), gsi::arg ("negative", false),
method_ext ("inside_check|enclosed_check", &inside2, gsi::arg ("other"), gsi::arg ("d"), gsi::arg ("whole_edges", false), gsi::arg ("metrics", db::metrics_type::Euclidian, "Euclidian"), gsi::arg ("ignore_angle", tl::Variant (), "default"), gsi::arg ("min_projection", tl::Variant (), "0"), gsi::arg ("max_projection", tl::Variant (), "max"), gsi::arg ("shielded", true), gsi::arg ("opposite_filter", db::NoOppositeFilter, "NoOppositeFilter"), gsi::arg ("rect_filter", db::NoRectFilter, "NoRectFilter"), gsi::arg ("negative", false), gsi::arg ("property_constraint", db::IgnoreProperties),
"@brief Performs an inside check with options\n"
"@param d The minimum distance for which the polygons are checked\n"
"@param other The other region against which to check\n"
@ -2681,6 +2694,7 @@ Class<db::Region> decl_Region (decl_dbShapeCollection, "db", "Region",
"@param opposite_filter Specifies a filter mode for errors happening on opposite sides of inputs shapes\n"
"@param rect_filter Specifies an error filter for rectangular input shapes\n"
"@param negative Negative output from the first input\n"
"@param property_constraint Specifies whether to consider only shapes with a certain property relation\n"
"\n"
"If \"whole_edges\" is true, the resulting \\EdgePairs collection will receive the whole "
"edges which contribute in the width check.\n"
@ -2717,8 +2731,9 @@ Class<db::Region> decl_Region (decl_dbShapeCollection, "db", "Region",
"The 'shielded', 'negative', 'not_opposite' and 'rect_sides' options have been introduced in version 0.27. "
"The interpretation of the 'negative' flag has been restriced to first-layout only output in 0.27.1.\n"
"The 'enclosed_check' alias was introduced in version 0.27.5.\n"
"'property_constraint' has been added in version 0.28.4."
) +
method_ext ("overlap_check", &overlap2, gsi::arg ("other"), gsi::arg ("d"), gsi::arg ("whole_edges", false), gsi::arg ("metrics", db::metrics_type::Euclidian, "Euclidian"), gsi::arg ("ignore_angle", tl::Variant (), "default"), gsi::arg ("min_projection", tl::Variant (), "0"), gsi::arg ("max_projection", tl::Variant (), "max"), gsi::arg ("shielded", true), gsi::arg ("opposite_filter", db::NoOppositeFilter, "NoOppositeFilter"), gsi::arg ("rect_filter", db::NoRectFilter, "NoRectFilter"), gsi::arg ("negative", false),
method_ext ("overlap_check", &overlap2, gsi::arg ("other"), gsi::arg ("d"), gsi::arg ("whole_edges", false), gsi::arg ("metrics", db::metrics_type::Euclidian, "Euclidian"), gsi::arg ("ignore_angle", tl::Variant (), "default"), gsi::arg ("min_projection", tl::Variant (), "0"), gsi::arg ("max_projection", tl::Variant (), "max"), gsi::arg ("shielded", true), gsi::arg ("opposite_filter", db::NoOppositeFilter, "NoOppositeFilter"), gsi::arg ("rect_filter", db::NoRectFilter, "NoRectFilter"), gsi::arg ("negative", false), gsi::arg ("property_constraint", db::IgnoreProperties),
"@brief Performs an overlap check with options\n"
"@param d The minimum overlap for which the polygons are checked\n"
"@param other The other region against which to check\n"
@ -2730,6 +2745,7 @@ Class<db::Region> decl_Region (decl_dbShapeCollection, "db", "Region",
"@param opposite_filter Specifies a filter mode for errors happening on opposite sides of inputs shapes\n"
"@param rect_filter Specifies an error filter for rectangular input shapes\n"
"@param negative Negative output from the first input\n"
"@param property_constraint Specifies whether to consider only shapes with a certain property relation\n"
"\n"
"If \"whole_edges\" is true, the resulting \\EdgePairs collection will receive the whole "
"edges which contribute in the width check.\n"
@ -2765,8 +2781,9 @@ Class<db::Region> decl_Region (decl_dbShapeCollection, "db", "Region",
"\n"
"The 'shielded', 'negative', 'not_opposite' and 'rect_sides' options have been introduced in version 0.27. "
"The interpretation of the 'negative' flag has been restriced to first-layout only output in 0.27.1.\n"
"'property_constraint' has been added in version 0.28.4."
) +
method_ext ("enclosing_check", &enclosing2, gsi::arg ("other"), gsi::arg ("d"), gsi::arg ("whole_edges", false), gsi::arg ("metrics", db::metrics_type::Euclidian, "Euclidian"), gsi::arg ("ignore_angle", tl::Variant (), "default"), gsi::arg ("min_projection", tl::Variant (), "0"), gsi::arg ("max_projection", tl::Variant (), "max"), gsi::arg ("shielded", true), gsi::arg ("opposite_filter", db::NoOppositeFilter, "NoOppositeFilter"), gsi::arg ("rect_filter", db::NoRectFilter, "NoRectFilter"), gsi::arg ("negative", false),
method_ext ("enclosing_check", &enclosing2, gsi::arg ("other"), gsi::arg ("d"), gsi::arg ("whole_edges", false), gsi::arg ("metrics", db::metrics_type::Euclidian, "Euclidian"), gsi::arg ("ignore_angle", tl::Variant (), "default"), gsi::arg ("min_projection", tl::Variant (), "0"), gsi::arg ("max_projection", tl::Variant (), "max"), gsi::arg ("shielded", true), gsi::arg ("opposite_filter", db::NoOppositeFilter, "NoOppositeFilter"), gsi::arg ("rect_filter", db::NoRectFilter, "NoRectFilter"), gsi::arg ("negative", false), gsi::arg ("property_constraint", db::IgnoreProperties),
"@brief Performs an enclosing check with options\n"
"@param d The minimum enclosing distance for which the polygons are checked\n"
"@param other The other region against which to check\n"
@ -2778,6 +2795,7 @@ Class<db::Region> decl_Region (decl_dbShapeCollection, "db", "Region",
"@param opposite_filter Specifies a filter mode for errors happening on opposite sides of inputs shapes\n"
"@param rect_filter Specifies an error filter for rectangular input shapes\n"
"@param negative Negative output from the first input\n"
"@param property_constraint Specifies whether to consider only shapes with a certain property relation\n"
"\n"
"If \"whole_edges\" is true, the resulting \\EdgePairs collection will receive the whole "
"edges which contribute in the width check.\n"
@ -2813,8 +2831,9 @@ Class<db::Region> decl_Region (decl_dbShapeCollection, "db", "Region",
"\n"
"The 'shielded', 'negative', 'not_opposite' and 'rect_sides' options have been introduced in version 0.27. "
"The interpretation of the 'negative' flag has been restriced to first-layout only output in 0.27.1.\n"
"'property_constraint' has been added in version 0.28.4."
) +
method_ext ("separation_check", &separation2, gsi::arg ("other"), gsi::arg ("d"), gsi::arg ("whole_edges", false), gsi::arg ("metrics", db::metrics_type::Euclidian, "Euclidian"), gsi::arg ("ignore_angle", tl::Variant (), "default"), gsi::arg ("min_projection", tl::Variant (), "0"), gsi::arg ("max_projection", tl::Variant (), "max"), gsi::arg ("shielded", true), gsi::arg ("opposite_filter", db::NoOppositeFilter, "NoOppositeFilter"), gsi::arg ("rect_filter", db::NoRectFilter, "NoRectFilter"), gsi::arg ("negative", false),
method_ext ("separation_check", &separation2, gsi::arg ("other"), gsi::arg ("d"), gsi::arg ("whole_edges", false), gsi::arg ("metrics", db::metrics_type::Euclidian, "Euclidian"), gsi::arg ("ignore_angle", tl::Variant (), "default"), gsi::arg ("min_projection", tl::Variant (), "0"), gsi::arg ("max_projection", tl::Variant (), "max"), gsi::arg ("shielded", true), gsi::arg ("opposite_filter", db::NoOppositeFilter, "NoOppositeFilter"), gsi::arg ("rect_filter", db::NoRectFilter, "NoRectFilter"), gsi::arg ("negative", false), gsi::arg ("property_constraint", db::IgnoreProperties),
"@brief Performs a separation check with options\n"
"@param d The minimum separation for which the polygons are checked\n"
"@param other The other region against which to check\n"
@ -2826,6 +2845,7 @@ Class<db::Region> decl_Region (decl_dbShapeCollection, "db", "Region",
"@param opposite_filter Specifies a filter mode for errors happening on opposite sides of inputs shapes\n"
"@param rect_filter Specifies an error filter for rectangular input shapes\n"
"@param negative Negative output from the first input\n"
"@param property_constraint Specifies whether to consider only shapes with a certain property relation\n"
"\n"
"If \"whole_edges\" is true, the resulting \\EdgePairs collection will receive the whole "
"edges which contribute in the width check.\n"
@ -2861,6 +2881,7 @@ Class<db::Region> decl_Region (decl_dbShapeCollection, "db", "Region",
"\n"
"The 'shielded', 'negative', 'not_opposite' and 'rect_sides' options have been introduced in version 0.27. "
"The interpretation of the 'negative' flag has been restriced to first-layout only output in 0.27.1.\n"
"'property_constraint' has been added in version 0.28.4."
) +
method_ext ("area", &area1,
"@brief The area of the region\n"

View File

@ -1137,6 +1137,37 @@ class DBRegion_TestClass < TestBase
end
# Check with properties
def test_check_with_properties
ly = RBA::Layout::new
tc = ly.create_cell("TOP")
l1 = ly.layer(1, 0)
l2 = ly.layer(2, 0)
p1 = ly.properties_id([ [ 1, 17 ] ])
p2 = ly.properties_id([ [ 1, 42 ] ])
tc.shapes(l1).insert(RBA::Box::new(RBA::Point::new(0, 0), RBA::Point::new(100, 200)), p1)
tc.shapes(l1).insert(RBA::Box::new(RBA::Point::new(200, 0), RBA::Point::new(300, 200)), p2)
tc.shapes(l1).insert(RBA::Box::new(RBA::Point::new(400, 0), RBA::Point::new(500, 200)))
tc.shapes(l2).insert(RBA::Box::new(RBA::Point::new(0, 250), RBA::Point::new(500, 300)), p1)
r = RBA::Region::new(tc.begin_shapes_rec(l1)).enable_properties
rr = RBA::Region::new(tc.begin_shapes_rec(l2)).enable_properties
assert_equal(r.separation_check(rr, 100, false, RBA::Region::Projection, nil, nil, nil, false, RBA::Region::NoOppositeFilter, RBA::Region::NoRectFilter, false).to_s, "(400,200;500,200)/(500,250;400,250);(0,200;100,200)/(100,250;0,250);(200,200;300,200)/(300,250;200,250)")
assert_equal(r.separation_check(rr, 100, false, RBA::Region::Projection, nil, nil, nil, false, RBA::Region::NoOppositeFilter, RBA::Region::NoRectFilter, false, RBA::Region::NoPropertyConstraint).to_s, "(400,200;500,200)/(500,250;400,250);(0,200;100,200)/(100,250;0,250);(200,200;300,200)/(300,250;200,250)")
assert_equal(r.separation_check(rr, 100, false, RBA::Region::Projection, nil, nil, nil, false, RBA::Region::NoOppositeFilter, RBA::Region::NoRectFilter, false, RBA::Region::SamePropertiesConstraint).to_s, "(0,200;100,200)/(100,250;0,250)")
assert_equal(r.separation_check(rr, 100, false, RBA::Region::Projection, nil, nil, nil, false, RBA::Region::NoOppositeFilter, RBA::Region::NoRectFilter, false, RBA::Region::DifferentPropertiesConstraint).to_s, "(400,200;500,200)/(500,250;400,250);(200,200;300,200)/(300,250;200,250)")
r.remove_properties
rr.remove_properties
assert_equal(r.separation_check(rr, 100, false, RBA::Region::Projection, nil, nil, nil, false, RBA::Region::NoOppositeFilter, RBA::Region::NoRectFilter, false, RBA::Region::SamePropertiesConstraint).to_s, "(0,200;100,200)/(100,250;0,250);(200,200;300,200)/(300,250;200,250);(400,200;500,200)/(500,250;400,250)")
end
end
load("test_epilogue.rb")