Class AssemblyGraphic

java.lang.Object
  extended byjavax.media.j3d.SceneGraphObject
      extended byjavax.media.j3d.Node
          extended byjavax.media.j3d.Group
              extended byjavax.media.j3d.BranchGroup
                  extended byAssemblyGraphic

public class AssemblyGraphic
extends javax.media.j3d.BranchGroup

Extends branchGroup to make a complete Assembly graphic. AssemblyGraphic | TransformGroup / | \ ... SubunitGraphics ........


Field Summary
 
Fields inherited from class javax.media.j3d.BranchGroup
ALLOW_DETACH
 
Fields inherited from class javax.media.j3d.Group
ALLOW_CHILDREN_EXTEND, ALLOW_CHILDREN_READ, ALLOW_CHILDREN_WRITE, ALLOW_COLLISION_BOUNDS_READ, ALLOW_COLLISION_BOUNDS_WRITE
 
Fields inherited from class javax.media.j3d.Node
ALLOW_AUTO_COMPUTE_BOUNDS_READ, ALLOW_AUTO_COMPUTE_BOUNDS_WRITE, ALLOW_BOUNDS_READ, ALLOW_BOUNDS_WRITE, ALLOW_COLLIDABLE_READ, ALLOW_COLLIDABLE_WRITE, ALLOW_LOCAL_TO_VWORLD_READ, ALLOW_PICKABLE_READ, ALLOW_PICKABLE_WRITE, ENABLE_COLLISION_REPORTING, ENABLE_PICK_REPORTING
 
Constructor Summary
AssemblyGraphic()
          Constructs a default AssemblyGraphic with a default detachable BranchGroup
AssemblyGraphic(Assembly asm)
          Constructs a AssemblyGraphic with a detachable childWritable BranchGroup.
 
Method Summary
 void addSubunit(Subunit sub)
          Adds the graphic of Subunit sub to the assembly graphic
 javax.media.j3d.BranchGroup branchGroup()
          Return AssemblyGraphic as a BranchGroup
 javax.vecmath.Vector3d getBindingSitePos(Subunit sub, BindingSite bs)
          Returns position of the binding site in relation to the real axis
 javax.vecmath.Quat4d getBindingSiteRot(Subunit sub, BindingSite bs)
          Returns the rotation of bs in relation to the real axis
 javax.vecmath.Vector3d getPos()
          Gets the translation component(position) of this AssemblyGraphic
 javax.vecmath.Quat4d getRot()
          Gets the rotation component of this AssemblyGraphic
 javax.media.j3d.Transform3D getTransform()
          Gets the Transform3D of this AssemblyGraphic
 void realRotate(javax.vecmath.Quat4d rot)
           
 void rotate(javax.vecmath.AxisAngle4d newrot)
           
 void rotate(javax.vecmath.Quat4d rot)
          Rotates this AssemblyGraphic by rot
 void setPos(javax.vecmath.Vector3d newpos)
          Sets position of this AssemblyGraphic to newpos
 void setRot(javax.vecmath.AxisAngle4d newrot)
           
 void setRot(javax.vecmath.Quat4d newrot)
          Sets rotation of this AssemblyGraphic to newrot
 void updateLocation(javax.vecmath.Quat4d rot, javax.vecmath.Vector3d pos)
          Updates the whole assembly graphic's new location specificed by rot and pos
 void updateLocation(javax.media.j3d.Transform3D tr)
          Updates the whole assembly graphic's new location specificed Transform3D tr
 
Methods inherited from class javax.media.j3d.BranchGroup
cloneNode, compile, detach, pickAll, pickAllSorted, pickAny, pickClosest
 
Methods inherited from class javax.media.j3d.Group
addChild, getAllChildren, getAlternateCollisionTarget, getChild, getCollisionBounds, indexOfChild, insertChild, moveTo, numChildren, removeAllChildren, removeChild, removeChild, setAlternateCollisionTarget, setChild, setCollisionBounds
 
Methods inherited from class javax.media.j3d.Node
cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, duplicateNode, getBounds, getBoundsAutoCompute, getCollidable, getLocalToVworld, getLocalToVworld, getParent, getPickable, setBounds, setBoundsAutoCompute, setCollidable, setPickable
 
Methods inherited from class javax.media.j3d.SceneGraphObject
clearCapability, clearCapabilityIsFrequent, duplicateSceneGraphObject, getCapability, getCapabilityIsFrequent, getUserData, isCompiled, isLive, setCapability, setCapabilityIsFrequent, setUserData, updateNodeReferences
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AssemblyGraphic

public AssemblyGraphic()
Constructs a default AssemblyGraphic with a default detachable BranchGroup


AssemblyGraphic

public AssemblyGraphic(Assembly asm)
Constructs a AssemblyGraphic with a detachable childWritable BranchGroup. The SubunitGraphics for each Subunit in Assembly asm are added as children. The graphic is given a "random" orientation and the identity position.

Method Detail

updateLocation

public void updateLocation(javax.vecmath.Quat4d rot,
                           javax.vecmath.Vector3d pos)
Updates the whole assembly graphic's new location specificed by rot and pos

Parameters:
rot - Quat4d the rotation of new location
pos - Vector3d the position of new location

updateLocation

public void updateLocation(javax.media.j3d.Transform3D tr)
Updates the whole assembly graphic's new location specificed Transform3D tr

Parameters:
tr - Transform3D

addSubunit

public void addSubunit(Subunit sub)
Adds the graphic of Subunit sub to the assembly graphic

Parameters:
sub - Subunit to be added to Assembly

branchGroup

public javax.media.j3d.BranchGroup branchGroup()
Return AssemblyGraphic as a BranchGroup

Returns:
BranchGroup

getBindingSitePos

public javax.vecmath.Vector3d getBindingSitePos(Subunit sub,
                                                BindingSite bs)
Returns position of the binding site in relation to the real axis

Parameters:
sub - Subunit
bs - BindingSite of sub
Returns:
Vector3d

getBindingSiteRot

public javax.vecmath.Quat4d getBindingSiteRot(Subunit sub,
                                              BindingSite bs)
Returns the rotation of bs in relation to the real axis

Parameters:
sub - Subunit
bs - BindingSite of sub
Returns:
Quat4d

getRot

public javax.vecmath.Quat4d getRot()
Gets the rotation component of this AssemblyGraphic

Returns:
Quat4d

getPos

public javax.vecmath.Vector3d getPos()
Gets the translation component(position) of this AssemblyGraphic

Returns:
Vector3d

setPos

public void setPos(javax.vecmath.Vector3d newpos)
Sets position of this AssemblyGraphic to newpos

Parameters:
newpos - Vector3d

setRot

public void setRot(javax.vecmath.Quat4d newrot)
Sets rotation of this AssemblyGraphic to newrot

Parameters:
newrot - Quat4d

setRot

public void setRot(javax.vecmath.AxisAngle4d newrot)

realRotate

public void realRotate(javax.vecmath.Quat4d rot)

rotate

public void rotate(javax.vecmath.Quat4d rot)
Rotates this AssemblyGraphic by rot

Parameters:
rot - Quat4d

rotate

public void rotate(javax.vecmath.AxisAngle4d newrot)

getTransform

public javax.media.j3d.Transform3D getTransform()
Gets the Transform3D of this AssemblyGraphic

Returns:
Transform3D