optics
Class OpticalSurface

java.lang.Object
  extended by optics.Optics
      extended by optics.OpticalSurface
Direct Known Subclasses:
OpticalPlane

public abstract class OpticalSurface
extends Optics

Abstract class to hold an general optical surface and the methods used to access the surface.

This is the base class of all the optical surfaces.


Field Summary
static int CLEAR
          Integer to specifies a clear aperture surface.
protected  OpticalGroup group
          Which OpticalGroup does surface belongs to.
static int REFLECTING
          Integer to specified a reflecting surface
static int REFRACTING
          Integer to specified a refracting surface
protected  RefractiveIndex refractiveIndex
          Refractive index on the image side.
protected  Position surfacePoint
          Reference point for the surface from which other measures are made.
protected  int surfaceType
          The surface type, being CLEAR, RERFACTING or REFLECTING.
 
Fields inherited from class optics.Optics
DEFAULT_WAVELENGTH, errorStream, fmt, MICRONS
 
Constructor Summary
OpticalSurface()
           
 
Method Summary
abstract  double distance(Position p, Director u)
          Abstract method to get the distance from a point to the surface.
 double distance(RayVector r)
          Method to get the distance from a RayVector to the surface.
 void edit()
          Method to invoke the Surface Editor
 CircularAperture entranceAperture()
          Method to get the entrance aperture of the surface begin cented on the surface at the edge-plane.
 CircularAperture exitAperture()
          Method to get the exit aperture of the surface begin cented on the surface at the edge-plane.
static OpticalSurface fromString(java.lang.String s)
          Static method to get a OpticalSurface from a specifying String.
static OpticalSurface fromTokens(java.util.StringTokenizer tokens)
          Static method get an OpticalSurface from a tokenized String.
abstract  double getCurvature()
          Abstract to get the curvature
abstract  double getEdgePlane()
          Abstract to get the edge plane
 OpticalGroup getGroup()
          Method to get the OpticalGroup to which the surface belongs.
 double getIndex(double lambda)
          Method to get the numerical value of the refractive index at a specified wavelength.
abstract  double getMaxRadius()
          Abstract to get the maximum radius of the surface
abstract  Director getNormal(Position p)
          Abstract method to get normal at specified point.
 Director getNormal(RayVector r)
          Method to get the Normal at point specified by a RayVector.
 Position getPoint()
          Method to get the surface reference point in global package coordinates taking the surface reference point as an offset from the OpticalGoup reference point.
 RefractiveIndex getRefractiveIndex()
          Method to get the RefractiveIndex, may be null for non-refracting surface.
 Position getSurfacePoint()
          Method to get the surface point
 int getSurfaceType()
          Method to get the surface type
 int getSurfaceType(Position p)
          Method to get the surface type at a particular position.
 void makeStandAlone()
          Method to make the current surface standalone by nulling the group and setting the local reference point to be as the same location as the group/old local point combination.
abstract  javax.vecmath.Point2d pointInPlane(Position p, Director u)
          Abstract Method to calculate the point in two-dimensional point in the plane intersected by a ray with current position and direction.
 javax.vecmath.Point2d pointInPlane(RayVector r)
          Method to calculate the point in two-dimensional point in the plane intersected by a RayVector
 void scale(double a)
          Method to scale the surface by specified factor.
 void setGroup(OpticalGroup g)
          Method to set the OpticalGroup to which the surface belongs It can be null for a standalone surface.
abstract  void setMaxRadius(double d)
          Abstract to set the maximum radius of the surface
 void setRefractiveIndex(RefractiveIndex index)
          Method to set the RefarctiveIndex.
 void setSurfacePoint(Position p)
          Method to set the surface reference point
 void setSurfaceType(int type)
          Method to set the surface type
 
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

CLEAR

public static final int CLEAR
Integer to specifies a clear aperture surface.

See Also:
Constant Field Values

REFRACTING

public static final int REFRACTING
Integer to specified a refracting surface

See Also:
Constant Field Values

REFLECTING

public static final int REFLECTING
Integer to specified a reflecting surface

See Also:
Constant Field Values

surfacePoint

protected Position surfacePoint
Reference point for the surface from which other measures are made.


refractiveIndex

protected RefractiveIndex refractiveIndex
Refractive index on the image side. Can be null if surface is clear or reflecting.


surfaceType

protected int surfaceType
The surface type, being CLEAR, RERFACTING or REFLECTING.


group

protected OpticalGroup group
Which OpticalGroup does surface belongs to. Can be null for a stand-alone surface.

Constructor Detail

OpticalSurface

public OpticalSurface()
Method Detail

setSurfacePoint

public void setSurfacePoint(Position p)
Method to set the surface reference point

Parameters:
p - the surface point

getSurfacePoint

public Position getSurfacePoint()
Method to get the surface point

Returns:
Position the surface point

setSurfaceType

public void setSurfaceType(int type)
Method to set the surface type

