MCPcopy Create free account
hub / github.com/KLayout/klayout / instance_is_covered

Method instance_is_covered

src/db/db/dbRecursiveShapeIterator.cc:1014–1032  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1012}
1013
1014bool
1015RecursiveShapeIterator::instance_is_covered (const box_type &inst_bx, unsigned int layer) const
1016{
1017 // Try some optimization: if the instance we're looking at is entirely covered
1018 // by a rectangle (other objects are too expensive to check), then we skip it
1019 //
1020 // We check 10 shapes max.
1021
1022 auto si = cell ()->shapes (layer).begin_overlapping (inst_bx, m_shape_flags, mp_shape_prop_sel, m_shape_inv_prop_sel);
1023 size_t nmax = 10;
1024 while (! si.at_end () && nmax-- > 0) {
1025 if (inst_bx.inside (si->rectangle ())) {
1026 return true;
1027 }
1028 ++si;
1029 }
1030
1031 return false;
1032}
1033
1034bool
1035RecursiveShapeIterator::skip_shapes () const

Callers

nothing calls this directly

Calls 5

rectangleMethod · 0.80
cellFunction · 0.70
begin_overlappingMethod · 0.45
at_endMethod · 0.45
insideMethod · 0.45

Tested by

no test coverage detected