showIsosurface
Class ShowIsosurface

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Panel
              extended by java.applet.Applet
                  extended by showIsosurface.ShowIsosurface
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class ShowIsosurface
extends java.applet.Applet

Displays orbital isosurfaces given a point set.

Applet Parameters

NAME Variable Type Default Description
CreateAxes Boolean False Determines whether coordinate axes will be created.
EnableRotate Boolean True Determines whether the scene may be rotated. Implemented only for ROTATE_SCENE
EnableTranslate Boolean True Determines whether the scene may be translated.
EnableZoom Boolean True Determines whether the scene zoom is available.
IsReady String   JavaScript variable that will be set to true when applet has initialized. Must use MAYSCRIPT in APPLET tag to use this feature.
NbrAtoms Integer 1 Number of atoms to be displayed.
RotateBehavior Integer 0 Specifies the mouse rotation behavior.
0 (ROTATE_SCENE) entire scene rotates together
1 (ROTATE_ALL) all atoms rotate simultaneous about their locations (axes do not rotate)
2 (ROTATE_INDIVIDUAL) all atoms rotate individually and independent of other atoms

Version:
1.2
Author:
David N. Blauch
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.applet.Applet
java.applet.Applet.AccessibleApplet
 
Nested classes/interfaces inherited from class java.awt.Panel
java.awt.Panel.AccessibleAWTPanel
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 int ROTATE_ALL
           
 int ROTATE_INDIVIDUAL
           
 int ROTATE_SCENE
           
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
ShowIsosurface()
           
 
Method Summary
 void createOrbital(int nAtom, int nIso)
          Creates a new Orbital object containing no isosurfaces
 void createOrbital(int nAtom, int nIso, java.lang.String fname)
          Creates a new Orbital object containing one isosurface, which is loaded from the specified VRML file
 void createOrbital(int nAtom, int nIso, java.lang.String fname, int nSurf)
          Creates a new Orbital object containing multiple isosurfaces, which are loaded from the specified VRML files
 void destroy()
           
 java.lang.String getAppletInfo()
           
 java.util.BitSet getChildMask(int nAtom)
          Returns the Switch child mask for the orbitals on the specified atom
 boolean getChildMask(int nAtom, int nOrb)
          Returns the Switch child mask setting for a specific orbital.
 java.lang.String getParameter(java.lang.String key, java.lang.String def)
           
 java.lang.String[][] getParameterInfo()
           
 javax.vecmath.AxisAngle4d getRotation()
          Provides the current setting for the system TransformGroup.
 double getRotationAngle()
          Returns the x component of the axis of rotation for the current transform
 double getRotationX()
          Returns the x component of the axis of rotation for the current transform
 double getRotationY()
          Returns the y component of the axis of rotation for the current transform
 double getRotationZ()
          Returns the z component of the axis of rotation for the current transform
 void init()
           
 void loadIsosurface(int nAtom, int nOrb, java.lang.String fname)
          Loads an isosurface from a VRML file into an orbital
 void loadIsosurfaces(int nAtom, int nOrb, java.lang.String fname, int nSurf)
          Loads a set of isosurfaces from VRML files into an orbital
 void setAtomPosition(int n, double x, double y, double z)
          Sets the position of the specified atom.
 void setAtomScale(int n, double s)
          Scales the geometry objects for the specified atom
 void setAtomView(int na, double x, double y, double z, double xa, double ya, double za, double a)
          Sets the rotation for a specific atom to view down the x axis.
 void setAxesLength(float r)
          Sets the range of all axes from -r to r.
 void setAxesLength(float xL, float xU, float yL, float yU, float zL, float zU)
          Sets the lengths of the axes.
 void setAxesVisible(boolean s)
          Indicates whether axes are visible
 void setChildMask(int nAtom, java.util.BitSet bs)
          For the specified atom, sets the Switch child mask.
 void setChildMask(int nAtom, int nOrb, boolean s)
          For the specified atom, sets the Switch child mask for the specified orbital.
 void setColor(int nAtom, int nOrb, int nIso, javax.vecmath.Color3f diffuseC)
          Sets the diffuse color of an isosurface
 void setColor(int nAtom, 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 setColor(int nAtom, int nOrb, int nIso, float fRed, float fGreen, float fBlue)
          Sets the diffuse color of an isosurface
 void setFontSize(int s)
          Sets the font size for the axes labels
 void setIsosurfaceVisible(int nAtom, int nOrb, int nIso, boolean s)
          Indicates whether an isosurface is visible
 void setNucleusColor(int n, float x, float y, float z)
          Sets the emissive color of the nucleus of the specified atom and sets the nucleus to be visible
 void setNucleusVisible(int n, boolean s)
          Determines whether the nucleus is visible as a small where sphere
 void setOrbitalActive(int nAtom, int nOrb)
          The orbital's BranchGroup is compiled and added to the atom's Switch node.
 void setOrbitalTransparency(int nAtom, int nOrb, float t)
          Sets the transparency of an orbital
 void setPosition(double x, double y, double z)
          Sets the position of the root transform.
 void setView(double x, double y, double z, double a)
          Sets the orientation to a specific value.
 void setViewDistance(float r)
          Sets the viewing distance.
 void setWhichOrbital(int nAtom, int nOrb)
          For the selected atom, specifies the orbital to be displayed.
 void setXView()
          Sets the orientation to view down the x axis.
 void setYView()
          Sets the orientation to view down the y axis.
 void setZView()
          Sets the orientation to view down the z axis.
 void start()
           
 void stop()
           
 
Methods inherited from class java.applet.Applet
getAccessibleContext, getAppletContext, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus
 
Methods inherited from class java.awt.Panel
addNotify
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ROTATE_SCENE

public final int ROTATE_SCENE
See Also:
Constant Field Values

ROTATE_ALL

public final int ROTATE_ALL
See Also:
Constant Field Values

ROTATE_INDIVIDUAL

public final int ROTATE_INDIVIDUAL
See Also:
Constant Field Values
Constructor Detail

ShowIsosurface

public ShowIsosurface()
Method Detail

getAppletInfo

public java.lang.String getAppletInfo()
Overrides:
getAppletInfo in class java.applet.Applet

getParameterInfo

public java.lang.String[][] getParameterInfo()
Overrides:
getParameterInfo in class java.applet.Applet

getParameter

public java.lang.String getParameter(java.lang.String key,
                                     java.lang.String def)

init

public void init()
Overrides:
init in class java.applet.Applet

start

public void start()
Overrides:
start in class java.applet.Applet

stop

public void stop()
Overrides:
stop in class java.applet.Applet

destroy

public void destroy()
Overrides:
destroy in class java.applet.Applet

createOrbital

public void createOrbital(int nAtom,
                          int nIso)
Creates a new Orbital object containing no isosurfaces

Parameters:
nAtom - index of the atom to contain the new orbital
nIso - number of isosurfaces for the new orbital

createOrbital

public void createOrbital(int nAtom,
                          int nIso,
                          java.lang.String fname)
Creates a new Orbital object containing one isosurface, which is loaded from the specified VRML file

Parameters:
nAtom - index of the atom to contain the new orbital
nIso - number of isosurfaces for the new orbital
fname - file name of the VRML file describing an isosurface

createOrbital

public void createOrbital(int nAtom,
                          int nIso,
                          java.lang.String fname,
                          int nSurf)
Creates a new Orbital object containing multiple isosurfaces, which are loaded from the specified VRML files

Parameters:
nAtom - index of the atom to contain the new orbital
nIso - number of isosurfaces for the orbital
fname - base file name of the VRML files describing isosurfaces
nSurf - number of isosurfaces to be loaded

getRotation

public javax.vecmath.AxisAngle4d getRotation()
Provides the current setting for the system TransformGroup.

Returns:
AxisAngle4d object for the current transform

getChildMask

public java.util.BitSet getChildMask(int nAtom)
Returns the Switch child mask for the orbitals on the specified atom

Parameters:
nAtom - atom of interest

getChildMask

public boolean getChildMask(int nAtom,
                            int nOrb)
Returns the Switch child mask setting for a specific orbital.

Parameters:
nAtom - atom of interest
nOrb - orbital of interest

setChildMask

public void setChildMask(int nAtom,
                         java.util.BitSet bs)
For the specified atom, sets the Switch child mask. Requires setWhichOrbital has been called with the CHILD_MASK option.

Parameters:
nAtom - atom of interest
bs - child mask

setChildMask

public void setChildMask(int nAtom,
                         int nOrb,
                         boolean s)
For the specified atom, sets the Switch child mask for the specified orbital. Requires setWhichOrbital has been called with the CHILD_MASK option.

Parameters:
nAtom - atom of interest
nOrb - orbital of interest
s - state for orbital

getRotationX

public double getRotationX()
Returns the x component of the axis of rotation for the current transform

Returns:
x-component of axis of rotation

getRotationY

public double getRotationY()
Returns the y component of the axis of rotation for the current transform

Returns:
y-component of axis of rotation

getRotationZ

public double getRotationZ()
Returns the z component of the axis of rotation for the current transform

Returns:
z-component of axis of rotation

getRotationAngle

public double getRotationAngle()
Returns the x component of the axis of rotation for the current transform

Returns:
angle of rotation

loadIsosurface

public void loadIsosurface(int nAtom,
                           int nOrb,
                           java.lang.String fname)
Loads an isosurface from a VRML file into an orbital

Parameters:
nAtom - index of atom
nOrb - index of orbital
fname - file name of the VRML file

loadIsosurfaces

public void loadIsosurfaces(int nAtom,
                            int nOrb,
                            java.lang.String fname,
                            int nSurf)
Loads a set of isosurfaces from VRML files into an orbital

Parameters:
nAtom - index of atom
nOrb - index of orbital
fname - base file name of the VRML files
nSurf - number of surfaces to be added

setAtomPosition

public void setAtomPosition(int n,
                            double x,
                            double y,
                            double z)
Sets the position of the specified atom.

Parameters:
n - index of the atoms
x - position of the atom along the x axis
y - position of the atom along the y axis
z - position of the atom along the z axis

setAtomScale

public void setAtomScale(int n,
                         double s)
Scales the geometry objects for the specified atom

Parameters:
n - atom index
s - scale

setAtomView

public void setAtomView(int na,
                        double x,
                        double y,
                        double z,
                        double xa,
                        double ya,
                        double za,
                        double a)
Sets the rotation for a specific atom to view down the x axis.

Parameters:
na - atom index
x - x position
y - y position
z - z position
xa - x-component of the axis of rotation
ya - y-component of the axis of rotation
za - z-component of the axis of rotation
a - angle of rotation

setAxesLength

public void setAxesLength(float r)
Sets the range of all axes from -r to r.

Parameters:
r - limits of each axis

setAxesLength

public void setAxesLength(float xL,
                          float xU,
                          float yL,
                          float yU,
                          float zL,
                          float zU)
Sets the lengths of the axes.

Parameters:
xL - lower limit of x axis
xU - upper limit of x axis
yL - lower limit of y axis
yU - upper limit of y axis
zL - lower limit of z axis
zU - upper limit of z axis

setAxesVisible

public void setAxesVisible(boolean s)
Indicates whether axes are visible

Parameters:
s - visibility state

setColor

public void setColor(int nAtom,
                     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:
nAtom - index of the Atom
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 nAtom,
                     int nOrb,
                     int nIso,
                     javax.vecmath.Color3f diffuseC)
Sets the diffuse color of an isosurface

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

setColor

public void setColor(int nAtom,
                     int nOrb,
                     int nIso,
                     float fRed,
                     float fGreen,
                     float fBlue)
Sets the diffuse color of an isosurface

Parameters:
nAtom - index of the Atom
nOrb - index of the Orbital
nIso - index of the Isosurface
fRed - red component of diffuse color
fGreen - green component of diffuse color
fBlue - blue component of diffuse color

setFontSize

public void setFontSize(int s)
Sets the font size for the axes labels

Parameters:
s - font size for the axes labels

setIsosurfaceVisible

public void setIsosurfaceVisible(int nAtom,
                                 int nOrb,
                                 int nIso,
                                 boolean s)
Indicates whether an isosurface is visible

Parameters:
nAtom - index for Atom
nOrb - index for Orbital
nIso - index for Isosurface
s - new state for visibility

setNucleusColor

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

Parameters:
n - index of atom
x - x component
y - y component
z - z component

setNucleusVisible

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

Parameters:
n - index of atom
s - visibility state

setOrbitalActive

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

Parameters:
nAtom - index of atom containing the orbital
nOrb - index of the orbital to be made active

setOrbitalTransparency

public void setOrbitalTransparency(int nAtom,
                                   int nOrb,
                                   float t)
Sets the transparency of an orbital

Parameters:
nAtom - index of atom containing the orbital
nOrb - index of the orbital
t - transparency

setPosition

public void setPosition(double x,
                        double y,
                        double z)
Sets the position of the root transform.

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

setView

public void setView(double x,
                    double y,
                    double z,
                    double a)
Sets the orientation to a specific value.

Parameters:
x - x-component of the axis of rotation
y - y-component of the axis of rotation
z - z-component of the axis of rotation
a - angle of rotation (right hand rule)

setViewDistance

public void setViewDistance(float r)
Sets the viewing distance.

Parameters:
r - new viewing distance (along z axis)

setXView

public void setXView()
Sets the orientation to view down the x axis.


setYView

public void setYView()
Sets the orientation to view down the y axis.


setZView

public void setZView()
Sets the orientation to view down the z axis. (This is the original orientation.)


setWhichOrbital

public void setWhichOrbital(int nAtom,
                            int nOrb)
For the selected atom, specifies the orbital to be displayed.

Parameters:
nAtom - atom that contains the orbital
nOrb - orbital to be displayed Special values for nOrb:
-1 (CHILD_NONE) no orbitals shown
-2 (CHILD_ALL) all orbitals shown
-3 (CHILD_MASK) use setChildMask to control which orbitals are shown