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

Method begin_touching

src/db/db/dbArray.h:1899–1930  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1897 */
1898 template <class BoxConv>
1899 array_iterator <coord_type, Trans> begin_touching (const box_type &b, const BoxConv &bc) const
1900 {
1901 if (b.empty ()) {
1902 return array_iterator <coord_type, Trans> (m_trans, true);
1903 } else if (b == box_type::world ()) {
1904 return begin ();
1905 } else if (mp_base) {
1906 box_type ob (bc (m_obj));
1907 if (ob.empty ()) {
1908 return array_iterator <coord_type, Trans> (m_trans, true);
1909 } else {
1910 if (mp_base->is_complex ()) {
1911 complex_trans_type ct = mp_base->complex_trans (simple_trans_type (m_trans));
1912 ct.disp (typename complex_trans_type::displacement_type ());
1913 ob = box_type (ct * ob);
1914 } else {
1915 ob.transform (db::fixpoint_trans<coord_type> (m_trans.rot ()));
1916 }
1917 vector_type d = m_trans.disp ();
1918 return array_iterator <coord_type, Trans> (m_trans, mp_base->begin_touching (box_type (point_type () + (b.p1 () - (ob.p2 () + d)), point_type () + (b.p2 () - (ob.p1 () + d)))));
1919 }
1920 } else {
1921 box_type ob (bc (m_obj));
1922 if (ob.empty ()) {
1923 return array_iterator <coord_type, Trans> (m_trans, true);
1924 } else {
1925 vector_type d = m_trans.disp ();
1926 ob.transform (db::fixpoint_trans<coord_type> (m_trans.rot ()));
1927 return array_iterator <coord_type, Trans> (m_trans, ! box_type (point_type () + (b.p1 () - (ob.p2 () + d)), point_type () + (b.p2 () - (ob.p1 () + d))).contains (point_type ()));
1928 }
1929 }
1930 }
1931
1932 /**
1933 * @brief The regular array member iterator

Callers 1

begin_touchingMethod · 0.45

Calls 11

worldFunction · 0.85
beginFunction · 0.70
emptyMethod · 0.45
is_complexMethod · 0.45
complex_transMethod · 0.45
dispMethod · 0.45
transformMethod · 0.45
rotMethod · 0.45
p1Method · 0.45
p2Method · 0.45
containsMethod · 0.45

Tested by

no test coverage detected