edu.mit.sketch.ddg
Class AspectRatioConstraint

java.lang.Object
  extended by edu.mit.sketch.ddg.Constraint
      extended by edu.mit.sketch.ddg.PropertyConstraint
          extended by edu.mit.sketch.ddg.AspectRatioConstraint
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class AspectRatioConstraint
extends PropertyConstraint
implements java.io.Serializable

This class represents aspect ratio properties of ellipses and groups. (like "elongated"). If the property holds, the primitive will have a self loop in the constraint graph - the constraint holds between the primitive and itself.

AspectRatioConstraint.java Created: Sat Nov 21 18:26:00 2001

Author:
Olya Veselova
See Also:
Serialized Form

Field Summary
static int ELONGATED
           
static int NON_ELONGATED
           
static int NUM_CONSTRAINTS
          Total number of possible constraints (to allow iterating over the names).
static int VERY_ELONGATED
           
 
Constructor Summary
AspectRatioConstraint()
          Constructs an empty constraint graph and initializes the name to "unknown".
AspectRatioConstraint(int name)
          Constructs an empty constraint graph with a given name
 
Method Summary
 void addConstraints(java.util.HashMap primToGeomParts)
          Infer the constraints for individual primitives from the user's stroke geometric parts and record add them to the constraint graph.
 void addConstraints(java.util.HashMap primToGeomParts, GroupingTree group, ConnectsConstraint connects, IntersectsConstraint intersects)
          Infer the constraints for groups from the user's stroke geometric parts and record add them to the constraint graph.
 java.lang.Object clone()
          Clone the constraint
static double constraintConfidence(DrawnObject object, int name)
          Returns the confidence that a given (by the name) constraint holds for a drawn object consisting of a group of primitives
static double constraintConfidence(Ellipse e, int name)
          Returns the confidence that a given (by the name) constraint holds for an ellipse
 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

ELONGATED

public static final int ELONGATED
See Also:
Constant Field Values

VERY_ELONGATED

public static final int VERY_ELONGATED
See Also:
Constant Field Values

NON_ELONGATED

public static final int NON_ELONGATED
See Also:
Constant Field Values

NUM_CONSTRAINTS

public static final int NUM_CONSTRAINTS
Total number of possible constraints (to allow iterating over the names). Assign the numbers to the constraint names in order starting from 0 and without gaps.

See Also:
Constant Field Values
Constructor Detail

AspectRatioConstraint

public AspectRatioConstraint()
Constructs an empty constraint graph and initializes the name to "unknown".


AspectRatioConstraint

public AspectRatioConstraint(int name)
Constructs an empty constraint graph with a given name

Method Detail

orientationInvariant

public boolean orientationInvariant()
Returns true if the constraint is orinetation invariant

Specified by:
orientationInvariant in class PropertyConstraint

addConstraints

public void addConstraints(java.util.HashMap primToGeomParts)
Infer the constraints for individual primitives from the user's stroke geometric parts and record add them to the constraint graph. HashMap: type of key: Primitive, type of value: GeometricObject


addConstraints

public void addConstraints(java.util.HashMap primToGeomParts,
                           GroupingTree group,
                           ConnectsConstraint connects,
                           IntersectsConstraint intersects)
Infer the constraints for groups from the user's stroke geometric parts and record add them to the constraint graph. HashMap: type of key: Primitive, type of value: GeometricObject Look for elongation only on groups that are closed contours


constraintConfidence

public static double constraintConfidence(Ellipse e,
                                          int name)
Returns the confidence that a given (by the name) constraint holds for an ellipse


constraintConfidence

public static double constraintConfidence(DrawnObject object,
                                          int name)
Returns the confidence that a given (by the name) constraint holds for a drawn object consisting of a group of primitives


name

public java.lang.String name()
Name of the constraint type.

Specified by:
name in class PropertyConstraint

clone

public java.lang.Object clone()
Clone the constraint

Specified by:
clone in class PropertyConstraint