SE_shape_evaluate_CBM |
Checks a relationship expression against a SE_CBM_INFO structure
LONG SE_shape_evaluate_CBM (SE_CBM_INFO *info, char *scltext, BOOL *testresult);
info | Contains the relationship of two shapes |
scltext | A character string defining a relationship |
testresult | TRUE or FALSE |
Compares a text-based relationship string against an SE_CBM_INFO structure that defines the relationship between two shapes. You must call SE_shape_find_CBM_relation before calling SE_shape_evaluate_CBM . SE_CBM_INFO is
typedef struct {
LONG primary_entity_type;
LONG secondary_entity_type;
LONG mask;
LONG sectdims[3][3];
} SE_CBM_INFO;
The mask has a flag for each of the relation types that is satisfied: identical, touch, cross, in or contain, disjoint, and overlap. The scltext parameter is a text string that describes a relationship between two shapes. It supports very complex relationships. The shape comparison language (SCL) supports a wide array of keywords and operators.
The SCL Keywords and Operators are:
AND
AREA
BOUNDARY
CONTAIN CONTAINS
CROSS CROSSES
DIM
DISJOINT
EQUAL EQUALS
EXTERIOR
FALSE
G1 or g1 The
primary shape
G2 or g2 The
secondary shape
IDENTICAL
IN INSIDE
INTERIOR
LINEAR
NIL NULL
NOT
OR
OVERLAPS OVERLAP
POINT
TOPOFORM If TRUE, two shapes touch or intersect at vertices
TOUCHES TOUCH
TRUE
XOR
= Equality
operator, also IDENTICAL operator for shapes
== Equality
operator, also IDENTICAL operator for shapes
!= Inequality
operator, also NON-IDENTICAL operator for shapes
=! DISJOINT
operator
=& OVERLAP
operator
=@ IN
operator
=* TOUCH
operator
=/ CROSS
operator
The base building block of the SCL language is g1 and g2 which represent the primary and secondary shapes that you want to compare. You can work with the dimensionality of the shapes with the dim keyword and adding either boundary, interior, or exterior.
dim(g1.interior) >= dim(g2.boundary)
If the dim keyword is used with one argument, the dimension of the shape is returned. You can also pass dim two arguments which will return the dimension of the intersection of the two arguments.
dim(g1.boundary,g2.interior)
Points have a dimension of 0, lines are 1, and areas (polygons) are 2. The dimension of a boundary of a shape is one less than the shapes dimension. A point has no boundary so the dimension of the boundary is -1 or nil. The boundary of a line has dimension 0 and are the end points of the line. An area shapes boundary consists of the lines that compose it and the boundary’s dimension is 1.
The dimension of a shapes interior is the same as the shape itself. The interior of a shape is the shape minus its boundary so a lines interior doesn’t include the end points. The exterior of any shape type is 2.
SCL supports six spatial relationships: contain or in, cross, touch, overlap, identical, and topoform. You can check whether two shapes cross with either of the following statements.
g1 cross g2
cross(g1,g2) = true
The topoform keyword is an extension to SCL. Topoform is TRUE when two shapes intersect at vertices. A line whose end point touches another line between two vertices has a false topoform value.
SE_SUCCESS
SE_INVALID_POINTER
SE_INVALID_SHAPE
SE_INVALID_SHAPE_OBJECT
∙ Ignores any CAD data.
∙ You must call SE_shape_find_CBM_relation before calling this function.