diva.sketch.features
Class StrokeBBox

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

public class StrokeBBox
extends Object

StrokeBBox computes the bounding box of a stroke and stores the result in the stroke's property table.

Version:
$Revision: 1.8 $
Author:
Michael Shilman (michaels@eecs.berkeley.edu), Heloise Hse (hwawen@eecs.berkeley.edu)

Field Summary
static String PROPERTY_KEY
          The key to a property table, to store or access the cached bounding box of a stroke.
 
Constructor Summary
StrokeBBox()
           
 
Method Summary
static Rectangle2D apply(TimedStroke s)
          Compute the stroke's bounding box using the minimum and maximum x, y values in the path.
static Rectangle2D bboxNoCache(TimedStroke s)
          Return the bounding box, but do not cache the results 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 property table, to store or access the cached bounding box of a stroke.

Constructor Detail

StrokeBBox

public StrokeBBox()
Method Detail

apply

public static Rectangle2D apply(TimedStroke s)
Compute the stroke's bounding box using the minimum and maximum x, y values in the path. If the specified stroke already has a bounding box in its property table, just return the cached box. This assumes that the stroke does not change. Otherwise, calculate the bounding box and stores it in the stroke's property table so that it won't need to be recalculated.

FIXME - this caching is extremely dangerous for incremental recognition. check number of points in stroke? have a force recompute function?


bboxNoCache

public static Rectangle2D bboxNoCache(TimedStroke s)
Return the bounding box, but do not cache the results in the stroke's property table.



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