gov.nist.microanalysis.NISTMonte
Class TrajectoryVRML

java.lang.Object
  extended by gov.nist.microanalysis.NISTMonte.TrajectoryVRML
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener

public class TrajectoryVRML
extends java.lang.Object
implements java.awt.event.ActionListener

TrajectoryVRML is an observer that watches an instance of NISTMonte for events related to electron trajectory changes. It then outputs a VRML description of the trajectory step. The VRML is then used to

Copyright: Pursuant to title 17 Section 105 of the United States Code this software is not subject to copyright protection and is in the public domain

Institution: National Institute of Standards and Technology

Version:
1.0
Author:
Nicholas

Nested Class Summary
static interface TrajectoryVRML.IRender
          Each class (nominally a MonteCarloSS.Shape) is responsible for knowing how to render itself as VRML.
 class TrajectoryVRML.RenderContext
          A set of functions that provide contextual information for rendering an object as VRML.
 
Field Summary
static double SCALE
           
 
Constructor Summary
TrajectoryVRML(MonteCarloSS mcss, java.io.Writer wr)
          Constructs a TrajectoryVRML object with the specified RenderContext that outputs to the specified Writer.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          actionPerformed - Implements actionPerformed for the ActionListener interface.
 void addView(java.lang.String name, double[] pos, double[] towards)
          addView - A mechanism for adding viewports into the VRML output file.
 double getMaxRadius()
          Gets the current value assigned to the maximum radius to plot
 int getMaxTrajectories()
          Gets the current value assigned to maxTrajectories
 TrajectoryVRML.RenderContext getRenderContext()
          getRenderContext - Returns the instance of RenderContext associated with this instance of TrajectoryVRML.
 double getTrajectoryWidth()
          Gets the current value assigned to the width of the cylinders in micrometers
 boolean isDisplayBackscatter()
          Determines whether backscattered electron tracks are displayed
 boolean isDisplayXRayEvent()
          Determines whether x-ray events (scattering events) are displayed
 boolean isEmissive()
          Determines whether the trajectory segments are drawn as an emissive or diffuse color
 boolean isShowIncident()
          Should we display the incident beam?
 void renderSample()
          renderSample - A mechanism to render the sample geometry as VRML.
 void setDisplayBackscatter(boolean displayBackscatter)
          Determines whether backscattered electron tracks are displayed
 void setDisplayXRayEvent(boolean displayXRayEvent)
          Determines whether x-ray events (scattering events) are displayed
 void setEmissive(boolean emissive)
          Determines whether the trajectory segments are drawn as an emissive or diffuse color
 void setMaxRadius(double maxR)
          Sets the value that determines the maximum radius to plot (nominlly 1.0e-4 meters)
 void setMaxTrajectories(int max)
          setMaxTrajectories - Sets the maximum number of trajectories to add to this image.
 void setShowIncident(boolean showIncident)
          Should we display the incident beam?
 void setTrajectoryWidth(double trajectoryWidth)
          Sets the value assigned to the width of the trajectory cylinders in micrometers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SCALE

public static final double SCALE
Constructor Detail

TrajectoryVRML

public TrajectoryVRML(MonteCarloSS mcss,
                      java.io.Writer wr)
Constructs a TrajectoryVRML object with the specified RenderContext that outputs to the specified Writer.

Parameters:
mcss -
wr -
Method Detail

setMaxTrajectories

public void setMaxTrajectories(int max)
setMaxTrajectories - Sets the maximum number of trajectories to add to this image. Subsequent trajectories are ignored.

Parameters:
max - int

renderSample

public void renderSample()
                  throws java.io.IOException
renderSample - A mechanism to render the sample geometry as VRML. Not all Shapes are currently supported. Shapes with common Materials are drawn in the same color.

Throws:
java.io.IOException

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed - Implements actionPerformed for the ActionListener interface.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - ActionEvent

isDisplayBackscatter

public boolean isDisplayBackscatter()
Determines whether backscattered electron tracks are displayed

Returns:
true to display backscattered electrons

setDisplayBackscatter

public void setDisplayBackscatter(boolean displayBackscatter)
Determines whether backscattered electron tracks are displayed

Parameters:
displayBackscatter -

isDisplayXRayEvent

public boolean isDisplayXRayEvent()
Determines whether x-ray events (scattering events) are displayed

Returns:
Returns true if xray events are to be displayed

setDisplayXRayEvent

public void setDisplayXRayEvent(boolean displayXRayEvent)
Determines whether x-ray events (scattering events) are displayed

Parameters:
displayXRayEvent -

getMaxTrajectories

public int getMaxTrajectories()
Gets the current value assigned to maxTrajectories

Returns:
Returns the maxTrajectories.

addView

public void addView(java.lang.String name,
                    double[] pos,
                    double[] towards)
             throws java.io.IOException
addView - A mechanism for adding viewports into the VRML output file.

Parameters:
name - A name for the view
pos - The position of the viewer
towards - The place the viewer is looking
Throws:
java.io.IOException

getTrajectoryWidth

public double getTrajectoryWidth()
Gets the current value assigned to the width of the cylinders in micrometers

Returns:
Returns the trajectoryWidth.

setTrajectoryWidth

public void setTrajectoryWidth(double trajectoryWidth)
Sets the value assigned to the width of the trajectory cylinders in micrometers. Nominally this is 0.0025 micrometers

Parameters:
trajectoryWidth - The value to which to set trajectoryWidth.

getMaxRadius

public double getMaxRadius()
Gets the current value assigned to the maximum radius to plot

Returns:
Returns the maximum radius

setMaxRadius

public void setMaxRadius(double maxR)
Sets the value that determines the maximum radius to plot (nominlly 1.0e-4 meters)

Parameters:
maxR - The value to which to set the maximum radius

isShowIncident

public boolean isShowIncident()
Should we display the incident beam?

Returns:
boolean.

setShowIncident

public void setShowIncident(boolean showIncident)
Should we display the incident beam?

Parameters:
showIncident - True to show the incident beam (default = false)

isEmissive

public boolean isEmissive()
Determines whether the trajectory segments are drawn as an emissive or diffuse color

Returns:
Returns the emissive.

setEmissive

public void setEmissive(boolean emissive)
Determines whether the trajectory segments are drawn as an emissive or diffuse color

Parameters:
emissive - true for emissive

getRenderContext

public TrajectoryVRML.RenderContext getRenderContext()
getRenderContext - Returns the instance of RenderContext associated with this instance of TrajectoryVRML.

Returns:
TrajectoryVRML.RenderContext