gumbo.graphic.probe
Interface IntersectableGraphic

All Superinterfaces:
Graphic, GraphicGeometry
All Known Subinterfaces:
IntersectionNode
All Known Implementing Classes:
AbstractIntersectionNode, AxisBound3, SwingSpaceNode

public interface IntersectableGraphic
extends GraphicGeometry

A graphic geometry that allows testing for spatial intersection. Intersectables and intersectors can be in different reference spaces but implementations must account for this difference (such as by using spatial transformations).

Unlike a pick operation, an intersection produces an unqualified hit/no-hit result, which can be useful for simple picking and collision schemes. Although defined in terms of spatial geometry, logical forms of intersection are not precluded.

For geometric intersection an intersection typically occurs if any part of the intesector shape is inside or on this intersectable's shape. For efficiency, the target graphic, as a whole or in parts, can be incorporated into an intersection tree (see IntersectionNode).

Version:
$Revision: 1.8 $
Author:
Jon Barrilleaux (jonb@jmbaai.com) of JMB and Associates Inc.

Method Summary
 boolean canIntersectGraphic(GraphicGeometry intersector)
          Returns true if the intersection operation between the intersector and this intersectable is supported.
 boolean intersectGraphic(GraphicGeometry intersector)
          Returns true if the intersector intersects this intersectable.
 
Methods inherited from interface gumbo.graphic.space.GraphicGeometry
getGraphicLocalSpace
 
Methods inherited from interface gumbo.graphic.Graphic
getGraphic
 

Method Detail

canIntersectGraphic

public boolean canIntersectGraphic(GraphicGeometry intersector)
Returns true if the intersection operation between the intersector and this intersectable is supported. Should include tests for intersector type and space tree collocation.

Parameters:
intersector - Value of the intersector. Never null.
Returns:
True if the intersection is supported.

intersectGraphic

public boolean intersectGraphic(GraphicGeometry intersector)
Returns true if the intersector intersects this intersectable. Does not call canIntersectGraphic() but should throw an exception if the operation is unsupported (such as ClassCastException).

Parameters:
intersector - Value of the intersector. Never null.
Returns:
True if an intersection occurs.