mirror of https://github.com/KLayout/klayout.git
WIP: more tests, debugging
This commit is contained in:
parent
8d6dd23850
commit
953bee4790
|
|
@ -394,3 +394,69 @@ TEST(9_LogicalSelectOperation)
|
|||
db::compare_layouts (_this, ly, tl::testsrc () + "/testdata/drc/compound_au9.gds");
|
||||
}
|
||||
|
||||
TEST(10_LogicalSelectOperation)
|
||||
{
|
||||
db::Layout ly;
|
||||
{
|
||||
std::string fn (tl::testsrc ());
|
||||
fn += "/testdata/drc/compound_10.gds";
|
||||
tl::InputStream stream (fn);
|
||||
db::Reader reader (stream);
|
||||
reader.read (ly);
|
||||
}
|
||||
|
||||
db::RegionCheckOptions check_options;
|
||||
check_options.metrics = db::Projection;
|
||||
|
||||
unsigned int l1 = ly.get_layer (db::LayerProperties (1, 0));
|
||||
db::Region r (db::RecursiveShapeIterator (ly, ly.cell (*ly.begin_top_down ()), l1));
|
||||
|
||||
unsigned int l2 = ly.get_layer (db::LayerProperties (2, 0));
|
||||
db::Region r2 (db::RecursiveShapeIterator (ly, ly.cell (*ly.begin_top_down ()), l2));
|
||||
|
||||
db::CompoundRegionOperationPrimaryNode *primary = new db::CompoundRegionOperationPrimaryNode ();
|
||||
|
||||
db::CompoundRegionFilterOperationNode *condition1 = new db::CompoundRegionFilterOperationNode (new db::RegionAreaFilter (0, 10000000, true), primary, true);
|
||||
db::CompoundRegionFilterOperationNode *condition1r = new db::CompoundRegionFilterOperationNode (new db::RegionAreaFilter (0, 10000000, false), primary, true);
|
||||
|
||||
db::CompoundRegionFilterOperationNode *condition2 = new db::CompoundRegionFilterOperationNode (new db::RectangleFilter (false), primary, true);
|
||||
|
||||
std::vector<db::CompoundRegionOperationNode *> inputs;
|
||||
inputs.push_back (condition1r);
|
||||
inputs.push_back (condition2);
|
||||
|
||||
db::CompoundRegionLogicalBoolOperationNode and_node (db::CompoundRegionLogicalBoolOperationNode::And, false, inputs);
|
||||
db::CompoundRegionLogicalBoolOperationNode not_and_node (db::CompoundRegionLogicalBoolOperationNode::And, true, inputs);
|
||||
|
||||
inputs.clear ();
|
||||
inputs.push_back (condition1);
|
||||
inputs.push_back (condition2);
|
||||
|
||||
db::CompoundRegionLogicalBoolOperationNode or_node (db::CompoundRegionLogicalBoolOperationNode::Or, false, inputs);
|
||||
db::CompoundRegionLogicalBoolOperationNode not_or_node (db::CompoundRegionLogicalBoolOperationNode::Or, true, inputs);
|
||||
|
||||
db::Region res;
|
||||
res = r.cop_to_region (and_node);
|
||||
|
||||
unsigned int l1000 = ly.get_layer (db::LayerProperties (1000, 0));
|
||||
res.insert_into (&ly, *ly.begin_top_down (), l1000);
|
||||
|
||||
res = r.cop_to_region (not_and_node);
|
||||
|
||||
unsigned int l1001 = ly.get_layer (db::LayerProperties (1001, 0));
|
||||
res.insert_into (&ly, *ly.begin_top_down (), l1001);
|
||||
|
||||
res = r.cop_to_region (or_node);
|
||||
|
||||
unsigned int l1002 = ly.get_layer (db::LayerProperties (1002, 0));
|
||||
res.insert_into (&ly, *ly.begin_top_down (), l1002);
|
||||
|
||||
res = r.cop_to_region (not_or_node);
|
||||
|
||||
unsigned int l1003 = ly.get_layer (db::LayerProperties (1003, 0));
|
||||
res.insert_into (&ly, *ly.begin_top_down (), l1003);
|
||||
|
||||
CHECKPOINT();
|
||||
db::compare_layouts (_this, ly, tl::testsrc () + "/testdata/drc/compound_au10.gds");
|
||||
}
|
||||
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue