showStructure
Class AtomGroup

java.lang.Object
  extended by javax.media.j3d.SceneGraphObject
      extended by javax.media.j3d.Node
          extended by javax.media.j3d.Group
              extended by javax.media.j3d.BranchGroup
                  extended by showStructure.AtomGroup

public class AtomGroup
extends javax.media.j3d.BranchGroup


Field Summary
protected  javax.media.j3d.RenderingAttributes[] atomRA
           
protected  javax.media.j3d.TransformGroup[] atomTG
           
protected  javax.media.j3d.TransformGroup atomTransformGroup
           
static javax.vecmath.Color3f BLACK
           
 
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_LOCALE_READ, ALLOW_PARENT_READ, ALLOW_PICKABLE_READ, ALLOW_PICKABLE_WRITE, ENABLE_COLLISION_REPORTING, ENABLE_PICK_REPORTING
 
Constructor Summary
AtomGroup()
          Default constructor is not usable
AtomGroup(int nx, int ny, float r, javax.vecmath.Color3f dc, javax.vecmath.Color3f ec)
          Creates a single layer of closest-packed atoms
AtomGroup(UnitCell cell, int s, float r, javax.vecmath.Color3f dc, javax.vecmath.Color3f ec)
          Creates sets of atoms for a unit cell.
 
Method Summary
 javax.vecmath.Vector3f getAtomTranslation(int idx)
          Returns virtual world translation of the specified atom.
 int getNbrAtoms()
           
 void setAllVisible(boolean s)
          Sets the visibility of all atoms
 void setRotation(float x, float y, float z, float a)
          Set rotation for the entire group.
 void setTranslation(float x, float y, float z)
          Set the translation for the entire group.
 void setVisible(int idx, boolean s)
          Sets the visibility of the indicated atom
 
Methods inherited from class javax.media.j3d.BranchGroup
cloneNode, compile, detach, pickAll, pickAll, pickAllSorted, pickAllSorted, pickAny, pickAny, pickClosest, 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, getLocale, getLocalToVworld, getLocalToVworld, getParent, getPickable, setBounds, setBoundsAutoCompute, setCollidable, setPickable
 
Methods inherited from class javax.media.j3d.SceneGraphObject
clearCapability, clearCapabilityIsFrequent, duplicateSceneGraphObject, getCapability, getCapabilityIsFrequent, getName, getUserData, isCompiled, isLive, setCapability, setCapabilityIsFrequent, setName, setUserData, toString, updateNodeReferences
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BLACK

public static javax.vecmath.Color3f BLACK

atomTransformGroup

protected javax.media.j3d.TransformGroup atomTransformGroup

atomTG

protected javax.media.j3d.TransformGroup[] atomTG

atomRA

protected javax.media.j3d.RenderingAttributes[] atomRA
Constructor Detail

AtomGroup

public AtomGroup()
Default constructor is not usable


AtomGroup

public AtomGroup(UnitCell cell,
                 int s,
                 float r,
                 javax.vecmath.Color3f dc,
                 javax.vecmath.Color3f ec)
Creates sets of atoms for a unit cell. Atoms either lie on the lattice points or on the hole positions.

Parameters:
cell - unit cell
s - atom type (0 primary coordinate sites; otherwise hole sites)
r - atom radius
dc - atom diffuse color
ec - atom emissive color

AtomGroup

public AtomGroup(int nx,
                 int ny,
                 float r,
                 javax.vecmath.Color3f dc,
                 javax.vecmath.Color3f ec)
Creates a single layer of closest-packed atoms

Parameters:
nx - number of atoms along x direction
ny - number of atoms along y direction
r - atom radius
dc - atom diffuse color
ec - atom emissive color
Method Detail

getAtomTranslation

public javax.vecmath.Vector3f getAtomTranslation(int idx)
Returns virtual world translation of the specified atom.

Parameters:
idx - index of atom

getNbrAtoms

public int getNbrAtoms()
Returns:
number of atoms in the group

setVisible

public void setVisible(int idx,
                       boolean s)
Sets the visibility of the indicated atom

Parameters:
idx - atom index
s - visibility state

setAllVisible

public void setAllVisible(boolean s)
Sets the visibility of all atoms

Parameters:
s - visibility state

setRotation

public void setRotation(float x,
                        float y,
                        float z,
                        float a)
Set rotation for the entire group.


setTranslation

public void setTranslation(float x,
                           float y,
                           float z)
Set the translation for the entire group.