edu.stanford.rsl.konrad.geometry
Class AbstractShape

java.lang.Object
  extended by edu.stanford.rsl.konrad.geometry.AbstractShape
All Implemented Interfaces:
Transformable, java.io.Serializable
Direct Known Subclasses:
AbstractCurve, AbstractSurface, CompoundShape, TimeVariantSurfaceBSpline

public abstract class AbstractShape
extends java.lang.Object
implements java.io.Serializable, Transformable

Class to model any kind of curve or surface.

Saddle Surface
Example for a 3D surface.

Author:
akmaier
See Also:
Serialized Form

Constructor Summary
AbstractShape()
           
 
Method Summary
abstract  void applyTransform(Transform t)
          Applies the Transform t to the object.
abstract  PointND evaluate(PointND u)
          Returns the point on the shape at the internal position u.
abstract  int getDimension()
          Returns the external dimension of the shape.
 java.util.ArrayList<PointND> getHitsOnBoundingBox_slow(AbstractCurve curve)
          Evaluates the bounding box and returns true if it is hit.
 java.util.ArrayList<PointND> getHitsOnBoundingBox(AbstractCurve curve)
           
abstract  int getInternalDimension()
          returns the internal dimension of the shape, i.e.
 PointND getMax()
           
 PointND getMin()
           
abstract  PointND[] getRasterPoints(int number)
          Rasters the shape with a given number of points or less.
abstract  java.util.ArrayList<PointND> intersect(AbstractCurve other)
          Returns the intersection points between the curve and the shape.
abstract  boolean isBounded()
          Returns true if the shape is of limited space
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractShape

public AbstractShape()
Method Detail

isBounded

public abstract boolean isBounded()
Returns true if the shape is of limited space

Returns:
Boundedness of this shape.

getHitsOnBoundingBox_slow

public java.util.ArrayList<PointND> getHitsOnBoundingBox_slow(AbstractCurve curve)
Evaluates the bounding box and returns true if it is hit. If the object is not bounded, it returns true as default.

Parameters:
curve - the curve
Returns:
true, if the object is hit.

getHitsOnBoundingBox

public java.util.ArrayList<PointND> getHitsOnBoundingBox(AbstractCurve curve)

evaluate

public abstract PointND evaluate(PointND u)
Returns the point on the shape at the internal position u. If the shape is a curve, u is of dimension 1, if the shape is a surface u is of dimension 2, etc.

Parameters:
u - the point in the internal parameter dimension
Returns:
the point on the shape at the internal dimension

getDimension

public abstract int getDimension()
Returns the external dimension of the shape.

Returns:
the dimension

getInternalDimension

public abstract int getInternalDimension()
returns the internal dimension of the shape, i.e. 1 if it is a curve, 2 if it is a surface, etc.

Returns:
the internal dimension

intersect

public abstract java.util.ArrayList<PointND> intersect(AbstractCurve other)
Returns the intersection points between the curve and the shape. Returns null, if the intersection is empty.

Parameters:
other -
Returns:
the intersection points.

getRasterPoints

public abstract PointND[] getRasterPoints(int number)
Rasters the shape with a given number of points or less. If the shape is not bounded null is returned.

Parameters:
number - the number of points
Returns:
the raster points

getMin

public PointND getMin()
Returns:
the minimal corner of the bounding box.

getMax

public PointND getMax()
Returns:
the maximal corner of the bounding box.

applyTransform

public abstract void applyTransform(Transform t)
Description copied from interface: Transformable
Applies the Transform t to the object.

Specified by:
applyTransform in interface Transformable
Parameters:
t - the transform to apply to the object.