Aviatrix3D
2.1.0

org.j3d.renderer.aviatrix3d.geom
Class Torus

java.lang.Object
  extended by org.j3d.aviatrix3d.SceneGraphObject
      extended by org.j3d.aviatrix3d.Node
          extended by org.j3d.aviatrix3d.Leaf
              extended by org.j3d.aviatrix3d.Shape3D
                  extended by org.j3d.renderer.aviatrix3d.geom.Torus
All Implemented Interfaces:
java.lang.Comparable, NodeUpdateListener, PickableObject, PickTarget, SinglePickTarget, Cullable, LeafCullable, ObjectRenderable, Renderable, ShapeRenderable

public class Torus
extends Shape3D
implements NodeUpdateListener

A simple torus that uses triangle strips.

As we assume you may want to use this as a collidable object, we store the GeometryData instance that is used to create the object in the userData of the underlying TriangleStripArray. The geometry does not have texture coordinates set.

Version:
$Revision: 1.5 $
Author:
Justin Couch

Field Summary
 
Fields inherited from class org.j3d.aviatrix3d.Node
bounds, implicitBounds, INVALID_BOUNDS, parent
 
Fields inherited from class org.j3d.aviatrix3d.SceneGraphObject
alive, LISTENER_SET_TIMING_ERR_PROP, updateHandler
 
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
 
Fields inherited from interface org.j3d.aviatrix3d.rendering.LeafCullable
AUDIO_CULLABLE, CLIP_CULLABLE, FOG_CULLABLE, GEOMETRY_CULLABLE, LIGHT_CULLABLE, OVERRIDE_CULLABLE
 
Constructor Summary
Torus()
          Construct a default torus with no appearance set.
Torus(Appearance app)
          Construct a default torus with the given appearance.
Torus(float innerRadius, float outerRadius)
          Construct a default torus with no appearance set.
Torus(float innerRadius, float outerRadius, Appearance app)
          Construct a default torus with the given appearance.
Torus(float innerRadius, float outerRadius, int inner, int outer, Appearance app)
          Construct a torus with all the values customisable.
Torus(int inner, int outer)
          Construct a default torus with no appearance set and a custom number of faces.
Torus(int inner, int outer, Appearance app)
          Construct a default torus with the given appearance and a custom number of faces.
 
Method Summary
 void setDimensions(float innerRadius, float outerRadius)
          Change the radius and height of the torus to the new values.
 void setFacetCount(int inner, int outer)
          Set the facet count of the torus to the new value.
 void updateNodeBoundsChanges(java.lang.Object src)
          Notification that its safe to update the node now with any operations that could potentially effect the node's bounds.
 void updateNodeDataChanges(java.lang.Object src)
          Notification that its safe to update the node now with any operations that only change the node's properties, but do not change the bounds.
 
Methods inherited from class org.j3d.aviatrix3d.Shape3D
checkForCyclicChild, checkPickMask, compareTo, compareTo, equals, equals, getAppearance, getAppearanceRenderable, getCenter, getCullableType, getGeometry, getGeometryRenderable, getPickableBounds, getPickableChild, getPickMask, getPickTargetType, getRenderable, is2D, isVisible, pickBatch, pickSingle, postRender, recomputeBounds, render, requestBoundsUpdate, setAppearance, setGeometry, setLive, setPickMask, setUpdateHandler, updateBounds
 
Methods inherited from class org.j3d.aviatrix3d.Node
boundsChanged, checkForCyclicParent, getBounds, getParent, markBoundsDirty, removeParent, setBounds, setParent, updateParentBounds
 
Methods inherited from class org.j3d.aviatrix3d.SceneGraphObject
dataChanged, getAppUpdateWriteTimingMessage, getBoundsWriteTimingMessage, getDataWriteTimingMessage, getUserData, isLive, setUserData
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.j3d.aviatrix3d.rendering.LeafCullable
getBounds
 

Constructor Detail

Torus

public Torus()
Construct a default torus with no appearance set. The default size of the torus is:
Outer radius: 2.0
Inner radius: 1.0
Outer radius Faces: 16
Inner radius Faces: 16


Torus

public Torus(Appearance app)
Construct a default torus with the given appearance. The default size of the torus is:
Outer radius: 2.0
Inner radius: 1.0
Outer radius Faces: 16
Inner radius Faces: 16

Parameters:
app - The appearance to use

Torus

public Torus(int inner,
             int outer)
Construct a default torus with no appearance set and a custom number of faces.
Outer radius: 2.0
Inner radius: 1.0

Parameters:
inner - The number of faces to use around the inner radius
outer - The number of faces to use around the outer radius

Torus

public Torus(float innerRadius,
             float outerRadius)
Construct a default torus with no appearance set. The height and radius as set to the new value and uses the default face count of:
Outer radius Faces: 16
Inner radius Faces: 16

Parameters:
innerRadius - The inner radius of the torus
outerRadius - The outer radius of the torus

Torus

public Torus(int inner,
             int outer,
             Appearance app)
Construct a default torus with the given appearance and a custom number of faces.
Outer radius: 2.0
Inner radius: 1.0

Parameters:
inner - The number of faces to use around the inner radius
outer - The number of faces to use around the outer radius
app - The appearance to use

Torus

public Torus(float innerRadius,
             float outerRadius,
             Appearance app)
Construct a default torus with the given appearance. The height and radius as set to the new value and uses the default face count of Outer radius Faces: 16
Inner radius Faces: 16

Parameters:
innerRadius - The inner radius of the torus
outerRadius - The outer radius of the torus
app - The appearance to use

Torus

public Torus(float innerRadius,
             float outerRadius,
             int inner,
             int outer,
             Appearance app)
Construct a torus with all the values customisable.

Parameters:
innerRadius - The inner radius of the torus
outerRadius - The outer radius of the torus
inner - The number of faces to use around the inner radius
outer - The number of faces to use around the outer radius
app - The appearance to use
Method Detail

updateNodeBoundsChanges

public void updateNodeBoundsChanges(java.lang.Object src)
Notification that its safe to update the node now with any operations that could potentially effect the node's bounds.

Specified by:
updateNodeBoundsChanges in interface NodeUpdateListener
Parameters:
src - The node or Node Component that is to be updated.

updateNodeDataChanges

public void updateNodeDataChanges(java.lang.Object src)
Notification that its safe to update the node now with any operations that only change the node's properties, but do not change the bounds.

Specified by:
updateNodeDataChanges in interface NodeUpdateListener
Parameters:
src - The node or Node Component that is to be updated.

setDimensions

public void setDimensions(float innerRadius,
                          float outerRadius)
Change the radius and height of the torus to the new values. If the geometry write capability has been turned off, this will not do anything.

Parameters:
innerRadius - The inner radius of the torus
outerRadius - The outer radius of the torus

setFacetCount

public void setFacetCount(int inner,
                          int outer)
Set the facet count of the torus to the new value. If the geometry write capability has been turned off, this will not do anything.

Parameters:
inner - The number of faces to use around the inner radius
outer - The number of faces to use around the outer radius

Aviatrix3D
2.1.0

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