Parameters:
type - the type

getSurfaceType

public int getSurfaceType()
Method to get the surface type

Returns:
int the surface type

getSurfaceType

public int getSurfaceType(Position p)
Method to get the surface type at a particular position. For most, except mirrors this defaults to the fixed surface type.

Parameters:
p - the position
Returns:
int the surface type
See Also:
getSurfaceType()

scale

public void scale(double a)
Method to scale the surface by specified factor. Here just scaled the surface point, but is typically overloaded in extending classes..

Parameters:
a - scale factor

setGroup

public void setGroup(OpticalGroup g)
Method to set the OpticalGroup to which the surface belongs It can be null for a standalone surface.

Parameters:
g - The OpticalGroup

getGroup

public OpticalGroup getGroup()
Method to get the OpticalGroup to which the surface belongs. It may be null for a standalone surface.

Returns:
OpticalGroup this surface belongs.

getPoint

public Position getPoint()
Method to get the surface reference point in global package coordinates taking the surface reference point as an offset from the OpticalGoup reference point. If the surface is stand alone, then its surface reference point is returned.

For most applications this is the correct method to access the surface reference point.

Returns:
Position absolute surface reference point.

setRefractiveIndex

public void setRefractiveIndex(RefractiveIndex index)
Method to set the RefarctiveIndex. May be null for a non refracting surface. If index set to null, then surface type gets set to CLEAR.

Parameters:
index - The Refractive Index

getRefractiveIndex

public RefractiveIndex getRefractiveIndex()
Method to get the RefractiveIndex, may be null for non-refracting surface.

Returns:
RefractiveIndex The refractive index

getIndex

public double getIndex(double lambda)
Method to get the numerical value of the refractive index at a specified wavelength.

If the surface is not refracting, then Double.NaN is returned.

Parameters:
lambda - the wavelength in microns.
Returns:
double value of refractive index.

getNormal

public abstract Director getNormal(Position p)
Abstract method to get normal at specified point.

Parameters:
p - the point, assumed to be on the surface.

Must be implemented by extending classes.

Returns:
Director the surface normal.

getNormal

public Director getNormal(RayVector r)
Method to get the Normal at point specified by a RayVector. The position of the RayVector is assumed to be on the surface.

Parameters:
r - the specifying RayVector.
Returns:
Director the surface normal.

distance

public abstract double distance(Position p,
                                Director u)
Abstract method to get the distance from a point to the surface.

Must be implemented by extending classes.

Parameters:
p - the position
u - the direction from the point.
Returns:
double the distance.

distance

public double distance(RayVector r)
Method to get the distance from a RayVector to the surface.

Parameters:
r - the RayVector.
Returns:
double the distance

setMaxRadius

public abstract void setMaxRadius(double d)
Abstract to set the maximum radius of the surface

Must be implemented by extending classes

Parameters:
d - the maximum radius

getMaxRadius

public abstract double getMaxRadius()
Abstract to get the maximum radius of the surface

Returns:
double the maximum radius

getCurvature

public abstract double getCurvature()
Abstract to get the curvature

Returns:
double the curvature.

getEdgePlane

public abstract double getEdgePlane()
Abstract to get the edge plane

Returns:
double plane containing the edge.

entranceAperture

public CircularAperture entranceAperture()
Method to get the entrance aperture of the surface begin cented on the surface at the edge-plane.

The returned CircularAperture will be in the same OpticalGroup as the current OpticalSurface, which can be null for a standalone surface.

Returns:
CircularAperture the entrance aperture

exitAperture

public CircularAperture exitAperture()
Method to get the exit aperture of the surface begin cented on the surface at the edge-plane.

For a single surface this is the same as the entrance aperture.

Returns:
CircularAperture the exit aperture

makeStandAlone

public void makeStandAlone()
Method to make the current surface standalone by nulling the group and setting the local reference point to be as the same location as the group/old local point combination.


pointInPlane

public abstract javax.vecmath.Point2d pointInPlane(Position p,
                                                   Director u)
Abstract Method to calculate the point in two-dimensional point in the plane intersected by a ray with current position and direction.

Parameters:
p - the position
u - the direction
Returns:
Point2d the position in the plane

pointInPlane

public javax.vecmath.Point2d pointInPlane(RayVector r)
Method to calculate the point in two-dimensional point in the plane intersected by a RayVector

Parameters:
r - the ray
Returns:
Point2d the position in the plane

fromString

public static OpticalSurface fromString(java.lang.String s)
Static method to get a OpticalSurface from a specifying String.

Parameters:
s - specifying String
Returns:
OpticalSurface fails to null

fromTokens

public static OpticalSurface fromTokens(java.util.StringTokenizer tokens)
Static method get an OpticalSurface from a tokenized String.

Parameters:
tokens - the token list
Returns:
OpticalSurface fails to null

edit

public void edit()
Method to invoke the Surface Editor