mirror of https://github.com/KLayout/klayout.git
Fixed hier processor in case of self-interactions
This commit is contained in:
parent
2e61998372
commit
ee55a4ca21
|
|
@ -155,21 +155,24 @@ void SelfOverlapMergeLocalOperation::compute_local (db::Layout *layout, const Sh
|
||||||
db::EdgeProcessor ep;
|
db::EdgeProcessor ep;
|
||||||
|
|
||||||
size_t p1 = 0, p2 = 1;
|
size_t p1 = 0, p2 = 1;
|
||||||
std::set<unsigned int> seen2;
|
std::set<unsigned int> seen;
|
||||||
|
|
||||||
for (ShapeInteractions::iterator i = interactions.begin (); i != interactions.end (); ++i) {
|
for (ShapeInteractions::iterator i = interactions.begin (); i != interactions.end (); ++i) {
|
||||||
|
|
||||||
const db::PolygonRef &subject = interactions.shape (i->first);
|
if (seen.find (i->first) == seen.end ()) {
|
||||||
for (db::PolygonRef::polygon_edge_iterator e = subject.begin_edge (); ! e.at_end(); ++e) {
|
seen.insert (i->first);
|
||||||
ep.insert (*e, p1);
|
const db::PolygonRef &subject = interactions.shape (i->first);
|
||||||
|
for (db::PolygonRef::polygon_edge_iterator e = subject.begin_edge (); ! e.at_end(); ++e) {
|
||||||
|
ep.insert (*e, p1);
|
||||||
|
}
|
||||||
|
p1 += 2;
|
||||||
}
|
}
|
||||||
p1 += 2;
|
|
||||||
|
|
||||||
for (db::ShapeInteractions::iterator2 o = i->second.begin (); o != i->second.end (); ++o) {
|
for (db::ShapeInteractions::iterator2 o = i->second.begin (); o != i->second.end (); ++o) {
|
||||||
// don't take the same (really the same, not an identical one) shape twice - the interaction
|
// don't take the same (really the same, not an identical one) shape twice - the interaction
|
||||||
// set does not take care to list just one copy of the same item on the intruder side.
|
// set does not take care to list just one copy of the same item on the intruder side.
|
||||||
if (seen2.find (*o) == seen2.end ()) {
|
if (seen.find (*o) == seen.end ()) {
|
||||||
seen2.insert (*o);
|
seen.insert (*o);
|
||||||
const db::PolygonRef &intruder = interactions.shape (*o);
|
const db::PolygonRef &intruder = interactions.shape (*o);
|
||||||
for (db::PolygonRef::polygon_edge_iterator e = intruder.begin_edge (); ! e.at_end(); ++e) {
|
for (db::PolygonRef::polygon_edge_iterator e = intruder.begin_edge (); ! e.at_end(); ++e) {
|
||||||
ep.insert (*e, p2);
|
ep.insert (*e, p2);
|
||||||
|
|
@ -414,6 +417,7 @@ public:
|
||||||
} else {
|
} else {
|
||||||
mp_result->add_shape (id2, *ref2);
|
mp_result->add_shape (id2, *ref2);
|
||||||
}
|
}
|
||||||
|
|
||||||
mp_result->add_interaction (id1, id2);
|
mp_result->add_interaction (id1, id2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -863,7 +867,11 @@ void LocalProcessor::compute_contexts (LocalProcessorContexts &contexts,
|
||||||
|
|
||||||
for (std::set<const db::CellInstArray *>::const_iterator j = i->second.first.begin (); j != i->second.first.end (); ++j) {
|
for (std::set<const db::CellInstArray *>::const_iterator j = i->second.first.begin (); j != i->second.first.end (); ++j) {
|
||||||
for (db::CellInstArray::iterator k = (*j)->begin_touching (nbox.enlarged (db::Vector (-1, -1)), inst_bcii); ! k.at_end (); ++k) {
|
for (db::CellInstArray::iterator k = (*j)->begin_touching (nbox.enlarged (db::Vector (-1, -1)), inst_bcii); ! k.at_end (); ++k) {
|
||||||
intruders_below.first.insert (db::CellInstArray (db::CellInst ((*j)->object ().cell_index ()), tni * (*j)->complex_trans (*k)));
|
db::ICplxTrans tk = (*j)->complex_trans (*k);
|
||||||
|
// NOTE: no self-interactions
|
||||||
|
if (i->first != *j || tn != tk) {
|
||||||
|
intruders_below.first.insert (db::CellInstArray (db::CellInst ((*j)->object ().cell_index ()), tni * tk));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
|
|
@ -910,7 +910,7 @@ TEST(BasicSelfOverlap9)
|
||||||
// from atop the CHILD cell don't interact with shapes inside CHILD, so there are 4 shapes rather than
|
// 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.
|
// 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"
|
"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, 4 shapes (2 times)\n"
|
"CHILD1[1] 0 insts, 4 shapes (2 times)\n"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue