ConditionalQuery

class ConditionalQuery(must_see: List[ShapeQuery], must_not_see: List[ShapeQuery])

A ConditionalQuery can be used to query a Shape 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 return True. 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_shape

Query a Shape for the conditions of this ConditionalQuery.

query_shape(shape: Shape, dynamic_evaluation_context: dict) bool

Query a Shape for the conditions of this ConditionalQuery.

Parameters:
Returns:

True if all of must_see are found and all of must_not_see are not found in shape.