Aviatrix3D
2.0 Dev

org.j3d.renderer.aviatrix3d.geom
Class Teapot

java.lang.Object
  extended byorg.j3d.aviatrix3d.SceneGraphObject
      extended byorg.j3d.aviatrix3d.NodeComponent
          extended byorg.j3d.aviatrix3d.Geometry
              extended byorg.j3d.renderer.aviatrix3d.geom.Teapot
All Implemented Interfaces:
java.lang.Comparable, LeafPickTarget, PickableObject, PickTarget, Renderable, RenderableGeometry

public class Teapot
extends Geometry

A simple teapot that is a low-level geometry primitive.

Internally this uses the OpenGL evaluators to work through the bezier patch data for rendering. The code is liberally stolen from the GLUT source which is copyright SGI. Converted to the JOGL API methods and different calling conventions.

Version:
$Revision: 1.5 $
Author:
Justin Couch

Field Summary
 
Fields inherited from class org.j3d.aviatrix3d.Geometry
bounds, implicitBounds, internalUpdater, INVALID_BOUNDS, lastParentList, parentList, pickFlags, validAlpha
 
Fields inherited from class org.j3d.aviatrix3d.NodeComponent
lastParent, liveCount
 
Fields inherited from class org.j3d.aviatrix3d.SceneGraphObject
alive, LISTENER_SET_NOT_LIVE_MESSAGE, updateHandler, WRITE_TIMING_MSG
 
Fields inherited from interface org.j3d.aviatrix3d.picking.PickableObject
COLLIDABLE_OBJECT, GENERAL_OBJECT, PROXIMITY_OBJECT, VISIBLE_OBJECT
 
Fields inherited from interface org.j3d.aviatrix3d.picking.PickTarget
CUSTOM_PICK_TYPE, GROUP_PICK_TYPE, LEAF_PICK_TYPE, SINGLE_PICK_TYPE
 
Constructor Summary
Teapot(float scale, int gridSize)
          Construct a default instance of the teapot with the given scale factor.
 
Method Summary
 int compareTo(java.lang.Object o)
          Compares this object with the specified object for order.
 int compareTo(Teapot ta)
          Compares this object with the specified object for order.
 boolean equals(java.lang.Object o)
          Compare this object for equality to the given object.
 boolean equals(Teapot ta)
          Compares this object with the specified object to check for equivalence.
protected  void markBoundsDirty()
          Mark this node as having dirty bounds due to it's geometry having changed.
 void postRender(javax.media.opengl.GL gl)
          Restore all openGL state.
protected  void recomputeBounds()
          Internal method to recalculate the implicit bounds of this Node.
 void render(javax.media.opengl.GL gl)
          Issue ogl commands needed for this renderable object.
protected  void updateBounds()
          Update this node's bounds and then call the parent to update it's bounds.
 
Methods inherited from class org.j3d.aviatrix3d.Geometry
addParent, boundsChanged, checkPickMask, getBounds, getPickableBounds, getPickMask, getPickTargetType, getRenderable, hasTransparency, isVisible, pickBatch, pickLineRay, pickLineSegment, pickSingle, removeParent, setBounds, setPickMask
 
Methods inherited from class org.j3d.aviatrix3d.NodeComponent
addParent, getParents, hasChanged, numParents, removeParent
 
Methods inherited from class org.j3d.aviatrix3d.SceneGraphObject
checkForCyclicChild, checkForCyclicParent, dataChanged, getUserData, isLive, setLive, setUpdateHandler, setUserData
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Teapot

public Teapot(float scale,
              int gridSize)
Construct a default instance of the teapot with the given scale factor.

Parameters:
scale - The scale of the teapot to use
Method Detail

render

public void render(javax.media.opengl.GL gl)
Issue ogl commands needed for this renderable object.

Parameters:
gl - The gl context to draw with

postRender

public void postRender(javax.media.opengl.GL gl)
Restore all openGL state.

Parameters:
gl - The gl context to draw with

updateBounds

protected void updateBounds()
Update this node's bounds and then call the parent to update it's bounds. Used to propogate bounds changes from the leaves of the tree to the root. A node implementation may decide when and where to tell the parent(s)s that updates are ready.

Overrides:
updateBounds in class Geometry

recomputeBounds

protected void recomputeBounds()
Internal method to recalculate the implicit bounds of this Node. By default the bounds are a point sphere, so derived classes should override this method with something better.

Specified by:
recomputeBounds in class Geometry

markBoundsDirty

protected void markBoundsDirty()
Mark this node as having dirty bounds due to it's geometry having changed.

Overrides:
markBoundsDirty in class Geometry

compareTo

public int compareTo(java.lang.Object o)
              throws java.lang.ClassCastException
Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

Parameters:
o - The objec to be compared
Returns:
-1, 0 or 1 depending on order
Throws:
java.lang.ClassCastException - The specified object's type prevents it from being compared to this Object

equals

public boolean equals(java.lang.Object o)
Compare this object for equality to the given object.

Parameters:
o - The object to be compared
Returns:
True if these represent the same values

compareTo

public int compareTo(Teapot ta)
Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

Parameters:
ta - The argument instance to be compared
Returns:
-1, 0 or 1 depending on order

equals

public boolean equals(Teapot ta)
Compares this object with the specified object to check for equivalence.

Parameters:
ta - The geometry instance to be compared
Returns:
true if the objects represent identical values

Aviatrix3D
2.0 Dev

Latest Info from http://aviatrix3d.j3d.org/
Copyright © 2003 - 2005 j3d.org