mirror of https://github.com/KLayout/klayout.git
First tests
This commit is contained in:
parent
b02d3b24a8
commit
2341170065
|
|
@ -699,7 +699,7 @@ Class<db::EdgePairs> decl_EdgePairs (decl_dbShapeCollection, "db", "EdgePairs",
|
|||
"edge pairs not fulfilling this criterion are returned.\n"
|
||||
"\n"
|
||||
"This version allows specifying an edge type instead of an angle. Edge types include multiple distinct orientations "
|
||||
"and are specified using one of the \\OrthoEdges, \\DiagonalEgdes or \\OrthoDiagonalEdges types.\n"
|
||||
"and are specified using one of the \\Edges#OrthoEdges, \\Edges#DiagonalEgdes or \\Edges#OrthoDiagonalEdges types.\n"
|
||||
"\n"
|
||||
"This method has been added in version 0.28.\n"
|
||||
) +
|
||||
|
|
@ -735,7 +735,7 @@ Class<db::EdgePairs> decl_EdgePairs (decl_dbShapeCollection, "db", "EdgePairs",
|
|||
"edge pairs not fulfilling this criterion are returned.\n"
|
||||
"\n"
|
||||
"This version allows specifying an edge type instead of an angle. Edge types include multiple distinct orientations "
|
||||
"and are specified using one of the \\OrthoEdges, \\DiagonalEgdes or \\OrthoDiagonalEdges types.\n"
|
||||
"and are specified using one of the \\Edges#OrthoEdges, \\Edges#DiagonalEgdes or \\Edges#OrthoDiagonalEdges types.\n"
|
||||
"\n"
|
||||
"This method has been added in version 0.28.\n"
|
||||
) +
|
||||
|
|
@ -875,22 +875,4 @@ Class<db::EdgePairs> decl_EdgePairs (decl_dbShapeCollection, "db", "EdgePairs",
|
|||
"This class has been introduced in version 0.23.\n"
|
||||
);
|
||||
|
||||
gsi::EnumIn<db::EdgePairs, db::SpecialEdgeOrientationFilter::FilterType> decl_EdgePairsEdgeFilterType ("db", "EdgeType",
|
||||
gsi::enum_const ("OrthoEdges", db::SpecialEdgeOrientationFilter::Ortho,
|
||||
"@brief Horizontal and vertical edges are selected\n"
|
||||
) +
|
||||
gsi::enum_const ("DiagonalEdges", db::SpecialEdgeOrientationFilter::Diagonal,
|
||||
"@brief Diagonal edges are selected (-45 and 45 degree)\n"
|
||||
) +
|
||||
gsi::enum_const ("OrthoDiagonalEdges", db::SpecialEdgeOrientationFilter::OrthoDiagonal,
|
||||
"@brief Diagonal or orthogonal edges are selected (0, 90, -45 and 45 degree)\n"
|
||||
),
|
||||
"@brief This enum specifies the the edge type for edge angle filters.\n"
|
||||
"\n"
|
||||
"This enum was introduced in version 0.28.\n"
|
||||
);
|
||||
|
||||
// Inject the db::SpecialEdgeOrientationFilter::FilterType declarations into EdgePairs:
|
||||
gsi::ClassExt<db::EdgePairs> decl_EdgePairsEdgeFilterType_into_parent (decl_EdgePairsEdgeFilterType.defs ());
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1000,7 +1000,7 @@ CODE
|
|||
args = args.select do |a|
|
||||
if a.is_a?(DRCBothEdges)
|
||||
if !self.data.is_a?(RBA::EdgePairs)
|
||||
raise("'both' keyword only available for edge pair layers")
|
||||
raise("'both' keyword is only available for edge pair layers")
|
||||
end
|
||||
f = :with_#{f}_both
|
||||
false
|
||||
|
|
@ -1018,11 +1018,10 @@ CODE
|
|||
if a.is_a?(Range)
|
||||
DRCLayer::new(@engine, @engine._tcmd(self.data, 0, result_class, f, a.begin, a.end, #{inv.inspect}))
|
||||
elsif a.is_a?(DRCOrthoEdges) || a.is_a?(DRCDiagonalOnlyEdges) || a.is_a?(DRCDiagonalEdges)
|
||||
if self.data.is_a?(RBA::Edges)
|
||||
DRCLayer::new(@engine, @engine._tcmd(self.data, 0, result_class, f, a.e_value, #{inv.inspect}))
|
||||
else
|
||||
DRCLayer::new(@engine, @engine._tcmd(self.data, 0, result_class, f, a.ep_value, #{inv.inspect}))
|
||||
if self.data.is_a?(RBA::Region)
|
||||
raise("'ortho', 'diagonal' or 'diagonal_only' keyword is only available for edge or edge pair layers")
|
||||
end
|
||||
DRCLayer::new(@engine, @engine._tcmd(self.data, 0, result_class, f, a.value, #{inv.inspect}))
|
||||
else
|
||||
DRCLayer::new(@engine, @engine._tcmd(self.data, 0, result_class, f, a, #{inv.inspect}))
|
||||
end
|
||||
|
|
|
|||
|
|
@ -22,30 +22,21 @@ module DRC
|
|||
|
||||
# A wrapper for the "ortho edges" flag for Edges#with_angle or EdgePairs#with_angle
|
||||
class DRCOrthoEdges
|
||||
def ep_value
|
||||
RBA::EdgePairs::OrthoEdges
|
||||
end
|
||||
def e_value
|
||||
def value
|
||||
RBA::Edges::OrthoEdges
|
||||
end
|
||||
end
|
||||
|
||||
# A wrapper for the "diagonal only edges" flag for Edges#with_angle or EdgePairs#with_angle
|
||||
class DRCDiagonalOnlyEdges
|
||||
def ep_value
|
||||
RBA::EdgePairs::DiagonalEdges
|
||||
end
|
||||
def e_value
|
||||
def value
|
||||
RBA::Edges::DiagonalEdges
|
||||
end
|
||||
end
|
||||
|
||||
# A wrapper for the "diagonal edges" flag for Edges#with_angle or EdgePairs#with_angle
|
||||
class DRCDiagonalEdges
|
||||
def ep_value
|
||||
RBA::EdgePairs::OrthoDiagonalEdges
|
||||
end
|
||||
def e_value
|
||||
def value
|
||||
RBA::Edges::OrthoDiagonalEdges
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1328,3 +1328,13 @@ TEST(55d_drccount)
|
|||
run_test (_this, "55", true);
|
||||
}
|
||||
|
||||
TEST(56_angle_classes)
|
||||
{
|
||||
run_test (_this, "56", false);
|
||||
}
|
||||
|
||||
TEST(56d_angle_classes)
|
||||
{
|
||||
run_test (_this, "56", true);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,31 @@
|
|||
|
||||
source $drc_test_source
|
||||
target $drc_test_target
|
||||
|
||||
if $drc_test_deep
|
||||
deep
|
||||
end
|
||||
|
||||
l1 = input(1, 0)
|
||||
|
||||
l1.output(1, 0)
|
||||
|
||||
l1e = l1.edges
|
||||
l1e.with_angle(ortho).output(100, 0)
|
||||
l1e.without_angle(ortho).output(101, 0)
|
||||
l1e.with_angle(diagonal).output(102, 0)
|
||||
l1e.without_angle(diagonal).output(103, 0)
|
||||
l1e.with_angle(diagonal_only).output(104, 0)
|
||||
l1e.without_angle(diagonal_only).output(105, 0)
|
||||
|
||||
l1ee = l1.width(100.um, projection)
|
||||
l1ee.output(10, 0)
|
||||
|
||||
l1ee.with_angle(ortho).output(200, 0)
|
||||
l1ee.without_angle(ortho).output(201, 0)
|
||||
l1ee.with_angle(diagonal).output(202, 0)
|
||||
l1ee.without_angle(diagonal).output(203, 0)
|
||||
l1ee.with_angle(diagonal_only).output(204, 0)
|
||||
l1ee.without_angle(diagonal_only).output(205, 0)
|
||||
l1ee.with_angle(ortho, both).output(210, 0)
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue