ConditionalQuery
- class ConditionalQuery(must_see: List[ShapeQuery], must_not_see: List[ShapeQuery])
A
ConditionalQuery
can be used to query aShape
for multiple conditions.Conditional queries are specified by lists of shapes that need to be found and shapes that need to not be found within a design for
query_shape()
to returnTrue
. These are specified as triples of (Shape
,HomogeneousTransformation
,ShapeQueryParameters
) that indicate the shape to search for, the type of transformation to use when searching for the shape, and the parameters to use in the search.- Parameters:
must_see – A list of
ShapeQuery
to look for in a design.must_not_see – A list of
ShapeQuery
to look for the absense of in a design.
Methods
Query a
Shape
for the conditions of thisConditionalQuery
.- query_shape(shape: Shape, dynamic_evaluation_context: dict) bool
Query a
Shape
for the conditions of thisConditionalQuery
.- Parameters:
shape – The design to query.
dynamic_evaluation_context – Passed into
set_dynamic_evaluation_context()
.
- Returns:
True if all of
must_see
are found and all ofmust_not_see
are not found inshape
.