diff --git a/src/buddies/src/bd/bdReaderOptions.cc b/src/buddies/src/bd/bdReaderOptions.cc index 678abdd2d..fde037d2b 100644 --- a/src/buddies/src/bd/bdReaderOptions.cc +++ b/src/buddies/src/bd/bdReaderOptions.cc @@ -110,6 +110,9 @@ GenericReaderOptions::GenericReaderOptions () m_lefdef_produce_labels = load_options.get_option_by_name ("lefdef_config.produce_labels").to_bool (); m_lefdef_label_suffix = load_options.get_option_by_name ("lefdef_config.labels_suffix").to_string (); m_lefdef_label_datatype = load_options.get_option_by_name ("lefdef_config.labels_datatype").to_int (); + m_lefdef_produce_lef_labels = load_options.get_option_by_name ("lefdef_config.produce_lef_labels").to_bool (); + m_lefdef_lef_label_suffix = load_options.get_option_by_name ("lefdef_config.lef_labels_suffix").to_string (); + m_lefdef_lef_label_datatype = load_options.get_option_by_name ("lefdef_config.lef_labels_datatype").to_int (); m_lefdef_produce_routing = load_options.get_option_by_name ("lefdef_config.produce_routing").to_bool (); m_lefdef_routing_suffix = load_options.get_option_by_name ("lefdef_config.routing_suffix_str").to_string (); m_lefdef_routing_datatype = load_options.get_option_by_name ("lefdef_config.routing_datatype_str").to_string (); @@ -584,16 +587,30 @@ GenericReaderOptions::add_options (tl::CommandLineOptions &cmd) "See '--" + m_long_prefix + "lefdef-via-geometry-suffix' for a description of the mapping scheme.\n" ) << tl::arg (group + - "#!--" + m_long_prefix + "lefdef-dont-produce-labels", &m_lefdef_produce_labels, "Skips label when producing geometry", - "If this option is given, no blockage geometry will be produced." + "#!--" + m_long_prefix + "lefdef-dont-produce-labels", &m_lefdef_produce_labels, "Skips DEF pin label when producing geometry", + "If this option is given, no DEF pin label will be produced." ) << tl::arg (group + - "#--" + m_long_prefix + "lefdef-label-suffix", &m_lefdef_label_suffix, "Specifies the label markers layer suffix in pattern-based mode", + "#--" + m_long_prefix + "lefdef-label-suffix", &m_lefdef_label_suffix, "Specifies the DEF pin label layer suffix in pattern-based mode", "The label marker generation and layer mapping is designed in the same way than via geometry mapping, except the option to use mask specific target layers. " "See '--" + m_long_prefix + "lefdef-via-geometry-suffix' for a description of the mapping scheme.\n" ) << tl::arg (group + - "#--" + m_long_prefix + "lefdef-label-datatype", &m_lefdef_label_datatype, "Specifies the label markers layer datatype in pattern-based mode", + "#--" + m_long_prefix + "lefdef-label-datatype", &m_lefdef_label_datatype, "Specifies the DEF pin label layer datatype in pattern-based mode", + "The label marker generation and layer mapping is designed in the same way than via geometry mapping, except the option to use mask specific target layers. " + "See '--" + m_long_prefix + "lefdef-via-geometry-suffix' for a description of the mapping scheme.\n" + ) + << tl::arg (group + + "#!--" + m_long_prefix + "lefdef-dont-produce-lef-labels", &m_lefdef_produce_lef_labels, "Skips LEF pin label when producing geometry", + "If this option is given, no LEF pin label will be produced." + ) + << tl::arg (group + + "#--" + m_long_prefix + "lefdef-lef-label-suffix", &m_lefdef_lef_label_suffix, "Specifies the LEF pin label layer suffix in pattern-based mode", + "The label marker generation and layer mapping is designed in the same way than via geometry mapping, except the option to use mask specific target layers. " + "See '--" + m_long_prefix + "lefdef-via-geometry-suffix' for a description of the mapping scheme.\n" + ) + << tl::arg (group + + "#--" + m_long_prefix + "lefdef-lef-label-datatype", &m_lefdef_lef_label_datatype, "Specifies the LEF pin label layer datatype in pattern-based mode", "The label marker generation and layer mapping is designed in the same way than via geometry mapping, except the option to use mask specific target layers. " "See '--" + m_long_prefix + "lefdef-via-geometry-suffix' for a description of the mapping scheme.\n" ) @@ -776,6 +793,9 @@ GenericReaderOptions::configure (db::LoadLayoutOptions &load_options) load_options.set_option_by_name ("lefdef_config.produce_labels", m_lefdef_produce_labels); load_options.set_option_by_name ("lefdef_config.labels_suffix", m_lefdef_label_suffix); load_options.set_option_by_name ("lefdef_config.labels_datatype", m_lefdef_label_datatype); + load_options.set_option_by_name ("lefdef_config.produce_lef_labels", m_lefdef_produce_lef_labels); + load_options.set_option_by_name ("lefdef_config.lef_labels_suffix", m_lefdef_lef_label_suffix); + load_options.set_option_by_name ("lefdef_config.lef_labels_datatype", m_lefdef_lef_label_datatype); load_options.set_option_by_name ("lefdef_config.produce_routing", m_lefdef_produce_routing); load_options.set_option_by_name ("lefdef_config.routing_suffix_str", m_lefdef_routing_suffix); load_options.set_option_by_name ("lefdef_config.routing_datatype_str", m_lefdef_routing_datatype); diff --git a/src/buddies/src/bd/bdReaderOptions.h b/src/buddies/src/bd/bdReaderOptions.h index 2691f3218..3b0e22bff 100644 --- a/src/buddies/src/bd/bdReaderOptions.h +++ b/src/buddies/src/bd/bdReaderOptions.h @@ -176,6 +176,9 @@ private: bool m_lefdef_produce_labels; std::string m_lefdef_label_suffix; int m_lefdef_label_datatype; + bool m_lefdef_produce_lef_labels; + std::string m_lefdef_lef_label_suffix; + int m_lefdef_lef_label_datatype; bool m_lefdef_produce_routing; std::string m_lefdef_routing_suffix; std::string m_lefdef_routing_datatype; diff --git a/src/db/db/dbCompoundOperation.cc b/src/db/db/dbCompoundOperation.cc index e3e9b8d7c..dfc0c3431 100644 --- a/src/db/db/dbCompoundOperation.cc +++ b/src/db/db/dbCompoundOperation.cc @@ -32,7 +32,7 @@ namespace db CompoundRegionOperationNode::CompoundRegionOperationNode () : m_dist (0) { - invalidate_cache (); + // .. nothing yet .. } CompoundRegionOperationNode::~CompoundRegionOperationNode () @@ -106,20 +106,20 @@ static void translate (db::Layout *, const std::vector &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionOperationNode::compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { std::vector > intermediate; intermediate.push_back (std::unordered_set ()); - implement_compute_local (layout, interactions, intermediate, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, intermediate, max_vertex_count, area_ratio); translate (layout, intermediate, results); } void -CompoundRegionOperationNode::compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionOperationNode::compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { std::vector > intermediate; intermediate.push_back (std::unordered_set ()); - implement_compute_local (layout, interactions, intermediate, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, intermediate, max_vertex_count, area_ratio); translate (layout, intermediate, results); } @@ -142,14 +142,14 @@ std::vector CompoundRegionOperationPrimaryNode::inputs () const return is; } -void CompoundRegionOperationPrimaryNode::do_compute_local (db::Layout *, const shape_interactions &interactions, std::vector > &results, size_t, double) const +void CompoundRegionOperationPrimaryNode::do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout *, const shape_interactions &interactions, std::vector > &results, size_t, double) const { for (shape_interactions::subject_iterator i = interactions.begin_subjects (); i != interactions.end_subjects (); ++i) { results.front ().insert (i->second); } } -void CompoundRegionOperationPrimaryNode::do_compute_local (db::Layout *, const shape_interactions &interactions, std::vector > &results, size_t, double) const +void CompoundRegionOperationPrimaryNode::do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout *, const shape_interactions &interactions, std::vector > &results, size_t, double) const { for (shape_interactions::subject_iterator i = interactions.begin_subjects (); i != interactions.end_subjects (); ++i) { results.front ().insert (i->second); @@ -177,14 +177,14 @@ std::vector CompoundRegionOperationSecondaryNode::inputs () const return iv; } -void CompoundRegionOperationSecondaryNode::do_compute_local (db::Layout *, const shape_interactions &interactions, std::vector > &results, size_t, double) const +void CompoundRegionOperationSecondaryNode::do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout *, const shape_interactions &interactions, std::vector > &results, size_t, double) const { for (shape_interactions::intruder_iterator i = interactions.begin_intruders (); i != interactions.end_intruders (); ++i) { results.front ().insert (i->second.second); } } -void CompoundRegionOperationSecondaryNode::do_compute_local (db::Layout *, const shape_interactions &interactions, std::vector > &results, size_t, double) const +void CompoundRegionOperationSecondaryNode::do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout *, const shape_interactions &interactions, std::vector > &results, size_t, double) const { for (shape_interactions::intruder_iterator i = interactions.begin_intruders (); i != interactions.end_intruders (); ++i) { results.front ().insert (i->second.second); @@ -211,14 +211,14 @@ std::vector CompoundRegionOperationForeignNode::inputs () const return iv; } -void CompoundRegionOperationForeignNode::do_compute_local (db::Layout *, const shape_interactions &interactions, std::vector > &results, size_t, double) const +void CompoundRegionOperationForeignNode::do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout *, const shape_interactions &interactions, std::vector > &results, size_t, double) const { for (shape_interactions::intruder_iterator i = interactions.begin_intruders (); i != interactions.end_intruders (); ++i) { results.front ().insert (i->second.second); } } -void CompoundRegionOperationForeignNode::do_compute_local (db::Layout *, const shape_interactions &interactions, std::vector > &results, size_t, double) const +void CompoundRegionOperationForeignNode::do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout *, const shape_interactions &interactions, std::vector > &results, size_t, double) const { for (shape_interactions::intruder_iterator i = interactions.begin_intruders (); i != interactions.end_intruders (); ++i) { results.front ().insert (i->second.second); @@ -360,15 +360,6 @@ CompoundRegionMultiInputOperationNode::~CompoundRegionMultiInputOperationNode () // .. nothing yet .. } -void -CompoundRegionMultiInputOperationNode::invalidate_cache () const -{ - CompoundRegionOperationNode::invalidate_cache (); - for (tl::shared_collection::const_iterator i = m_children.begin (); i != m_children.end (); ++i) { - i->invalidate_cache (); - } -} - db::Coord CompoundRegionMultiInputOperationNode::computed_dist () const { @@ -455,7 +446,7 @@ std::string CompoundRegionLogicalBoolOperationNode::generated_description () con } template -void CompoundRegionLogicalBoolOperationNode::implement_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +void CompoundRegionLogicalBoolOperationNode::implement_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { bool ok = (m_op == And ? true : false); @@ -468,7 +459,7 @@ void CompoundRegionLogicalBoolOperationNode::implement_compute_local (db::Layout const CompoundRegionOperationNode *node = child (ci); - bool any = node->compute_local_bool (layout, child_interactions, max_vertex_count, area_ratio); + bool any = node->compute_local_bool (cache, layout, child_interactions, max_vertex_count, area_ratio); if (m_op == And) { if (! any) { @@ -752,13 +743,13 @@ static void copy_results (std::vector > &, const std::vect template void -CompoundRegionGeometricalBoolOperationNode::implement_bool (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionGeometricalBoolOperationNode::implement_bool (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { std::vector > one_a; one_a.push_back (std::unordered_set ()); shape_interactions computed_a; - child (0)->compute_local (layout, interactions_for_child (interactions, 0, computed_a), one_a, max_vertex_count, area_ratio); + child (0)->compute_local (cache, layout, interactions_for_child (interactions, 0, computed_a), one_a, max_vertex_count, area_ratio); if (one_a.front ().empty ()) { @@ -772,7 +763,7 @@ CompoundRegionGeometricalBoolOperationNode::implement_bool (db::Layout *layout, one_b.push_back (std::unordered_set ()); shape_interactions computed_b; - child (1)->compute_local (layout, interactions_for_child (interactions, 1, computed_b), one_b, max_vertex_count, area_ratio); + child (1)->compute_local (cache, layout, interactions_for_child (interactions, 1, computed_b), one_b, max_vertex_count, area_ratio); copy_results (results, one_b); @@ -784,7 +775,7 @@ CompoundRegionGeometricalBoolOperationNode::implement_bool (db::Layout *layout, one_b.push_back (std::unordered_set ()); shape_interactions computed_b; - child (1)->compute_local (layout, interactions_for_child (interactions, 1, computed_b), one_b, max_vertex_count, area_ratio); + child (1)->compute_local (cache, layout, interactions_for_child (interactions, 1, computed_b), one_b, max_vertex_count, area_ratio); if (one_b.front ().empty ()) { @@ -803,44 +794,44 @@ CompoundRegionGeometricalBoolOperationNode::implement_bool (db::Layout *layout, template void -CompoundRegionGeometricalBoolOperationNode::implement_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionGeometricalBoolOperationNode::implement_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { ResultType res_a = child (0)->result_type (); ResultType res_b = child (1)->result_type (); if (res_a == Region && res_b == Region) { - implement_bool (layout, interactions, results, max_vertex_count, area_ratio); + implement_bool (cache, layout, interactions, results, max_vertex_count, area_ratio); } else if (res_a == Region && res_b == Edges) { - implement_bool (layout, interactions, results, max_vertex_count, area_ratio); + implement_bool (cache, layout, interactions, results, max_vertex_count, area_ratio); } else if (res_a == Edges && res_b == Region) { - implement_bool (layout, interactions, results, max_vertex_count, area_ratio); + implement_bool (cache, layout, interactions, results, max_vertex_count, area_ratio); } else if (res_a == Edges && res_b == Edges) { - implement_bool (layout, interactions, results, max_vertex_count, area_ratio); + implement_bool (cache, layout, interactions, results, max_vertex_count, area_ratio); } } void -CompoundRegionGeometricalBoolOperationNode::do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionGeometricalBoolOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } void -CompoundRegionGeometricalBoolOperationNode::do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionGeometricalBoolOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } void -CompoundRegionGeometricalBoolOperationNode::do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionGeometricalBoolOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } void -CompoundRegionGeometricalBoolOperationNode::do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionGeometricalBoolOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } // --------------------------------------------------------------------------------------------- @@ -909,7 +900,7 @@ namespace template template -void compound_region_generic_operation_node::implement_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +void compound_region_generic_operation_node::implement_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { generic_result_adaptor adaptor (&results); @@ -926,7 +917,7 @@ void compound_region_generic_operation_node::implement_compute_local shape_interactions self_interactions_heap; const shape_interactions &self_interactions = interactions_for_child (interactions, 0, self_interactions_heap); - self->compute_local (layout, self_interactions, self_result, max_vertex_count, area_ratio); + self->compute_local (cache, layout, self_interactions, self_result, max_vertex_count, area_ratio); db::generic_shape_iterator is (self_result.front ().begin (), self_result.front ().end ()); @@ -943,7 +934,7 @@ void compound_region_generic_operation_node::implement_compute_local shape_interactions intruder_interactions_heap; const shape_interactions &intruder_interactions = interactions_for_child (interactions, ci, intruder_interactions_heap); - intruder->compute_local (layout, intruder_interactions, intruder_result, max_vertex_count, area_ratio); + intruder->compute_local (cache, layout, intruder_interactions, intruder_result, max_vertex_count, area_ratio); intruder_results.push_back (std::unordered_set ()); intruder_results.back ().swap (intruder_result.front ()); @@ -959,14 +950,14 @@ void compound_region_generic_operation_node::implement_compute_local } // explicit instantiations -template DB_PUBLIC void compound_region_generic_operation_node::implement_compute_local (db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; -template DB_PUBLIC void compound_region_generic_operation_node::implement_compute_local (db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; -template DB_PUBLIC void compound_region_generic_operation_node::implement_compute_local (db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; -template DB_PUBLIC void compound_region_generic_operation_node::implement_compute_local (db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; -template DB_PUBLIC void compound_region_generic_operation_node::implement_compute_local (db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; -template DB_PUBLIC void compound_region_generic_operation_node::implement_compute_local (db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; -template DB_PUBLIC void compound_region_generic_operation_node::implement_compute_local (db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; -template DB_PUBLIC void compound_region_generic_operation_node::implement_compute_local (db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; +template DB_PUBLIC void compound_region_generic_operation_node::implement_compute_local (db::CompoundRegionOperationCache *, db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; +template DB_PUBLIC void compound_region_generic_operation_node::implement_compute_local (db::CompoundRegionOperationCache *, db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; +template DB_PUBLIC void compound_region_generic_operation_node::implement_compute_local (db::CompoundRegionOperationCache *, db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; +template DB_PUBLIC void compound_region_generic_operation_node::implement_compute_local (db::CompoundRegionOperationCache *, db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; +template DB_PUBLIC void compound_region_generic_operation_node::implement_compute_local (db::CompoundRegionOperationCache *, db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; +template DB_PUBLIC void compound_region_generic_operation_node::implement_compute_local (db::CompoundRegionOperationCache *, db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; +template DB_PUBLIC void compound_region_generic_operation_node::implement_compute_local (db::CompoundRegionOperationCache *, db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; +template DB_PUBLIC void compound_region_generic_operation_node::implement_compute_local (db::CompoundRegionOperationCache *, db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; // --------------------------------------------------------------------------------------------- @@ -999,7 +990,7 @@ CompoundRegionLogicalCaseSelectOperationNode::result_type () const } template -void CompoundRegionLogicalCaseSelectOperationNode::implement_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +void CompoundRegionLogicalCaseSelectOperationNode::implement_compute_local (db::CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { bool ok = false; @@ -1014,7 +1005,7 @@ void CompoundRegionLogicalCaseSelectOperationNode::implement_compute_local (db:: if (ci + 1 < children ()) { - ok = node->compute_local_bool (layout, child_interactions, max_vertex_count, area_ratio); + ok = node->compute_local_bool (cache, layout, child_interactions, max_vertex_count, area_ratio); continue; } else { @@ -1030,12 +1021,12 @@ void CompoundRegionLogicalCaseSelectOperationNode::implement_compute_local (db:: std::vector > one; one.push_back (std::unordered_set ()); - node->compute_local (layout, child_interactions, one, max_vertex_count, area_ratio); + node->compute_local (cache, layout, child_interactions, one, max_vertex_count, area_ratio); results[ci / 2].swap (one.front ()); } else { - node->compute_local (layout, child_interactions, results, max_vertex_count, area_ratio); + node->compute_local (cache, layout, child_interactions, results, max_vertex_count, area_ratio); } @@ -1047,12 +1038,12 @@ void CompoundRegionLogicalCaseSelectOperationNode::implement_compute_local (db:: } -template void CompoundRegionLogicalCaseSelectOperationNode::implement_compute_local (db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; -template void CompoundRegionLogicalCaseSelectOperationNode::implement_compute_local (db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; -template void CompoundRegionLogicalCaseSelectOperationNode::implement_compute_local (db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; -template void CompoundRegionLogicalCaseSelectOperationNode::implement_compute_local (db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; -template void CompoundRegionLogicalCaseSelectOperationNode::implement_compute_local (db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; -template void CompoundRegionLogicalCaseSelectOperationNode::implement_compute_local (db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; +template void CompoundRegionLogicalCaseSelectOperationNode::implement_compute_local (CompoundRegionOperationCache *, db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; +template void CompoundRegionLogicalCaseSelectOperationNode::implement_compute_local (CompoundRegionOperationCache *, db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; +template void CompoundRegionLogicalCaseSelectOperationNode::implement_compute_local (CompoundRegionOperationCache *, db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; +template void CompoundRegionLogicalCaseSelectOperationNode::implement_compute_local (CompoundRegionOperationCache *, db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; +template void CompoundRegionLogicalCaseSelectOperationNode::implement_compute_local (CompoundRegionOperationCache *, db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; +template void CompoundRegionLogicalCaseSelectOperationNode::implement_compute_local (CompoundRegionOperationCache *, db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; // --------------------------------------------------------------------------------------------- @@ -1154,24 +1145,24 @@ CompoundRegionJoinOperationNode::result_type () const } template -void CompoundRegionJoinOperationNode::implement_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +void CompoundRegionJoinOperationNode::implement_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { for (unsigned int ci = 0; ci < children (); ++ci) { shape_interactions computed; const shape_interactions &child_interactions = interactions_for_child (interactions, ci, computed); - child (ci)->compute_local (layout, child_interactions, results, max_vertex_count, area_ratio); + child (ci)->compute_local (cache, layout, child_interactions, results, max_vertex_count, area_ratio); } } -template void CompoundRegionJoinOperationNode::implement_compute_local (db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; -template void CompoundRegionJoinOperationNode::implement_compute_local (db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; -template void CompoundRegionJoinOperationNode::implement_compute_local (db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; -template void CompoundRegionJoinOperationNode::implement_compute_local (db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; -template void CompoundRegionJoinOperationNode::implement_compute_local (db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; -template void CompoundRegionJoinOperationNode::implement_compute_local (db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; +template void CompoundRegionJoinOperationNode::implement_compute_local (CompoundRegionOperationCache *, db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; +template void CompoundRegionJoinOperationNode::implement_compute_local (CompoundRegionOperationCache *, db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; +template void CompoundRegionJoinOperationNode::implement_compute_local (CompoundRegionOperationCache *, db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; +template void CompoundRegionJoinOperationNode::implement_compute_local (CompoundRegionOperationCache *, db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; +template void CompoundRegionJoinOperationNode::implement_compute_local (CompoundRegionOperationCache *, db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; +template void CompoundRegionJoinOperationNode::implement_compute_local (CompoundRegionOperationCache *, db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; // --------------------------------------------------------------------------------------------- @@ -1190,15 +1181,15 @@ CompoundRegionFilterOperationNode::~CompoundRegionFilterOperationNode () } void -CompoundRegionFilterOperationNode::do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionFilterOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } void -CompoundRegionFilterOperationNode::do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionFilterOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } // --------------------------------------------------------------------------------------------- @@ -1218,15 +1209,15 @@ CompoundRegionEdgeFilterOperationNode::~CompoundRegionEdgeFilterOperationNode () } void -CompoundRegionEdgeFilterOperationNode::do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionEdgeFilterOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } void -CompoundRegionEdgeFilterOperationNode::do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionEdgeFilterOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } // --------------------------------------------------------------------------------------------- @@ -1246,15 +1237,15 @@ CompoundRegionEdgePairFilterOperationNode::~CompoundRegionEdgePairFilterOperatio } void -CompoundRegionEdgePairFilterOperationNode::do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionEdgePairFilterOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } void -CompoundRegionEdgePairFilterOperationNode::do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionEdgePairFilterOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } bool @@ -1280,15 +1271,15 @@ CompoundRegionProcessingOperationNode::~CompoundRegionProcessingOperationNode () } void -CompoundRegionProcessingOperationNode::do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionProcessingOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } void -CompoundRegionProcessingOperationNode::do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionProcessingOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } void @@ -1324,15 +1315,15 @@ CompoundRegionToEdgeProcessingOperationNode::~CompoundRegionToEdgeProcessingOper } void -CompoundRegionToEdgeProcessingOperationNode::do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionToEdgeProcessingOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } void -CompoundRegionToEdgeProcessingOperationNode::do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionToEdgeProcessingOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } void @@ -1364,15 +1355,15 @@ CompoundRegionEdgeProcessingOperationNode::~CompoundRegionEdgeProcessingOperatio } void -CompoundRegionEdgeProcessingOperationNode::do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionEdgeProcessingOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } void -CompoundRegionEdgeProcessingOperationNode::do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionEdgeProcessingOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } void CompoundRegionEdgeProcessingOperationNode::processed (db::Layout *, const db::Edge &p, std::vector &res) const @@ -1397,15 +1388,15 @@ CompoundRegionEdgeToPolygonProcessingOperationNode::~CompoundRegionEdgeToPolygon } void -CompoundRegionEdgeToPolygonProcessingOperationNode::do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionEdgeToPolygonProcessingOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } void -CompoundRegionEdgeToPolygonProcessingOperationNode::do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionEdgeToPolygonProcessingOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } void @@ -1442,15 +1433,15 @@ CompoundRegionToEdgePairProcessingOperationNode::~CompoundRegionToEdgePairProces } void -CompoundRegionToEdgePairProcessingOperationNode::do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionToEdgePairProcessingOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } void -CompoundRegionToEdgePairProcessingOperationNode::do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionToEdgePairProcessingOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } void @@ -1482,15 +1473,15 @@ CompoundRegionEdgePairToPolygonProcessingOperationNode::~CompoundRegionEdgePairT } void -CompoundRegionEdgePairToPolygonProcessingOperationNode::do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionEdgePairToPolygonProcessingOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } void -CompoundRegionEdgePairToPolygonProcessingOperationNode::do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionEdgePairToPolygonProcessingOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } void @@ -1527,15 +1518,15 @@ CompoundRegionEdgePairToEdgeProcessingOperationNode::~CompoundRegionEdgePairToEd } void -CompoundRegionEdgePairToEdgeProcessingOperationNode::do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionEdgePairToEdgeProcessingOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } void -CompoundRegionEdgePairToEdgeProcessingOperationNode::do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionEdgePairToEdgeProcessingOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } // --------------------------------------------------------------------------------------------- @@ -1592,7 +1583,7 @@ CompoundRegionCheckOperationNode::computed_dist () const } void -CompoundRegionCheckOperationNode::do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionCheckOperationNode::do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { db::check_local_operation op (m_check, m_different_polygons, m_has_other, m_is_other_merged, m_options); @@ -1608,7 +1599,7 @@ CompoundRegionCheckOperationNode::do_compute_local (db::Layout *layout, const sh } void -CompoundRegionCheckOperationNode::do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionCheckOperationNode::do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { db::check_local_operation op (m_check, m_different_polygons, m_has_other, m_is_other_merged, m_options); diff --git a/src/db/db/dbCompoundOperation.h b/src/db/db/dbCompoundOperation.h index c7d285465..178bef4dc 100644 --- a/src/db/db/dbCompoundOperation.h +++ b/src/db/db/dbCompoundOperation.h @@ -48,6 +48,50 @@ inline db::Region *subject_regionptr () { return (db::Region *) 0; } inline db::Region *foreign_regionptr () { return (db::Region *) 1; } inline bool is_subject_regionptr (const db::Region *ptr) { return ptr == subject_regionptr () || ptr == foreign_regionptr (); } +class CompoundRegionOperationNode; + +/** + * @brief A per-node cache for results of the compound operations + * + * This cache is important to avoid duplicate evaluation of the same node in + * a diamond-graph structure of nodes. + */ +class DB_PUBLIC CompoundRegionOperationCache +{ +public: + template + std::pair > *> get (const CompoundRegionOperationNode *node) + { + bool valid = false; + std::vector > *cache = 0; + get_cache (cache, valid, node); + return std::make_pair (valid, cache); + } + +private: + std::map > > m_cache_polyref; + std::map > > m_cache_poly; + std::map > > m_cache_edge; + std::map > > m_cache_edge_pair; + + template + void get_cache_generic (std::map > > &caches, std::vector > *&cache_ptr, bool &valid, const CompoundRegionOperationNode *node) + { + typename std::map > >::iterator c = caches.find (node); + if (c != caches.end ()) { + valid = true; + cache_ptr = &c->second; + } else { + cache_ptr = &caches [node]; + } + } + + void get_cache (std::vector > *&cache_ptr, bool &valid, const CompoundRegionOperationNode *node) { get_cache_generic (m_cache_polyref, cache_ptr, valid, node); } + void get_cache (std::vector > *&cache_ptr, bool &valid, const CompoundRegionOperationNode *node) { get_cache_generic (m_cache_poly, cache_ptr, valid, node); } + void get_cache (std::vector > *&cache_ptr, bool &valid, const CompoundRegionOperationNode *node) { get_cache_generic (m_cache_edge, cache_ptr, valid, node); } + void get_cache (std::vector > *&cache_ptr, bool &valid, const CompoundRegionOperationNode *node) { get_cache_generic (m_cache_edge_pair, cache_ptr, valid, node); } +}; + /** * @brief A node of the compound operation tree * @@ -147,62 +191,62 @@ public: */ virtual bool wants_variants () const { return false; } - void compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + void compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } - void compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + void compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; - void compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + void compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } - void compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + void compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } - void compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + void compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } - void compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + void compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; - void compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + void compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } - void compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + void compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } template - bool compute_local_bool (db::Layout *layout, const shape_interactions &interactions, size_t max_vertex_count, double area_ratio) const + bool compute_local_bool (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, size_t max_vertex_count, double area_ratio) const { if (result_type () == Region) { std::vector > res; res.push_back (std::unordered_set ()); - compute_local (layout, interactions, res, max_vertex_count, area_ratio); + compute_local (cache, layout, interactions, res, max_vertex_count, area_ratio); return ! res.front ().empty (); } else if (result_type () == Edges) { std::vector > res; res.push_back (std::unordered_set ()); - compute_local (layout, interactions, res, max_vertex_count, area_ratio); + compute_local (cache, layout, interactions, res, max_vertex_count, area_ratio); return ! res.front ().empty (); } else if (result_type () == EdgePairs) { std::vector > res; res.push_back (std::unordered_set ()); - compute_local (layout, interactions, res, max_vertex_count, area_ratio); + compute_local (cache, layout, interactions, res, max_vertex_count, area_ratio); return ! res.front ().empty (); } else { @@ -210,31 +254,14 @@ public: } } - virtual void invalidate_cache () const - { - m_cache_polyref.clear (); - m_cache_polyref_valid = false; - m_cache_poly.clear (); - m_cache_poly_valid = false; - m_cache_edge.clear (); - m_cache_edge_valid = false; - m_cache_edge_pair.clear (); - m_cache_edge_pair_valid = false; - } - - void setup_cache () const - { - invalidate_cache (); - } - protected: // the different computation slots - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } virtual db::Coord computed_dist () const = 0; @@ -243,44 +270,28 @@ protected: private: std::string m_description; db::Coord m_dist; - mutable std::vector > m_cache_polyref; - mutable bool m_cache_polyref_valid; - mutable std::vector > m_cache_poly; - mutable bool m_cache_poly_valid; - mutable std::vector > m_cache_edge; - mutable bool m_cache_edge_valid; - mutable std::vector > m_cache_edge_pair; - mutable bool m_cache_edge_pair_valid; - - void get_cache (std::vector > *&cache_ptr, bool *&valid) const { cache_ptr = &m_cache_polyref; valid = &m_cache_polyref_valid; } - void get_cache (std::vector > *&cache_ptr, bool *&valid) const { cache_ptr = &m_cache_poly; valid = &m_cache_poly_valid; } - void get_cache (std::vector > *&cache_ptr, bool *&valid) const { cache_ptr = &m_cache_edge; valid = &m_cache_edge_valid; } - void get_cache (std::vector > *&cache_ptr, bool *&valid) const { cache_ptr = &m_cache_edge_pair; valid = &m_cache_edge_pair_valid; } template - void implement_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + void implement_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { // TODO: confine caching to those nodes which need it. - std::vector > *cache = 0; - bool *valid = 0; - get_cache (cache, valid); + std::pair > *> cp = cache->get (this); - if (! *valid) { + if (! cp.first) { std::vector > uncached_results; uncached_results.resize (results.size ()); - do_compute_local (layout, interactions, uncached_results, max_vertex_count, area_ratio); + do_compute_local (cache, layout, interactions, uncached_results, max_vertex_count, area_ratio); - cache->swap (uncached_results); - *valid = true; + cp.second->swap (uncached_results); } - tl_assert (results.size () == cache->size ()); + tl_assert (results.size () == cp.second->size ()); for (size_t r = 0; r < results.size (); ++r) { - results[r].insert ((*cache)[r].begin (), (*cache)[r].end ()); + results[r].insert ((*cp.second)[r].begin (), (*cp.second)[r].end ()); } } }; @@ -349,14 +360,14 @@ public: virtual db::Coord computed_dist () const { return 0; } virtual ResultType result_type () const { return Region; } - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; // non-implemented - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } }; class DB_PUBLIC CompoundRegionOperationForeignNode @@ -370,14 +381,14 @@ public: virtual db::Coord computed_dist () const { return 0; } virtual ResultType result_type () const { return Region; } - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; // non-implemented - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } }; class DB_PUBLIC CompoundRegionOperationSecondaryNode @@ -391,14 +402,14 @@ public: virtual db::Coord computed_dist () const { return 0; } virtual ResultType result_type () const { return Region; } - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; // non-implemented - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } private: db::Region *mp_input; @@ -445,8 +456,6 @@ public: virtual const TransformationReducer *vars () const; virtual bool wants_variants () const; - virtual void invalidate_cache () const; - protected: bool needs_reduce_interactions (unsigned int child_index) const { @@ -523,28 +532,28 @@ public: virtual ResultType result_type () const; // the different computation slots - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } // non-implemented - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } private: LogicalOp m_op; bool m_invert; template - void implement_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + void implement_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; }; @@ -564,34 +573,34 @@ public: } // the different computation slots - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } private: @@ -599,12 +608,12 @@ private: bool m_invert; template - void implement_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + void implement_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { std::vector > one; one.push_back (std::unordered_set ()); - child (0)->compute_local (layout, interactions, one, max_vertex_count, area_ratio); + child (0)->compute_local (cache, layout, interactions, one, max_vertex_count, area_ratio); if ((one.front ().size () >= m_min_count && one.front ().size () < m_max_count) != m_invert) { results.front ().insert (one.front ().begin (), one.front ().end ()); @@ -628,22 +637,22 @@ public: virtual db::Coord computed_dist () const; // the different computation slots - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; // non-implemented - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } private: GeometricalOp m_op; template - void implement_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + void implement_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; template - void implement_bool (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + void implement_bool (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; }; template @@ -716,7 +725,7 @@ protected: } template - void implement_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + void implement_compute_local (db::CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; private: const db::local_operation *m_op; @@ -736,21 +745,21 @@ public: std::string generated_description () const; - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } // non-implemented - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } private: typedef db::interacting_local_operation op_type; @@ -765,21 +774,21 @@ public: std::string generated_description () const; - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } // non-implemented - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } private: db::interacting_with_edge_local_operation m_op; @@ -794,21 +803,21 @@ public: std::string generated_description () const; - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } // non-implemented - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } private: db::pull_local_operation m_op; @@ -822,21 +831,21 @@ public: std::string generated_description () const; - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } // non-implemented - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } private: db::pull_with_edge_local_operation m_op; @@ -861,39 +870,39 @@ public: virtual ResultType result_type () const; // the different computation slots - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } private: template - void implement_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + void implement_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; }; /** @@ -918,39 +927,39 @@ public: virtual ResultType result_type () const; // the different computation slots - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } private: template - void implement_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + void implement_compute_local (db::CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; bool m_multi_layer; }; @@ -966,14 +975,14 @@ public: // specifies the result type virtual ResultType result_type () const { return Region; } - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; // non-implemented - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } virtual const TransformationReducer *vars () const { return mp_filter->vars (); } virtual bool wants_variants () const { return mp_filter->wants_variants (); } @@ -984,12 +993,12 @@ private: bool m_sum_of_set; template - void implement_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + void implement_compute_local (db::CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { std::vector > one; one.push_back (std::unordered_set ()); - child (0)->compute_local (layout, interactions, one, max_vertex_count, area_ratio); + child (0)->compute_local (cache, layout, interactions, one, max_vertex_count, area_ratio); if (m_sum_of_set) { if (mp_filter->selected_set (one.front ())) { @@ -1015,14 +1024,14 @@ public: // specifies the result type virtual ResultType result_type () const { return Edges; } - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; // non-implemented - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } virtual const TransformationReducer *vars () const { return mp_filter->vars (); } virtual bool wants_variants () const { return mp_filter->wants_variants (); } @@ -1033,12 +1042,12 @@ private: bool m_sum_of; template - void implement_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + void implement_compute_local (db::CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { std::vector > one; one.push_back (std::unordered_set ()); - child (0)->compute_local (layout, interactions, one, max_vertex_count, area_ratio); + child (0)->compute_local (cache, layout, interactions, one, max_vertex_count, area_ratio); if (m_sum_of) { if (mp_filter->selected (one.front ())) { @@ -1064,14 +1073,14 @@ public: // specifies the result type virtual ResultType result_type () const { return EdgePairs; } - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; // non-implemented - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } virtual const TransformationReducer *vars () const { return mp_filter->vars (); } virtual bool wants_variants () const { return mp_filter->wants_variants (); } @@ -1083,12 +1092,12 @@ private: bool is_selected (const db::EdgePair &p) const; template - void implement_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + void implement_compute_local (db::CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { std::vector > one; one.push_back (std::unordered_set ()); - child (0)->compute_local (layout, interactions, one, max_vertex_count, area_ratio); + child (0)->compute_local (cache, layout, interactions, one, max_vertex_count, area_ratio); for (typename std::unordered_set::const_iterator p = one.front ().begin (); p != one.front ().end (); ++p) { if (is_selected (*p)) { @@ -1113,14 +1122,14 @@ public: virtual const TransformationReducer *vars () const { return mp_proc->vars (); } virtual bool wants_variants () const { return mp_proc->wants_variants (); } - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; // non-implemented - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } private: PolygonProcessorBase *mp_proc; bool m_owns_proc; @@ -1130,12 +1139,12 @@ private: void processed (db::Layout *layout, const db::PolygonRef &p, std::vector &res) const; template - void implement_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + void implement_compute_local (db::CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { std::vector > one; one.push_back (std::unordered_set ()); - child (0)->compute_local (layout, interactions, one, max_vertex_count, area_ratio); + child (0)->compute_local (cache, layout, interactions, one, max_vertex_count, area_ratio); std::vector res; for (typename std::unordered_set::const_iterator p = one.front ().begin (); p != one.front ().end (); ++p) { @@ -1185,33 +1194,33 @@ public: return std::string ("merged") + CompoundRegionMultiInputOperationNode::generated_description (); } - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - implement_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); } // non-implemented - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } private: bool m_min_coherence; unsigned int m_min_wc; template - void implement_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + void implement_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { std::vector > one; one.push_back (std::unordered_set ()); - child (0)->compute_local (layout, interactions, one, max_vertex_count, area_ratio); + child (0)->compute_local (cache, layout, interactions, one, max_vertex_count, area_ratio); db::EdgeProcessor ep; @@ -1250,14 +1259,14 @@ public: virtual const TransformationReducer *vars () const { return mp_proc->vars (); } virtual bool wants_variants () const { return mp_proc->wants_variants (); } - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; // non-implemented - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } private: EdgeToPolygonProcessorBase *mp_proc; @@ -1267,12 +1276,12 @@ private: void processed (db::Layout *layout, const db::Edge &p, std::vector &res) const; template - void implement_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + void implement_compute_local (db::CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { std::vector > one; one.push_back (std::unordered_set ()); - child (0)->compute_local (layout, interactions, one, max_vertex_count, area_ratio); + child (0)->compute_local (cache, layout, interactions, one, max_vertex_count, area_ratio); std::vector res; for (typename std::unordered_set::const_iterator p = one.front ().begin (); p != one.front ().end (); ++p) { @@ -1296,14 +1305,14 @@ public: virtual const TransformationReducer *vars () const { return mp_proc->vars (); } virtual bool wants_variants () const { return mp_proc->wants_variants (); } - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; // non-implemented - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } private: EdgeProcessorBase *mp_proc; @@ -1312,12 +1321,12 @@ private: void processed (db::Layout *, const db::Edge &p, std::vector &res) const; template - void implement_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + void implement_compute_local (db::CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { std::vector > one; one.push_back (std::unordered_set ()); - child (0)->compute_local (layout, interactions, one, max_vertex_count, area_ratio); + child (0)->compute_local (cache, layout, interactions, one, max_vertex_count, area_ratio); std::vector res; for (typename std::unordered_set::const_iterator p = one.front ().begin (); p != one.front ().end (); ++p) { @@ -1341,14 +1350,14 @@ public: virtual const TransformationReducer *vars () const { return mp_proc->vars (); } virtual bool wants_variants () const { return mp_proc->wants_variants (); } - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; // non-implemented - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } private: EdgePairToPolygonProcessorBase *mp_proc; @@ -1358,12 +1367,12 @@ private: void processed (db::Layout *layout, const db::EdgePair &p, std::vector &res) const; template - void implement_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + void implement_compute_local (db::CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { std::vector > one; one.push_back (std::unordered_set ()); - child (0)->compute_local (layout, interactions, one, max_vertex_count, area_ratio); + child (0)->compute_local (cache, layout, interactions, one, max_vertex_count, area_ratio); std::vector res; for (typename std::unordered_set::const_iterator p = one.front ().begin (); p != one.front ().end (); ++p) { @@ -1387,26 +1396,26 @@ public: virtual const TransformationReducer *vars () const { return mp_proc->vars (); } virtual bool wants_variants () const { return mp_proc->wants_variants (); } - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; // non-implemented - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } private: EdgePairToEdgeProcessorBase *mp_proc; bool m_owns_proc; template - void implement_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + void implement_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { std::vector > one; one.push_back (std::unordered_set ()); - child (0)->compute_local (layout, interactions, one, max_vertex_count, area_ratio); + child (0)->compute_local (cache, layout, interactions, one, max_vertex_count, area_ratio); std::vector res; for (typename std::unordered_set::const_iterator p = one.front ().begin (); p != one.front ().end (); ++p) { @@ -1430,14 +1439,14 @@ public: virtual const TransformationReducer *vars () const { return mp_proc->vars (); } virtual bool wants_variants () const { return mp_proc->wants_variants (); } - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; // non-implemented - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } private: PolygonToEdgeProcessorBase *mp_proc; @@ -1447,12 +1456,12 @@ private: void processed (db::Layout *layout, const db::PolygonRef &p, std::vector &res) const; template - void implement_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + void implement_compute_local (db::CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { std::vector > one; one.push_back (std::unordered_set ()); - child (0)->compute_local (layout, interactions, one, max_vertex_count, area_ratio); + child (0)->compute_local (cache, layout, interactions, one, max_vertex_count, area_ratio); std::vector res; for (typename std::unordered_set::const_iterator p = one.front ().begin (); p != one.front ().end (); ++p) { @@ -1486,14 +1495,14 @@ public: virtual const TransformationReducer *vars () const { return mp_proc->vars (); } virtual bool wants_variants () const { return mp_proc->wants_variants (); } - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; // non-implemented - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } private: PolygonToEdgePairProcessorBase *mp_proc; @@ -1503,12 +1512,12 @@ private: void processed (db::Layout *layout, const db::PolygonRef &p, std::vector &res) const; template - void implement_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + void implement_compute_local (db::CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { std::vector > one; one.push_back (std::unordered_set ()); - child (0)->compute_local (layout, interactions, one, max_vertex_count, area_ratio); + child (0)->compute_local (cache, layout, interactions, one, max_vertex_count, area_ratio); std::vector res; for (typename std::unordered_set::const_iterator p = one.front ().begin (); p != one.front ().end (); ++p) { @@ -1550,14 +1559,14 @@ public: virtual OnEmptyIntruderHint on_empty_intruder_hint () const; virtual db::Coord computed_dist () const; - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; // non-implemented - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } private: db::EdgeRelationFilter m_check; @@ -1592,8 +1601,8 @@ public: protected: virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const { - mp_node->setup_cache (); - mp_node->compute_local (layout, interactions, results, max_vertex_count, area_ratio); + CompoundRegionOperationCache cache; + mp_node->compute_local (&cache, layout, interactions, results, max_vertex_count, area_ratio); } virtual db::Coord dist () const { return mp_node->dist (); } diff --git a/src/db/db/dbPolygonTools.cc b/src/db/db/dbPolygonTools.cc index 31d4b079a..dc252fc9b 100644 --- a/src/db/db/dbPolygonTools.cc +++ b/src/db/db/dbPolygonTools.cc @@ -2140,7 +2140,7 @@ ms_extraction (db::EdgeProcessor &ep, bool resolve_holes) } static db::Polygon -do_minkowsky_sum (const db::Polygon &a, const db::Edge &b, bool resolve_holes) +do_minkowski_sum (const db::Polygon &a, const db::Edge &b, bool resolve_holes) { db::EdgeProcessor ep; db::ms_production (a, b.p1 (), b.p2 (), ep); @@ -2148,17 +2148,17 @@ do_minkowsky_sum (const db::Polygon &a, const db::Edge &b, bool resolve_holes) } db::Polygon -minkowsky_sum (const db::Polygon &a, const db::Edge &b, bool rh) +minkowski_sum (const db::Polygon &a, const db::Edge &b, bool rh) { if (a.holes () > 0) { - return do_minkowsky_sum (db::resolve_holes (a), b, rh); + return do_minkowski_sum (db::resolve_holes (a), b, rh); } else { - return do_minkowsky_sum (a, b, rh); + return do_minkowski_sum (a, b, rh); } } static db::Polygon -do_minkowsky_sum (const db::Polygon &a, const db::Polygon &b, bool resolve_holes) +do_minkowski_sum (const db::Polygon &a, const db::Polygon &b, bool resolve_holes) { tl_assert (a.begin_hull () != a.end_hull ()); @@ -2174,33 +2174,33 @@ do_minkowsky_sum (const db::Polygon &a, const db::Polygon &b, bool resolve_holes } db::Polygon -minkowsky_sum (const db::Polygon &a, const db::Polygon &b, bool rh) +minkowski_sum (const db::Polygon &a, const db::Polygon &b, bool rh) { if (a.holes () > 0) { - return do_minkowsky_sum (db::resolve_holes (a), b, rh); + return do_minkowski_sum (db::resolve_holes (a), b, rh); } else { - return do_minkowsky_sum (a, b, rh); + return do_minkowski_sum (a, b, rh); } } static db::Polygon -do_minkowsky_sum (const db::Polygon &a, const db::Box &b, bool resolve_holes) +do_minkowski_sum (const db::Polygon &a, const db::Box &b, bool resolve_holes) { - return minkowsky_sum (a, db::Polygon (b), resolve_holes); + return minkowski_sum (a, db::Polygon (b), resolve_holes); } db::Polygon -minkowsky_sum (const db::Polygon &a, const db::Box &b, bool rh) +minkowski_sum (const db::Polygon &a, const db::Box &b, bool rh) { if (a.holes () > 0) { - return do_minkowsky_sum (db::resolve_holes (a), b, rh); + return do_minkowski_sum (db::resolve_holes (a), b, rh); } else { - return do_minkowsky_sum (a, b, rh); + return do_minkowski_sum (a, b, rh); } } static db::Polygon -do_minkowsky_sum (const db::Polygon &a, const std::vector &c, bool resolve_holes) +do_minkowski_sum (const db::Polygon &a, const std::vector &c, bool resolve_holes) { db::EdgeProcessor ep; for (size_t i = 1; i < c.size (); ++i) { @@ -2211,12 +2211,12 @@ do_minkowsky_sum (const db::Polygon &a, const std::vector &c, bool re } db::Polygon -minkowsky_sum (const db::Polygon &a, const std::vector &c, bool rh) +minkowski_sum (const db::Polygon &a, const std::vector &c, bool rh) { if (a.holes () > 0) { - return do_minkowsky_sum (db::resolve_holes (a), c, rh); + return do_minkowski_sum (db::resolve_holes (a), c, rh); } else { - return do_minkowsky_sum (a, c, rh); + return do_minkowski_sum (a, c, rh); } } diff --git a/src/db/db/dbPolygonTools.h b/src/db/db/dbPolygonTools.h index 562fc61dc..c90691ba4 100644 --- a/src/db/db/dbPolygonTools.h +++ b/src/db/db/dbPolygonTools.h @@ -651,22 +651,22 @@ bool DB_PUBLIC rasterize (const db::Polygon &polygon, db::AreaMap &am); /** * @brief Minkowski sum of an edge and a polygon */ -db::Polygon DB_PUBLIC minkowsky_sum (const db::Polygon &a, const db::Edge &b, bool resolve_holes = false); +db::Polygon DB_PUBLIC minkowski_sum (const db::Polygon &a, const db::Edge &b, bool resolve_holes = false); /** * @brief Minkowski sum of a polygon and a polygon */ -db::Polygon DB_PUBLIC minkowsky_sum (const db::Polygon &a, const db::Polygon &b, bool resolve_holes = false); +db::Polygon DB_PUBLIC minkowski_sum (const db::Polygon &a, const db::Polygon &b, bool resolve_holes = false); /** * @brief Minkowski sum of a polygon and a box */ -db::Polygon DB_PUBLIC minkowsky_sum (const db::Polygon &a, const db::Box &b, bool resolve_holes = false); +db::Polygon DB_PUBLIC minkowski_sum (const db::Polygon &a, const db::Box &b, bool resolve_holes = false); /** * @brief Minkowski sum of a polygon and a contour */ -db::Polygon DB_PUBLIC minkowsky_sum (const db::Polygon &a, const std::vector &c, bool resolve_holes = false); +db::Polygon DB_PUBLIC minkowski_sum (const db::Polygon &a, const std::vector &c, bool resolve_holes = false); /** * @brief Resolve holes diff --git a/src/db/db/dbRegionProcessors.h b/src/db/db/dbRegionProcessors.h index 4ba76d63c..8cf502555 100644 --- a/src/db/db/dbRegionProcessors.h +++ b/src/db/db/dbRegionProcessors.h @@ -410,11 +410,11 @@ private: * The object can be Edge, Polygon, Box and std::vector */ template -class DB_PUBLIC_TEMPLATE minkowsky_sum_computation +class DB_PUBLIC_TEMPLATE minkowski_sum_computation : public db::PolygonProcessorBase { public: - minkowsky_sum_computation (const K &q) + minkowski_sum_computation (const K &q) : m_q (q) { // .. nothing yet .. @@ -422,7 +422,7 @@ public: void process (const db::Polygon &poly, std::vector &result) const { - result.push_back (db::minkowsky_sum (poly, m_q, false)); + result.push_back (db::minkowski_sum (poly, m_q, false)); } // TODO: could be less if the object is symmetric diff --git a/src/db/db/gsiDeclDbCompoundOperation.cc b/src/db/db/gsiDeclDbCompoundOperation.cc index 419470747..633a74d48 100644 --- a/src/db/db/gsiDeclDbCompoundOperation.cc +++ b/src/db/db/gsiDeclDbCompoundOperation.cc @@ -289,28 +289,28 @@ static db::CompoundRegionOperationNode *new_merged (db::CompoundRegionOperationN return new db::CompoundRegionMergeOperationNode (min_coherence, min_wc, input); } -static db::CompoundRegionOperationNode *new_minkowsky_sum_node1 (db::CompoundRegionOperationNode *input, const db::Edge &e) +static db::CompoundRegionOperationNode *new_minkowski_sum_node1 (db::CompoundRegionOperationNode *input, const db::Edge &e) { check_non_null (input, "input"); - return new db::CompoundRegionProcessingOperationNode (new db::minkowsky_sum_computation (e), input, true /*processor is owned*/); + return new db::CompoundRegionProcessingOperationNode (new db::minkowski_sum_computation (e), input, true /*processor is owned*/); } -static db::CompoundRegionOperationNode *new_minkowsky_sum_node2 (db::CompoundRegionOperationNode *input, const db::Polygon &p) +static db::CompoundRegionOperationNode *new_minkowski_sum_node2 (db::CompoundRegionOperationNode *input, const db::Polygon &p) { check_non_null (input, "input"); - return new db::CompoundRegionProcessingOperationNode (new db::minkowsky_sum_computation (p), input, true /*processor is owned*/); + return new db::CompoundRegionProcessingOperationNode (new db::minkowski_sum_computation (p), input, true /*processor is owned*/); } -static db::CompoundRegionOperationNode *new_minkowsky_sum_node3 (db::CompoundRegionOperationNode *input, const db::Box &p) +static db::CompoundRegionOperationNode *new_minkowski_sum_node3 (db::CompoundRegionOperationNode *input, const db::Box &p) { check_non_null (input, "input"); - return new db::CompoundRegionProcessingOperationNode (new db::minkowsky_sum_computation (p), input, true /*processor is owned*/); + return new db::CompoundRegionProcessingOperationNode (new db::minkowski_sum_computation (p), input, true /*processor is owned*/); } -static db::CompoundRegionOperationNode *new_minkowsky_sum_node4 (db::CompoundRegionOperationNode *input, const std::vector &p) +static db::CompoundRegionOperationNode *new_minkowski_sum_node4 (db::CompoundRegionOperationNode *input, const std::vector &p) { check_non_null (input, "input"); - return new db::CompoundRegionProcessingOperationNode (new db::minkowsky_sum_computation > (p), input, true /*processor is owned*/); + return new db::CompoundRegionProcessingOperationNode (new db::minkowski_sum_computation > (p), input, true /*processor is owned*/); } static db::CompoundRegionOperationNode *new_edges (db::CompoundRegionOperationNode *input) @@ -640,16 +640,16 @@ Class decl_CompoundRegionOperationNode ("db", " gsi::constructor ("new_merged", &new_merged, gsi::arg ("input"), gsi::arg ("min_coherence", false), gsi::arg ("min_wc", 0), "@brief Creates a node providing merged input polygons.\n" ) + - gsi::constructor ("new_minkowsky_sum", &new_minkowsky_sum_node1, gsi::arg ("input"), gsi::arg ("e"), + gsi::constructor ("new_minkowski_sum|#new_minkowsky_sum", &new_minkowski_sum_node1, gsi::arg ("input"), gsi::arg ("e"), "@brief Creates a node providing a Minkowski sum with an edge.\n" ) + - gsi::constructor ("new_minkowsky_sum", &new_minkowsky_sum_node2, gsi::arg ("input"), gsi::arg ("p"), + gsi::constructor ("new_minkowski_sum|#new_minkowsky_sum", &new_minkowski_sum_node2, gsi::arg ("input"), gsi::arg ("p"), "@brief Creates a node providing a Minkowski sum with a polygon.\n" ) + - gsi::constructor ("new_minkowsky_sum", &new_minkowsky_sum_node3, gsi::arg ("input"), gsi::arg ("p"), + gsi::constructor ("new_minkowski_sum|#new_minkowsky_sum", &new_minkowski_sum_node3, gsi::arg ("input"), gsi::arg ("p"), "@brief Creates a node providing a Minkowski sum with a box.\n" ) + - gsi::constructor ("new_minkowsky_sum", &new_minkowsky_sum_node4, gsi::arg ("input"), gsi::arg ("p"), + gsi::constructor ("new_minkowski_sum|#new_minkowsky_sum", &new_minkowski_sum_node4, gsi::arg ("input"), gsi::arg ("p"), "@brief Creates a node providing a Minkowski sum with a point sequence forming a contour.\n" ) + gsi::constructor ("new_width_check", &new_width_check, gsi::arg ("d"), gsi::arg ("whole_edges", false), gsi::arg ("metrics", db::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), diff --git a/src/db/db/gsiDeclDbPolygon.cc b/src/db/db/gsiDeclDbPolygon.cc index fbfb9a415..04c8da938 100644 --- a/src/db/db/gsiDeclDbPolygon.cc +++ b/src/db/db/gsiDeclDbPolygon.cc @@ -567,34 +567,34 @@ struct simple_polygon_defs } }; -static db::Polygon sp_minkowsky_sum_pe (const db::SimplePolygon *sp, const db::Edge &e, bool rh) +static db::Polygon sp_minkowski_sum_pe (const db::SimplePolygon *sp, const db::Edge &e, bool rh) { db::Polygon p; p.assign_hull (sp->begin_hull (), sp->end_hull (), false); - return db::minkowsky_sum (p, e, rh); + return db::minkowski_sum (p, e, rh); } -static db::Polygon sp_minkowsky_sum_pp (const db::SimplePolygon *sp, const db::SimplePolygon &spp, bool rh) +static db::Polygon sp_minkowski_sum_pp (const db::SimplePolygon *sp, const db::SimplePolygon &spp, bool rh) { db::Polygon p; p.assign_hull (sp->begin_hull (), sp->end_hull (), false); db::Polygon pp; pp.assign_hull (spp.begin_hull (), spp.end_hull (), false); - return db::minkowsky_sum (p, pp, rh); + return db::minkowski_sum (p, pp, rh); } -static db::Polygon sp_minkowsky_sum_pb (const db::SimplePolygon *sp, const db::Box &b, bool rh) +static db::Polygon sp_minkowski_sum_pb (const db::SimplePolygon *sp, const db::Box &b, bool rh) { db::Polygon p; p.assign_hull (sp->begin_hull (), sp->end_hull (), false); - return db::minkowsky_sum (p, b, rh); + return db::minkowski_sum (p, b, rh); } -static db::Polygon sp_minkowsky_sum_pc (const db::SimplePolygon *sp, const std::vector &c, bool rh) +static db::Polygon sp_minkowski_sum_pc (const db::SimplePolygon *sp, const std::vector &c, bool rh) { db::Polygon p; p.assign_hull (sp->begin_hull (), sp->end_hull (), false); - return db::minkowsky_sum (p, c, rh); + return db::minkowski_sum (p, c, rh); } static db::DSimplePolygon *transform_cplx_sp (db::DSimplePolygon *p, const db::DCplxTrans &t) @@ -638,7 +638,7 @@ Class decl_SimplePolygon ("db", "SimplePolygon", "\n" "This method has been introduced in version 0.25." ) + - method_ext ("minkowsky_sum", &sp_minkowsky_sum_pe, gsi::arg ("e"), gsi::arg ("resolve_holes"), + method_ext ("minkowski_sum|#minkowsky_sum", &sp_minkowski_sum_pe, gsi::arg ("e"), gsi::arg ("resolve_holes"), "@brief Computes the Minkowski sum of a polygon and an edge\n" "\n" "@param e The edge.\n" @@ -648,7 +648,7 @@ Class decl_SimplePolygon ("db", "SimplePolygon", "\n" "This method was introduced in version 0.22.\n" ) + - method_ext ("minkowsky_sum", &sp_minkowsky_sum_pp, gsi::arg ("p"), gsi::arg ("resolve_holes"), + method_ext ("minkowski_sum|#minkowsky_sum", &sp_minkowski_sum_pp, gsi::arg ("p"), gsi::arg ("resolve_holes"), "@brief Computes the Minkowski sum of a polygon and a polygon\n" "\n" "@param p The other polygon.\n" @@ -658,7 +658,7 @@ Class decl_SimplePolygon ("db", "SimplePolygon", "\n" "This method was introduced in version 0.22.\n" ) + - method_ext ("minkowsky_sum", &sp_minkowsky_sum_pb, gsi::arg ("b"), gsi::arg ("resolve_holes"), + method_ext ("minkowski_sum|#minkowsky_sum", &sp_minkowski_sum_pb, gsi::arg ("b"), gsi::arg ("resolve_holes"), "@brief Computes the Minkowski sum of a polygon and a box\n" "\n" "@param b The box.\n" @@ -668,7 +668,7 @@ Class decl_SimplePolygon ("db", "SimplePolygon", "\n" "This method was introduced in version 0.22.\n" ) + - method_ext ("minkowsky_sum", &sp_minkowsky_sum_pc, gsi::arg ("c"), gsi::arg ("resolve_holes"), + method_ext ("minkowski_sum|#minkowsky_sum", &sp_minkowski_sum_pc, gsi::arg ("c"), gsi::arg ("resolve_holes"), "@brief Computes the Minkowski sum of a polygon and a contour of points (a trace)\n" "\n" "@param c The contour (a series of points forming the trace).\n" @@ -1607,24 +1607,24 @@ static db::Polygon smooth (const db::Polygon *p, db::Coord d, bool keep_hv) return db::smooth (*p, d, keep_hv); } -static db::Polygon minkowsky_sum_pe (const db::Polygon *p, const db::Edge &e, bool rh) +static db::Polygon minkowski_sum_pe (const db::Polygon *p, const db::Edge &e, bool rh) { - return db::minkowsky_sum (*p, e, rh); + return db::minkowski_sum (*p, e, rh); } -static db::Polygon minkowsky_sum_pp (const db::Polygon *p, const db::Polygon &pp, bool rh) +static db::Polygon minkowski_sum_pp (const db::Polygon *p, const db::Polygon &pp, bool rh) { - return db::minkowsky_sum (*p, pp, rh); + return db::minkowski_sum (*p, pp, rh); } -static db::Polygon minkowsky_sum_pb (const db::Polygon *p, const db::Box &b, bool rh) +static db::Polygon minkowski_sum_pb (const db::Polygon *p, const db::Box &b, bool rh) { - return db::minkowsky_sum (*p, b, rh); + return db::minkowski_sum (*p, b, rh); } -static db::Polygon minkowsky_sum_pc (const db::Polygon *p, const std::vector &c, bool rh) +static db::Polygon minkowski_sum_pc (const db::Polygon *p, const std::vector &c, bool rh) { - return db::minkowsky_sum (*p, c, rh); + return db::minkowski_sum (*p, c, rh); } static db::Polygon *polygon_from_dpolygon (const db::DPolygon &p) @@ -1800,7 +1800,7 @@ Class decl_Polygon ("db", "Polygon", "\n" "This method was introduced in version 0.23. The 'keep_hv' optional parameter was added in version 0.27.\n" ) + - method_ext ("minkowsky_sum", &minkowsky_sum_pe, gsi::arg ("e"), gsi::arg ("resolve_holes"), + method_ext ("minkowski_sum|#minkowsky_sum", &minkowski_sum_pe, gsi::arg ("e"), gsi::arg ("resolve_holes"), "@brief Computes the Minkowski sum of the polygon and an edge\n" "\n" "@param e The edge.\n" @@ -1814,7 +1814,7 @@ Class decl_Polygon ("db", "Polygon", "\n" "This method was introduced in version 0.22.\n" ) + - method_ext ("minkowsky_sum", &minkowsky_sum_pp, gsi::arg ("b"), gsi::arg ("resolve_holes"), + method_ext ("minkowski_sum|#minkowsky_sum", &minkowski_sum_pp, gsi::arg ("b"), gsi::arg ("resolve_holes"), "@brief Computes the Minkowski sum of the polygon and a polygon\n" "\n" "@param p The first argument.\n" @@ -1824,7 +1824,7 @@ Class decl_Polygon ("db", "Polygon", "\n" "This method was introduced in version 0.22.\n" ) + - method_ext ("minkowsky_sum", &minkowsky_sum_pb, gsi::arg ("b"), gsi::arg ("resolve_holes"), + method_ext ("minkowski_sum|#minkowsky_sum", &minkowski_sum_pb, gsi::arg ("b"), gsi::arg ("resolve_holes"), "@brief Computes the Minkowski sum of the polygon and a box\n" "\n" "@param b The box.\n" @@ -1834,7 +1834,7 @@ Class decl_Polygon ("db", "Polygon", "\n" "This method was introduced in version 0.22.\n" ) + - method_ext ("minkowsky_sum", &minkowsky_sum_pc, gsi::arg ("b"), gsi::arg ("resolve_holes"), + method_ext ("minkowski_sum|#minkowsky_sum", &minkowski_sum_pc, gsi::arg ("b"), gsi::arg ("resolve_holes"), "@brief Computes the Minkowski sum of the polygon and a contour of points (a trace)\n" "\n" "@param b The contour (a series of points forming the trace).\n" diff --git a/src/db/db/gsiDeclDbRegion.cc b/src/db/db/gsiDeclDbRegion.cc index 1edb5c535..30db8130c 100644 --- a/src/db/db/gsiDeclDbRegion.cc +++ b/src/db/db/gsiDeclDbRegion.cc @@ -223,24 +223,24 @@ static void insert_si2 (db::Region *r, db::RecursiveShapeIterator si, db::ICplxT } } -static db::Region minkowsky_sum_pe (const db::Region *r, const db::Edge &e) +static db::Region minkowski_sum_pe (const db::Region *r, const db::Edge &e) { - return r->processed (db::minkowsky_sum_computation (e)); + return r->processed (db::minkowski_sum_computation (e)); } -static db::Region minkowsky_sum_pp (const db::Region *r, const db::Polygon &q) +static db::Region minkowski_sum_pp (const db::Region *r, const db::Polygon &q) { - return r->processed (db::minkowsky_sum_computation (q)); + return r->processed (db::minkowski_sum_computation (q)); } -static db::Region minkowsky_sum_pb (const db::Region *r, const db::Box &q) +static db::Region minkowski_sum_pb (const db::Region *r, const db::Box &q) { - return r->processed (db::minkowsky_sum_computation (q)); + return r->processed (db::minkowski_sum_computation (q)); } -static db::Region minkowsky_sum_pc (const db::Region *r, const std::vector &q) +static db::Region minkowski_sum_pc (const db::Region *r, const std::vector &q) { - return r->processed (db::minkowsky_sum_computation > (q)); + return r->processed (db::minkowski_sum_computation > (q)); } static db::Region &move_p (db::Region *r, const db::Vector &p) @@ -2237,7 +2237,7 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "\n" "This method has been introduced in version 0.26." ) + - method_ext ("minkowsky_sum", &minkowsky_sum_pe, gsi::arg ("e"), + method_ext ("minkowski_sum|#minkowsky_sum", &minkowski_sum_pe, gsi::arg ("e"), "@brief Compute the Minkowski sum of the region and an edge\n" "\n" "@param e The edge.\n" @@ -2251,7 +2251,7 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "The resulting polygons are not merged. In order to remove overlaps, use the \\merge or \\merged method." "Merged semantics applies for the input of this method (see \\merged_semantics= for a description of this concept)\n" ) + - method_ext ("minkowsky_sum", &minkowsky_sum_pp, gsi::arg ("p"), + method_ext ("minkowski_sum|#minkowsky_sum", &minkowski_sum_pp, gsi::arg ("p"), "@brief Compute the Minkowski sum of the region and a polygon\n" "\n" "@param p The first argument.\n" @@ -2264,7 +2264,7 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "The resulting polygons are not merged. In order to remove overlaps, use the \\merge or \\merged method." "Merged semantics applies for the input of this method (see \\merged_semantics= for a description of this concept)\n" ) + - method_ext ("minkowsky_sum", &minkowsky_sum_pb, gsi::arg ("b"), + method_ext ("minkowski_sum|#minkowsky_sum", &minkowski_sum_pb, gsi::arg ("b"), "@brief Compute the Minkowski sum of the region and a box\n" "\n" "@param b The box.\n" @@ -2277,7 +2277,7 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "The resulting polygons are not merged. In order to remove overlaps, use the \\merge or \\merged method." "Merged semantics applies for the input of this method (see \\merged_semantics= for a description of this concept)\n" ) + - method_ext ("minkowsky_sum", &minkowsky_sum_pc, gsi::arg ("b"), + method_ext ("minkowski_sum|#minkowsky_sum", &minkowski_sum_pc, gsi::arg ("b"), "@brief Compute the Minkowski sum of the region and a contour of points (a trace)\n" "\n" "@param b The contour (a series of points forming the trace).\n" diff --git a/src/db/unit_tests/dbDeepRegionTests.cc b/src/db/unit_tests/dbDeepRegionTests.cc index c5f7703a1..f22eda02e 100644 --- a/src/db/unit_tests/dbDeepRegionTests.cc +++ b/src/db/unit_tests/dbDeepRegionTests.cc @@ -1279,8 +1279,8 @@ TEST(21_Processors) target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (25, 0)), r1.processed (db::RelativeExtentsAsEdges (0.5, 0.5, 0.5, 0.5))); target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (26, 0)), r1.processed (db::RelativeExtentsAsEdges (0.25, 0.4, 0.75, 0.6))); - target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (30, 0)), r1.processed (db::minkowsky_sum_computation (db::Box (-1000, -2000, 3000, 4000)))); - target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (31, 0)), r1.processed (db::minkowsky_sum_computation (db::Edge (-1000, 0, 3000, 0)))); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (30, 0)), r1.processed (db::minkowski_sum_computation (db::Box (-1000, -2000, 3000, 4000)))); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (31, 0)), r1.processed (db::minkowski_sum_computation (db::Edge (-1000, 0, 3000, 0)))); target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (40, 0)), r1.processed (db::TrapezoidDecomposition (db::TD_htrapezoids))); target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (41, 0)), r1.processed (db::ConvexDecomposition (db::PO_vertical))); diff --git a/src/db/unit_tests/dbPolygonToolsTests.cc b/src/db/unit_tests/dbPolygonToolsTests.cc index 0d55b1ae1..ca51b3e34 100644 --- a/src/db/unit_tests/dbPolygonToolsTests.cc +++ b/src/db/unit_tests/dbPolygonToolsTests.cc @@ -1094,27 +1094,27 @@ TEST(41) db::Polygon p; p.assign_hull (&pattern[0], &pattern[0] + sizeof (pattern) / sizeof (pattern[0])); - db::Polygon pout = minkowsky_sum (p, db::Edge (db::Point (10, 10), db::Point (210, 110)), true); + db::Polygon pout = minkowski_sum (p, db::Edge (db::Point (10, 10), db::Point (210, 110)), true); EXPECT_EQ (pout.to_string (), "(10,-90;10,-40;-90,-65;10,110;210,210;260,160;310,185;310,60)"); - pout = minkowsky_sum (p, db::Edge (db::Point (10, 10), db::Point (10, 110)), true); + pout = minkowski_sum (p, db::Edge (db::Point (10, 10), db::Point (10, 110)), true); EXPECT_EQ (pout.to_string (), "(10,-90;10,-40;-90,-65;-90,35;10,210;60,160;110,185;110,-40)"); - pout = minkowsky_sum (p, db::Edge (db::Point (10, 110), db::Point (10, 10)), true); + pout = minkowski_sum (p, db::Edge (db::Point (10, 110), db::Point (10, 10)), true); EXPECT_EQ (pout.to_string (), "(10,-90;10,-40;-90,-65;-90,35;10,210;60,160;110,185;110,-40)"); - pout = minkowsky_sum (p, db::Edge (db::Point (10, 10), db::Point (210, 10)), true); + pout = minkowski_sum (p, db::Edge (db::Point (10, 10), db::Point (210, 10)), true); EXPECT_EQ (pout.to_string (), "(10,-90;10,-65;-90,-65;10,110;210,110;235,85;310,85;310,-40;210,-90)"); - pout = minkowsky_sum (p, db::Edge (db::Point (210, 10), db::Point (10, 10)), true); + pout = minkowski_sum (p, db::Edge (db::Point (210, 10), db::Point (10, 10)), true); EXPECT_EQ (pout.to_string (), "(10,-90;10,-65;-90,-65;10,110;210,110;235,85;310,85;310,-40;210,-90)"); - pout = minkowsky_sum (p, db::Edge (db::Point (10, 10), db::Point (210, -90)), true); + pout = minkowski_sum (p, db::Edge (db::Point (10, 10), db::Point (210, -90)), true); EXPECT_EQ (pout.to_string (), "(210,-190;143,-157;110,-165;-90,-65;10,110;85,72;110,85;310,-15;310,-140)"); @@ -1125,7 +1125,7 @@ TEST(41) c.push_back (db::Point (210, 10)); c.push_back (db::Point (10, 10)); - pout = minkowsky_sum (p, c, true); + pout = minkowski_sum (p, c, true); EXPECT_EQ (pout.to_string (), "(10,-90;10,-65;-90,-65;-90,35;10,210;210,210;235,185;310,185;310,-40;210,-90)"); @@ -1136,7 +1136,7 @@ TEST(41) c.push_back (db::Point (510, 10)); c.push_back (db::Point (10, 10)); - pout = minkowsky_sum (p, c, true); + pout = minkowski_sum (p, c, true); EXPECT_EQ (pout.to_string (), "(10,-90;10,-65;-90,-65;-90,210;110,210;110,110;410,110;410,210;-90,210;-90,235;10,410;510,410;535,385;610,385;610,-40;510,-90)"); @@ -1144,7 +1144,7 @@ TEST(41) EXPECT_EQ (db::resolve_holes (pout).to_string (), "(10,-90;10,-65;-90,-65;-90,210;110,210;110,110;410,110;410,210;-90,210;-90,235;10,410;510,410;535,385;610,385;610,-40;510,-90)"); EXPECT_EQ (db::polygon_to_simple_polygon (pout).to_string (), "(10,-90;10,-65;-90,-65;-90,210;110,210;110,110;410,110;410,210;-90,210;-90,235;10,410;510,410;535,385;610,385;610,-40;510,-90)"); - pout = minkowsky_sum (p, c, false); + pout = minkowski_sum (p, c, false); EXPECT_EQ (pout.to_string (), "(10,-90;10,-65;-90,-65;-90,235;10,410;510,410;535,385;610,385;610,-40;510,-90/110,110;410,110;410,210;110,210)"); @@ -1153,11 +1153,11 @@ TEST(41) EXPECT_EQ (db::polygon_to_simple_polygon (pout).to_string (), "(10,-90;10,-65;-90,-65;-90,210;110,210;110,110;410,110;410,210;-90,210;-90,235;10,410;510,410;535,385;610,385;610,-40;510,-90)"); EXPECT_EQ (db::simple_polygon_to_polygon (db::polygon_to_simple_polygon (pout)).to_string (), "(10,-90;10,-65;-90,-65;-90,210;110,210;110,110;410,110;410,210;-90,210;-90,235;10,410;510,410;535,385;610,385;610,-40;510,-90)"); - pout = minkowsky_sum (p, db::Box (db::Point (10, 10), db::Point (210, 110)), true); + pout = minkowski_sum (p, db::Box (db::Point (10, 10), db::Point (210, 110)), true); EXPECT_EQ (pout.to_string (), "(10,-90;10,-65;-90,-65;-90,35;10,210;210,210;235,185;310,185;310,-40;210,-90)"); - pout = minkowsky_sum (p, db::Box (db::Point (10, 10), db::Point (510, 310)), false); + pout = minkowski_sum (p, db::Box (db::Point (10, 10), db::Point (510, 310)), false); EXPECT_EQ (pout.to_string (), "(10,-90;10,-65;-90,-65;-90,235;10,410;510,410;535,385;610,385;610,-40;510,-90)"); } @@ -1191,15 +1191,15 @@ TEST(42) p.insert_hole (&hole[0], &hole[0] + sizeof (hole) / sizeof (hole[0])); - db::Polygon pout = minkowsky_sum (p, db::Edge (db::Point (10, 10), db::Point (30, 10)), true); + db::Polygon pout = minkowski_sum (p, db::Edge (db::Point (10, 10), db::Point (30, 10)), true); EXPECT_EQ (pout.to_string (), "(10,-90;10,-45;-70,-65;-90,-65;-15,65;27,65;-27,-29;25,-16;45,-16;50,-20;50,-47;90,-27;90,43;76,36;56,36;27,65;-15,65;-8,78;10,110;30,110;73,67;110,85;130,85;130,-40;30,-90)"); - pout = minkowsky_sum (p, db::Edge (db::Point (10, 10), db::Point (110, 110)), true); + pout = minkowski_sum (p, db::Edge (db::Point (10, 10), db::Point (110, 110)), true); EXPECT_EQ (pout.to_string (), "(10,-90;10,-40;-90,-65;-8,78;10,110;110,210;160,160;210,185;210,60;110,-40)"); - pout = minkowsky_sum (p, db::Edge (db::Point (10, 10), db::Point (50, 10)), true); + pout = minkowski_sum (p, db::Edge (db::Point (10, 10), db::Point (50, 10)), true); EXPECT_EQ (pout.to_string (), "(10,-90;10,-50;-50,-65;-90,-65;-23,52;40,52;-3,-23;25,-16;65,-16;70,-20;70,-37;90,-27;90,36;56,36;40,52;-23,52;-8,78;10,110;50,110;87,73;110,85;150,85;150,-40;50,-90)"); } diff --git a/src/db/unit_tests/dbRegionTests.cc b/src/db/unit_tests/dbRegionTests.cc index e11ff12de..7ca238133 100644 --- a/src/db/unit_tests/dbRegionTests.cc +++ b/src/db/unit_tests/dbRegionTests.cc @@ -2044,8 +2044,8 @@ TEST(100_Processors) EXPECT_EQ (db::compare (r.processed (db::RelativeExtentsAsEdges (0.5, 0.5, 0.5, 0.5)), "(50,100;50,100);(100,400;100,400)"), true); EXPECT_EQ (db::compare (r.processed (db::RelativeExtentsAsEdges (0.25, 0.4, 0.75, 0.6)), "(25,80;75,120);(50,380;150,420)"), true); - EXPECT_EQ (db::compare (r.processed (db::minkowsky_sum_computation (db::Box (-10, -20, 30, 40))), "(-10,-20;-10,240;130,240;130,-20);(-10,280;-10,440;90,440;90,540;230,540;230,280)"), true); - EXPECT_EQ (db::compare (r.processed (db::minkowsky_sum_computation (db::Edge (-10, 0, 30, 0))), "(-10,0;-10,200;130,200;130,0);(-10,300;-10,400;90,400;90,500;230,500;230,300)"), true); + EXPECT_EQ (db::compare (r.processed (db::minkowski_sum_computation (db::Box (-10, -20, 30, 40))), "(-10,-20;-10,240;130,240;130,-20);(-10,280;-10,440;90,440;90,540;230,540;230,280)"), true); + EXPECT_EQ (db::compare (r.processed (db::minkowski_sum_computation (db::Edge (-10, 0, 30, 0))), "(-10,0;-10,200;130,200;130,0);(-10,300;-10,400;90,400;90,500;230,500;230,300)"), true); EXPECT_EQ (db::compare (r.processed (db::TrapezoidDecomposition (db::TD_htrapezoids)), "(0,0;0,200;100,200;100,0);(100,300;100,500;200,500;200,300);(0,300;0,400;100,400;100,300)"), true); EXPECT_EQ (r.processed (db::ConvexDecomposition (db::PO_vertical)).to_string (), "(0,0;0,200;100,200;100,0);(100,300;100,500;200,500;200,300);(0,300;0,400;100,400;100,300)"); diff --git a/src/drc/unit_tests/drcSimpleTests.cc b/src/drc/unit_tests/drcSimpleTests.cc index 11b7e6413..6b19de6d3 100644 --- a/src/drc/unit_tests/drcSimpleTests.cc +++ b/src/drc/unit_tests/drcSimpleTests.cc @@ -1292,3 +1292,9 @@ TEST(49d_drcWithFragments) { run_test (_this, "49", true); } + +TEST(50_issue826) +{ + run_test (_this, "50", false); +} + diff --git a/src/edt/edt/InstantiationForm.ui b/src/edt/edt/InstantiationForm.ui index d01a490bc..ad69ce127 100644 --- a/src/edt/edt/InstantiationForm.ui +++ b/src/edt/edt/InstantiationForm.ui @@ -179,7 +179,7 @@ Bottom - Topcell + Top cell : diff --git a/src/edt/edt/edtMainService.cc b/src/edt/edt/edtMainService.cc index 5d44adb74..f778d6fe2 100644 --- a/src/edt/edt/edtMainService.cc +++ b/src/edt/edt/edtMainService.cc @@ -120,7 +120,7 @@ lay::FlattenInstOptionsDialog * MainService::flatten_inst_options_dialog () { if (! mp_flatten_inst_options_dialog) { - mp_flatten_inst_options_dialog = new lay::FlattenInstOptionsDialog (view (), false /*don't allow prunining*/); + mp_flatten_inst_options_dialog = new lay::FlattenInstOptionsDialog (view (), false /*don't allow pruning*/); } return mp_flatten_inst_options_dialog; } @@ -196,7 +196,7 @@ class CommonInsts { public: CommonInsts () - : m_valid (true), m_first (true), m_ambigous (false), m_cv_index (0) + : m_valid (true), m_first (true), m_ambiguous (false), m_cv_index (0) { // .. nothing yet .. } @@ -229,7 +229,7 @@ public: ++i1; ++i2; } if (i1 != m_common_inst.end ()) { - m_ambigous = true; + m_ambiguous = true; m_common_inst.erase (i1, m_common_inst.end ()); } @@ -251,9 +251,9 @@ public: return ! m_first; } - bool ambigous () const + bool ambiguous () const { - return m_ambigous && m_common_inst.empty (); + return m_ambiguous && m_common_inst.empty (); } bool empty () const @@ -275,7 +275,7 @@ private: std::vector m_common_inst; bool m_valid; bool m_first; - bool m_ambigous; + bool m_ambiguous; unsigned int m_cv_index; }; @@ -300,7 +300,7 @@ MainService::cm_descend () if (! common_inst.anything ()) { throw tl::Exception (tl::to_string (QObject::tr ("Select an object to determine into which instance to descend"))); } - if (! common_inst.valid () || common_inst.ambigous ()) { + if (! common_inst.valid () || common_inst.ambiguous ()) { throw tl::Exception (tl::to_string (QObject::tr ("Selection is ambiguous - cannot determine into which instance to descend"))); } diff --git a/src/edt/edt/edtPartialService.cc b/src/edt/edt/edtPartialService.cc index abe291b3d..c079103cb 100644 --- a/src/edt/edt/edtPartialService.cc +++ b/src/edt/edt/edtPartialService.cc @@ -1520,7 +1520,7 @@ PartialService::edit_cancel () } bool -PartialService::wheel_event (int /*delta*/, bool /*horizonal*/, const db::DPoint & /*p*/, unsigned int /*buttons*/, bool /*prio*/) +PartialService::wheel_event (int /*delta*/, bool /*horizontal*/, const db::DPoint & /*p*/, unsigned int /*buttons*/, bool /*prio*/) { hover_reset (); return false; @@ -2665,7 +2665,7 @@ PartialService::partial_select (const db::DBox &box, lay::Editable::SelectionMod // check, if there is a selected instance inside the box - in this case, we do not do a new selection if (! box.is_point ()) { - lay::InstFinder inst_finder (box.is_point (), m_top_level_sel, true /*full arrays*/, true /*enclose*/, 0 /*no exludes*/, true /*visible layers*/); + lay::InstFinder inst_finder (box.is_point (), m_top_level_sel, true /*full arrays*/, true /*enclose*/, 0 /*no excludes*/, true /*visible layers*/); inst_finder.find (view (), search_box); // collect the founds from the finder diff --git a/src/edt/edt/edtPartialService.h b/src/edt/edt/edtPartialService.h index d59b1a64e..1ff4bc24c 100644 --- a/src/edt/edt/edtPartialService.h +++ b/src/edt/edt/edtPartialService.h @@ -199,7 +199,7 @@ public: /** * @brief Implement the wheel event (for resetting hove state) */ - virtual bool wheel_event (int delta, bool horizonal, const db::DPoint &p, unsigned int buttons, bool prio); + virtual bool wheel_event (int delta, bool horizontal, const db::DPoint &p, unsigned int buttons, bool prio); /** * @brief Implement the mouse mode: move event diff --git a/src/edt/edt/edtServiceImpl.cc b/src/edt/edt/edtServiceImpl.cc index bef273681..73e2d23b3 100644 --- a/src/edt/edt/edtServiceImpl.cc +++ b/src/edt/edt/edtServiceImpl.cc @@ -209,7 +209,7 @@ ShapeEditService::tap (const db::DPoint &initial) * An edge is searched that emerges from p and intersects with the m->o edge in a way that the intersection * point is closest to o. * - * This method returns the intersection point ("new o") and a flag if the search was sucessful (.first of return value). + * This method returns the intersection point ("new o") and a flag if the search was successful (.first of return value). */ std::pair ShapeEditService::interpolate (const db::DPoint &m, const db::DPoint &o, const db::DPoint &p) const diff --git a/src/edt/edt/edtUtils.h b/src/edt/edt/edtUtils.h index 766fa3dad..47e7e9d80 100644 --- a/src/edt/edt/edtUtils.h +++ b/src/edt/edt/edtUtils.h @@ -53,7 +53,7 @@ class Service; std::string pcell_parameters_to_string (const std::map ¶meters); /** - * @brief Deerializes PCell parameters from a string + * @brief Deserializes PCell parameters from a string */ std::map pcell_parameters_from_string (const std::string &s); diff --git a/src/edt/edt/gsiDeclEdt.cc b/src/edt/edt/gsiDeclEdt.cc index 75768e99c..420cbac7e 100644 --- a/src/edt/edt/gsiDeclEdt.cc +++ b/src/edt/edt/gsiDeclEdt.cc @@ -266,7 +266,7 @@ gsi::Class decl_ObjectInstPath ("lay", "ObjectInstPath", gsi::method_ext ("layer", &ip_layer, "@brief Gets the layer index that describes which layer the selected shape is on\n" "\n" - "Startiong with version 0.27, this method returns nil for this property if \\is_cell_inst? is false - " + "Starting with version 0.27, this method returns nil for this property if \\is_cell_inst? is false - " "i.e. the selection does not represent a shape." ) + gsi::method ("layer=", &lay::ObjectInstPath::set_layer, gsi::arg ("layer_index"), @@ -284,7 +284,7 @@ gsi::Class decl_ObjectInstPath ("lay", "ObjectInstPath", "the selection must be set in the view using \\LayoutView#object_selection= or \\LayoutView#select_object.\n" "\n" "This method delivers valid results only for object selections that represent shapes. " - "Startiong with version 0.27, this method returns nil for this property if \\is_cell_inst? is false." + "Starting with version 0.27, this method returns nil for this property if \\is_cell_inst? is false." ) + gsi::method ("shape=", &lay::ObjectInstPath::set_shape, gsi::arg ("shape"), "@brief Sets the shape object that describes the selected shape geometrically\n" diff --git a/src/gsi/gsi/gsiClassBase.cc b/src/gsi/gsi/gsiClassBase.cc index 97e2d551c..3110f6d19 100644 --- a/src/gsi/gsi/gsiClassBase.cc +++ b/src/gsi/gsi/gsiClassBase.cc @@ -709,7 +709,7 @@ ClassBase::classes_in_definition_order (const char *mod_name) if (taken.find (*c) != taken.end ()) { // not considered. } else if ((*c)->declaration () && (*c)->declaration () != *c && taken.find ((*c)->declaration ()) == taken.end ()) { - // can't produce this class yet - it refers to a class whic is not available. + // can't produce this class yet - it refers to a class which is not available. tl::error << tl::sprintf ("class %s.%s refers to another class (%s.%s) which is not available", (*c)->module (), (*c)->name (), (*c)->declaration ()->module (), (*c)->declaration ()->name ()); } else if ((*c)->parent () != 0 && taken.find ((*c)->parent ()) == taken.end ()) { // can't produce this class yet - it's a child of a parent that is not produced yet. diff --git a/src/gsi/gsi/gsiClassBase.h b/src/gsi/gsi/gsiClassBase.h index 92728ed91..afefb8fb1 100644 --- a/src/gsi/gsi/gsiClassBase.h +++ b/src/gsi/gsi/gsiClassBase.h @@ -547,7 +547,7 @@ public: * * This method will be called by the GSI system to provide initialization after * the static initialization. Some schemes cannot be implementation statically, plus - * the initialization order is indetermined for static initialization. + * the initialization order is undetermined for static initialization. * In that case, this initialization step is useful. It will call the initialize * method on all method declarations. */ diff --git a/src/gsi/gsi/gsiDeclTl.cc b/src/gsi/gsi/gsiDeclTl.cc index bdff15a96..401458d24 100644 --- a/src/gsi/gsi/gsiDeclTl.cc +++ b/src/gsi/gsi/gsiDeclTl.cc @@ -762,7 +762,7 @@ Class decl_Recipe_Impl ("tl", "Recipe", "\n" "This method has been introduced in version 0.27 and replaces 'execute'." ), - "@brief A facility for providing reproducable recipes\n" + "@brief A facility for providing reproducible recipes\n" "The idea of this facility is to provide a service by which an object\n" "can be reproduced in a parametrized way. The intended use case is a \n" "DRC report for example, where the DRC script is the generator.\n" diff --git a/src/gsi/gsi/gsiInterpreter.h b/src/gsi/gsi/gsiInterpreter.h index 485d05020..36ddea1e1 100644 --- a/src/gsi/gsi/gsiInterpreter.h +++ b/src/gsi/gsi/gsiInterpreter.h @@ -210,7 +210,7 @@ public: /** * @brief Ignores the next exception * - * This is useful for suppressing reraised exceptions in the debugger. + * This is useful for suppressing re-raised exceptions in the debugger. */ virtual void ignore_next_exception () = 0; diff --git a/src/gsi/gsi/gsiSerialisation.h b/src/gsi/gsi/gsiSerialisation.h index ef4a9f8a3..d3cc55f65 100644 --- a/src/gsi/gsi/gsiSerialisation.h +++ b/src/gsi/gsi/gsiSerialisation.h @@ -21,8 +21,8 @@ */ -#ifndef _HDR_gsiSerialisation -#define _HDR_gsiSerialisation +#ifndef _HDR_gsiSerialization +#define _HDR_gsiSerialization #include "gsiTypes.h" #include "tlHeap.h" diff --git a/src/gsi/gsi/gsiTypes.h b/src/gsi/gsi/gsiTypes.h index 945b3499c..4fe85e6e3 100644 --- a/src/gsi/gsi/gsiTypes.h +++ b/src/gsi/gsi/gsiTypes.h @@ -1714,7 +1714,7 @@ public: } /** - * @brief Returns a value indicating that the ownership of a passed object is transfered to the receiver + * @brief Returns a value indicating that the ownership of a passed object is transferred to the receiver */ bool pass_obj () const { @@ -1722,7 +1722,7 @@ public: } /** - * @brief Sets a value indicating that the ownership of a passed object is transfered to the receiver + * @brief Sets a value indicating that the ownership of a passed object is transferred to the receiver */ void set_pass_obj (bool b) { diff --git a/src/gtfui/gtfUiDialog.cc b/src/gtfui/gtfUiDialog.cc index 3d245c666..05910ee96 100644 --- a/src/gtfui/gtfUiDialog.cc +++ b/src/gtfui/gtfUiDialog.cc @@ -52,7 +52,7 @@ static QBrush right_diff_brush_dep (QColor (64, 192, 64), Qt::Dense4Pattern); * "o1" those that only appear in stream 1, "o2" only those that appear in stream 2, * "d" will receive std::pair's of elements that differ between 1 and 2. * Two parameters govern the algorithm: - * "max_lookahead": tell how far to look into the future to find "synchronised" parts. + * "max_lookahead": tell how far to look into the future to find "synchronized" parts. * "min_sync": how many elements must be equal (in sequence) to resync. */ template diff --git a/src/img/img/gsiDeclImg.cc b/src/img/img/gsiDeclImg.cc index ebe23675e..5d613d7ff 100644 --- a/src/img/img/gsiDeclImg.cc +++ b/src/img/img/gsiDeclImg.cc @@ -192,7 +192,7 @@ gsi::Class decl_ImageDataMapping ("lay", "ImageDataMapping", "@return The number of entries.\n" ) + gsi::method_ext ("colormap_value", &gsi::colormap_value, gsi::arg ("n"), - "@brief Returns the vlue for a given color map entry.\n" + "@brief Returns the value for a given color map entry.\n" "@param n The index of the entry (0..\\num_colormap_entries-1)\n" "@return The value (see \\add_colormap_entry for a description).\n" ) + @@ -1001,7 +1001,7 @@ gsi::Class decl_Image (decl_BasicImage, "lay", "Image", "@brief Forces an update of the view\n" "Usually it is not required to call this method. The image object is automatically synchronized " "with the view's image objects. For performance reasons this update is delayed to collect multiple " - "update requests. Calling 'update' will ensure immdiate updates.\n" + "update requests. Calling 'update' will ensure immediate updates.\n" "\n" "This method has been introduced in version 0.25." ) + @@ -1408,7 +1408,7 @@ gsi::ClassExt tiling_processor_ext ( "@brief Specifies output to an image\n" "This method will establish an output channel which delivers float data to image data. " "The image is a monochrome image where each pixel corresponds to a single tile. This " - "method for example is useful to collect densitity information into an image. The " + "method for example is useful to collect density information into an image. The " "image is configured such that each pixel covers one tile.\n" "\n" "The name is the name which must be used in the _output function of the scripts in order to " diff --git a/src/img/img/imgService.cc b/src/img/img/imgService.cc index 71ab0e8b1..f8fe7ae5e 100644 --- a/src/img/img/imgService.cc +++ b/src/img/img/imgService.cc @@ -499,7 +499,7 @@ Service::insert_image (const img::Object &image) img::Object *new_image = new img::Object (image); const db::DUserObject &s = mp_view->annotation_shapes ().insert (db::DUserObject (new_image)); - // NOTE: the const_cast will allow us to modfiy the object begin the DUserObject - that is not really clean + // NOTE: the const_cast will allow us to modify the object begin the DUserObject - that is not really clean return const_cast (dynamic_cast (s.ptr ())); } @@ -885,7 +885,7 @@ Service::end_move (const db::DPoint &, lay::angle_constraint_type) int id = obj2id (mp_view->annotation_shapes ().replace (m_selected.begin ()->first, db::DUserObject (inew))); image_changed_event (id); - // clear the selection (that was artifically created before) + // clear the selection (that was artificially created before) if (! m_keep_selection_for_landmark) { clear_selection (); } else { @@ -899,7 +899,7 @@ Service::end_move (const db::DPoint &, lay::angle_constraint_type) int id = obj2id (mp_view->annotation_shapes ().replace (m_selected.begin ()->first, db::DUserObject (inew))); image_changed_event (id); - // clear the selection (that was artifically created before) + // clear the selection (that was artificially created before) clear_selection (); } diff --git a/src/lay/lay/doc/programming/geometry_api.xml b/src/lay/lay/doc/programming/geometry_api.xml index cff528b57..9b2e28531 100644 --- a/src/lay/lay/doc/programming/geometry_api.xml +++ b/src/lay/lay/doc/programming/geometry_api.xml @@ -198,8 +198,8 @@ box = RBA::Box::new(dbox)

will remove points that connect two collinear edges. It has a parameter that controls whether to remove - reflecting edges (spikes) as well. returns true, if a given point is inside the polygon. - computes the Minkowsky sum between a polygon and another object in various flavors. will displace the polygon + reflecting edges (spikes) as well. returns true, if a given point is inside the polygon. + computes the Minkowski sum between a polygon and another object in various flavors. will displace the polygon by the distance given by the Point argument. will return the moved polygon without modifying the polygon it is called on (out-of-place operation). will return the transformed polygon, either with a simple or a complex transformation (see the description of the Box object and the @@ -652,7 +652,7 @@ ly.top_cell.shapes(ly.layer(100, 0)).insert(r11 & r21) way in another region.

and merge the polygons. This feature allows selecting overlapping polygons (minimum wrap count parameter).

-

computes the Minkowsky sum of the region with other objects (edges, single polygons and other regions).

+

computes the Minkowski sum of the region with other objects (edges, single polygons and other regions).

, , and apply geometrical transformations.

, , and diff --git a/src/lay/lay/layMacroEditorPage.cc b/src/lay/lay/layMacroEditorPage.cc index ec1c42bb6..7ca4bf85d 100644 --- a/src/lay/lay/layMacroEditorPage.cc +++ b/src/lay/lay/layMacroEditorPage.cc @@ -628,14 +628,40 @@ static bool valid_element (const SyntaxHighlighterElement &e) return e.basic_attribute_id != lay::dsComment && e.basic_attribute_id != lay::dsString; } -void MacroEditorPage::complete () +QTextCursor MacroEditorPage::get_completer_cursor (int &pos0, int &pos) { QTextCursor c = mp_text->textCursor (); if (c.selectionStart () != c.selectionEnd ()) { + return QTextCursor (); + } + + pos = c.anchor (); + c.select (QTextCursor::WordUnderCursor); + pos0 = c.selectionStart (); + + if (pos0 >= pos) { + // if there is no word before, move to left to catch one + c = mp_text->textCursor (); + c.movePosition (QTextCursor::WordLeft, QTextCursor::KeepAnchor); + pos = c.anchor (); + pos0 = c.selectionStart (); + } + + if (pos0 >= pos) { + return QTextCursor (); + } else { + return c; + } +} + +void MacroEditorPage::complete () +{ + int pos0 = 0, pos = 0; + QTextCursor c = get_completer_cursor (pos0, pos); + if (c.isNull ()) { return; } - c.select (QTextCursor::WordUnderCursor); if (mp_completer_list->currentItem ()) { QString s = mp_completer_list->currentItem ()->text (); c.insertText (s); @@ -644,40 +670,55 @@ void MacroEditorPage::complete () void MacroEditorPage::fill_completer_list () { - QTextCursor c = mp_text->textCursor (); - if (c.selectionStart () != c.selectionEnd ()) { - return; - } - - int pos = c.anchor (); - c.select (QTextCursor::WordUnderCursor); - int pos0 = c.selectionStart (); - if (pos0 >= pos) { + int pos0 = 0, pos = 0; + QTextCursor c = get_completer_cursor (pos0, pos); + if (c.isNull ()) { return; } QString ssel = c.selectedText (); QString s = ssel.mid (0, pos - pos0); + if (! s[0].isLetter () && s[0].toLatin1 () != '_') { + return; // not a word + } + QString text = mp_text->toPlainText (); std::set words; - int i = 0; - while (i >= 0) { - i = text.indexOf (s, i); - if (i >= 0) { - QString::iterator c = text.begin () + i; - QString w; - while (c->isLetterOrNumber () || c->toLatin1 () == '_') { - w += *c; - ++c; - } - if (! w.isEmpty () && w != s && w != ssel) { - words.insert (w); - } - ++i; + int i = -1; + while (true) { + + i = text.indexOf (s, i + 1); + if (i < 0) { + // no more occurance + break; } + if (i == pos0) { + // same position than we are at currently + continue; + } + if (i > 0 && (text [i - 1].isLetterOrNumber () || text [i - 1].toLatin1 () == '_')) { + // not at the beginning of the word + continue; + } + + QString::iterator c = text.begin () + i; + QString w; + while (c->isLetterOrNumber () || c->toLatin1 () == '_') { + w += *c; + ++c; + } + + if (w == ssel) { + // the selected word is present already - assume it's the right one + words.clear (); + break; + } else if (! w.isEmpty () && w != s) { + words.insert (w); + } + } for (std::set::const_iterator w = words.begin (); w != words.end (); ++w) { @@ -1135,7 +1176,11 @@ MacroEditorPage::replace_and_find_next (const QString &replace) QTextCursor c = mp_text->textCursor (); if (c.hasSelection ()) { - c.insertText (interpolate_string (replace, m_current_search)); + QTextBlock b = c.block (); + int o = std::max (0, c.position () - b.position ()); + if (m_current_search.indexIn (b.text (), o) == o) { + c.insertText (interpolate_string (replace, m_current_search)); + } } find_next (); @@ -1150,10 +1195,21 @@ MacroEditorPage::replace_all (const QString &replace) const QTextDocument *doc = mp_text->document (); + QTextBlock bs = doc->begin (), be = doc->end (); + QTextCursor c = mp_text->textCursor (); + if (c.hasSelection ()) { + QTextBlock s = mp_text->document ()->findBlock (mp_text->textCursor ().selectionStart ()); + QTextBlock e = mp_text->document ()->findBlock (mp_text->textCursor ().selectionEnd ()); + if (e != s) { + bs = s; + be = e; + } + } + c.beginEditBlock (); - for (QTextBlock b = doc->begin(); b != doc->end(); b = b.next()) { + for (QTextBlock b = bs; b != be; b = b.next()) { int o = 0; @@ -1705,7 +1761,13 @@ MacroEditorPage::eventFilter (QObject *watched, QEvent *event) } else if (is_find_key (ke)) { QTextCursor c = mp_text->textCursor (); - emit search_requested (c.selectedText ()); + if (c.selectionStart () != c.selectionEnd ()) { + QTextBlock s = mp_text->document ()->findBlock (c.selectionStart ()); + QTextBlock e = mp_text->document ()->findBlock (c.selectionEnd ()); + if (e == s) { + emit search_requested (c.selectedText ()); + } + } return true; diff --git a/src/lay/lay/layMacroEditorPage.h b/src/lay/lay/layMacroEditorPage.h index 732160dfc..5392d4ace 100644 --- a/src/lay/lay/layMacroEditorPage.h +++ b/src/lay/lay/layMacroEditorPage.h @@ -313,6 +313,7 @@ private: bool tab_key_pressed (); void fill_completer_list (); void complete (); + QTextCursor get_completer_cursor (int &pos0, int &pos); bool eventFilter (QObject *watched, QEvent *event); }; diff --git a/src/lym/lym/gsiDeclLymMacro.cc b/src/lym/lym/gsiDeclLymMacro.cc index db8d67517..0b81454a4 100644 --- a/src/lym/lym/gsiDeclLymMacro.cc +++ b/src/lym/lym/gsiDeclLymMacro.cc @@ -86,14 +86,14 @@ Class decl_MacroExecutionContext ("lay", "MacroExecu gsi::method ("ignore_next_exception", &gsi::MacroExecutionContext::ignore_next_exception, "@brief Ignores the next exception in the debugger\n" "The next exception thrown will be ignored in the debugger. That feature is useful when " - "reraising exceptions if those new exception shall not appear in the debugger." + "re-raising exceptions if those new exception shall not appear in the debugger." ), "@brief Support for various debugger features\n" "\n" "This class implements some features that allow customization of the debugger behavior, specifically " "the generation of back traces and the handling of exception. These functions are particular useful " "for implementing DSL interpreters and providing proper error locations in the back traces or to " - "suppress exceptions when reraising them." + "suppress exceptions when re-raising them." ); class MacroInterpreter @@ -334,7 +334,7 @@ Class decl_MacroInterpreter ("lay", "MacroInterpreter", "\n" "Use this attribute setter in the initializer before registering the interpreter.\n" "\n" - "Before version 0.25 this attribute was a reimplementable method. It has been turned into an attribute for " + "Before version 0.25 this attribute was a re-implementable method. It has been turned into an attribute for " "performance reasons in version 0.25.\n" ) + gsi::method ("debugger_scheme=", &gsi::MacroInterpreter::set_debugger_scheme, gsi::arg ("scheme"), @@ -344,7 +344,7 @@ Class decl_MacroInterpreter ("lay", "MacroInterpreter", "\n" "Use this attribute setter in the initializer before registering the interpreter.\n" "\n" - "Before version 0.25 this attribute was a reimplementable method. It has been turned into an attribute for " + "Before version 0.25 this attribute was a re-implementable method. It has been turned into an attribute for " "performance reasons in version 0.25.\n" ) + gsi::method ("storage_scheme=", &gsi::MacroInterpreter::set_storage_scheme, gsi::arg ("scheme"), @@ -355,7 +355,7 @@ Class decl_MacroInterpreter ("lay", "MacroInterpreter", "\n" "Use this attribute setter in the initializer before registering the interpreter.\n" "\n" - "Before version 0.25 this attribute was a reimplementable method. It has been turned into an attribute for " + "Before version 0.25 this attribute was a re-implementable method. It has been turned into an attribute for " "performance reasons in version 0.25.\n" ) + gsi::method ("description=", &gsi::MacroInterpreter::set_description, gsi::arg ("description"), @@ -366,7 +366,7 @@ Class decl_MacroInterpreter ("lay", "MacroInterpreter", "\n" "Use this attribute setter in the initializer before registering the interpreter.\n" "\n" - "Before version 0.25 this attribute was a reimplementable method. It has been turned into an attribute for " + "Before version 0.25 this attribute was a re-implementable method. It has been turned into an attribute for " "performance reasons in version 0.25.\n" ) + gsi::method ("suffix=", &gsi::MacroInterpreter::set_suffix, gsi::arg ("suffix"), @@ -377,7 +377,7 @@ Class decl_MacroInterpreter ("lay", "MacroInterpreter", "\n" "Use this attribute setter in the initializer before registering the interpreter.\n" "\n" - "Before version 0.25 this attribute was a reimplementable method. It has been turned into an attribute for " + "Before version 0.25 this attribute was a re-implementable method. It has been turned into an attribute for " "performance reasons in version 0.25.\n" ) + gsi::callback ("executable", &gsi::MacroInterpreter::executable, &gsi::MacroInterpreter::f_executable, gsi::arg ("macro"), diff --git a/src/lym/lym/lymMacro.h b/src/lym/lym/lymMacro.h index d1ead8d2a..85c8266e9 100644 --- a/src/lym/lym/lymMacro.h +++ b/src/lym/lym/lymMacro.h @@ -831,7 +831,7 @@ public: * * The collection becomes the owner of the object passed to this method * - * @return true, if the macro could be added sucessfully. + * @return true, if the macro could be added successfully. */ bool add (lym::Macro *m); @@ -883,7 +883,7 @@ public: * * If a name is given, it is used as a prefix to create a unique name. * This method will also create the directory for this folder. - * If not sucessful, it will return 0. + * If not successful, it will return 0. */ lym::MacroCollection *create_folder (const char *name = 0, bool mkdir = true); diff --git a/src/plugins/streamers/cif/lay_plugin/CIFWriterOptionPage.ui b/src/plugins/streamers/cif/lay_plugin/CIFWriterOptionPage.ui index d9185b971..205dae28e 100644 --- a/src/plugins/streamers/cif/lay_plugin/CIFWriterOptionPage.ui +++ b/src/plugins/streamers/cif/lay_plugin/CIFWriterOptionPage.ui @@ -39,7 +39,7 @@ If checked, a blank character is used as x/y coordinate -separator. Otherweise a comma is used. +separator. Otherwise a comma is used. diff --git a/src/plugins/streamers/gds2/db_plugin/gsiDeclDbGDS2.cc b/src/plugins/streamers/gds2/db_plugin/gsiDeclDbGDS2.cc index c8e62120e..c571b20e8 100644 --- a/src/plugins/streamers/gds2/db_plugin/gsiDeclDbGDS2.cc +++ b/src/plugins/streamers/gds2/db_plugin/gsiDeclDbGDS2.cc @@ -167,8 +167,8 @@ gsi::ClassExt gds2_writer_options ( gsi::method_ext ("gds2_resolve_skew_arrays=", &set_gds2_resolve_skew_arrays, gsi::arg ("flag"), "@brief Resolves skew arrays into single instances\n" "\n" - "Setting this property to true will make skew (non-orthongonal) arrays being resolved into single instances.\n" - "Skew arrays happen if either the row or column vector isn't paralell to x or y axis. Such arrays can cause problems with " + "Setting this property to true will make skew (non-orthogonal) arrays being resolved into single instances.\n" + "Skew arrays happen if either the row or column vector isn't parallel to x or y axis. Such arrays can cause problems with " "some legacy software and can be disabled with this option.\n" "\nThis property has been added in version 0.27.1.\n" ) + diff --git a/src/plugins/streamers/lefdef/db_plugin/dbDEFImporter.cc b/src/plugins/streamers/lefdef/db_plugin/dbDEFImporter.cc index c5a7e6626..70b93117a 100644 --- a/src/plugins/streamers/lefdef/db_plugin/dbDEFImporter.cc +++ b/src/plugins/streamers/lefdef/db_plugin/dbDEFImporter.cc @@ -423,7 +423,7 @@ DEFImporter::produce_routing_geometry (db::Cell &design, const Polygon *style, u db::Polygon k; k.assign_hull (octagon, octagon + sizeof (octagon) / sizeof (octagon[0])); - db::Polygon p = db::minkowsky_sum (k, db::Edge (*pt0, *pt)); + db::Polygon p = db::minkowski_sum (k, db::Edge (*pt0, *pt)); if (prop_id != 0) { design.shapes (layer).insert (db::object_with_properties (p, prop_id)); } else { @@ -439,7 +439,7 @@ DEFImporter::produce_routing_geometry (db::Cell &design, const Polygon *style, u } else { for (size_t i = 0; i < pts.size () - 1; ++i) { - db::Polygon p = db::minkowsky_sum (*style, db::Edge (pts [i], pts [i + 1])); + db::Polygon p = db::minkowski_sum (*style, db::Edge (pts [i], pts [i + 1])); if (prop_id != 0) { design.shapes (layer).insert (db::object_with_properties (p, prop_id)); } else { diff --git a/src/plugins/streamers/lefdef/db_plugin/dbLEFDEFImporter.cc b/src/plugins/streamers/lefdef/db_plugin/dbLEFDEFImporter.cc index 3d89896f5..6e9931faf 100644 --- a/src/plugins/streamers/lefdef/db_plugin/dbLEFDEFImporter.cc +++ b/src/plugins/streamers/lefdef/db_plugin/dbLEFDEFImporter.cc @@ -127,6 +127,8 @@ static std::string purpose_to_name (LayerPurpose purpose) return "VIA"; case Label: return "LABEL"; + case LEFLabel: + return "LEFLABEL"; case Pins: return "PIN"; case Fills: @@ -497,6 +499,9 @@ LEFDEFReaderOptions::LEFDEFReaderOptions () m_produce_labels (true), m_labels_suffix (".LABEL"), m_labels_datatype (1), + m_produce_lef_labels (true), + m_lef_labels_suffix (".LABEL"), + m_lef_labels_datatype (1), m_produce_routing (true), m_routing_suffix (""), m_routing_datatype (0), @@ -566,6 +571,9 @@ LEFDEFReaderOptions &LEFDEFReaderOptions::operator= (const LEFDEFReaderOptions & m_produce_labels = d.m_produce_labels; m_labels_suffix = d.m_labels_suffix; m_labels_datatype = d.m_labels_datatype; + m_produce_lef_labels = d.m_produce_lef_labels; + m_lef_labels_suffix = d.m_lef_labels_suffix; + m_lef_labels_datatype = d.m_lef_labels_datatype; m_produce_routing = d.m_produce_routing; m_routing_suffix = d.m_routing_suffix; m_routing_suffixes = d.m_routing_suffixes; @@ -990,22 +998,58 @@ LEFDEFReaderState::read_map_file (const std::string &path, db::Layout &layout) // into a canonical name mapping like // "(M1/LABELS): M1.LABEL" // "(M2/LABELS): M2.LABEL" + // supported purposes: PINS(->Label), LEFPINS(->LEFLabels) + + std::vector< std::pair > layer_defs; - std::vector layer_names; std::vector purposes = tl::split (w2, ","); for (std::vector::const_iterator p = purposes.begin (); p != purposes.end (); ++p) { + if (*p == "DIEAREA" || *p == "ALL" || *p == "COMP") { + tl::warn << tl::sprintf (tl::to_string (tr ("Reading layer map file %s, line %d: NAME record ignored for entity: %s")), path, ts.line_number (), *p); + } else { - layer_names.push_back (tl::split (*p, "/").front ()); + + std::vector lp = tl::split (*p, "/"); + + if (lp.size () > 1) { + + LayerPurpose label_purpose = Pins; + std::map::const_iterator i = purpose_translation.find (lp[1]); + if (i != purpose_translation.end ()) { + label_purpose = i->second; + } + + if (label_purpose == Pins || label_purpose == LEFPins) { + layer_defs.push_back (std::make_pair (lp.front (), label_purpose == Pins ? Label : LEFLabel)); + } else { + tl::warn << tl::sprintf (tl::to_string (tr ("Reading layer map file %s, line %d: NAME record ignored for purpose: %s")), path, ts.line_number (), purpose_to_name (label_purpose)); + } + + } else { + + layer_defs.push_back (std::make_pair (lp.front (), Label)); + layer_defs.push_back (std::make_pair (lp.front (), LEFLabel)); + + } + } + } - std::string final_name = tl::join (layer_names, "/") + ".LABEL"; - for (std::vector::const_iterator ln = layer_names.begin (); ln != layer_names.end (); ++ln) { + std::string final_name; + for (std::vector< std::pair >::const_iterator i = layer_defs.begin (); i != layer_defs.end (); ++i) { + if (! final_name.empty ()) { + final_name += "/"; + } + final_name += i->first + "." + purpose_to_name (i->second); + } + + for (std::vector< std::pair >::const_iterator i = layer_defs.begin (); i != layer_defs.end (); ++i) { for (std::vector::const_iterator l = layers.begin (); l != layers.end (); ++l) { for (std::vector::const_iterator d = datatypes.begin (); d != datatypes.end (); ++d) { - layer_map [std::make_pair (*ln, LayerDetailsKey (Label))].push_back (db::LayerProperties (*l, *d, final_name)); + layer_map [std::make_pair (i->first, LayerDetailsKey (i->second))].push_back (db::LayerProperties (*l, *d, final_name)); } } } @@ -1320,6 +1364,9 @@ std::set LEFDEFReaderState::open_layer_uncached(db::Layout &layout case Label: produce = mp_tech_comp->produce_labels (); break; + case LEFLabel: + produce = mp_tech_comp->produce_lef_labels (); + break; case Pins: produce = mp_tech_comp->produce_pins (); break; @@ -1364,6 +1411,10 @@ std::set LEFDEFReaderState::open_layer_uncached(db::Layout &layout name_suffix = mp_tech_comp->labels_suffix (); dt = mp_tech_comp->labels_datatype (); break; + case LEFLabel: + name_suffix = mp_tech_comp->lef_labels_suffix (); + dt = mp_tech_comp->lef_labels_datatype (); + break; case Pins: name_suffix = mp_tech_comp->pins_suffix_per_mask (mask); dt = mp_tech_comp->pins_datatype_per_mask (mask); diff --git a/src/plugins/streamers/lefdef/db_plugin/dbLEFDEFImporter.h b/src/plugins/streamers/lefdef/db_plugin/dbLEFDEFImporter.h index c022d0735..b37c951e0 100644 --- a/src/plugins/streamers/lefdef/db_plugin/dbLEFDEFImporter.h +++ b/src/plugins/streamers/lefdef/db_plugin/dbLEFDEFImporter.h @@ -607,7 +607,7 @@ public: return m_produce_labels; } - void set_produce_labels (bool f) + void set_produce_labels (bool f) { m_produce_labels = f; } @@ -632,6 +632,36 @@ public: m_labels_datatype = s; } + bool produce_lef_labels () const + { + return m_produce_lef_labels; + } + + void set_produce_lef_labels (bool f) + { + m_produce_lef_labels = f; + } + + const std::string &lef_labels_suffix () const + { + return m_lef_labels_suffix; + } + + void set_lef_labels_suffix (const std::string &s) + { + m_lef_labels_suffix = s; + } + + int lef_labels_datatype () const + { + return m_lef_labels_datatype; + } + + void set_lef_labels_datatype (int s) + { + m_lef_labels_datatype = s; + } + bool produce_routing () const { return m_produce_routing; @@ -953,6 +983,9 @@ private: bool m_produce_labels; std::string m_labels_suffix; int m_labels_datatype; + bool m_produce_lef_labels; + std::string m_lef_labels_suffix; + int m_lef_labels_datatype; bool m_produce_routing; std::string m_routing_suffix; int m_routing_datatype; @@ -984,7 +1017,8 @@ enum LayerPurpose SpecialRouting, // from DEF only LEFPins, // from LEF ViaGeometry, // from LEF+DEF - Label, // from LEF+DEF + Label, // from DEF + LEFLabel, // from LEF Obstructions, // from LEF only Outline, // from LEF+DEF Blockage, // from DEF only @@ -1247,7 +1281,7 @@ public: void register_macro_cell (const std::string &mn, LEFDEFLayoutGenerator *generator); /** - * @brief Gets the macro cell for the given macro name or 0 if no such maco is registered + * @brief Gets the macro cell for the given macro name or 0 if no such macro is registered */ std::pair macro_cell (const std::string &mn, Layout &layout, const std::vector &maskshift_layers, const std::vector &masks, const MacroDesc ¯o_desc, const LEFDEFNumberOfMasks *nm); @@ -1427,7 +1461,7 @@ public: protected: /** - * @brief Actually does the readong + * @brief Actually does the reading * * Reimplement that method for the LEF and DEF implementation */ @@ -1581,7 +1615,7 @@ protected: } /** - * @brief Gets a flag indicating whether pinance names shall be produced as properties + * @brief Gets a flag indicating whether pin names shall be produced as properties */ bool produce_pin_props () const { @@ -1589,7 +1623,7 @@ protected: } /** - * @brief Gets the property name id of the pinance name property + * @brief Gets the property name id of the pin name property */ db::property_names_id_type pin_prop_name_id () const { diff --git a/src/plugins/streamers/lefdef/db_plugin/dbLEFDEFPlugin.cc b/src/plugins/streamers/lefdef/db_plugin/dbLEFDEFPlugin.cc index cb6c92ec0..35489ff1e 100644 --- a/src/plugins/streamers/lefdef/db_plugin/dbLEFDEFPlugin.cc +++ b/src/plugins/streamers/lefdef/db_plugin/dbLEFDEFPlugin.cc @@ -374,6 +374,9 @@ class LEFDEFFormatDeclaration tl::make_member (&LEFDEFReaderOptions::produce_labels, &LEFDEFReaderOptions::set_produce_labels, "produce-labels") + tl::make_member (&LEFDEFReaderOptions::labels_suffix, &LEFDEFReaderOptions::set_labels_suffix, "labels-suffix") + tl::make_member (&LEFDEFReaderOptions::labels_datatype, &LEFDEFReaderOptions::set_labels_datatype, "labels-datatype") + + tl::make_member (&LEFDEFReaderOptions::produce_lef_labels, &LEFDEFReaderOptions::set_produce_lef_labels, "produce-lef-labels") + + tl::make_member (&LEFDEFReaderOptions::lef_labels_suffix, &LEFDEFReaderOptions::set_lef_labels_suffix, "lef-labels-suffix") + + tl::make_member (&LEFDEFReaderOptions::lef_labels_datatype, &LEFDEFReaderOptions::set_lef_labels_datatype, "lef-labels-datatype") + tl::make_member (&LEFDEFReaderOptions::produce_routing, &LEFDEFReaderOptions::set_produce_routing, "produce-routing") + // for backward compatibility tl::make_member (&LEFDEFReaderOptions::set_routing_suffix, "special-routing-suffix") + diff --git a/src/plugins/streamers/lefdef/db_plugin/dbLEFImporter.cc b/src/plugins/streamers/lefdef/db_plugin/dbLEFImporter.cc index 2714a5d52..b98adb222 100644 --- a/src/plugins/streamers/lefdef/db_plugin/dbLEFImporter.cc +++ b/src/plugins/streamers/lefdef/db_plugin/dbLEFImporter.cc @@ -887,7 +887,7 @@ LEFImporter::read_macro (Layout &layout) read_geometries (mg, layout.dbu (), LEFPins, &boxes_for_labels, prop_id); for (std::map ::const_iterator b = boxes_for_labels.begin (); b != boxes_for_labels.end (); ++b) { - mg->add_text (b->first, Label, db::Text (label.c_str (), db::Trans (b->second.center () - db::Point ())), 0, 0); + mg->add_text (b->first, LEFLabel, db::Text (label.c_str (), db::Trans (b->second.center () - db::Point ())), 0, 0); } } else { diff --git a/src/plugins/streamers/lefdef/db_plugin/gsiDeclDbLEFDEF.cc b/src/plugins/streamers/lefdef/db_plugin/gsiDeclDbLEFDEF.cc index 3bf4f4ad4..6b8ecd6bb 100644 --- a/src/plugins/streamers/lefdef/db_plugin/gsiDeclDbLEFDEF.cc +++ b/src/plugins/streamers/lefdef/db_plugin/gsiDeclDbLEFDEF.cc @@ -194,7 +194,7 @@ gsi::Class decl_lefdef_config ("db", "LEFDEFReaderConfi ) + gsi::method ("cell_outline_layer", &db::LEFDEFReaderOptions::cell_outline_layer, "@brief Gets the layer on which to produce the cell outline (diearea).\n" - "This attribute is a string correspondig to the string representation of \\LayerInfo. " + "This attribute is a string corresponding to the string representation of \\LayerInfo. " "This string can be either a layer number, a layer/datatype pair, a name or a combination of both. See \\LayerInfo for details.\n" "The setter for this attribute is \\cell_outline_layer=. See also \\produce_cell_outlines." ) + @@ -212,7 +212,7 @@ gsi::Class decl_lefdef_config ("db", "LEFDEFReaderConfi ) + gsi::method ("placement_blockage_layer", &db::LEFDEFReaderOptions::placement_blockage_layer, "@brief Gets the layer on which to produce the placement blockage.\n" - "This attribute is a string correspondig to the string representation of \\LayerInfo. " + "This attribute is a string corresponding to the string representation of \\LayerInfo. " "This string can be either a layer number, a layer/datatype pair, a name or a combination of both. See \\LayerInfo for details." "The setter for this attribute is \\placement_blockage_layer=. See also \\produce_placement_blockages." ) + @@ -234,7 +234,7 @@ gsi::Class decl_lefdef_config ("db", "LEFDEFReaderConfi ) + gsi::method ("region_layer", &db::LEFDEFReaderOptions::region_layer, "@brief Gets the layer on which to produce the regions.\n" - "This attribute is a string correspondig to the string representation of \\LayerInfo. " + "This attribute is a string corresponding to the string representation of \\LayerInfo. " "This string can be either a layer number, a layer/datatype pair, a name or a combination of both. See \\LayerInfo for details." "The setter for this attribute is \\region_layer=. See also \\produce_regions.\n" "\n" @@ -662,6 +662,42 @@ gsi::Class decl_lefdef_config ("db", "LEFDEFReaderConfi "@brief Sets the labels layer datatype value.\n" "See \\produce_via_geometry for details about the layer production rules." ) + + gsi::method ("produce_lef_labels", &db::LEFDEFReaderOptions::produce_lef_labels, + "@brief Gets a value indicating whether lef_labels shall be produced.\n" + "See \\produce_via_geometry for details about the layer production rules.\n" + "\n" + "This method has been introduced in version 0.27.2\n" + ) + + gsi::method ("produce_lef_labels=", &db::LEFDEFReaderOptions::set_produce_lef_labels, gsi::arg ("produce"), + "@brief Sets a value indicating whether lef_labels shall be produced.\n" + "See \\produce_via_geometry for details about the layer production rules.\n" + "\n" + "This method has been introduced in version 0.27.2\n" + ) + + gsi::method ("lef_labels_suffix", &db::LEFDEFReaderOptions::lef_labels_suffix, + "@brief Gets the label layer name suffix.\n" + "See \\produce_via_geometry for details about the layer production rules.\n" + "\n" + "This method has been introduced in version 0.27.2\n" + ) + + gsi::method ("lef_labels_suffix=", &db::LEFDEFReaderOptions::set_lef_labels_suffix, gsi::arg ("suffix"), + "@brief Sets the label layer name suffix.\n" + "See \\produce_via_geometry for details about the layer production rules.\n" + "\n" + "This method has been introduced in version 0.27.2\n" + ) + + gsi::method ("lef_labels_datatype", &db::LEFDEFReaderOptions::lef_labels_datatype, + "@brief Gets the lef_labels layer datatype value.\n" + "See \\produce_via_geometry for details about the layer production rules.\n" + "\n" + "This method has been introduced in version 0.27.2\n" + ) + + gsi::method ("lef_labels_datatype=", &db::LEFDEFReaderOptions::set_lef_labels_datatype, gsi::arg ("datatype"), + "@brief Sets the lef_labels layer datatype value.\n" + "See \\produce_via_geometry for details about the layer production rules.\n" + "\n" + "This method has been introduced in version 0.27.2\n" + ) + gsi::method ("produce_routing", &db::LEFDEFReaderOptions::produce_routing, "@brief Gets a value indicating whether routing geometry shall be produced.\n" "See \\produce_via_geometry for details about the layer production rules." @@ -836,7 +872,7 @@ gsi::Class decl_lefdef_config ("db", "LEFDEFReaderConfi ) + gsi::method ("separate_groups=", &db::LEFDEFReaderOptions::set_separate_groups, gsi::arg ("flag"), "@brief Sets a value indicating whether to create separate parent cells for individual groups.\n" - "See \\seperate_groups for details about this property.\n" + "See \\separate_groups for details about this property.\n" "\n" "This property has been added in version 0.27.\n" ) + diff --git a/src/plugins/streamers/lefdef/lay_plugin/LEFDEFTechnologyComponentEditor.ui b/src/plugins/streamers/lefdef/lay_plugin/LEFDEFTechnologyComponentEditor.ui index f999fa569..de17b4e9a 100644 --- a/src/plugins/streamers/lefdef/lay_plugin/LEFDEFTechnologyComponentEditor.ui +++ b/src/plugins/streamers/lefdef/lay_plugin/LEFDEFTechnologyComponentEditor.ui @@ -35,7 +35,7 @@ - 0 + 2 @@ -1037,8 +1037,8 @@ Otherwise it's looked up relative to the LEF or DEF file. 0 - - + + 0 @@ -1047,8 +1047,56 @@ Otherwise it's looked up relative to the LEF or DEF file. - - + + + + + 0 + 0 + + + + + + + + Layer name +suffix ... + + + + + + + Routing (*) + + + + + + + + 0 + 0 + + + + + + + :/right.png + + + + + + + Special routing (*) + + + + + 0 @@ -1073,6 +1121,16 @@ Otherwise it's looked up relative to the LEF or DEF file. + + + + + 0 + 0 + + + + @@ -1089,174 +1147,6 @@ Otherwise it's looked up relative to the LEF or DEF file. - - - - - 0 - 0 - - - - - - - - Fills (*) - - - - - - - Layer name -suffix ... - - - - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - - - - LEF Pins (*) - - - - - - - Layer name -suffix ... - - - - - - - - - - :/right.png - - - - - - - Via geometry (*) - - - - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - - - - GDS data- -type ... - - - - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - - - :/right.png - - - - - - - - 0 - 0 - - - - - - - - Pins (*) - - - @@ -1273,6 +1163,129 @@ type ... + + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + + + + :/right.png + + + + + + + + 0 + 0 + + + + + + + :/right.png + + + + + + + Qt::Vertical + + + + + + + + + + :/right.png + + + + + + + Fills (*) + + + + + + + Via geometry (*) + + + + + + + Obstructions + + + + + + + + 0 + 0 + + + + + + + :/right.png + + + + + + + DEF Pins (*) + + + + + + + + 0 + 0 + + + + @@ -1283,6 +1296,52 @@ type ... + + + + + 0 + 0 + + + + + + + + GDS data- +type ... + + + + + + + + 0 + 0 + + + + + + + + Layer name +suffix ... + + + + + + + + 0 + 0 + + + + @@ -1309,22 +1368,8 @@ type ... - - - - Special routing (*) - - - - - - - Obstructions - - - - - + + 0 @@ -1333,46 +1378,8 @@ type ... - - - - - 0 - 0 - - - - - - - :/right.png - - - - - - - Pin labels - - - - - - - GDS data- -type ... - - - - - - - Routing (*) - - - - - + + 0 @@ -1381,31 +1388,8 @@ type ... - - - - - 0 - 0 - - - - - - - :/right.png - - - - - - - Qt::Vertical - - - - - + + 0 @@ -1414,30 +1398,24 @@ type ... - - + + - Blockages + LEF Pins (*) - - + + - + 0 0 - - - - - :/right.png - - + @@ -1447,8 +1425,8 @@ type ... - - + + 0 @@ -1457,6 +1435,51 @@ type ... + + + + GDS data- +type ... + + + + + + + Blockages + + + + + + + DEF pin labels + + + + + + + LEF pin labels + + + + + + + + + + :/right.png + + + + + + + + + @@ -1613,9 +1636,6 @@ type ... produce_labels suffix_labels datatype_labels - produce_blockages - suffix_blockages - datatype_blockages read_all_cbx diff --git a/src/plugins/streamers/lefdef/lay_plugin/layLEFDEFImportDialogs.cc b/src/plugins/streamers/lefdef/lay_plugin/layLEFDEFImportDialogs.cc index 58f35e1aa..744dab2f0 100644 --- a/src/plugins/streamers/lefdef/lay_plugin/layLEFDEFImportDialogs.cc +++ b/src/plugins/streamers/lefdef/lay_plugin/layLEFDEFImportDialogs.cc @@ -516,6 +516,9 @@ LEFDEFReaderOptionsEditor::commit (db::FormatSpecificReaderOptions *options, con data->set_produce_labels (produce_labels->isChecked ()); data->set_labels_suffix (tl::to_string (suffix_labels->text ())); data->set_labels_datatype (datatype_labels->text ().toInt ()); + data->set_produce_lef_labels (produce_lef_labels->isChecked ()); + data->set_lef_labels_suffix (tl::to_string (suffix_lef_labels->text ())); + data->set_lef_labels_datatype (datatype_lef_labels->text ().toInt ()); data->set_separate_groups (separate_groups->isChecked ()); data->set_read_lef_with_def (read_lef_with_def->isChecked ()); data->set_map_file (tl::to_string (mapfile_path->text ())); @@ -587,6 +590,9 @@ LEFDEFReaderOptionsEditor::setup (const db::FormatSpecificReaderOptions *options produce_labels->setChecked (data->produce_labels ()); suffix_labels->setText (tl::to_qstring (data->labels_suffix ())); datatype_labels->setText (QString::number (data->labels_datatype ())); + produce_lef_labels->setChecked (data->produce_lef_labels ()); + suffix_lef_labels->setText (tl::to_qstring (data->lef_labels_suffix ())); + datatype_lef_labels->setText (QString::number (data->lef_labels_datatype ())); separate_groups->setChecked (data->separate_groups ()); read_lef_with_def->setChecked (data->read_lef_with_def ()); mapfile_path->setText (tl::to_qstring (data->map_file ())); diff --git a/src/plugins/streamers/lefdef/unit_tests/dbLEFDEFImportTests.cc b/src/plugins/streamers/lefdef/unit_tests/dbLEFDEFImportTests.cc index f80484acc..a378ef84d 100644 --- a/src/plugins/streamers/lefdef/unit_tests/dbLEFDEFImportTests.cc +++ b/src/plugins/streamers/lefdef/unit_tests/dbLEFDEFImportTests.cc @@ -335,6 +335,13 @@ TEST(22) run_test (_this, "def13", "map:test.map+lef:test.lef_5.8+def:top.def.gz", "au2.oas.gz", opt); } +TEST(23) +{ + db::LEFDEFReaderOptions opt = default_options (); + opt.set_macro_resolution_mode (1); + run_test (_this, "def14", "map:test.map+lef:tech.lef+lef:stdlib.lef+def:test.def", "au.oas.gz", opt); +} + TEST(100) { run_test (_this, "issue-172", "lef:in.lef+def:in.def", "au.oas.gz", default_options (), false); @@ -515,7 +522,7 @@ TEST(113_masks_1) "'M0PO.SPNET:2' : 'M0PO.SPNET:2' (1/201)\n" "'M0PO.VIA:1' : 'M0PO.VIA:1' (1/102)\n" "'M0PO.VIA:2' : 'M0PO.VIA:2' (1/202)\n" - "M0PO.LABEL : M0PO.LABEL (1/1)\n" + "M0PO.LABEL;M0PO.LEFLABEL : 'M0PO.LABEL/M0PO.LEFLABEL' (1/1)\n" "'M1.NET:1' : 'M1.NET:1' (3/100)\n" "'M1.NET:2' : 'M1.NET:2' (3/200)\n" "M1.PIN : M1.PIN (3/2)\n" @@ -525,7 +532,7 @@ TEST(113_masks_1) "'M1.SPNET:2' : 'M1.SPNET:2' (3/201)\n" "'M1.VIA:1' : 'M1.VIA:1' (3/102)\n" "'M1.VIA:2' : 'M1.VIA:2' (3/202)\n" - "M1.LABEL : M1.LABEL (3/1)\n" + "M1.LABEL;M1.LEFLABEL : 'M1.LABEL/M1.LEFLABEL' (3/1)\n" "'VIA0.NET:1' : 'VIA0.NET:1' (2/100)\n" "'VIA0.NET:2' : 'VIA0.NET:2' (2/200)\n" "VIA0.PIN : VIA0.PIN (2/2)\n" @@ -535,7 +542,7 @@ TEST(113_masks_1) "'VIA0.SPNET:2' : 'VIA0.SPNET:2' (2/201)\n" "'VIA0.VIA:1' : 'VIA0.VIA:1' (2/102)\n" "'VIA0.VIA:2' : 'VIA0.VIA:2' (2/202)\n" - "VIA0.LABEL : VIA0.LABEL (2/1)\n" + "VIA0.LABEL;VIA0.LEFLABEL : 'VIA0.LABEL/VIA0.LEFLABEL' (2/1)\n" ) } @@ -726,11 +733,11 @@ TEST(117_mapfile_all) "'\\'M1.FILLOPC:2\\' : \\'M1.FILLOPC:2\\' (11/0)';" "'\\'M1.VIA:SIZE0.05X0.05\\' : \\'M1.VIA:SIZE0.05X0.05\\' (20/0)';" "'\\'M1.VIA:SIZE3X3\\' : \\'M1.VIA:SIZE3X3\\' (21/0)';" - "'+M1.LABEL : M1.LABEL (26/0)';" - "'+M1.LABEL : M1.LABEL (27/0)';" - "'+M1.LABEL : M1.LABEL (28/1)';" + "'M1.LABEL : M1.LABEL (26/0)';" + // NAME M1/NET not supported: "'+M1.LABEL : M1.LABEL (27/0)';" + // NAME M1/SPNET not supported: "'+M1.LABEL : M1.LABEL (28/1)';" "'+M1.BLK : M1.BLK (13/0)';" - "'M1_TEXT.LABEL : M1_TEXT.LABEL (29/0)'" + "'M1_TEXT.LABEL;M1_TEXT.LEFLABEL : \\'M1_TEXT.LABEL/M1_TEXT.LEFLABEL\\' (29/0)'" ")" ) } diff --git a/src/plugins/streamers/magic/db_plugin/dbMAGReader.cc b/src/plugins/streamers/magic/db_plugin/dbMAGReader.cc index 71a69ae09..f8869a9b3 100644 --- a/src/plugins/streamers/magic/db_plugin/dbMAGReader.cc +++ b/src/plugins/streamers/magic/db_plugin/dbMAGReader.cc @@ -580,7 +580,7 @@ MAGReader::read_cell_instance (tl::Extractor &ex, tl::TextInputStream &stream, L lib_path = lp->second; } } else { - // give precendence to lib_path + // give precedence to lib_path filename = tl::filename (filename); // save for next use m_use_lib_paths.insert (std::make_pair (filename, lib_path)); diff --git a/src/plugins/streamers/magic/db_plugin/dbMAGWriter.cc b/src/plugins/streamers/magic/db_plugin/dbMAGWriter.cc index d37a1f244..d4371c152 100644 --- a/src/plugins/streamers/magic/db_plugin/dbMAGWriter.cc +++ b/src/plugins/streamers/magic/db_plugin/dbMAGWriter.cc @@ -93,7 +93,7 @@ MAGWriter::write (db::Layout &layout, tl::OutputStream &stream, const db::SaveLa // As a favor, write a dummy top level file before closing the stream. If the file name corresponds to a real cell, // this file is overwritten by the true cell. - write_dummmy_top (cell_set, layout, stream); + write_dummy_top (cell_set, layout, stream); stream.close (); for (std::set::const_iterator c = cell_set.begin (); c != cell_set.end (); ++c) { @@ -115,7 +115,7 @@ MAGWriter::filename_for_cell (db::cell_index_type ci, db::Layout &layout) } void -MAGWriter::write_dummmy_top (const std::set &cell_set, const db::Layout &layout, tl::OutputStream &os) +MAGWriter::write_dummy_top (const std::set &cell_set, const db::Layout &layout, tl::OutputStream &os) { os.set_as_text (true); os << "magic\n"; @@ -407,7 +407,7 @@ MAGWriter::scaled (const db::Vector &v) const { db::Vector res (db::DVector (v) * m_sf); if (! db::DVector (res).equal (db::DVector (v) * m_sf)) { - tl::warn << tl::sprintf (tl::to_string (tr ("Vector rounding occured at %s in cell %s - not a multiple of lambda (%.12g)")), v.to_string (), m_cellname, m_options.lambda); + tl::warn << tl::sprintf (tl::to_string (tr ("Vector rounding occurred at %s in cell %s - not a multiple of lambda (%.12g)")), v.to_string (), m_cellname, m_options.lambda); } return res; } @@ -417,7 +417,7 @@ MAGWriter::scaled (const db::Point &p) const { db::Point res (db::DPoint (p) * m_sf); if (! db::DPoint (res).equal (db::DPoint (p) * m_sf)) { - tl::warn << tl::sprintf (tl::to_string (tr ("Coordinate rounding occured at %s in cell %s - not a multiple of lambda (%.12g)")), p.to_string (), m_cellname, m_options.lambda); + tl::warn << tl::sprintf (tl::to_string (tr ("Coordinate rounding occurred at %s in cell %s - not a multiple of lambda (%.12g)")), p.to_string (), m_cellname, m_options.lambda); } return res; } diff --git a/src/plugins/streamers/magic/db_plugin/dbMAGWriter.h b/src/plugins/streamers/magic/db_plugin/dbMAGWriter.h index 4d12c1caf..f76629945 100644 --- a/src/plugins/streamers/magic/db_plugin/dbMAGWriter.h +++ b/src/plugins/streamers/magic/db_plugin/dbMAGWriter.h @@ -99,7 +99,7 @@ private: std::string filename_for_cell (db::cell_index_type ci, db::Layout &layout); void write_cell (db::cell_index_type ci, const std::vector > &layers, db::Layout &layout, tl::OutputStream &os); - void write_dummmy_top (const std::set &cell_set, const db::Layout &layout, tl::OutputStream &os); + void write_dummy_top (const std::set &cell_set, const db::Layout &layout, tl::OutputStream &os); void do_write_cell (db::cell_index_type ci, const std::vector > &layers, db::Layout &layout, tl::OutputStream &os); void write_polygon (const db::Polygon &poly, const db::Layout &layout, tl::OutputStream &os); void write_label (const std::string &layer, const db::Text &text, const Layout &layout, tl::OutputStream &os); diff --git a/src/plugins/streamers/magic/db_plugin/gsiDeclDbMAG.cc b/src/plugins/streamers/magic/db_plugin/gsiDeclDbMAG.cc index 205e10c88..9d63389d8 100644 --- a/src/plugins/streamers/magic/db_plugin/gsiDeclDbMAG.cc +++ b/src/plugins/streamers/magic/db_plugin/gsiDeclDbMAG.cc @@ -212,7 +212,7 @@ gsi::ClassExt mag_reader_options ( gsi::method_ext ("mag_lambda=", &set_mag_lambda, gsi::arg ("lambda"), "@brief Specifies the lambda value to used for reading\n" "\n" - "The lamdba value is the basic unit of the layout. Magic draws layout as multiples of this basic unit. " + "The lambda value is the basic unit of the layout. Magic draws layout as multiples of this basic unit. " "The layout read by the MAG reader will use the database unit specified by \\mag_dbu, but the physical layout " "coordinates will be multiples of \\mag_lambda.\n" "\nThis property has been added in version 0.26.2.\n" @@ -276,7 +276,7 @@ gsi::ClassExt mag_writer_options ( gsi::method_ext ("mag_lambda=", &set_mag_lambda_w, gsi::arg ("lambda"), "@brief Specifies the lambda value to used for writing\n" "\n" - "The lamdba value is the basic unit of the layout.\n" + "The lambda value is the basic unit of the layout.\n" "The layout is brought to units of this value. If the layout is not on-grid on this unit, snapping will happen. " "If the value is less or equal to zero, KLayout will use the lambda value stored inside the layout set by a previous read operation " "of a MAGIC file. The lambda value is stored in the Layout object as the \"lambda\" metadata attribute.\n" diff --git a/src/plugins/streamers/oasis/db_plugin/dbOASIS.h b/src/plugins/streamers/oasis/db_plugin/dbOASIS.h index 98b8b839e..b3d6168ef 100644 --- a/src/plugins/streamers/oasis/db_plugin/dbOASIS.h +++ b/src/plugins/streamers/oasis/db_plugin/dbOASIS.h @@ -197,7 +197,7 @@ public: bool is_regular (db::Vector &a, db::Vector &b, size_t &n, size_t &m) const; /** - * @brief Check, if the repepetition is a iterated one + * @brief Check, if the repetition is a iterated one * * @return 0 if not, otherwise a pointer to a vector of points */ diff --git a/src/plugins/streamers/oasis/db_plugin/dbOASISFormat.h b/src/plugins/streamers/oasis/db_plugin/dbOASISFormat.h index e84685ed4..f2fc45831 100644 --- a/src/plugins/streamers/oasis/db_plugin/dbOASISFormat.h +++ b/src/plugins/streamers/oasis/db_plugin/dbOASISFormat.h @@ -60,7 +60,7 @@ public: /** * @brief Indicates that the reader expects strict mode or note * - * This is mainly a debugging an testing option but it may be used to verifiy + * This is mainly a debugging an testing option but it may be used to verify * the compliance of a file with string or non-strict mode. * * The values are: diff --git a/src/plugins/streamers/oasis/db_plugin/dbOASISReader.cc b/src/plugins/streamers/oasis/db_plugin/dbOASISReader.cc index 8ee0eead6..3fd429a9e 100644 --- a/src/plugins/streamers/oasis/db_plugin/dbOASISReader.cc +++ b/src/plugins/streamers/oasis/db_plugin/dbOASISReader.cc @@ -1952,7 +1952,7 @@ OASISReader::do_read_text (bool xy_absolute, const std::vector *points = 0; - // If the repetion is a regular one, convert the repetition into + // If the repetition is a regular one, convert the repetition into // a shape array db::Vector a, b; size_t na, nb; @@ -2085,7 +2085,7 @@ OASISReader::do_read_rectangle (bool xy_absolute, const std::vector *points = 0; - // If the repetion is a regular one, convert the repetition into + // If the repetition is a regular one, convert the repetition into // a box array db::Vector a, b; size_t na, nb; @@ -2207,7 +2207,7 @@ OASISReader::do_read_polygon (bool xy_absolute, db::cell_index_type cell_index, const std::vector *points = 0; - // If the repetion is a regular one, convert the repetition into + // If the repetition is a regular one, convert the repetition into // a shape array db::Vector a, b; size_t na, nb; @@ -2376,7 +2376,7 @@ OASISReader::do_read_path (bool xy_absolute, db::cell_index_type cell_index, db: const std::vector *points = 0; - // If the repetion is a regular one, convert the repetition into + // If the repetition is a regular one, convert the repetition into // a shape array db::Vector a, b; size_t na, nb; @@ -2545,7 +2545,7 @@ OASISReader::do_read_trapezoid (unsigned char r, bool xy_absolute,db::cell_index const std::vector *points = 0; - // If the repetion is a regular one, convert the repetition into + // If the repetition is a regular one, convert the repetition into // a shape array db::Vector a, b; size_t na, nb; @@ -2905,7 +2905,7 @@ OASISReader::do_read_ctrapezoid (bool xy_absolute,db::cell_index_type cell_index const std::vector *points = 0; - // If the repetion is a regular one, convert the repetition into + // If the repetition is a regular one, convert the repetition into // a shape array db::Vector a, b; size_t na, nb; @@ -3044,7 +3044,7 @@ OASISReader::do_read_circle (bool xy_absolute, db::cell_index_type cell_index, d const std::vector *points = 0; - // If the repetion is a regular one, convert the repetition into + // If the repetition is a regular one, convert the repetition into // a shape array db::Vector a, b; size_t na, nb; diff --git a/src/plugins/streamers/oasis/db_plugin/dbOASISWriter.h b/src/plugins/streamers/oasis/db_plugin/dbOASISWriter.h index 7ce9da4fc..d5bcb8391 100644 --- a/src/plugins/streamers/oasis/db_plugin/dbOASISWriter.h +++ b/src/plugins/streamers/oasis/db_plugin/dbOASISWriter.h @@ -54,7 +54,7 @@ class OASISWriter; * This object will collect objects of the given kind and create * OASIS repetitions then. For this, it creates a hash map collecting all * equivalent objects on "add" and their displacements. When "emit" is called, - * these displacements are converted to OASIS repetions and + * these displacements are converted to OASIS repetitions and * emitted to the writer. */ diff --git a/src/plugins/streamers/pcb/db_plugin/dbGerberImporter.h b/src/plugins/streamers/pcb/db_plugin/dbGerberImporter.h index ac9d01f35..39bc11e8e 100644 --- a/src/plugins/streamers/pcb/db_plugin/dbGerberImporter.h +++ b/src/plugins/streamers/pcb/db_plugin/dbGerberImporter.h @@ -53,7 +53,7 @@ namespace db struct GerberMetaData { /** - * @brief Identfies the function of the layer + * @brief Identifies the function of the layer */ enum Function { @@ -69,7 +69,7 @@ struct GerberMetaData }; /** - * @brief Identfies the position of the layer + * @brief Identifies the position of the layer */ enum Position { @@ -501,7 +501,7 @@ protected: /** * @brief This method updates the progress counter * - * This method should be called regularily + * This method should be called regularly */ void progress_checkpoint (); diff --git a/src/plugins/streamers/pcb/db_plugin/dbRS274XApertures.cc b/src/plugins/streamers/pcb/db_plugin/dbRS274XApertures.cc index 717ee09de..cdc01109e 100644 --- a/src/plugins/streamers/pcb/db_plugin/dbRS274XApertures.cc +++ b/src/plugins/streamers/pcb/db_plugin/dbRS274XApertures.cc @@ -93,7 +93,7 @@ RS274XApertureBase::produce_linear (const db::DCplxTrans &d, const db::DVector & if (! do_produce_linear (from, to)) { - // fallback: produce flash and employ a Minkowsky sum to generate the resulting structure + // fallback: produce flash and employ a Minkowski sum to generate the resulting structure do_produce_flash (); double dbu = mp_reader->dbu (); @@ -111,7 +111,7 @@ RS274XApertureBase::produce_linear (const db::DCplxTrans &d, const db::DVector & } for (std::vector::const_iterator f = p.begin (); f != p.end (); ++f) { - m_polygons.push_back (db::minkowsky_sum (*f, db::Edge (ifrom, ito), true /*resolve holes*/)); + m_polygons.push_back (db::minkowski_sum (*f, db::Edge (ifrom, ito), true /*resolve holes*/)); } } diff --git a/src/plugins/tools/net_tracer/db_plugin/dbNetTracer.cc b/src/plugins/tools/net_tracer/db_plugin/dbNetTracer.cc index 6baf4ea98..0b5907082 100644 --- a/src/plugins/tools/net_tracer/db_plugin/dbNetTracer.cc +++ b/src/plugins/tools/net_tracer/db_plugin/dbNetTracer.cc @@ -1067,7 +1067,7 @@ NetTracer::trace (const db::Layout &layout, const db::Cell &cell, const NetTrace db::Box b = c->first.bbox (); double a = c->first.shape ().area (); - // The ratio theshold of 20 for box/shape area was determined empirically + // The ratio threshold of 20 for box/shape area was determined empirically if ((combined_box + b).area () > (asum + a) * 20.0) { ++c; --n; @@ -1221,7 +1221,7 @@ NetTracer::trace (const db::Layout &layout, const db::Cell &cell, const NetTrace const NetTracerShape *stop = &m_shapes_graph.find (m_stop_shape)->first; const NetTracerShape *start = &m_shapes_graph.find (m_start_shape)->first; - // find the shortest path with Dijkstras algorithm + // find the shortest path with Dijkstra's algorithm std::map previous; std::map cost; diff --git a/src/plugins/tools/net_tracer/lay_plugin/layNetTracerDialog.cc b/src/plugins/tools/net_tracer/lay_plugin/layNetTracerDialog.cc index d701b3774..7b8b24dc8 100644 --- a/src/plugins/tools/net_tracer/lay_plugin/layNetTracerDialog.cc +++ b/src/plugins/tools/net_tracer/lay_plugin/layNetTracerDialog.cc @@ -824,7 +824,7 @@ NetTracerDialog::update_info () db::coord_traits::area_type area = 0; db::coord_traits::perimeter_type perimeter = 0; - // Despite merging, a multitude of seperate non-touching polygons can exist. + // Despite merging, a multitude of separate non-touching polygons can exist. for (std::vector ::iterator j = merged.begin (); j != merged.end (); ++j) { // Sum area area += j->area (); diff --git a/src/plugins/tools/view_25d/lay_plugin/layD25ViewUtils.cc b/src/plugins/tools/view_25d/lay_plugin/layD25ViewUtils.cc index 6b873c96a..0dc1c87a8 100644 --- a/src/plugins/tools/view_25d/lay_plugin/layD25ViewUtils.cc +++ b/src/plugins/tools/view_25d/lay_plugin/layD25ViewUtils.cc @@ -180,7 +180,7 @@ normalize_scene_trans (const QMatrix4x4 &cam_trans, QVector3D &displacement, dou // // this is image invariant (only x,y results are considered) against changes of s (s->s') if // - // 1.) (p*d*s+z)/s = (p*d'*s'+z)/s' (because x and y will be devided by this value) + // 1.) (p*d*s+z)/s = (p*d'*s'+z)/s' (because x and y will be divided by this value) // 2.) (M*d*s+t)/s = (M*d'*s'+t)/s' for [x] and [y] // // or diff --git a/src/plugins/tools/view_25d/lay_plugin/layD25ViewWidget.cc b/src/plugins/tools/view_25d/lay_plugin/layD25ViewWidget.cc index 67c6bc8c9..7e9ce7b09 100644 --- a/src/plugins/tools/view_25d/lay_plugin/layD25ViewWidget.cc +++ b/src/plugins/tools/view_25d/lay_plugin/layD25ViewWidget.cc @@ -309,7 +309,7 @@ D25ViewWidget::keyPressEvent (QKeyEvent *event) if (! top_view () && (event->modifiers () & Qt::ControlModifier) != 0) { - // Ctrl + left/right changes azumith + // Ctrl + left/right changes azimuths double d = (event->key () == Qt::Key_Right ? 2 : -2); diff --git a/src/plugins/tools/xor/lay_plugin/layXORToolDialog.cc b/src/plugins/tools/xor/lay_plugin/layXORToolDialog.cc index eadd232a8..a828584ad 100644 --- a/src/plugins/tools/xor/lay_plugin/layXORToolDialog.cc +++ b/src/plugins/tools/xor/lay_plugin/layXORToolDialog.cc @@ -806,7 +806,7 @@ XORWorker::do_perform_deep (const XORTask *xor_task) rr.size (((*t + 1) / 2), (unsigned int)2, false); } - // TODO: no clipping for hieararchical mode yet + // TODO: no clipping for hierarchical mode yet mp_job->issue_region (tol_index, xor_task->layer_index (), rr); mp_job->add_results (xor_task->lp (), *t, rr.count (), xor_task->ix (), xor_task->iy ()); diff --git a/src/pya/pya/pya.cc b/src/pya/pya/pya.cc index 75232b1a5..dee876b65 100644 --- a/src/pya/pya/pya.cc +++ b/src/pya/pya/pya.cc @@ -331,7 +331,7 @@ PythonInterpreter::PythonInterpreter (bool embedded) #endif // Build two objects that provide a way to redirect stdout, stderr - // and instatiate them two times for stdout and stderr. + // and instantiate them two times for stdout and stderr. PYAChannelObject::make_class (module); m_stdout_channel = PythonRef (PYAChannelObject::create (gsi::Console::OS_stdout)); m_stdout = PythonPtr (m_stdout_channel.get ()); @@ -401,7 +401,7 @@ PythonInterpreter::remove_package_location (const std::string & /*package_path*/ void PythonInterpreter::require (const std::string & /*filename*/) { - // TOOD: is there a way to implement that? + // TODO: is there a way to implement that? throw tl::Exception (tl::to_string (tr ("'require' not implemented for Python interpreter"))); } diff --git a/src/pya/pya/pya.h b/src/pya/pya/pya.h index ae8423c6d..4688e64e8 100644 --- a/src/pya/pya/pya.h +++ b/src/pya/pya/pya.h @@ -150,7 +150,7 @@ public: /** * @brief Ignores the next exception * - * This is useful for suppressing reraised exceptions in the debugger. + * This is useful for suppressing re-raised exceptions in the debugger. */ void ignore_next_exception (); @@ -160,17 +160,17 @@ public: void load_file (const std::string &filename); /** - * @brief Implementatiom of gsi::Interpreter::eval_string + * @brief Implementation of gsi::Interpreter::eval_string */ void eval_string (const char *string, const char *filename = 0, int line = 1, int context = -1); /** - * @brief Implementatiom of gsi::Interpreter::eval_expr + * @brief Implementation of gsi::Interpreter::eval_expr */ tl::Variant eval_expr (const char *string, const char *filename = 0, int line = 1, int context = -1); /** - * @brief Implementatiom of gsi::Interpreter::eval_string_and_print + * @brief Implementation of gsi::Interpreter::eval_string_and_print */ void eval_string_and_print (const char *string, const char *filename = 0, int line = 1, int context = -1); diff --git a/src/pya/pya/pyaConvert.cc b/src/pya/pya/pyaConvert.cc index 271a71234..932c564cd 100644 --- a/src/pya/pya/pyaConvert.cc +++ b/src/pya/pya/pyaConvert.cc @@ -134,7 +134,7 @@ unsigned long long python2c_func::operator() (PyObject *rval template <> __int128 python2c_func<__int128>::operator() (PyObject *rval) { - // TOOD: this is pretty simplistic + // TODO: this is pretty simplistic #if PY_MAJOR_VERSION < 3 if (PyInt_Check (rval)) { return PyInt_AsLong (rval); @@ -393,7 +393,7 @@ object_to_python (void *obj, PYAObjectBase *self, const gsi::ArgType &atype) * @brief Correct constness if a reference is const and a non-const reference is required * HINT: this is a workaround for the fact that unlike C++, Python does not have const or non-const * references. Since a reference is identical with the object it points to, there are only const or non-const - * objects. We deliver const objects first, but if a non-const version is requestes, the + * objects. We deliver const objects first, but if a non-const version is requested, the * object turns into a non-const one. This may be confusing but provides a certain level * of "constness", at least until there is another non-const reference for that object. */ @@ -607,7 +607,7 @@ PyObject *c2python_func::operator() (const QString &qs) if (qs.isNull ()) { Py_RETURN_NONE; } else { - // TODO: can be done more efficently + // TODO: can be done more efficiently std::string c (tl::to_string (qs)); return c2python (c); } diff --git a/src/pya/pya/pyaMarshal.cc b/src/pya/pya/pyaMarshal.cc index ad72b4c12..0c44b2874 100644 --- a/src/pya/pya/pyaMarshal.cc +++ b/src/pya/pya/pyaMarshal.cc @@ -446,7 +446,7 @@ struct writer /** * @brief A serialization wrapper (write mode) - * Specialisation for objects + * Specialization for objects */ template <> struct writer @@ -530,7 +530,7 @@ struct writer /** * @brief A serialization wrapper (write mode) - * Specialisation for void + * Specialization for void */ template <> struct writer @@ -548,7 +548,7 @@ push_arg (const gsi::ArgType &atype, gsi::SerialArgs &aserial, PyObject *arg, tl } /** - * @brief Deseralisation wrapper + * @brief Deserialization wrapper * * The default implementation is for POD types, strings and variants */ @@ -582,7 +582,7 @@ struct reader }; /** - * @brief Deseralisation wrapper: specialization for const char * + * @brief Deserialization wrapper: specialization for const char * * * Without that would would have to handle void *&, void * const &, ... * TODO: right now these types are not supported. @@ -601,7 +601,7 @@ struct reader }; /** - * @brief Deseralisation wrapper: specialization for strings + * @brief Deserialization wrapper: specialization for strings */ template <> struct reader @@ -618,7 +618,7 @@ struct reader }; /** - * @brief Deseralisation wrapper: specialization for byte arrays + * @brief Deserialization wrapper: specialization for byte arrays */ template <> struct reader @@ -699,7 +699,7 @@ PyObject *object_from_variant (tl::Variant &var, PYAObjectBase *self, const gsi: } /** - * @brief Deseralisation wrapper: specialization for variants + * @brief Deserialization wrapper: specialization for variants */ template <> struct reader @@ -723,7 +723,7 @@ struct reader }; /** - * @brief Deseralisation wrapper: specialization for vectors + * @brief Deserialization wrapper: specialization for vectors */ template <> struct reader @@ -743,7 +743,7 @@ struct reader }; /** - * @brief Deseralisation wrapper: specialization for maps + * @brief Deserialization wrapper: specialization for maps */ template <> struct reader @@ -764,7 +764,7 @@ struct reader }; /** - * @brief Deseralisation wrapper: specialization for object + * @brief Deserialization wrapper: specialization for object */ template <> struct reader @@ -781,7 +781,7 @@ struct reader }; /** - * @brief Deseralisation wrapper: specialization for void + * @brief Deserialization wrapper: specialization for void */ template <> struct reader diff --git a/src/pya/pya/pyaMarshal.h b/src/pya/pya/pyaMarshal.h index 22aac4160..872205709 100644 --- a/src/pya/pya/pyaMarshal.h +++ b/src/pya/pya/pyaMarshal.h @@ -75,7 +75,7 @@ test_arg (const gsi::ArgType &atype, PyObject *arg, bool loose); * @brief Correct constness if a reference is const and a non-const reference is required * HINT: this is a workaround for the fact that unlike C++, Python does not have const or non-const * references. Since a reference is identical with the object it points to, there are only const or non-const - * objects. We deliver const objects first, but if a non-const version is requestes, the + * objects. We deliver const objects first, but if a non-const version is requested, the * object turns into a non-const one. This may be confusing but provides a certain level * of "constness", at least until there is another non-const reference for that object. */ diff --git a/src/pya/pya/pyaObject.cc b/src/pya/pya/pyaObject.cc index 09f635164..551e61c57 100644 --- a/src/pya/pya/pyaObject.cc +++ b/src/pya/pya/pyaObject.cc @@ -376,7 +376,7 @@ PYAObjectBase::initialize_callbacks () PythonRef type_ref ((PyObject *) Py_TYPE (py_object ()), false /*borrowed*/); - // Locate the callback-enabled methods set by Python tpye object (pointer) + // Locate the callback-enabled methods set by Python type object (pointer) // NOTE: I'm not quite sure whether the type object pointer is a good key // for the cache. It may change since class objects may expire too if // classes are put on the heap. Hence we have to keep a reference which is @@ -409,7 +409,7 @@ PYAObjectBase::initialize_callbacks () // possible to reimplement a method through instance attributes (rare case, I hope). // In addition, if we'd use instance attributes we create circular references // (self/callback to method, method to self). - // TOOD: That may happen too often, i.e. if the Python class does not reimplement the virtual + // TODO: That may happen too often, i.e. if the Python class does not reimplement the virtual // method, but the C++ class defines a method hook that the reimplementation can call. // We don't want to produce a lot of overhead for the Qt classes here. PythonRef py_attr = PyObject_GetAttrString ((PyObject *) Py_TYPE (py_object ()), nstr); @@ -476,7 +476,7 @@ PYAObjectBase::initialize_callbacks () // possible to reimplement a method through instance attributes (rare case, I hope). // In addition, if we'd use instance attributes we create circular references // (self/callback to method, method to self). - // TOOD: That may happen too often, i.e. if the Python class does not reimplement the virtual + // TODO: That may happen too often, i.e. if the Python class does not reimplement the virtual // method, but the C++ class defines a method hook that the reimplementation can call. // We don't want to produce a lot of overhead for the Qt classes here. PythonRef py_attr = PyObject_GetAttrString ((PyObject *) Py_TYPE (py_object ()), nstr); diff --git a/src/pyastub/pya.h b/src/pyastub/pya.h index 42f963cec..45826dc9d 100644 --- a/src/pyastub/pya.h +++ b/src/pyastub/pya.h @@ -82,7 +82,7 @@ public: /** * @brief Ignores the next exception * - * This is useful for suppressing reraised exceptions in the debugger. + * This is useful for suppressing re-raised exceptions in the debugger. */ void ignore_next_exception (); @@ -92,17 +92,17 @@ public: void load_file (const std::string &filename); /** - * @brief Implementatiom of gsi::Interpreter::eval_string + * @brief Implementation of gsi::Interpreter::eval_string */ void eval_string (const char *string, const char *filename = 0, int line = 1, int context = -1); /** - * @brief Implementatiom of gsi::Interpreter::eval_expr + * @brief Implementation of gsi::Interpreter::eval_expr */ tl::Variant eval_expr (const char *string, const char *filename = 0, int line = 1, int context = -1); /** - * @brief Implementatiom of gsi::Interpreter::eval_string_and_print + * @brief Implementation of gsi::Interpreter::eval_string_and_print */ void eval_string_and_print (const char *string, const char *filename = 0, int line = 1, int context = -1); diff --git a/src/rba/rba/rba.cc b/src/rba/rba/rba.cc index 17e970ddd..b0978762a 100644 --- a/src/rba/rba/rba.cc +++ b/src/rba/rba/rba.cc @@ -703,7 +703,7 @@ struct RubyInterpreterPrivateData } \ } \ if (__exc != Qnil) { \ - /* Reraise the exception without blocking in the debugger */ \ + /* Re-raise the exception without blocking in the debugger */ \ /* TODO: should not access private data */ \ RubyInterpreter::instance ()->d->block_exceptions = true; \ rb_exc_raise (__exc); \ @@ -836,7 +836,7 @@ special_method_impl (const gsi::MethodBase *meth, int argc, VALUE *argv, VALUE s return destroyed (self); } else if (smt == gsi::MethodBase::Assign) { - // this is either assign or dup in diguise + // this is either assign or dup in disguise tl_assert (argc == 1); return assign (self, argv [0]); diff --git a/src/rba/rba/rba.h b/src/rba/rba/rba.h index 41312de6f..bd8442724 100644 --- a/src/rba/rba/rba.h +++ b/src/rba/rba/rba.h @@ -95,7 +95,7 @@ public: /** * @brief Ignores the next exception * - * This is useful for suppressing reraised exceptions in the debugger. + * This is useful for suppressing re-raised exceptions in the debugger. */ void ignore_next_exception (); @@ -105,17 +105,17 @@ public: void load_file (const std::string &filename); /** - * @brief Implementatiom of gsi::Interpreter::eval_string + * @brief Implementation of gsi::Interpreter::eval_string */ void eval_string (const char *string, const char *filename = 0, int line = 1, int context = -1); /** - * @brief Implementatiom of gsi::Interpreter::eval_expr + * @brief Implementation of gsi::Interpreter::eval_expr */ tl::Variant eval_expr (const char *string, const char *filename = 0, int line = 1, int context = -1); /** - * @brief Implementatiom of gsi::Interpreter::eval_string_and_print + * @brief Implementation of gsi::Interpreter::eval_string_and_print */ void eval_string_and_print (const char *string, const char *filename = 0, int line = 1, int context = -1); diff --git a/src/rba/rba/rbaConvert.cc b/src/rba/rba/rbaConvert.cc index 06292b34f..6ac1a7877 100644 --- a/src/rba/rba/rbaConvert.cc +++ b/src/rba/rba/rbaConvert.cc @@ -143,7 +143,7 @@ VALUE object_to_ruby (void *obj, Proxy *self, const gsi::ArgType &atype) * @brief Correct constness if a reference is const and a non-const reference is required * HINT: this is a workaround for the fact that unlike C++, Ruby does not have const or non-const * references. Since a reference is identical with the object it points to, there are only const or non-const - * objects. We deliver const objects first, but if a non-const version is requestes, the + * objects. We deliver const objects first, but if a non-const version is requested, the * object turns into a non-const one. This may be confusing but provides a certain level * of "constness", at least until there is another non-const reference for that object. */ diff --git a/src/rba/rba/rbaConvert.h b/src/rba/rba/rbaConvert.h index 4d04e6d7e..66fc377a6 100644 --- a/src/rba/rba/rbaConvert.h +++ b/src/rba/rba/rbaConvert.h @@ -295,7 +295,7 @@ inline unsigned long long ruby2c (VALUE rval) template <> inline __int128 ruby2c<__int128> (VALUE rval) { - // TOOD: this is pretty simplistic + // TODO: this is pretty simplistic return rba_safe_num2dbl (rval); } #endif @@ -442,7 +442,7 @@ inline VALUE c2ruby (const unsigned long long &c) template <> inline VALUE c2ruby<__int128> (const __int128 &c) { - // TOOD: this is pretty simplistic + // TODO: this is pretty simplistic return rb_float_new (double (c)); } #endif diff --git a/src/rba/rba/rbaInternal.cc b/src/rba/rba/rbaInternal.cc index 65624843d..a7a1ecaf5 100644 --- a/src/rba/rba/rbaInternal.cc +++ b/src/rba/rba/rbaInternal.cc @@ -219,7 +219,7 @@ inline void destroy_object (const gsi::ClassBase *cls, void *obj) /** * @brief A GC disabler - * By instantiating this object, the gc is disabled while the object is alife. + * By instantiating this object, the gc is disabled while the object is alive. * Specifically in callbacks it's important to disable the GC to avoid undesired * side effects. */ diff --git a/src/rba/rba/rbaMarshal.cc b/src/rba/rba/rbaMarshal.cc index 58db2cb3f..15d5584d9 100644 --- a/src/rba/rba/rbaMarshal.cc +++ b/src/rba/rba/rbaMarshal.cc @@ -481,7 +481,7 @@ struct writer }; /** - * @brief A specialisation of the write function for vector types + * @brief A specialization of the write function for vector types */ template <> struct writer @@ -576,7 +576,7 @@ push_arg (const gsi::ArgType &atype, gsi::SerialArgs &aserial, VALUE arg, tl::He } /** - * @brief Deseralisation wrapper + * @brief Deserialization wrapper * * The default implementation is for POD types, strings and variants */ @@ -610,7 +610,7 @@ struct reader }; /** - * @brief Deseralisation wrapper: specialization for void * + * @brief Deserialization wrapper: specialization for void * * * Without that would would have to handle void *&, void * const &, ... * TODO: right now these types are not supported. @@ -629,7 +629,7 @@ struct reader }; /** - * @brief Deseralisation wrapper: specialization for strings + * @brief Deserialization wrapper: specialization for strings */ template <> struct reader @@ -646,7 +646,7 @@ struct reader }; /** - * @brief Deseralisation wrapper: specialization for strings + * @brief Deserialization wrapper: specialization for strings */ template <> struct reader @@ -720,7 +720,7 @@ static VALUE object_from_variant (tl::Variant &var, Proxy *self, const gsi::ArgT } /** - * @brief Deseralisation wrapper: specialization for variants + * @brief Deserialization wrapper: specialization for variants */ template <> struct reader @@ -744,7 +744,7 @@ struct reader }; /** - * @brief Deseralisation wrapper: specialization for vectors + * @brief Deserialization wrapper: specialization for vectors */ template <> struct reader @@ -764,7 +764,7 @@ struct reader }; /** - * @brief Deseralisation wrapper: specialization for maps + * @brief Deserialization wrapper: specialization for maps */ template <> struct reader @@ -785,7 +785,7 @@ struct reader }; /** - * @brief Deseralisation wrapper: specialization for objects + * @brief Deserialization wrapper: specialization for objects */ template <> struct reader diff --git a/src/rba/rba/rbaUtils.h b/src/rba/rba/rbaUtils.h index c784f022b..896183dd4 100644 --- a/src/rba/rba/rbaUtils.h +++ b/src/rba/rba/rbaUtils.h @@ -164,7 +164,7 @@ inline void rb_set_progname (VALUE pn) * functionality, the rb_sourcefile () variable is copied into the RNode object, as this * variable is usually updated with the current sourcefile name. * In effect, the string referenced by this variable participates in the GC mark&sweep - * steps which leads to unpredicable results, if this variable is not set to a valid + * steps which leads to unpredictable results, if this variable is not set to a valid * string (ruby) buffer or 0. * * As a consequence, this function must be called before rb_protect and likely other xx_protect diff --git a/src/rbastub/rba.h b/src/rbastub/rba.h index e87888dd1..2fc5a7ca2 100644 --- a/src/rbastub/rba.h +++ b/src/rbastub/rba.h @@ -79,7 +79,7 @@ public: /** * @brief Ignores the next exception * - * This is useful for suppressing reraised exceptions in the debugger. + * This is useful for suppressing re-raised exceptions in the debugger. */ void ignore_next_exception (); @@ -89,17 +89,17 @@ public: void load_file (const std::string &filename); /** - * @brief Implementatiom of gsi::Interpreter::eval_string + * @brief Implementation of gsi::Interpreter::eval_string */ void eval_string (const char *string, const char *filename = 0, int line = 1, int context = -1); /** - * @brief Implementatiom of gsi::Interpreter::eval_expr + * @brief Implementation of gsi::Interpreter::eval_expr */ tl::Variant eval_expr (const char *string, const char *filename = 0, int line = 1, int context = -1); /** - * @brief Implementatiom of gsi::Interpreter::eval_string_and_print + * @brief Implementation of gsi::Interpreter::eval_string_and_print */ void eval_string_and_print (const char *string, const char *filename = 0, int line = 1, int context = -1); diff --git a/src/rdb/rdb/gsiDeclRdb.cc b/src/rdb/rdb/gsiDeclRdb.cc index 4fe956551..6a67db600 100644 --- a/src/rdb/rdb/gsiDeclRdb.cc +++ b/src/rdb/rdb/gsiDeclRdb.cc @@ -176,7 +176,7 @@ Class decl_RdbCell ("rdb", "RdbCell", "This method has been introduced in version 0.23." ) + gsi::iterator_ext ("each_item", &cell_items_begin, &cell_items_end, - "@brief Iterates over all iterms inside the database which are associated with this cell\n" + "@brief Iterates over all items inside the database which are associated with this cell\n" "\n" "This method has been introduced in version 0.23." ) + @@ -299,7 +299,7 @@ Class decl_RdbCategory ("rdb", "RdbCategory", "This method has been introduced in version 0.23." ) + gsi::iterator_ext ("each_item", &category_items_begin, &category_items_end, - "@brief Iterates over all iterms inside the database which are associated with this category\n" + "@brief Iterates over all items inside the database which are associated with this category\n" "\n" "This method has been introduced in version 0.23." ) + @@ -402,7 +402,7 @@ Class decl_RdbCategory ("rdb", "RdbCategory", ), "@brief A category inside the report database\n" "Every item in the report database is assigned to a category. A category is a DRC rule check for example. " - "Categories can be organised hierarchically, i.e. a category may have sub-categories. Item counts are summarized " + "Categories can be organized hierarchically, i.e. a category may have sub-categories. Item counts are summarized " "for categories and items belonging to sub-categories of one category can be browsed together for example. " "As a general rule, categories not being leaf categories (having child categories) may not have items. " ); @@ -1339,18 +1339,18 @@ Class decl_ReportDatabase ("rdb", "ReportDatabase", "@brief Reset the modified flag\n" ) + gsi::iterator_ext ("each_item", &database_items_begin, &database_items_end, - "@brief Iterates over all iterms inside the database\n" + "@brief Iterates over all items inside the database\n" ) + gsi::iterator_ext ("each_item_per_cell", &database_items_begin_cell, &database_items_end_cell, gsi::arg ("cell_id"), - "@brief Iterates over all iterms inside the database which are associated with the given cell\n" + "@brief Iterates over all items inside the database which are associated with the given cell\n" "@param cell_id The ID of the cell for which all associated items should be retrieved\n" ) + gsi::iterator_ext ("each_item_per_category", &database_items_begin_cat, &database_items_end_cat, gsi::arg ("category_id"), - "@brief Iterates over all iterms inside the database which are associated with the given category\n" + "@brief Iterates over all items inside the database which are associated with the given category\n" "@param category_id The ID of the category for which all associated items should be retrieved\n" ) + gsi::iterator_ext ("each_item_per_cell_and_category", &database_items_begin_cc, &database_items_end_cc, gsi::arg ("cell_id"), gsi::arg ("category_id"), - "@brief Iterates over all iterms inside the database which are associated with the given cell and category\n" + "@brief Iterates over all items inside the database which are associated with the given cell and category\n" "@param cell_id The ID of the cell for which all associated items should be retrieved\n" "@param category_id The ID of the category for which all associated items should be retrieved\n" ) + @@ -1371,13 +1371,13 @@ Class decl_ReportDatabase ("rdb", "ReportDatabase", "The database is always saved in KLayout's XML-based format.\n" ), "@brief The report database object\n" - "A report database is organised around a set of items which are associated with cells and categories. " - "Categories can be organised hierarchically by created sub-categories of other categories. " + "A report database is organized around a set of items which are associated with cells and categories. " + "Categories can be organized hierarchically by created sub-categories of other categories. " "Cells are associated with layout database cells and can come with a example instantiation if the layout " "database does not allow a unique association of the cells.\n" "Items in the database can have a variety of attributes: values, tags and an image object. Values are " "geometrical objects for example. Tags are a set of boolean flags and an image can be attached to an item " - "to provide a screenshot for visualisation for example.\n" + "to provide a screenshot for visualization for example.\n" "This is the main report database object. The basic use case of this object is to create one inside a \\LayoutView and " "populate it with items, cell and categories or load it from a file. Another use case is to create a standalone " "ReportDatabase object and use the methods provided to perform queries or to populate it.\n" diff --git a/src/rdb/rdb/rdb.h b/src/rdb/rdb/rdb.h index 6c08e6d3d..138cd4d96 100644 --- a/src/rdb/rdb/rdb.h +++ b/src/rdb/rdb/rdb.h @@ -69,7 +69,7 @@ class Items; * An item is member of exactly one category. This can be a check for example. * A category is described by a name and a description string. An Id is provided * to reference this category from actual report items. - * Categories can be organised hierarchically for which a category collection + * Categories can be organized hierarchically for which a category collection * is provided and member of the individual category. * * A category can only be created by the database object, since the diff --git a/testdata/drc/drcSimpleTests_50.drc b/testdata/drc/drcSimpleTests_50.drc new file mode 100644 index 000000000..c4fe22019 --- /dev/null +++ b/testdata/drc/drcSimpleTests_50.drc @@ -0,0 +1,14 @@ + +source $drc_test_source +target $drc_test_target + +# Problem of #826 was deep-mode universal DRC with threading + +deep +threads(4) + +l7 = input(7, 0) +l7.output(7, 0) + +l7.drc((angle == 0) & (length < 12.0)).extended_out(1.dbu).output(100, 0) + diff --git a/testdata/drc/drcSimpleTests_50.gds b/testdata/drc/drcSimpleTests_50.gds new file mode 100644 index 000000000..667f1e7be Binary files /dev/null and b/testdata/drc/drcSimpleTests_50.gds differ diff --git a/testdata/drc/drcSimpleTests_au50.gds b/testdata/drc/drcSimpleTests_au50.gds new file mode 100644 index 000000000..b4666c147 Binary files /dev/null and b/testdata/drc/drcSimpleTests_au50.gds differ diff --git a/testdata/lefdef/mapfile/test.map b/testdata/lefdef/mapfile/test.map index 7a8609dad..0f8dfaf24 100644 --- a/testdata/lefdef/mapfile/test.map +++ b/testdata/lefdef/mapfile/test.map @@ -14,5 +14,6 @@ M1 BLOCKAGEFILL 12 150 M1 BLOCKAGE 12 151 M1 FILL 12 152 NAME M1/PIN 12 10 +NAME M1/LEFPIN 12 10 VIA1 LEFPIN,LEFOBS,VIA,PIN,NET,SPNET 13 0 M2 LEFPIN,LEFOBS,PIN,NET,SPNET,VIA 14 0 diff --git a/testdata/lefdef/masks-1/au_map.oas.gz b/testdata/lefdef/masks-1/au_map.oas.gz index dd9c9bc00..e158ced2c 100644 Binary files a/testdata/lefdef/masks-1/au_map.oas.gz and b/testdata/lefdef/masks-1/au_map.oas.gz differ diff --git a/testdata/lefdef/masks-2/au.oas.gz b/testdata/lefdef/masks-2/au.oas.gz index bb71f6fe6..a0547b10e 100644 Binary files a/testdata/lefdef/masks-2/au.oas.gz and b/testdata/lefdef/masks-2/au.oas.gz differ