diva.sketch.features
Class StrokeHull

java.lang.Object
  extended by diva.sketch.features.StrokeHull

public class StrokeHull
extends Object

StrokeHull computes the convex hull of a stroke and stores the result in the stroke's property table.

Version:
$Revision: 1.11 $
Author:
Michael Shilman (michaels@eecs.berkeley.edu), Heloise Hse (hwawen@eecs.berkeley.edu)
See Also:
ConvexHull

Field Summary
static String PROPERTY_KEY
          The key to a stroke's property table, to store or access the cached convex hull of a stroke.
 
Constructor Summary
StrokeHull()
           
 
Method Summary
static ConvexHull apply(TimedStroke s)
          Generate a convex hull object for the specified stroke.
static ConvexHull hullNoCache(TimedStroke s)
          Generate a convex hull object for the specified stroke, but do not cache it in the stroke's property table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_KEY

public static String PROPERTY_KEY
The key to a stroke's property table, to store or access the cached convex hull of a stroke.

Constructor Detail

StrokeHull

public StrokeHull()
Method Detail

apply

public static ConvexHull apply(TimedStroke s)
Generate a convex hull object for the specified stroke. The result is stored in the stroke's property table so that it won't need to be recalculated each time.

First check to see if the stroke's property table contains a convex hull. If so, just return the cached hull. This assumes that the stroke does not change. FIXME - this caching is extremely dangerous for incremental recognition. check number of points in stroke? have a force recompute function?


hullNoCache

public static ConvexHull hullNoCache(TimedStroke s)
Generate a convex hull object for the specified stroke, but do not cache it in the stroke's property table.



Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.