showIsosurface
Class Atom

java.lang.Object
  extended by showIsosurface.Atom

public class Atom
extends java.lang.Object

The Atom class creates a TransformGroup object that locates the position of the atom and a Switch object that contains one or more Orbital Representations.

Version:
1.1
Author:
David N. Blauch

Constructor Summary
Atom()
          Creates an Atom object with the atom located at the origin.
Atom(double x, double y, double z)
          Creates an Atom object with the atom located at the specified position.
 
Method Summary
 void createOrbital(int n)
          Creates a new Orbital object containing no isosurfaces
 void createOrbital(int n, java.net.URL url)
          Creates a new Orbital object containing one isosurface, which is loaded from the specified VRML file
 void createOrbital(int n, java.net.URL url, int nSurf)
          Creates a new Orbital object containing multiple isosurfaces, which are loaded from the specified VRML files
 void destroy()
          Destroys the objects associated with this atom
 java.util.BitSet getChildMask()
          Returns the ChildMask for the atom SwitchGroup.
 java.lang.String getInfo()
          Returns name, version, copyright, and author information about this class.
 java.lang.String getName()
          Provides the name of the atom
 Orbital getOrbital(int n)
          Provides the indicated Orbital object
 javax.media.j3d.Transform3D getTransform3D()
          Method for obtaining the atom's TransformGroup transform
 javax.media.j3d.TransformGroup getTransformGroup()
          Method for obtaining the atom's TransformGroup
 void loadIsosurface(int n, java.net.URL url)
          Loads an isosurface in the specified orbital
 void loadIsosurfaces(int n, java.net.URL url, int nSurf)
          Loads multiple isosurfaces in the specified orbital
 void setAllIsosurfacesVisible(int nOrb, boolean s)
          Determines whether all isosurfaces in the specified orbital are visible
 void setChildMask(java.util.BitSet b)
          Sets the ChildMask option to indicate which orbitals are displayed.
 void setColor(int nOrb, int nIso, javax.vecmath.Color3f diffuseC)
          Sets the diffuse color of an isosurface
 void setColor(int nOrb, int nIso, javax.vecmath.Color3f ambientC, javax.vecmath.Color3f diffuseC, javax.vecmath.Color3f emissiveC, javax.vecmath.Color3f specularC)
          Sets the color of an isosurface
 void setIsosurfaceVisible(int nOrb, int nIso, boolean s)
          Determines whether the specified isosurface in the specified orbital is visible
 void setName(java.lang.String name)
          Sets the name of the atom
 void setNucleusColor(float x, float y, float z)
          Sets the emissive color of the nucleus and sets the nucleus to be visible
 void setNucleusVisible(boolean s)
          Determines whether the nucleus is visible as a small where sphere
 void setOrbitalActive(int n)
          The orbital's BranchGroup is compiled and added to the atom's Switch node.
 void setPosition(double x, double y, double z)
          Sets the position of the atom
 void setScale(double s)
          Sets the transform scale
 void setTransform(javax.media.j3d.Transform3D trans)
          Sets the transform of the atom
 void setTransparency(int n, float t)
          Sets the transparency of the specified orbital
 void setWhichOrbital(int n)
          Indicates which orbital is to be displayed May also specify Switch.CHILD_ALL, Switch.CHILD_NONE, or Switch.CHILD_MASK.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Atom

public Atom()
Creates an Atom object with the atom located at the origin.


Atom

public Atom(double x,
            double y,
            double z)
Creates an Atom object with the atom located at the specified position.

Parameters:
x - position of atom along x axis
y - position of atom along y axis
z - position of atom along z axis
Method Detail

createOrbital

public void createOrbital(int n)
Creates a new Orbital object containing no isosurfaces

Parameters:
n - number of isosurfaces for the orbital

createOrbital

public void createOrbital(int n,
                          java.net.URL url)
Creates a new Orbital object containing one isosurface, which is loaded from the specified VRML file

Parameters:
n - number of isosurfaces for the orbital
url - URL of the VRML file describing an isosurface

createOrbital

public void createOrbital(int n,
                          java.net.URL url,
                          int nSurf)
Creates a new Orbital object containing multiple isosurfaces, which are loaded from the specified VRML files

Parameters:
n - number of isosurfaces for the orbital
url - URL of the VRML files describing isosurfaces
nSurf - number of isosurfaces to be loaded

destroy

public void destroy()
Destroys the objects associated with this atom


