Class Shape

java.lang.Object
  extended by Shape
All Implemented Interfaces:
CloneableEx, java.lang.Cloneable, Persistent
Direct Known Subclasses:
Box, Ellipsoid, Plane, Polygon, Sphere

public abstract class Shape
extends java.lang.Object
implements Persistent, CloneableEx

An abstract class that provides an interface for manipulating different shapes.

The Shape class also provides a way to load and access the SurfaceProperties of a shape.


Constructor Summary
Shape()
          Constructs a Shape with default surface properties.
Shape(SurfaceProperties surfaceProperties)
          Constructs a Shape with the specified SurfaceProperties.
 
Method Summary
abstract  java.lang.Object clone()
          Returns a copy of the object.
 SurfaceProperties getSurfaceProperties()
          Returns the surface properties of this shape.
 void load(DataParser dataParser)
          Loads data using the DataParser object.
abstract  double nearestIntersectionTime(Ray3d ray)
          Gets the nearest intersection time between the specified ray and the shape.
 void setSurfaceProperties(SurfaceProperties surfaceProperties)
          Sets the surface properties.
abstract  javax.vecmath.Vector3d surfaceNormal(javax.vecmath.Point3d point)
          Gets the surface normal at the specified point on the shape.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Shape

public Shape()
Constructs a Shape with default surface properties.


Shape

public Shape(SurfaceProperties surfaceProperties)
Constructs a Shape with the specified SurfaceProperties.

Parameters:
surfaceProperties - The surface properties of this shape.
Method Detail

clone

public abstract java.lang.Object clone()
Description copied from interface: CloneableEx
Returns a copy of the object.

Specified by:
clone in interface CloneableEx
Overrides:
clone in class java.lang.Object
Returns:
A copy of the object.

setSurfaceProperties

public void setSurfaceProperties(SurfaceProperties surfaceProperties)
Sets the surface properties.

Parameters:
surfaceProperties - The surface properties to set.

getSurfaceProperties

public SurfaceProperties getSurfaceProperties()
Returns the surface properties of this shape.

Returns:
The surface properties.

nearestIntersectionTime

public abstract double nearestIntersectionTime(Ray3d ray)
Gets the nearest intersection time between the specified ray and the shape.

Parameters:
ray - The ray to intersect with the shape.
Returns:
The nearest time of intersection.

surfaceNormal

public abstract javax.vecmath.Vector3d surfaceNormal(javax.vecmath.Point3d point)
Gets the surface normal at the specified point on the shape.

Parameters:
point - The point on the surface of the shape.
Returns:
The surface normal of the point on the shape.

load

public void load(DataParser dataParser)
Description copied from interface: Persistent
Loads data using the DataParser object.

A class overrides this function to load data that has been parsed.

Specified by:
load in interface Persistent
Parameters:
dataParser - The DataParser to load data from.