PenProfile 2.x

com.livescribe.geom
Interface BoundsStrategy

All Known Implementing Classes:
OctagonBoundsStrategy, RectangleBoundsStrategy

public interface BoundsStrategy

An interface that defines strategies for finding bounding shapes given a set of Shapes. For example, more advanced convex hull algorithms could be used to calculate a more accurate bounding polygon.

Since:
2.3
See Also:
Shape

Method Summary
 void addShape(Shape s)
          Adds a set of points to the bounds.
 Shape getBounds()
          Gets the accumulated bounds.
 void resetBounds()
          Resets the state so that it is as if no points have been added.
 

Method Detail

addShape

void addShape(Shape s)
Adds a set of points to the bounds. The points are given as a Shape. If the shape is null then it is as if no points are added.

Recall that Shapes can be one of a few types whose points do not necessarily complete the entire set of points in the shape. For example, a Rectangle uses two points, two opposing corners, to represent the shape and not four points. Similarly, an Ellipse also uses just two points to define itself.

Parameters:
s - the set of points to add, given as a Shape
See Also:
Shape

getBounds

Shape getBounds()
Gets the accumulated bounds. This does not specify what shape to return if no points have been added.

Returns:
the accumulated bounds.
See Also:
addShape(Shape)

resetBounds

void resetBounds()
Resets the state so that it is as if no points have been added.


PenProfile 2.x

Copyright © 2010 Livescribe Inc. All Rights Reserved.
Confidential and subject to NDA.