optics
Class ParaxialGroup

java.lang.Object
  extended by optics.Optics
      extended by optics.ParaxialMatrix
          extended by optics.ParaxialGroup
All Implemented Interfaces:
Diagram2DComponent
Direct Known Subclasses:
LaserCavity

public class ParaxialGroup
extends ParaxialMatrix
implements Diagram2DComponent

Class to hold a ParaxialGroup, begin a paraxial representation of a group of optical elements, typically a compound lens which in represented by the underlying ParaxialMatrix. The location of planes are in global coordinates.

This class also implemnts the Diagram2DComponent so it can be added to a Diagram2D. The focal input/output and principle planes are drawn.


Field Summary
protected  double inputHeight
          Height of input plane
protected  double inputPlane
          Location of input plane
protected  boolean label
          Boolean flag to put on labels on daigrams (false by default).
protected  double outputHeight
          Height of output plane
 
Fields inherited from class optics.ParaxialMatrix
A, B, C, D, thickness
 
Fields inherited from class optics.Optics
DEFAULT_WAVELENGTH, errorStream, fmt, MICRONS, version
 
Constructor Summary
ParaxialGroup()
          Default constructor forms a ParaxialGroup\ consisting of the unit system matrix of thickness zero with input plane also at zero and input/output heights are unset.
ParaxialGroup(OpticalGroup g, double lambda)
          Form a ParaxialGroup from an OpticalGroup at a given wavelength.
ParaxialGroup(ParaxialGroup g)
          Form a ParaxialGroup from specified ParaxialGroup.
ParaxialGroup(ParaxialMatrix m)
          Form a ParaxialGroup with specified Paraxial system matrix with input plane at the origin.
ParaxialGroup(ParaxialMatrix m, double input)
          Form a ParaxialGroup with specified Paraxial system matrix with specified input plane in global coordinate.
ParaxialGroup(ParaxialMatrix m, double input, double fno)
          Form a ParaxialGroup with specified Paraxial matrix with specified input plane in global coordinate and effective FNo.
ParaxialGroup(ParaxialMatrix m, double input, double inheight, double outheight)
          Form a ParaxialGroup with specified ParaxialMatrix specified input plane in global coordinate annd specifed input and output plane heights.
 
Method Summary
 ParaxialGroup clone()
          Method to form clone of current ParaxialGroup
 void draw(Graphics2D g)
          Method to draw the Group planes in a Graphics2D context.
 double getBackFocal()
          Return position of back focal plane in global coordinates.
 double getBackPrincipal()
          Return position of back principal plane in global coordinates.
 Rectangle2D getBounds()
          Method to get the Bounds for graphics rendering.
 double getFrontFocal()
          Return position of front focal plane in global coordinates.
 double getFrontPrincipal()
          Return position of front principal plane in global coordinates.
 double getInputHeight()
          Method to get the input plane height
 double getInputPlane()
          Get position of input plane in global coordinates.
 double getOutputHeight()
          Method to get the input plane height
 double getOutputPlane()
          Return position the output plane in global coordinates.
 Position imagePosition(Position object)
          Method to get an image Position for a three-dimensional object Position using simple Gaussian lens formula.
 void multBy(ParaxialGroup g)
          Method to pre-multiply the current ParaxialGroup This will also propaate from the output plane of the current group to the input plane of the specified group.
static ParaxialGroup read(File file)
          Method to read an ParaxialGroup from a text file where each line of the file specifies one type of optical component.
static ParaxialGroup read(Reader in)
          Method to read an optical matrix from abstract Reader with each line specifying an optical component.
static ParaxialGroup read(String fn)
          Method to read an ParaxialGroup from a text file where each line of the file specifies one type of optical component.
static ParaxialGroup readChooser()
          Static method to read a ParaxuialGroup via a filechooser windows.
static ParaxialGroup readChooser(String dir)
          Static method to read a Paraxial Group from a file via a chooser.
 void scale(double a)
          Method to scale the ParaxialGroup.
 void setFNo(double fno)
          Method to set the FNo of the Group which sets the input and output heights using the front and back focal lengths.
 void setHeight(double h)
          Method to set the Input and Output height to a single value
 void setInputHeight(double h)
          Method to set the input plane height.
 void setInputPlane(double input)
          Set the position on input plane in global coordinates
 void setLabel()
          Method to switch-on labels in Diagrams
 void setOutputHeight(double h)
          Method to set the output plane height
 String toString()
          Default toString method to give formatted output of matrix elements, thickness, input plane, and input and output heights.
 boolean write()
          Method to write current ParaxialGroup to System.out
 boolean write(File file)
          Method to write current ParaxialGroup to a File
 boolean write(PrintStream out)
          Method to write the current ParaxialGroup to a PrintStream
 boolean write(String fileName)
          Method to write current ParaxialGroup to file by name
 boolean writeChooser(String dir)
          Method to write Paraxial Group from a file via a chooser.
 
