|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.mit.sketch.ddg.Constraint
edu.mit.sketch.ddg.BinaryRelationshipConstraint
edu.mit.sketch.ddg.PositionConstraint
public class PositionConstraint
This class represents the relative position constraints (like "above") for lines, ellipses, and groups.
PositionConstraint.java Created: Sat Nov 21 18:26:00 2001
| Field Summary | |
|---|---|
static int |
ABOVE
|
static int |
ABOVE_CENTERED
|
static int |
BELOW
|
static int |
INSIDE
|
static int |
INSIDE_BOX
|
static int |
INSIDE_CENTERED
|
static int |
LEFT
|
static int |
LOWER_LEFT
|
static int |
LOWER_RIGHT
|
static int |
NUM_CONSTRAINTS
Total number of possible constraints (to allow iterating over the names) |
static int |
RIGHT
|
static int |
RIGHT_CENTERED
|
static int |
UPPER_LEFT
|
static int |
UPPER_RIGHT
|
| Constructor Summary | |
|---|---|
PositionConstraint()
Constructs an empty constraint graph. |
|
PositionConstraint(int name)
Constructs an empty constraint graph. |
|
PositionConstraint(java.lang.String name)
Constructs an empty constraint graph. |
|
| Method Summary | |
|---|---|
void |
addConstraints(java.util.HashMap primToGeomParts,
double[][] obstruction,
PrimitiveList primitives)
Infer the constraints from the users stroke geom parts and add them to the constraint graph. |
void |
addConstraints(java.util.HashMap primToGeomParts,
GroupingTree group)
Recursively looks at pairs of groups in the tree and initializes the relationship constraints. |
static double |
boxPosition(GeometricObject o1,
GeometricObject o2,
int position)
Returns the confidence of a given spatial relationship between objects just based on their bounding box and center |
boolean |
centered()
Whether the constraint is centered |
java.lang.Object |
clone()
Clone the constraint |
static double |
constraintConfidence(DrawnObject object1,
DrawnObject object2,
int name)
Returns the confidence that a given (by the name) constraint holds |
static double |
constraintConfidence(Ellipse e1,
Ellipse e2,
int name)
Returns the confidence that the constraint with the given name holds between two primitives |
static double |
constraintConfidence(Ellipse e1,
Line l2,
int name)
Returns the confidence that the constraint with the given name holds between two primitives |
static double |
constraintConfidence(Line l1,
Ellipse e2,
int name)
Returns the confidence that the constraint with the given name holds between two primitives |
static double |
constraintConfidence(Line l1,
Line l2,
int name)
Returns the confidence that the constraint with the given name holds between two primitives |
static double |
constraintRelevance(DrawnObject object,
DrawnObject object2,
int name)
Returns the relevance of a given (by the name) constraint |
java.lang.String |
name()
Name of the constraint type |
boolean |
orientationInvariant()
Returns true if the constraint is orinetation invariant |
| Methods inherited from class edu.mit.sketch.ddg.Constraint |
|---|
constraintGraph, labelledEdgeList, mergeIn, print, removeLowConfidence, removeLowRelevance, renamePrimitives, sameAs, setConstraintGraph, subgraph |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int ABOVE
public static final int RIGHT
public static final int BELOW
public static final int LEFT
public static final int UPPER_RIGHT
public static final int UPPER_LEFT
public static final int LOWER_RIGHT
public static final int LOWER_LEFT
public static final int ABOVE_CENTERED
public static final int RIGHT_CENTERED
public static final int INSIDE
public static final int INSIDE_CENTERED
public static final int INSIDE_BOX
public static final int NUM_CONSTRAINTS
| Constructor Detail |
|---|
public PositionConstraint()
public PositionConstraint(int name)
public PositionConstraint(java.lang.String name)
| Method Detail |
|---|
public boolean orientationInvariant()
orientationInvariant in class BinaryRelationshipConstraint
public void addConstraints(java.util.HashMap primToGeomParts,
double[][] obstruction,
PrimitiveList primitives)
public void addConstraints(java.util.HashMap primToGeomParts,
GroupingTree group)
public static double boxPosition(GeometricObject o1,
GeometricObject o2,
int position)
public static double constraintConfidence(DrawnObject object1,
DrawnObject object2,
int name)
public static double constraintConfidence(Line l1,
Line l2,
int name)
public static double constraintConfidence(Ellipse e1,
Ellipse e2,
int name)
public static double constraintConfidence(Line l1,
Ellipse e2,
int name)
public static double constraintConfidence(Ellipse e1,
Line l2,
int name)
public static double constraintRelevance(DrawnObject object,
DrawnObject object2,
int name)
public java.lang.String name()
name in class BinaryRelationshipConstraintpublic boolean centered()
public java.lang.Object clone()
clone in class BinaryRelationshipConstraint
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||