Class Model

java.lang.Object
  extended by Model
Direct Known Subclasses:
Composite, Polygon

public abstract class Model
extends java.lang.Object

Represents a figure in three-dimensional space. In a well-designed system, each Model implementation would be an immutable class.


Field Summary
static Model EMPTY
          The null model, containing no components.
 
Constructor Summary
Model()
           
 
Method Summary
 Model color(java.awt.Color c)
          Returns a model equivalent to this one, except that its default color is the given color instead.
abstract  void draw(Graphics3D g)
           
 Model rotateX(double theta)
          Returns a model equivalent to this one, except where its coordinate system has been rotated the given number of radians around the x-axis.
 Model rotateY(double theta)
          Returns a model equivalent to this one, except where its coordinate system has been rotated the given number of radians around the y-axis.
 Model rotateZ(double theta)
          Returns a model equivalent to this one, except where its coordinate system has been rotated the given number of radians around the z-axis.
 Model scale(double x, double y, double z)
          Returns a model equivalent to this one, except where its coordinate system has been scaled in the given proportions along the x-, y-, and z-axes.
 Model transform(Transform xform)
          Returns a model equivalent to this one, except where its coordinate system has been transformed as given.
 Model translate(double x, double y, double z)
          Returns a model equivalent to this one, except where its coordinate system has been translated the given distance along the x-, y-, and z-axes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY

public static final Model EMPTY
The null model, containing no components.

Constructor Detail

Model

public Model()
Method Detail

draw

public abstract void draw(Graphics3D g)

color

public Model color(java.awt.Color c)
Returns a model equivalent to this one, except that its default color is the given color instead.


transform

public Model transform(Transform xform)
Returns a model equivalent to this one, except where its coordinate system has been transformed as given.


scale

public Model scale(double x,
                   double y,
                   double z)
Returns a model equivalent to this one, except where its coordinate system has been scaled in the given proportions along the x-, y-, and z-axes.


translate

public Model translate(double x,
                       double y,
                       double z)
Returns a model equivalent to this one, except where its coordinate system has been translated the given distance along the x-, y-, and z-axes.


rotateX

public Model rotateX(double theta)
Returns a model equivalent to this one, except where its coordinate system has been rotated the given number of radians around the x-axis.


rotateY

public Model rotateY(double theta)
Returns a model equivalent to this one, except where its coordinate system has been rotated the given number of radians around the y-axis.


rotateZ

public Model rotateZ(double theta)
Returns a model equivalent to this one, except where its coordinate system has been rotated the given number of radians around the z-axis.