optics
Class Ray

java.lang.Object
  extended by optics.Optics
      extended by optics.Ray
Direct Known Subclasses:
ParaxialRay, RayVector

public abstract class Ray
extends Optics

Abstract class to represent a ray. All other rays types extend this class. The only ray attributes implemented here are wavelength, intensity and the RayMonitor.


Field Summary
protected  double intensity
          The intensity of the ray, defaults to unity.
protected  RayMonitor monitor
          The RayMonitor, defaults to null
protected  double waveLength
          Wavelength of the ray in microns, defaults to current default wavelength Optics.DEFAULT_WAVELENGTH
 
Fields inherited from class optics.Optics
DEFAULT_WAVELENGTH, errorStream, fmt, MICRONS
 
Constructor Summary
Ray()
           
 
Method Summary
 void addMonitor(RayMonitor m)
          Method to add a RayMonitor to this ray.
 void clearMonitor()
          Method to remove the RayMonitor from this ray.
 double getIntensity()
          Method to get the ray intensity
 RayMonitor getMonitor()
          Method to get the RayMonitor, which may be null if not set.
abstract  Position getPosition()
          Abstract method to get the Ray Position in three dimensions.
 double getWaveLength()
          Method to get the wavelength in microns.
abstract  boolean isInvalid()
          Method to test if a ray is invalid.
 boolean isValid()
          Method to test if a ray is valid.
 void monitorUpdate()
          Method to update RayMonitor (if it is defines).
abstract  javax.vecmath.Point2d pointInPlane(double plane)
          Abstract method to calculate the point where this ray will intersect a x/y plane specified by it location on the optical z-axis.
 void setIntensity(double i)
          Method to set the ray intensity
abstract  void setInvalid()
          Method to set the ray as invalid.
 void setWaveLength(double lambda)
          Method to set the wavelength specified in microns.
 
Methods inherited from class optics.Optics
getDefaultWaveLength, getErrorStream, getFormatString, getName, getStaticName, getVersion, printError, setDefaultWaveLength, setErrorStream, setFormatString, setMicrons
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

waveLength

protected double waveLength
Wavelength of the ray in microns, defaults to current default wavelength Optics.DEFAULT_WAVELENGTH


intensity

protected double intensity
The intensity of the ray, defaults to unity.


monitor

protected RayMonitor monitor
The RayMonitor, defaults to null

Constructor Detail

Ray

public Ray()
Method Detail

setWaveLength

public void setWaveLength(double lambda)
Method to set the wavelength specified in microns.

Parameters:
lambda - the wavelength in microns.

getWaveLength

public double getWaveLength()
Method to get the wavelength in microns.

Returns:
double the wavelength in microns.

setIntensity

public void setIntensity(double i)
Method to set the ray intensity

Parameters:
i - the intensity

getIntensity

public double getIntensity()
Method to get the ray intensity

Returns:
double the intensity

setInvalid

public abstract void setInvalid()
Method to set the ray as invalid. This needs to be defined in the extending classes.


isInvalid

public abstract boolean isInvalid()
Method to test if a ray is invalid. This needs to be defined in the extending classes.

Returns:
boolean true if ray is NOT valid.

isValid

public boolean isValid()
Method to test if a ray is valid.

Returns:
boolean true if ray is NOT valid

addMonitor

public void addMonitor(RayMonitor m)
Method to add a RayMonitor to this ray. The RayMonitor is automatically called every-time the ray position changes.

Parameters:
m - the monitor
See Also:
RayMonitor

getMonitor

public RayMonitor getMonitor()
Method to get the RayMonitor, which may be null if not set.

Returns:
RayMonitor the current RayMonitor.

clearMonitor

public void clearMonitor()
Method to remove the RayMonitor from this ray. The RayMonitor will be set null and further calls to monitorUpdate() will be ignored.


monitorUpdate

public void monitorUpdate()
Method to update RayMonitor (if it is defines). This is automatically called every time the position of the Ray changes. This method is not normally called by users, but may be useful in real-time or graphical applications. If the RayMonitor is null, then this call is ignored without error.


getPosition

public abstract Position getPosition()
Abstract method to get the Ray Position in three dimensions. Needs to be defined in extending classes.

Returns:
Position the ray position.

pointInPlane

public abstract javax.vecmath.Point2d pointInPlane(double plane)
Abstract method to calculate the point where this ray will intersect a x/y plane specified by it location on the optical z-axis.

Parameters:
plane - the z location of the plane
Returns:
Point2d the location in the plane.