Methods inherited from class optics.ParaxialMatrix
cavity, determinant, dielectric, dielectric, doublet, edit, edit, fromGroup, fromGroup, fromGroup, fromPlanes, getA, getB, getBackFocalLength, getBackPower, getC, getD, getFrontFocalLength, getFrontPower, getThickness, inverse, mirror, mult, multBy, propagation, setBackFocalLength, setElements, setElements, setFrontFocalLength, thickLens, thinLens, thinLens, trace
 
Methods inherited from class optics.Optics
getDefaultWaveLength, getErrorStream, getFormatString, getName, getStaticName, getVersion, printError, setDefaultWaveLength, setErrorStream, setFormatString, setMicrons
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

inputPlane

protected double inputPlane
Location of input plane


inputHeight

protected double inputHeight
Height of input plane


outputHeight

protected double outputHeight
Height of output plane


label

protected boolean label
Boolean flag to put on labels on daigrams (false by default).

Constructor Detail

ParaxialGroup

public ParaxialGroup(ParaxialMatrix m,
                     double input,
                     double inheight,
                     double outheight)
Form a ParaxialGroup with specified ParaxialMatrix specified input plane in global coordinate annd specifed input and output plane heights.

Parameters:
m - the system matrix
input - the input plane.
inheight - height of input plane
outheight - height of output plane

ParaxialGroup

public ParaxialGroup(ParaxialMatrix m,
                     double input,
                     double fno)
Form a ParaxialGroup with specified Paraxial matrix with specified input plane in global coordinate and effective FNo.

Parameters:
m - the system matrix
input - the input plane.
fno - the effective FNo

ParaxialGroup

public ParaxialGroup(ParaxialMatrix m,
                     double input)
Form a ParaxialGroup with specified Paraxial system matrix with specified input plane in global coordinate. The input and output heights are unset.

Parameters:
m - the system matrix
input - the input plane.

ParaxialGroup

public ParaxialGroup(ParaxialMatrix m)
Form a ParaxialGroup with specified Paraxial system matrix with input plane at the origin. The input and output heights are not set.

Parameters:
m - the system matrix

ParaxialGroup

public ParaxialGroup()
Default constructor forms a ParaxialGroup\ consisting of the unit system matrix of thickness zero with input plane also at zero and input/output heights are unset.


ParaxialGroup

public ParaxialGroup(ParaxialGroup g)
Form a ParaxialGroup from specified ParaxialGroup.

Parameters:
g - the ParaxialGroup

ParaxialGroup

public ParaxialGroup(OpticalGroup g,
                     double lambda)
Form a ParaxialGroup from an OpticalGroup at a given wavelength. The OpticalGroup is assume to be on-axis.

Parameters:
g - the OpticalGroup
lambda - the wavelength in microns
Method Detail

clone

public ParaxialGroup clone()
Method to form clone of current ParaxialGroup

Overrides:
clone in class ParaxialMatrix
Returns:
ParaxialGroup clone of current.

setInputPlane

public void setInputPlane(double input)
Set the position on input plane in global coordinates

Parameters:
input - the input plane location.

getInputPlane

public double getInputPlane()
Get position of input plane in global coordinates.

Returns:
double location of input plane

getOutputPlane

public double getOutputPlane()
Return position the output plane in global coordinates.

Returns:
double location of system output plane

setInputHeight

public void setInputHeight(double h)
Method to set the input plane height.

Parameters:
h - the height

getInputHeight

public double getInputHeight()
Method to get the input plane height

Returns:
double input plane height

setOutputHeight

public void setOutputHeight(double h)
Method to set the output plane height

Parameters:
h - the height

getOutputHeight

public double getOutputHeight()
Method to get the input plane height

Returns:
double input plane height

setHeight

public void setHeight(double h)
Method to set the Input and Output height to a single value

Parameters:
h - the height.

setFNo

public void setFNo(double fno)
Method to set the FNo of the Group which sets the input and output heights using the front and back focal lengths.

