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

Function init_layout

src/db/unit_tests/dbLayoutQueryTests.cc:977–1022  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

975}
976
977void init_layout (db::Layout &g)
978{
979 g = db::Layout ();
980
981 g.insert_layer (0, db::LayerProperties ("l0"));
982 g.insert_layer (1, db::LayerProperties ("l1"));
983 g.insert_layer (2, db::LayerProperties ("l2"));
984 db::Cell &c1 (g.cell (g.add_cell ("c1")));
985 db::Cell &c2 (g.cell (g.add_cell ("c2x")));
986 db::Cell &c3 (g.cell (g.add_cell ("c3")));
987 db::Cell &c4 (g.cell (g.add_cell ("c4")));
988 db::Cell &c5 (g.cell (g.add_cell ("c5x")));
989 c2.shapes (0).insert (db::Box (0, 1, 2, 3));
990 c2.shapes (1).insert (db::Polygon (db::Box (0, 1, 2, 3)));
991 c2.shapes (1).insert (db::Edge (db::Point (0, 1), db::Point (2, 3)));
992 c2.shapes (2).insert (db::Text ("hallo", db::Trans (db::Vector (10, 11))));
993 c1.shapes (1).insert (db::Box (0, 10, 10, 30));
994
995 db::FTrans f (1, true);
996 db::Vector p (-10, 20);
997 db::Trans t (f.rot (), p);
998 db::Vector pp (10, -20);
999 db::Trans tt (0, pp);
1000
1001 // c4->c1 (aref)
1002 c4.insert (db::array <db::CellInst, db::Trans> (db::CellInst (c1.cell_index ()), t, db::Vector(1, 1), db::Vector (0, 2), 2, 3));
1003 // c5->c1
1004 c5.insert (db::array <db::CellInst, db::Trans> (db::CellInst (c1.cell_index ()), t));
1005 // c3->c5 (3x)
1006 c3.insert (db::array <db::CellInst, db::Trans> (db::CellInst (c5.cell_index ()), t));
1007 c3.insert (db::array <db::CellInst, db::Trans> (db::CellInst (c5.cell_index ()), tt));
1008 c3.insert (db::array <db::CellInst, db::Trans> (db::CellInst (c5.cell_index ()), t));
1009 // c4->c3
1010 c4.insert (db::array <db::CellInst, db::Trans> (db::CellInst (c3.cell_index ()), t));
1011 // c4->c1
1012 c4.insert (db::array <db::CellInst, db::Trans> (db::CellInst (c1.cell_index ()), tt));
1013 // c2->c1 (2x)
1014 c2.insert (db::array <db::CellInst, db::Trans> (db::CellInst (c1.cell_index ()), t));
1015 c2.insert (db::array <db::CellInst, db::Trans> (db::CellInst (c1.cell_index ()), tt));
1016 // c2->c4 (2x)
1017 c2.insert (db::array <db::CellInst, db::Trans> (db::CellInst (c4.cell_index ()), t));
1018 c2.insert (db::array <db::CellInst, db::Trans> (db::CellInst (c4.cell_index ()), t));
1019 // c2->c5 (2x)
1020 c2.insert (db::array <db::CellInst, db::Trans> (db::CellInst (c5.cell_index ()), t));
1021 c2.insert (db::array <db::CellInst, db::Trans> (db::CellInst (c5.cell_index ()), tt));
1022}
1023
1024void init_layout2 (db::Layout &g)
1025{

Callers 1

Calls 15

LayoutClass · 0.50
LayerPropertiesClass · 0.50
BoxClass · 0.50
PolygonFunction · 0.50
EdgeClass · 0.50
PointClass · 0.50
TextClass · 0.50
VectorClass · 0.50
CellInstFunction · 0.50
insert_layerMethod · 0.45
cellMethod · 0.45
add_cellMethod · 0.45

Tested by

no test coverage detected