showStructure
Class SegmentGroup

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.SegmentGroup

public class SegmentGroup
extends javax.media.j3d.BranchGroup


Field Summary
protected  javax.vecmath.Color3f ambientColor
           
protected  double creaseAngle
           
protected  javax.vecmath.Color3f diffuseColor
           
protected  javax.vecmath.Color3f emissiveColor
           
protected  javax.media.j3d.TransformGroup groupTG
           
protected  int nAngle
           
protected  double r
           
protected  javax.media.j3d.RenderingAttributes[] segmentRA
           
protected  javax.media.j3d.TransformGroup[] segmentTG
           
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
SegmentGroup()
           
SegmentGroup(float radius, float d, float dRed, float dGreen, float dBlue, float eRed, float eGreen, float eBlue)
          Constructs a set of sphere segments for atoms in center unit cell layer of an hcp structure
SegmentGroup(int ns, float radius, float dRed, float dGreen, float dBlue, float eRed, float eGreen, float eBlue)
          Constructs a set of sphere segments.
SegmentGroup(int ns, float radius, float d, float dRed, float dGreen, float dBlue, float eRed, float eGreen, float eBlue)
          Constructs a set of sphere segments for atoms in center unit cell layer ns = 0 hexagonal unit cell ns = 1 a tetragonal unit cell
 
Method Summary
 javax.media.j3d.Transform3D getSegmentTransform3D(int idx)
           
 javax.media.j3d.TransformGroup getSegmentTransformGroup(int idx)
           
 javax.vecmath.Point3d[] rotX(double a, javax.vecmath.Point3d[] pts)
          Rotates a set a points around the x axis
 javax.vecmath.Point3d[] rotY(double a, javax.vecmath.Point3d[] pts)
          Rotates a set a points around the y axis
 javax.vecmath.Point3d[] rotZ(double a, javax.vecmath.Point3d[] pts)
          Rotates a set a points around the z axis
 void setAllVisible(boolean s)
          Sets the visibility of all segments
 void setRotation(float x, float y, float z, float a)
          Set rotation for the entire group.
 void setRotation(int idx, float x, float y, float z, float a)
          Set rotation for the indicated segment.
 void setTranslation(float x, float y, float z)
          Set the translation for the entire group.
 void setTranslation(int idx, float x, float y, float z)
          Set the translation for the indicated segment.
 void setVisible(int idx, boolean s)
          Sets the visibility of the indicated segment
 
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

groupTG

protected javax.media.j3d.TransformGroup groupTG

segmentTG

protected javax.media.j3d.TransformGroup[] segmentTG

segmentRA

protected javax.media.j3d.RenderingAttributes[] segmentRA

nAngle

protected int nAngle

creaseAngle

protected double creaseAngle

r

protected double r

ambientColor

protected javax.vecmath.Color3f ambientColor

diffuseColor

protected javax.vecmath.Color3f diffuseColor

emissiveColor

protected javax.vecmath.Color3f emissiveColor

specularColor

protected javax.vecmath.Color3f specularColor

shininess

protected float shininess
Constructor Detail

SegmentGroup

public SegmentGroup()

SegmentGroup

public SegmentGroup(int ns,
                    float radius,
                    float dRed,
                    float dGreen,
                    float dBlue,
                    float eRed,
                    float eGreen,
                    float eBlue)
Constructs a set of sphere segments. ns = -1 atoms in center unit cell layer of an hcp structure ns = 0 atoms on vertices of hexagonal cell ns = 2 sphere cut into halves by xy plane ns = 4 sphere cut into quarters by xy and xz planes ns = 6 sphere cut into sixths by xy plane and phi = 0, 120, and 240 degrees ns = 8 sphere cut into eighths by xy, xz, and yz planes

Parameters:
radius - sphere radius
ns - type of segments

SegmentGroup

public SegmentGroup(float radius,
                    float d,
                    float dRed,
                    float dGreen,
                    float dBlue,
                    float eRed,
                    float eGreen,
                    float eBlue)
Constructs a set of sphere segments for atoms in center unit cell layer of an hcp structure

Parameters:
d - distance between center of sphere and planes

SegmentGroup

public SegmentGroup(int ns,
                    float radius,
                    float d,
                    float dRed,
                    float dGreen,
                    float dBlue,
                    float eRed,
                    float eGreen,
                    float eBlue)
Constructs a set of sphere segments for atoms in center unit cell layer ns = 0 hexagonal unit cell ns = 1 a tetragonal unit cell

Parameters:
ns - type of geometry
d - distance between center of sphere and planes
Method Detail

getSegmentTransformGroup

public javax.media.j3d.TransformGroup getSegmentTransformGroup(int idx)
Parameters:
idx - index of segment
Returns:
TransformGroup for the individual segment

getSegmentTransform3D

public javax.media.j3d.Transform3D getSegmentTransform3D(int idx)
Parameters:
idx - index of segment
Returns:
Transform3D for the individual segment

setRotation

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


setRotation

public void setRotation(int idx,
                        float x,
                        float y,
                        float z,
                        float a)
Set rotation for the indicated segment.


setTranslation

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


setTranslation

public void setTranslation(int idx,
                           float x,
                           float y,
                           float z)
Set the translation for the indicated segment.


setVisible

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

Parameters:
idx - atom index
s - visibility state

setAllVisible

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

Parameters:
s - visibility state

rotX

public javax.vecmath.Point3d[] rotX(double a,
                                    javax.vecmath.Point3d[] pts)
Rotates a set a points around the x axis

Parameters:
a - angle of rotation
Returns:
new set of points

rotY

public javax.vecmath.Point3d[] rotY(double a,
                                    javax.vecmath.Point3d[] pts)
Rotates a set a points around the y axis

Parameters:
a - angle of rotation
Returns:
new set of points

rotZ

public javax.vecmath.Point3d[] rotZ(double a,
                                    javax.vecmath.Point3d[] pts)
Rotates a set a points around the z axis

Parameters:
a - angle of rotation
Returns:
new set of points