|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdiva.sketch.recognition.BasicScene
public class BasicScene
A scene database that keeps track of multiple interpretations of a set of strokes. Groups of strokes are stored hierarchically, and these also have multiple interpretations. There are also choice elements that represent a mutually exclusive choice between objects of the same type that use the same type. Using this data structure, a client can view all of the interpretations of the scene and perform efficient operations to filter interpretations.
BasicScene uses the Java collections classes to implement the scene infrastructure in an obvious and unoptimized way. Future implementations of the scene interface may
Constructor Summary | |
---|---|
BasicScene()
|
Method Summary | |
---|---|
void |
_markDescendents(SceneElement elt,
short mark,
boolean makeChoices)
Mark the given element and all of its descendents with the given mark, so that a subsequent traversal will be able to distinguish between elements inside and outside of the marked set. |
boolean |
_sameID(BitSet id1,
BitSet id2)
Return true if the supports of the two elements (i.e. |
CompositeElement |
addComposite(TypedData data,
double confidence,
SceneElement[] children,
String[] names)
Add a new composite element to the database and return it. |
StrokeElement |
addStroke(TimedStroke stroke)
Add a new stroke element to the database. |
List |
choices()
Return a list of all of the choices contained in the scene. |
void |
confirm(CompositeElement elt,
boolean makeChoices)
Accept the given interpretation of the set of strokes that the given element covers as the correct interpretation of those strokes. |
List |
elementsOfType(Type type,
CompositeElement elt)
Find the elements in the scene with the given type that do not contradict the given element, and return them as a list. |
int |
getCompositeCount()
Return a count of the total number of composite nodes in the database, for a crude measure of performance. |
int |
getStrokeCount()
Return a count of the total number of stroke nodes in the database, for a crude measure of performance. |
boolean |
isConsistent(SceneElement e1,
SceneElement e2)
Return whether or not the two elements are consistent, that is, whether the leaf nodes that they cover (their support) are strictly disjoint. |
boolean |
isCoveringAll(SceneElement elt)
Return whether or not this element covers all of the leaves. |
void |
removeElement(SceneElement elt)
Remove an element from the database. |
List |
roots()
Return a list of every root node in the database, i.e. |
boolean |
sameSupport(SceneElement e1,
SceneElement e2)
Return true if the supports of the two elements (i.e. |
List |
strokes()
Return a list the stroke elements of the scene in the order that they were added to the database. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BasicScene()
Method Detail |
---|
public CompositeElement addComposite(TypedData data, double confidence, SceneElement[] children, String[] names)
addComposite
in interface Scene
data
- The typed data associated with the composite.confidence
- The confidence of recognition, between 0 and 1.children
- The children of this element in the tree.names
- The names of the children.public List choices()
choices
in interface Scene
public StrokeElement addStroke(TimedStroke stroke)
addStroke
in interface Scene
public void confirm(CompositeElement elt, boolean makeChoices)
confirm
in interface Scene
elt
- The interpretation to confirmmakeChoices
- Whether or not to confirm the existing
choice nodes at or under elt.public List elementsOfType(Type type, CompositeElement elt)
elementsOfType
in interface Scene
type
- The type of elements that will be returned.elt
- The element that the returned set must be consistent with,
or null if it doesn't matter.
isConsistent(SceneElement, SceneElement)
public int getCompositeCount()
public int getStrokeCount()
public boolean isCoveringAll(SceneElement elt)
isCoveringAll
in interface Scene
public boolean isConsistent(SceneElement e1, SceneElement e2)
isConsistent
in interface Scene
public void removeElement(SceneElement elt)
removeElement
in interface Scene
public List roots()
roots
in interface Scene
public boolean sameSupport(SceneElement e1, SceneElement e2)
public List strokes()
strokes
in interface Scene
public void _markDescendents(SceneElement elt, short mark, boolean makeChoices)
public boolean _sameID(BitSet id1, BitSet id2)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |