public class DE9IMRelation extends BinaryConstraint
GeometricShapeVariable).
These shapes can be points, strings of segments, or polygons. The relations constitute a topological mode called
the Dimensionally Extended nine-Intersection Model (DE-9IM) (see (Clementini et al., 1993) and https://en.wikipedia.org/wiki/DE-9IM).
If the shapes are all polygons, then a Jointly Exclusive and Pairwise Disjoint (JEPD) subset of these relations is
equivalent to RCC8 (Cohn et al., 2007).| Modifier and Type | Class and Description |
|---|---|
static class |
DE9IMRelation.Type
The 10 meaningful relations in DE-9IM.
|
annotation, autoRemovable, color, id, logger, masked, numIDs, scope| Modifier | Constructor and Description |
|---|---|
protected |
DE9IMRelation() |
|
DE9IMRelation(DE9IMRelation.Type... types)
Create a new DE-9IM relation with given types.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
clone() |
java.lang.String |
getEdgeLabel()
Every
Constraint should implement this method - its value is
what is drawn by the ConstraintNetwork rendering methods. |
static DE9IMRelation.Type[] |
getRCC8Relations(GeometricShapeVariable gv1,
GeometricShapeVariable gv2)
Get the RCC8 relation(s) existing between two
GeometricShapeVariables. |
static DE9IMRelation.Type[] |
getRelations(GeometricShapeVariable gv1,
GeometricShapeVariable gv2)
Get the DE-9IM relation(s) existing between two
GeometricShapeVariables. |
DE9IMRelation.Type[] |
getTypes()
Get the types of this DE-9IM relation.
|
boolean |
isEquivalent(Constraint c)
Method for assessing the "equivalence" between two constraints.
|
static boolean |
isRCC8Relation(DE9IMRelation.Type t)
Find out whether a relation is a
DE9IMRelation belongs to the RCC8 subset. |
boolean |
isRelation(DE9IMRelation.Type relationType)
Assess whether this relation is of a given
DE9IMRelation.Type. |
static boolean |
isRelation(GeometricShapeVariable gv1,
GeometricShapeVariable gv2,
DE9IMRelation.Type t)
Check if the spatial relation between two
GeometricShapeVariables is of a given type. |
getFrom, getTo, setFrom, setTo, toStringgetAnnotation, getColor, getDescription, getID, getScope, isAutoRemovable, isMasked, isSkippableSolver, isUnary, mask, setAnnotation, setAutoRemovable, setColor, setScope, skipSolver, unmaskprotected DE9IMRelation()
public DE9IMRelation(DE9IMRelation.Type... types)
types - The type(s) of the new relation.public boolean isRelation(DE9IMRelation.Type relationType)
DE9IMRelation.Type.relationType - The DE9IMRelation.Type to compare against.true iff this relation is of the given DE9IMRelation.Type.public static DE9IMRelation.Type[] getRelations(GeometricShapeVariable gv1, GeometricShapeVariable gv2)
GeometricShapeVariables.gv1 - The first GeometricShapeVariable (the source of the directed edge).gv2 - The second GeometricShapeVariable (the destination of the directed edge).GeometricShapeVariables.public static DE9IMRelation.Type[] getRCC8Relations(GeometricShapeVariable gv1, GeometricShapeVariable gv2)
GeometricShapeVariables.gv1 - The first GeometricShapeVariable (the source of the directed edge).gv2 - The second GeometricShapeVariable (the destination of the directed edge).GeometricShapeVariables.public static boolean isRelation(GeometricShapeVariable gv1, GeometricShapeVariable gv2, DE9IMRelation.Type t)
GeometricShapeVariables is of a given type.gv1 - The source GeometricShapeVariable.gv2 - The destination GeometricShapeVariable.t - The type of relation to check.true iff the given variables are in the given relation.public static boolean isRCC8Relation(DE9IMRelation.Type t)
DE9IMRelation belongs to the RCC8 subset.t - The relation to testtrue iff the given DE9IMRelation belongs to the RCC8 subset.public DE9IMRelation.Type[] getTypes()
public java.lang.String getEdgeLabel()
ConstraintConstraint should implement this method - its value is
what is drawn by the ConstraintNetwork rendering methods.getEdgeLabel in class ConstraintString representation of the constraint to be used for
ConstraintNetwork rendering.public java.lang.Object clone()
clone in class Constraintpublic boolean isEquivalent(Constraint c)
ConstraintisEquivalent in class Constraintc - The Constraint to compare against.true iff the two constraints are considered to be equivalent.