showStructure
Class UnitCell

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.UnitCell
Direct Known Subclasses:
HexagonalCell

public class UnitCell
extends javax.media.j3d.BranchGroup


Field Summary
protected  float alpha
           
protected  javax.vecmath.Color3f ambientColor
           
protected  float beta
           
protected  float cellA
           
protected  float cellB
           
protected  float cellC
           
protected  javax.vecmath.Point3f[] cellPts
           
protected  javax.media.j3d.TransformGroup cellTG
           
protected  int cellType
           
protected  javax.vecmath.Color3f emissiveColor
           
protected  javax.vecmath.Color3f faceDiffuseColor
           
protected  javax.media.j3d.RenderingAttributes faceRA
           
protected  float gamma
           
protected  javax.media.j3d.RenderingAttributes lineRA
           
protected  float shininess
           
protected  javax.vecmath.Color3f specularColor
           
 
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
UnitCell()
          Default constructor creates a simple cubic cell with dimension 1.0
UnitCell(int t, float d)
          Creates a cubic cell of arbitrary dimension
UnitCell(int t, float a, float b, float c)
          Creates a cubic cell of arbitrary dimension
 
Method Summary
 float getAlpha()
           
 float getBeta()
           
 float getCellA()
           
 float getCellB()
           
 float getCellC()
           
protected  javax.vecmath.Point3f[] getCellPts()
           
 int getCellType()
          Cell Types: 1 cubic (simple cubic) 2 body-centered cubic (bcc) 3 face-centered cubic (fcc)
 float getGamma()
           
 javax.vecmath.Vector3f getPointTranslation(int idx)
          Returns the virtual world translation of the specified point.
 void mulRotation(float x, float y, float z, float a)
          Multiplies the existing transform by the new rotation
 void mulTranslation(float x, float y, float z)
          Multiplies the existing transform by the new translation
protected  void setCellAngles(float a, float b, float c)
           
protected  void setCellSize(float a, float b, float c)
           
protected  void setCellType(int t)
           
 void setFacesVisible(boolean s)
          Sets the visibility of the unit cell faces
 void setLinesVisible(boolean s)
          Sets the visibility of the unit cell lines
 void setRotation(float x, float y, float z, float a)
          Sets the UnitCell rotation
 void setTranslation(float x, float y, float z)
          Sets the UnitCell translation.
 
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

cellTG

protected javax.media.j3d.TransformGroup cellTG

cellType

protected int cellType

cellA

protected float cellA

cellB

protected float cellB

cellC

protected float cellC

alpha

protected float alpha

beta

protected float beta

gamma

protected float gamma

cellPts

protected javax.vecmath.Point3f[] cellPts

lineRA

protected javax.media.j3d.RenderingAttributes lineRA

faceRA

protected javax.media.j3d.RenderingAttributes faceRA

ambientColor

protected javax.vecmath.Color3f ambientColor

faceDiffuseColor

protected javax.vecmath.Color3f faceDiffuseColor

emissiveColor

protected javax.vecmath.Color3f emissiveColor

specularColor

protected javax.vecmath.Color3f specularColor

shininess

protected float shininess
Constructor Detail

UnitCell

public UnitCell()
Default constructor creates a simple cubic cell with dimension 1.0


UnitCell

public UnitCell(int t,
                float d)
Creates a cubic cell of arbitrary dimension

Parameters:
t - cell type (1 = sc, 2 = bcc, 3 = fcc)
d - cell dimension

UnitCell

public UnitCell(int t,
                float a,
                float b,
                float c)
Creates a cubic cell of arbitrary dimension

Parameters:
t - cell type (1 = sc, 2 = bcc, 3 = fcc)
a - cell a dimension
b - cell b dimension
c - cell c dimension
Method Detail

getCellType

public int getCellType()
Cell Types: 1 cubic (simple cubic) 2 body-centered cubic (bcc) 3 face-centered cubic (fcc)

Returns:
cell type

getCellA

public float getCellA()

getCellB

public float getCellB()

getCellC

public float getCellC()

getAlpha

public float getAlpha()

getBeta

public float getBeta()

getGamma

public float getGamma()

getPointTranslation

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

Parameters:
idx - index of point

setFacesVisible

public void setFacesVisible(boolean s)
Sets the visibility of the unit cell faces

Parameters:
s - visibility state

setLinesVisible

public void setLinesVisible(boolean s)
Sets the visibility of the unit cell lines

Parameters:
s - visibility state

setTranslation

public void setTranslation(float x,
                           float y,
                           float z)
Sets the UnitCell translation.

Parameters:
x -
y -
z -

setRotation

public void setRotation(float x,
                        float y,
                        float z,
                        float a)
Sets the UnitCell rotation

Parameters:
x - x component of axis of rotation
y - y component of axis of rotation
z - z component of axis of rotation
a - angle of rotation

mulRotation

public void mulRotation(float x,
                        float y,
                        float z,
                        float a)
Multiplies the existing transform by the new rotation


mulTranslation

public void mulTranslation(float x,
                           float y,
                           float z)
Multiplies the existing transform by the new translation


setCellType

protected void setCellType(int t)

setCellSize

protected void setCellSize(float a,
                           float b,
                           float c)

setCellAngles

protected void setCellAngles(float a,
                             float b,
                             float c)

getCellPts

protected javax.vecmath.Point3f[] getCellPts()