|
|||||||||
| 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.ConnectsConstraint
public class ConnectsConstraint
This class represents the connects constraint. The main constraint graph stores how lines connect to each other. There are also additional 4 constraint graphs for exact specification of what end-points connect to waht end-points, given a labelling (example CONNECTS_P1_P2). This class has methods for checking that another connects constraint graph is a subgraph of this one, consistent with the labelling of points (but not necessarily the same labelling). It also has methods for determining the confidence of a constraint between two particular line end-points.
A lot of algorithms do not need the detailed end-point information, so they operate with this constraint as with any other constraint. Consistency with the more detailed graphs has to be verified explicitly.
Needed Improvements:
More detailed connects constraints should be reimplemented with directional lines and what other lines they connect to.
That will reduce redundancy by half.
| Field Summary | |
|---|---|
static int |
CONNECTS_P1_P1
Subconstraint names |
static int |
CONNECTS_P1_P2
|
static int |
CONNECTS_P2_P1
|
static int |
CONNECTS_P2_P2
|
| Constructor Summary | |
|---|---|
ConnectsConstraint()
Constructs an empty constraint graph (and empty constraint subgraphs) |
|
| Method Summary | |
|---|---|
java.lang.Object |
clone()
Clone the constraint |
static double |
constraintConfidence(Line l1,
Line l2)
Returns the confidence that the constraint holds between the two given line primitives |
static double |
constraintConfidence(Line l1,
Line l2,
int name)
Returns the confidence the sub constraint with a given name between the two primitives. |
ConstraintGraph |
graphConnectsP1P1()
Return the more detailed graph |
ConstraintGraph |
graphConnectsP1P2()
Return the more detailed graph |
ConstraintGraph |
graphConnectsP2P1()
Return the more detailed graph |
ConstraintGraph |
graphConnectsP2P2()
Return the more detailed graph |
void |
initialize(java.util.HashMap primToGeomParts)
Infer the constraints from the user stroke's geometric parts and record the constraint graphs. |
void |
mergeIn(Constraint other)
Put the constraints that are in other into this one, if they are not already in the graph |
java.lang.String |
name()
Name of the constraint |
boolean |
orientationInvariant()
Returns true if the constraint is orinetation invariant |
boolean |
P1P1(ConstraintGraphEdge edge)
Return weather the edge is in a given graph |
boolean |
P1P2(ConstraintGraphEdge edge)
Return weather the edge is in a given graph |
boolean |
P2P1(ConstraintGraphEdge edge)
Return weather the edge is in a given graph |
boolean |
P2P2(ConstraintGraphEdge edge)
Return weather the edge is in a given graph |
void |
print(java.io.PrintStream out,
boolean printDetails)
Print the main constraint graph. |
void |
removeLowConfidence(double confidenceThreshold)
Remove constraints that are below the confidence threshold. |
void |
removeLowRelevance(double relevanceThreshold)
Remove constraints that are below the relevance threshold. |
void |
renamePrimitives(PrimitiveMapping mapping,
PrimitiveList relabelled)
Rename the primitives in the following constraint according to the given mapping |
boolean |
sameAs(Constraint other,
PrimitiveMapping mapping)
Verifies whether this constraint is the same as the other one given the mapping between primitives. |
Constraint |
subgraph(PrimitiveList primitiveList)
Return a new constraint that is a subgraph of this one only for the primitives in the given list. |
boolean |
subgraphOfUpToRelabelling(Constraint otherConstraint,
PrimitiveMapping mapping,
PrimitiveList relabelled,
PrimitiveList nonRelabelled)
Verifies that this constraint is a subgraph of other up to swapping of line end-point labels (P1 and P2). |
| Methods inherited from class edu.mit.sketch.ddg.Constraint |
|---|
constraintGraph, labelledEdgeList, setConstraintGraph |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int CONNECTS_P1_P1
public static final int CONNECTS_P1_P2
public static final int CONNECTS_P2_P1
public static final int CONNECTS_P2_P2
| Constructor Detail |
|---|
public ConnectsConstraint()
| Method Detail |
|---|
public boolean orientationInvariant()
orientationInvariant in class Constraintpublic void initialize(java.util.HashMap primToGeomParts)
public static double constraintConfidence(Line l1,
Line l2)
public static double constraintConfidence(Line l1,
Line l2,
int name)
public java.lang.String name()
name in class Constraintpublic Constraint subgraph(PrimitiveList primitiveList)
subgraph in class Constraintpublic void mergeIn(Constraint other)
mergeIn in class Constraint
public void renamePrimitives(PrimitiveMapping mapping,
PrimitiveList relabelled)
renamePrimitives in class Constraint
public boolean sameAs(Constraint other,
PrimitiveMapping mapping)
sameAs in class Constraint
public boolean subgraphOfUpToRelabelling(Constraint otherConstraint,
PrimitiveMapping mapping,
PrimitiveList relabelled,
PrimitiveList nonRelabelled)
public void removeLowConfidence(double confidenceThreshold)
removeLowConfidence in class Constraintpublic void removeLowRelevance(double relevanceThreshold)
removeLowRelevance in class Constraint
public void print(java.io.PrintStream out,
boolean printDetails)
print in class Constraintpublic ConstraintGraph graphConnectsP1P1()
public ConstraintGraph graphConnectsP1P2()
public ConstraintGraph graphConnectsP2P1()
public ConstraintGraph graphConnectsP2P2()
public boolean P1P1(ConstraintGraphEdge edge)
public boolean P1P2(ConstraintGraphEdge edge)
public boolean P2P1(ConstraintGraphEdge edge)
public boolean P2P2(ConstraintGraphEdge edge)
public java.lang.Object clone()
clone in class Constraint
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||