optics
Class OpticalPlane

java.lang.Object
  extended by optics.Optics
      extended by optics.OpticalSurface
          extended by optics.OpticalPlane
All Implemented Interfaces:
Diagram2DComponent
Direct Known Subclasses:
Aperture, DistortionGrid, OpticalImage, QuadricSurface, TiltedPlane

public class OpticalPlane
extends OpticalSurface
implements Diagram2DComponent

Class to implement an flat OpticalPlane being plane with specifed reference position and surface normal.

Also implements the Disagram2DComponet interface so can be rendered on a Diagram2D panel.


Field Summary
protected static Director blockedNormal
          Static final Director for surface normal of blocked area of plane.
protected  double maxRadius
          Maximum radius of the plane from its centre.
protected  Director planeNormal
          Director for surface normal of transmissive area of plane.
 
Fields inherited from class optics.OpticalSurface
CLEAR, group, REFLECTING, REFRACTING, refractiveIndex, surfacePoint, surfaceType
 
Fields inherited from class optics.Optics
DEFAULT_WAVELENGTH, errorStream, fmt, MICRONS
 
Constructor Summary
OpticalPlane()
          Form an OpticalPlane at specified location along the z axis with surface point a (0,0,z) and null refractive index.
OpticalPlane(double z)
          Form an OpticalPlane at specified location along the z axis with surface point a (0,0,z) and null refractive index.
OpticalPlane(double z, RefractiveIndex index)
          Form an OpticalPlane with a specified plane and refractive index where the reference poit in on-axis being located at (0,0,z).
OpticalPlane(OpticalPlane p)
          Form an OpticalPlane with the parameters given by a specified OpticalPlane.
OpticalPlane(Position p)
          Form an OpticalPlane with a specified reference point and null refractive index which represents a non-diffracting surface, form example an aperture or an image.
OpticalPlane(Position p, Director n)
          Form an OpticalPlane with a specified reference point and surface normal with and null refractive index which represents a non-diffracting surface, form example an aperture or an image.
OpticalPlane(Position p, Director n, RefractiveIndex index)
          Form an OpticalPlane with a specified reference point, plane normal and refractive index on the image side of the plane.
OpticalPlane(Position p, RefractiveIndex index)
          Form an OpticalPlane with a specified reference point and refractive index on the image side of the plane.
 
Method Summary
 OpticalPlane clone()
          Method to clone the current OpticalPlane.
 double distance(Position r, Director v)
          Get distance from a specified point to the OpticalPlane.
 void draw(java.awt.Graphics2D g)
          Method to draw OpticalPlane in as Graphics2D context.
 java.awt.geom.Rectangle2D getBounds()
          Method to get the graphical bounds in two-dimensions in global coordinates.
 double getCurvature()
          Method to get curvature, defaults to zero (which is correct for a flat plane).
 double getEdgePlane()
          Method to get the plane at the maximum radius, will just be the position of the Optical Plane
 double getMaxRadius()
          Method to get the maximum radius of the plane.
 Director getNormal(Position r)
          Method to get the surface normal.
 Director getPlaneNormal()
          Method to get the plane normal
 javax.vecmath.Point2d pointInPlane(Position r, Director u)
          Get two-dimensional point in the plane relative to its reference point where a ray from specified position and direction intersect the surface.
 void scale(double a)
          Method to scale the OpticalPlane scaling the surface point and the maximum radius.
 void setMaxRadius(double r)
          Method to set the maximum radius of the plane.
 void setPlaneNormal(Director n)
          Method to set the plane normal
 java.lang.String toString()
          toString method
 
Methods inherited from class optics.OpticalSurface
distance, edit, entranceAperture, exitAperture, fromString, fromTokens, getGroup, getIndex, getNormal, getPoint, getRefractiveIndex, getSurfacePoint, getSurfaceType, getSurfaceType, makeStandAlone, pointInPlane, setGroup, setRefractiveIndex, setSurfacePoint, setSurfaceType
 
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

maxRadius

protected double maxRadius
Maximum radius of the plane from its centre.


planeNormal

protected Director planeNormal
Director for surface normal of transmissive area of plane. It is (0,0,1)


blockedNormal

protected static final Director blockedNormal
Static final Director for surface normal of blocked area of plane. Is set to invalid.

Constructor Detail

OpticalPlane

public OpticalPlane(Position p,
                    Director n,
                    RefractiveIndex index)