getInfo

public java.lang.String getInfo()
Returns name, version, copyright, and author information about this class.


getName

public java.lang.String getName()
Provides the name of the atom

Returns:
atom name

getOrbital

public Orbital getOrbital(int n)
Provides the indicated Orbital object

Parameters:
n - index of the orbital
Returns:
Orbital object

getTransform3D

public javax.media.j3d.Transform3D getTransform3D()
Method for obtaining the atom's TransformGroup transform

Returns:
Transform3D object for the atom

getTransformGroup

public javax.media.j3d.TransformGroup getTransformGroup()
Method for obtaining the atom's TransformGroup

Returns:
TransformGroup for the atom

loadIsosurface

public void loadIsosurface(int n,
                           java.net.URL url)
Loads an isosurface in the specified orbital

Parameters:
n - orbital index
url - URL of VRML file used to create the isosurface

loadIsosurfaces

public void loadIsosurfaces(int n,
                            java.net.URL url,
                            int nSurf)
Loads multiple isosurfaces in the specified orbital

Parameters:
n - orbital index
url - URL of VRML files used to create the isosurfaces
nSurf - number of isosurfaces to be loaded

setAllIsosurfacesVisible

public void setAllIsosurfacesVisible(int nOrb,
                                     boolean s)
Determines whether all isosurfaces in the specified orbital are visible

Parameters:
nOrb - index of Orbital
s - visibility state

setColor

public void setColor(int nOrb,
                     int nIso,
                     javax.vecmath.Color3f ambientC,
                     javax.vecmath.Color3f diffuseC,
                     javax.vecmath.Color3f emissiveC,
                     javax.vecmath.Color3f specularC)
Sets the color of an isosurface

Parameters:
nOrb - index of the Orbital
nIso - index of the Isosurface
ambientC - ambient color
diffuseC - diffuse color
emissiveC - emissive color
specularC - specular color

setColor

public void setColor(int nOrb,
                     int nIso,
                     javax.vecmath.Color3f diffuseC)
Sets the diffuse color of an isosurface

Parameters:
nOrb - index of the Orbital
nIso - index of the Isosurface
diffuseC - diffuse color

setIsosurfaceVisible

public void setIsosurfaceVisible(int nOrb,
                                 int nIso,
                                 boolean s)
Determines whether the specified isosurface in the specified orbital is visible

Parameters:
nOrb - index of Orbital
nIso - index of Isosurface
s - visibility state

setName

public void setName(java.lang.String name)
Sets the name of the atom

Parameters:
name - atom name

setNucleusColor

public void setNucleusColor(float x,
                            float y,
                            float z)
Sets the emissive color of the nucleus and sets the nucleus to be visible

Parameters:
x - x component
y - y component
z - z component

setNucleusVisible

public void setNucleusVisible(boolean s)
Determines whether the nucleus is visible as a small where sphere

Parameters:
s - visibility state

setOrbitalActive

public void setOrbitalActive(int n)
The orbital's BranchGroup is compiled and added to the atom's Switch node.

Parameters:
n - index of orbital to be made active

setPosition

public void setPosition(double x,
                        double y,
                        double z)
Sets the position of the atom

Parameters:
x - position of atom along x axis
y - position of atom along y axis
z - position of atom along z axis

setScale

public void setScale(double s)
Sets the transform scale

Parameters:
s - scale

setTransform

public void setTransform(javax.media.j3d.Transform3D trans)
Sets the transform of the atom

Parameters:
trans - orientation and position of the atom

setTransparency

public void setTransparency(int n,
                            float t)
Sets the transparency of the specified orbital

Parameters:
n - orbital index
t - transparency

setWhichOrbital

public void setWhichOrbital(int n)
Indicates which orbital is to be displayed May also specify Switch.CHILD_ALL, Switch.CHILD_NONE, or Switch.CHILD_MASK. If CHILD_MASK is specified, setChildMask() is employed to identify the orbitals to be displayed.

Parameters:
n - orbital index

getChildMask

public java.util.BitSet getChildMask()
Returns the ChildMask for the atom SwitchGroup. This value indicates which orbitals are being displayed.

Returns:
ChildMask value

setChildMask

public void setChildMask(java.util.BitSet b)
Sets the ChildMask option to indicate which orbitals are displayed. Use with setWhichOrbital(Switch.CHILD_MASK)

Parameters:
b - BitSet indicating which orbitals are displayed