diff --git a/src/plugins/tools/netx/testdata/hlp1.oas b/src/plugins/tools/netx/testdata/hlp1.oas index 39fe2a5dd..27c260c48 100644 Binary files a/src/plugins/tools/netx/testdata/hlp1.oas and b/src/plugins/tools/netx/testdata/hlp1.oas differ diff --git a/src/plugins/tools/netx/testdata/hlp10.oas b/src/plugins/tools/netx/testdata/hlp10.oas index 53aba0a97..0da2e135c 100644 Binary files a/src/plugins/tools/netx/testdata/hlp10.oas and b/src/plugins/tools/netx/testdata/hlp10.oas differ diff --git a/src/plugins/tools/netx/testdata/hlp2.oas b/src/plugins/tools/netx/testdata/hlp2.oas index bbdb6edb8..f23c070e1 100644 Binary files a/src/plugins/tools/netx/testdata/hlp2.oas and b/src/plugins/tools/netx/testdata/hlp2.oas differ diff --git a/src/plugins/tools/netx/testdata/hlp3.oas b/src/plugins/tools/netx/testdata/hlp3.oas index feb47dd7b..e0574ba5f 100644 Binary files a/src/plugins/tools/netx/testdata/hlp3.oas and b/src/plugins/tools/netx/testdata/hlp3.oas differ diff --git a/src/plugins/tools/netx/testdata/hlp4.oas b/src/plugins/tools/netx/testdata/hlp4.oas index 508689d78..ea722bf01 100644 Binary files a/src/plugins/tools/netx/testdata/hlp4.oas and b/src/plugins/tools/netx/testdata/hlp4.oas differ diff --git a/src/plugins/tools/netx/testdata/hlp5.oas b/src/plugins/tools/netx/testdata/hlp5.oas index dd9ffd9e8..04963b400 100644 Binary files a/src/plugins/tools/netx/testdata/hlp5.oas and b/src/plugins/tools/netx/testdata/hlp5.oas differ diff --git a/src/plugins/tools/netx/testdata/hlp6.oas b/src/plugins/tools/netx/testdata/hlp6.oas index 56db21f0a..38a6ae94a 100644 Binary files a/src/plugins/tools/netx/testdata/hlp6.oas and b/src/plugins/tools/netx/testdata/hlp6.oas differ diff --git a/src/plugins/tools/netx/testdata/hlp7.oas b/src/plugins/tools/netx/testdata/hlp7.oas index 36664d1a9..275744865 100644 Binary files a/src/plugins/tools/netx/testdata/hlp7.oas and b/src/plugins/tools/netx/testdata/hlp7.oas differ diff --git a/src/plugins/tools/netx/testdata/hlp8.oas b/src/plugins/tools/netx/testdata/hlp8.oas index 9b32237c9..3b9f1acc1 100644 Binary files a/src/plugins/tools/netx/testdata/hlp8.oas and b/src/plugins/tools/netx/testdata/hlp8.oas differ diff --git a/src/plugins/tools/netx/testdata/hlp9.oas b/src/plugins/tools/netx/testdata/hlp9.oas index 16d63a4f8..9b597f891 100644 Binary files a/src/plugins/tools/netx/testdata/hlp9.oas and b/src/plugins/tools/netx/testdata/hlp9.oas differ diff --git a/src/plugins/tools/netx/unit_tests/dbHierProcessorTests.cc b/src/plugins/tools/netx/unit_tests/dbHierProcessorTests.cc index b45f3b4e7..6dd1c5b03 100644 --- a/src/plugins/tools/netx/unit_tests/dbHierProcessorTests.cc +++ b/src/plugins/tools/netx/unit_tests/dbHierProcessorTests.cc @@ -76,6 +76,50 @@ private: db::Coord m_dist; }; +/** + * @brief A new processor class which and/nots with a sized version of the intruder + */ +class SelfOverlapWithSizedLocalOperation + : public db::SelfOverlapMergeLocalOperation +{ +public: + SelfOverlapWithSizedLocalOperation (unsigned int wc, db::Coord dist) + : SelfOverlapMergeLocalOperation (wc), m_dist (dist) + { + // .. nothing yet .. + } + + virtual void compute_local (db::Layout *layout, const db::ShapeInteractions &interactions, std::set &result) const + { + db::ShapeInteractions sized_interactions = interactions; + for (db::ShapeInteractions::iterator i = sized_interactions.begin (); i != sized_interactions.end (); ++i) { + + const db::PolygonRef &ref = interactions.shape (i->first); + db::Polygon poly = ref.obj ().transformed (ref.trans ()); + poly.size (m_dist / 2, m_dist / 2); + sized_interactions.add_shape (i->first, db::PolygonRef (poly, layout->shape_repository ())); + + for (db::ShapeInteractions::iterator2 j = i->second.begin (); j != i->second.end (); ++j) { + const db::PolygonRef &ref = interactions.shape (*j); + db::Polygon poly = ref.obj ().transformed (ref.trans ()); + poly.size (m_dist / 2, m_dist / 2); + sized_interactions.add_shape (*j, db::PolygonRef (poly, layout->shape_repository ())); + } + + } + + SelfOverlapMergeLocalOperation::compute_local (layout, sized_interactions, result); + } + + db::Coord dist () const + { + return m_dist; + } + +private: + db::Coord m_dist; +}; + /** * @brief Turns a layer into polygons and polygon references * The hierarchical processor needs polygon references and can't work on polygons directly. @@ -228,8 +272,12 @@ void run_test_bool_with_size_gen (tl::TestBase *_this, const char *file, TestMod p.layer = 2; p.datatype = 0; - lmap.map (db::LDPair (2, 0), l2 = layout_org.insert_layer ()); - layout_org.set_properties (l2, p); + if (mode == TMSelfOverlap) { + lmap.map (db::LDPair (2, 0), l2 = l1); + } else { + lmap.map (db::LDPair (2, 0), l2 = layout_org.insert_layer ()); + layout_org.set_properties (l2, p); + } p.layer = out_layer_num; p.datatype = 0; @@ -246,19 +294,27 @@ void run_test_bool_with_size_gen (tl::TestBase *_this, const char *file, TestMod normalize_layer (layout_org, l1); normalize_layer (layout_org, l2); - BoolAndOrNotWithSizedLocalOperation op (mode == TMAnd, dist); + db::LocalOperation *lop = 0; + BoolAndOrNotWithSizedLocalOperation bool_op (mode == TMAnd, dist); + SelfOverlapWithSizedLocalOperation self_intersect_op (2, dist); + if (mode == TMSelfOverlap) { + lop = &self_intersect_op; + } else { + lop = &bool_op; + } + if (single) { db::LocalProcessor proc (&layout_org, &layout_org.cell (*layout_org.begin_top_down ())); if (! context_doc) { - proc.run (&op, l1, l2, lout); + proc.run (lop, l1, l2, lout); } else { db::LocalProcessorContexts contexts; - proc.compute_contexts (contexts, &op, l1, l2); + proc.compute_contexts (contexts, lop, l1, l2); *context_doc = contexts_to_s (&layout_org, contexts); - proc.compute_results (contexts, &op, lout); + proc.compute_results (contexts, lop, lout); } } else { @@ -268,12 +324,12 @@ void run_test_bool_with_size_gen (tl::TestBase *_this, const char *file, TestMod db::LocalProcessor proc (&layout_org, &layout_org.cell (*layout_org.begin_top_down ()), &layout_org2, &layout_org2.cell (*layout_org2.begin_top_down ())); if (! context_doc) { - proc.run (&op, l1, l2, lout); + proc.run (lop, l1, l2, lout); } else { db::LocalProcessorContexts contexts; - proc.compute_contexts (contexts, &op, l1, l2); + proc.compute_contexts (contexts, lop, l1, l2); *context_doc = contexts_to_s (&layout_org, contexts); - proc.compute_results (contexts, &op, lout); + proc.compute_results (contexts, lop, lout); } } @@ -853,55 +909,55 @@ TEST(TwoInputsNotWithSize10) TEST(BasicSelfOverlap1) { - // Simple flat AND + // Simple flat Self overlap run_test_bool (_this, "hlp1.oas", TMSelfOverlap, 110); } TEST(BasicSelfOverlap2) { - // Up/down and down/up interactions, AND + // Up/down and down/up interactions, Self overlap run_test_bool (_this, "hlp2.oas", TMSelfOverlap, 110); } TEST(BasicSelfOverlap3) { - // Variant building, AND + // Variant building, Self overlap run_test_bool (_this, "hlp3.oas", TMSelfOverlap, 110); } TEST(BasicSelfOverlap4) { - // Sibling interactions, variant building, AND + // Sibling interactions, variant building, Self overlap run_test_bool (_this, "hlp4.oas", TMSelfOverlap, 110); } TEST(BasicSelfOverlap5) { - // Variant building with intermediate hierarchy, AND + // Variant building with intermediate hierarchy, Self overlap run_test_bool (_this, "hlp5.oas", TMSelfOverlap, 110); } TEST(BasicSelfOverlap6) { - // Extreme variants (copy, vanishing), AND + // Extreme variants (copy, vanishing), Self overlap run_test_bool (_this, "hlp6.oas", TMSelfOverlap, 110); } TEST(BasicSelfOverlap7) { - // Context replication - direct and indirect, AND + // Context replication - direct and indirect, Self overlap run_test_bool (_this, "hlp7.oas", TMSelfOverlap, 110); } TEST(BasicSelfOverlap8) { - // Mixed sibling-parent contexts, AND + // Mixed sibling-parent contexts, Self overlap run_test_bool (_this, "hlp8.oas", TMSelfOverlap, 110); } TEST(BasicSelfOverlap9) { - // Top-level ring structure, AND + // Top-level ring structure, Self overlap std::string doc; run_test_bool (_this, "hlp9.oas", TMSelfOverlap, 110, &doc); EXPECT_EQ (doc, @@ -917,62 +973,61 @@ TEST(BasicSelfOverlap9) TEST(BasicSelfOverlap10) { - // Array instances, AND + // Array instances, Self overlap run_test_bool (_this, "hlp10.oas", TMSelfOverlap, 110); } -#if 0 // @@@ TEST(BasicSelfOverlapWithSize1) { - // Simple flat AND + // Simple flat Self overlap run_test_bool_with_size (_this, "hlp1.oas", TMSelfOverlap, 1500, 111); } TEST(BasicSelfOverlapWithSize2) { - // Up/down and down/up interactions, AND + // Up/down and down/up interactions, Self overlap run_test_bool_with_size (_this, "hlp2.oas", TMSelfOverlap, 1500, 111); } TEST(BasicSelfOverlapWithSize3) { - // Variant building, AND + // Variant building, Self overlap run_test_bool_with_size (_this, "hlp3.oas", TMSelfOverlap, 1500, 111); } TEST(BasicSelfOverlapWithSize4) { - // Sibling interactions, variant building, AND + // Sibling interactions, variant building, Self overlap run_test_bool_with_size (_this, "hlp4.oas", TMSelfOverlap, 1500, 111); } TEST(BasicSelfOverlapWithSize5) { - // Variant building with intermediate hierarchy, AND + // Variant building with intermediate hierarchy, Self overlap run_test_bool_with_size (_this, "hlp5.oas", TMSelfOverlap, 1500, 111); } TEST(BasicSelfOverlapWithSize6) { - // Extreme variants (copy, vanishing), AND + // Extreme variants (copy, vanishing), Self overlap run_test_bool_with_size (_this, "hlp6.oas", TMSelfOverlap, 1500, 111); } TEST(BasicSelfOverlapWithSize7) { - // Context replication - direct and indirect, AND + // Context replication - direct and indirect, Self overlap run_test_bool_with_size (_this, "hlp7.oas", TMSelfOverlap, 1500, 111); } TEST(BasicSelfOverlapWithSize8) { - // Mixed sibling-parent contexts, AND + // Mixed sibling-parent contexts, Self overlap run_test_bool_with_size (_this, "hlp8.oas", TMSelfOverlap, 1500, 111); } TEST(BasicSelfOverlapWithSize9) { - // Top-level ring structure, AND + // Top-level ring structure, Self overlap std::string doc; run_test_bool_with_size (_this, "hlp9.oas", TMSelfOverlap, 1500, 111, &doc); EXPECT_EQ (doc, @@ -981,16 +1036,14 @@ TEST(BasicSelfOverlapWithSize9) // from atop the CHILD cell don't interact with shapes inside CHILD, so there are 4 shapes rather than // 6. And the shapes from top inside the ring are not seen by the RING's subject shapes. "TOP[1] 0 insts, 0 shapes (1 times)\n" - "RING[1] 0 insts, 0 shapes (1 times)\n" + "RING[1] 0 insts, 1 shapes (1 times)\n" "CHILD1[1] 0 insts, 6 shapes (2 times)\n" ); } TEST(BasicSelfOverlapWithSize10) { - // Array instances, AND + // Array instances, Self overlap run_test_bool_with_size (_this, "hlp10.oas", TMSelfOverlap, 150, 111); } -#endif -