showIsosurface
Class Orbital

java.lang.Object
  extended by showIsosurface.Orbital

public class Orbital
extends java.lang.Object

The Orbital class creates a BranchGroup object and populates that object with children the describe the various regions of an atomic or molecular orbital. The children are Shape3D objects.

Version:
1.1
Author:
David N. Blauch

Constructor Summary
Orbital()
          Creates the Orbital object.
Orbital(int n)
          Creates the Orbital object.
 
Method Summary
 void compile()
          Compiles the orbital BranchGroup.
 void destroy()
          Sets all isosurface objects to null and creates an empty BranchGroup
 javax.media.j3d.Group getBranchGroup()
          Returns the BranchGroup object for the orbital
 java.lang.String getInfo()
          Returns name, version, copyright, and author information about this class.
 Isosurface getIsosurface(int n)
          Provides the requested Isosurface object
 java.lang.String getOrbitalName()
          Returns the name of the orbital
 void loadIsosurface(java.net.URL url)
          Loads an isosurface (a region of the orbital) from a VRML node file
 void loadIsosurfaces(java.net.URL burl, int n)
          Loads a set of isosurfaces (regions of the orbital) from a set of VRML node files.
 void setAllVisible(boolean s)
          Sets the visibility state for all of the isosurfaces
 void setColor(int n, javax.vecmath.Color3f diffuseC)
          Sets the diffuse color of an isosurface
 void setColor(int n, javax.vecmath.Color3f ambientC, javax.vecmath.Color3f diffuseC, javax.vecmath.Color3f emissiveC, javax.vecmath.Color3f specularC)
          Sets the color of an isosurface
 void setName(java.lang.String name)
          Sets the name of the orbital
 void setTransparency(float t)
          Sets the transparency of the orbital
 void setVisible(int n, boolean s)
          Sets the visibility state of a specific isosurface
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Orbital

public Orbital()
Creates the Orbital object. The orbital name is a single space. Only two orbital regions (isosurfaces) are allocated.


Orbital

public Orbital(int n)
Creates the Orbital object. Only two orbital regions (isosurfaces) are allocated.

Parameters:
n - number of orbital regions (isosurfaces)
Method Detail

compile

public void compile()
Compiles the orbital BranchGroup. After compiling, no additional isosurfaces may be added.


destroy

public void destroy()
Sets all isosurface objects to null and creates an empty BranchGroup


getBranchGroup

public javax.media.j3d.Group getBranchGroup()
Returns the BranchGroup object for the orbital

Returns:
BranchGroup object containing Shape3D objects

getInfo

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


getIsosurface

public Isosurface getIsosurface(int n)
Provides the requested Isosurface object

Parameters:
n - index of the isosurface
Returns:
Isosurface object

getOrbitalName

public java.lang.String getOrbitalName()
Returns the name of the orbital

Returns:
orbital name

loadIsosurface

public void loadIsosurface(java.net.URL url)
Loads an isosurface (a region of the orbital) from a VRML node file

Parameters:
url - URL of the VRML node file

loadIsosurfaces

public void loadIsosurfaces(java.net.URL burl,
                            int n)
Loads a set of isosurfaces (regions of the orbital) from a set of VRML node files. The VRML node filenames are constructed from the base name and the number of isosurfaces. If the base name is "2s" and there are two isosurfaces, the method will attempt to load files 2s.0.wrl.gz and 2s.1.wrl.gz .

Parameters:
burl - base URL for the VRML node files
n - number of isosurfaces to be loaded

setAllVisible

public void setAllVisible(boolean s)
Sets the visibility state for all of the isosurfaces

Parameters:
s - visibility state

setColor

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

Parameters:
n - number of the isosurface
ambientC - ambient color
diffuseC - diffuse color
emissiveC - emissive color
specularC - specular color

setColor

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

Parameters:
n - number of the isosurface
diffuseC - diffuse color

setName

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

Parameters:
name - orbital name

setTransparency

public void setTransparency(float t)
Sets the transparency of the orbital

Parameters:
t -

setVisible

public void setVisible(int n,
                       boolean s)
Sets the visibility state of a specific isosurface

Parameters:
n - number of the isosurface
s - visibility state