edu.mit.sketch.ddg
Class LineRelationshipConstraint
java.lang.Object
|
+--edu.mit.sketch.ddg.Constraint
|
+--edu.mit.sketch.ddg.LineRelationshipConstraint
- public class LineRelationshipConstraint
- extends Constraint
This class represents constraints between pairs of line primitives (like "connects").
The ObjectDescription will store several instances of this class representing different constraints, depending
on what constraint name is passed to the constructor. For example, to record all the intersects constraints,
instantiate this class passing the user strokes and the name INTERSECTS to the constructor. According to the name
an appropriate function will be used to figure out which lines intersect.
(An alternative way to implement this would be to create a separate subclass of Constraint for each constraint. I may change
to the latter implementation)
LineRelationshipConstraint.java
Created: Sat Nov 21 18:26:00 2001
|
Method Summary |
void |
inferConstraints(HashMap primToGeomParts)
Infer the constraints from the users stroke geom parts
and record the constraint graph into the hashtable. |
String |
name()
Name of the constraint type. |
| Methods inherited from class edu.mit.sketch.ddg.Constraint |
addHoldsBetween, confidence, constraintGraph, edgeList, holdsBetween, holdsBetween, print, relevance, removeHoldsBetween, removeLowConfidence, removeUncertain, setConfidence, setRelevance |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
m_name
protected int m_name
- Name of the constraint
CONNECTS
public static final int CONNECTS
- Possible cnstraints (note: numbers are used for iteration over these so the sequence has to be without gaps)
MEETS
public static final int MEETS
INTERSECTS
public static final int INTERSECTS
PARALLEL
public static final int PARALLEL
PERPENDICULAR
public static final int PERPENDICULAR
ABOVE_CENTERED
public static final int ABOVE_CENTERED
RIGHT_CENTERED
public static final int RIGHT_CENTERED
UPPER_RIGHT
public static final int UPPER_RIGHT
UPPER_LEFT
public static final int UPPER_LEFT
SAME_LENGTH
public static final int SAME_LENGTH
LONGER
public static final int LONGER
MUCH_LONGER
public static final int MUCH_LONGER
OBTUSE_ANGLE
public static final int OBTUSE_ANGLE
ACUTE_ANGLE
public static final int ACUTE_ANGLE
CONNECTS_P1_P1
public static final int CONNECTS_P1_P1
CONNECTS_P1_P2
public static final int CONNECTS_P1_P2
CONNECTS_P2_P1
public static final int CONNECTS_P2_P1
CONNECTS_P2_P2
public static final int CONNECTS_P2_P2
MEETS_P1
public static final int MEETS_P1
MEETS_P2
public static final int MEETS_P2
NUM_CONSTRAINTS
public static final int NUM_CONSTRAINTS
- Total number of possible constraints (to allow iterating over the names)
LineRelationshipConstraint
public LineRelationshipConstraint()
- Constructs an empty constraint graph.
LineRelationshipConstraint
public LineRelationshipConstraint(HashMap primToGeomParts,
Object name)
- Constructs the constraint graph from and example drawn by the user.
The constraint is specified by the name.
HashMap: type of key: Primitive, type of value: GeometricObject
Type of name should be int.
inferConstraints
public void inferConstraints(HashMap primToGeomParts)
- Infer the constraints from the users stroke geom parts
and record the constraint graph into the hashtable.
HashMap: type of key: Primitive, type of value: GeometricObject
- Overrides:
inferConstraints in class Constraint
name
public String name()
- Name of the constraint type.
- Overrides:
name in class Constraint