Form an OpticalPlane with a specified reference point, plane normal and refractive index on the image side of the plane. This represents a flat refracting surface.

Parameters:
p - the reference point
n - the plane normal
index - the refractive index

OpticalPlane

public OpticalPlane(Position p,
                    RefractiveIndex index)
Form an OpticalPlane with a specified reference point and refractive index on the image side of the plane. This represents a flat refracting surface.

Parameters:
p - the reference point
index - the refractive index

OpticalPlane

public OpticalPlane(Position p,
                    Director n)
Form an OpticalPlane with a specified reference point and surface normal with and null refractive index which represents a non-diffracting surface, form example an aperture or an image.

Parameters:
p - the surface point
n - the surface normal

OpticalPlane

public OpticalPlane(Position p)
Form an OpticalPlane with a specified reference point and null refractive index which represents a non-diffracting surface, form example an aperture or an image.

Parameters:
p - the surface point

OpticalPlane

public OpticalPlane(double z,
                    RefractiveIndex index)
Form an OpticalPlane with a specified plane and refractive index where the reference poit in on-axis being located at (0,0,z).

Parameters:
z - the z location
index - the refractive index

OpticalPlane

public OpticalPlane(double z)
Form an OpticalPlane at specified location along the z axis with surface point a (0,0,z) and null refractive index.

Parameters:
z - the z location

OpticalPlane

public OpticalPlane()
Form an OpticalPlane at specified location along the z axis with surface point a (0,0,z) and null refractive index.


OpticalPlane

public OpticalPlane(OpticalPlane p)
Form an OpticalPlane with the parameters given by a specified OpticalPlane. All parameters except the OpticalGroup and copied.

Parameters:
p - the specifying OpticalPlane
Method Detail

clone

public OpticalPlane clone()
Method to clone the current OpticalPlane.

Overrides:
clone in class java.lang.Object
Returns:
OpticalPlane clone of current OpticalPlane

setMaxRadius

public void setMaxRadius(double r)
Method to set the maximum radius of the plane.

Specified by:
setMaxRadius in class OpticalSurface
Parameters:
r - rhe radius

getMaxRadius

public double getMaxRadius()
Method to get the maximum radius of the plane.

Specified by:
getMaxRadius in class OpticalSurface
Returns:
double the maximum radius

scale

public void scale(double a)
Method to scale the OpticalPlane scaling the surface point and the maximum radius.

Overrides:
scale in class OpticalSurface
Parameters:
a - the scale

distance

public double distance(Position r,
                       Director v)
Get distance from a specified point to the OpticalPlane.

Specified by:
distance in class OpticalSurface
Parameters:
r - the ray position
v - the ray direction
Returns:
double the distance

setPlaneNormal

public void setPlaneNormal(Director n)
Method to set the plane normal

Parameters:
n - the plane normal

getPlaneNormal

public Director getPlaneNormal()
Method to get the plane normal

Returns:
Director the plane normal

getNormal

public Director getNormal(Position r)
Method to get the surface normal. This will be in position z direction will be invalid if outside the maximum radius.

Specified by:
getNormal in class OpticalSurface
Parameters:
r - the position, assumed to be in the plane.
Returns:
Director will be 0,0,1 if inside maximum radius otherwise will be invalid.

pointInPlane

public javax.vecmath.Point2d pointInPlane(Position r,
                                          Director u)
Get two-dimensional point in the plane relative to its reference point where a ray from specified position and direction intersect the surface.

Note either the Position or the Director are changed.

Specified by:
pointInPlane in class OpticalSurface
Parameters:
r - the position
u - the direction
Returns:
Point2d the position in the plane.

getCurvature

public double getCurvature()
Method to get curvature, defaults to zero (which is correct for a flat plane).

Specified by:
getCurvature in class OpticalSurface
Returns:
double the curvature.

getEdgePlane

public double getEdgePlane()
Method to get the plane at the maximum radius, will just be the position of the Optical Plane

Specified by:
getEdgePlane in class OpticalSurface
Returns:
double the edge plane, being just the plane position.

toString

public java.lang.String toString()
toString method

Overrides:
toString in class java.lang.Object

getBounds

public java.awt.geom.Rectangle2D getBounds()
Method to get the graphical bounds in two-dimensions in global coordinates.

Specified by:
getBounds in interface Diagram2DComponent
Returns:
Rectangle2D.Float graphical bounds

draw

public void draw(java.awt.Graphics2D g)
Method to draw OpticalPlane in as Graphics2D context.

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