Parameters:
fno - the effective FNo

getFrontPrincipal

public double getFrontPrincipal()
Return position of front principal plane in global coordinates.

Overrides:
getFrontPrincipal in class ParaxialMatrix
Returns:
double location of front Principal plane.

getBackPrincipal

public double getBackPrincipal()
Return position of back principal plane in global coordinates.

Overrides:
getBackPrincipal in class ParaxialMatrix
Returns:
double location of back Principal plane.

getFrontFocal

public double getFrontFocal()
Return position of front focal plane in global coordinates.

Overrides:
getFrontFocal in class ParaxialMatrix
Returns:
double location of front focal plane.

getBackFocal

public double getBackFocal()
Return position of back focal plane in global coordinates.

Overrides:
getBackFocal in class ParaxialMatrix
Returns:
double location of back focal plane.

setLabel

public void setLabel()
Method to switch-on labels in Diagrams


scale

public void scale(double a)
Method to scale the ParaxialGroup. The underlying ParaxialMatrix and plane heights are scaled, but the input plane is NOT changed.

Overrides:
scale in class ParaxialMatrix
Parameters:
a - the scale factor

multBy

public void multBy(ParaxialGroup g)
Method to pre-multiply the current ParaxialGroup This will also propaate from the output plane of the current group to the input plane of the specified group.

Parameters:
g - the pre-multiplier.

imagePosition

public Position imagePosition(Position object)
Method to get an image Position for a three-dimensional object Position using simple Gaussian lens formula.

Note: infinities are not trapped.

Parameters:
object - position of object
Returns:
Position Gaussian position of image

toString

public String toString()
Default toString method to give formatted output of matrix elements, thickness, input plane, and input and output heights.

Overrides:
toString in class ParaxialMatrix
Returns:
String formatted output.
See Also:
Optics.setFormatString(java.lang.String)

getBounds

public Rectangle2D getBounds()
Method to get the Bounds for graphics rendering. Returns a rectangle containing the Group and its front/back focal planes.

Specified by:
getBounds in interface Diagram2DComponent
Returns:
Rectangle2D the bounds of the ParaxialGroup

draw

public void draw(Graphics2D g)
Method to draw the Group planes in a Graphics2D context. This draws the input/output planes, principal planes and focal planes using the colours specifed in Colour.

Specified by:
draw in interface Diagram2DComponent
Parameters:
g - the Graphics2D

readChooser

public static ParaxialGroup readChooser()
Static method to read a ParaxuialGroup via a filechooser windows.


readChooser

public static ParaxialGroup readChooser(String dir)
Static method to read a Paraxial Group from a file via a chooser. If dir is null, then the environmental variable LENSROOT is used, if this is also null, then finally $HOME is used.

Parameters:
dir - the lens root directory
Returns:
ParaxialMatrix the paraxial matrix

read

public static ParaxialGroup read(String fn)
Method to read an ParaxialGroup from a text file where each line of the file specifies one type of optical component.

Parameters:
fn - file name holding matrix information
Returns:
ParaxialMatrix the system matrix.

read

public static ParaxialGroup read(File file)
Method to read an ParaxialGroup from a text file where each line of the file specifies one type of optical component.

Parameters:
file - File holding matrix information
Returns:
ParaxialMatrix the system matrix.

read

public static ParaxialGroup read(Reader in)
Method to read an optical matrix from abstract Reader with each line specifying an optical component.

Parameters:
in - Reader holding the matrix
Returns:
ParaxialMatrix the system matrix.

write

public boolean write()
Method to write current ParaxialGroup to System.out

Returns:
boolean true is success, false if write fails.

write

public boolean write(String fileName)
Method to write current ParaxialGroup to file by name

Parameters:
fileName - the file name
Returns:
boolean true is success, false if write fails.

write

public boolean write(File file)
Method to write current ParaxialGroup to a File

Parameters:
file - the File to write to.
Returns:
boolean true is success, false if write fails.

writeChooser

public boolean writeChooser(String dir)
Method to write Paraxial Group from a file via a chooser. If dir is null, then the environmental variable LENSROOT is used, if this is also null, then finally $HOME is used.

Parameters:
dir - the lens root directory
Returns:
ParaxialMatrix the paraxial matrix

write

public boolean write(PrintStream out)
Method to write the current ParaxialGroup to a PrintStream

Parameters:
out - the PrintSteam.
Returns:
boolean true is success, false if wriute fails.