Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

LOSR::Analyzer Class Reference

LOSR::Analyzer is an high level tool to analyze optical systems. More...

#include <Analyzer.hpp>

List of all members.

Public Methods

 Analyzer ()
 Constructor (do nothing).

 ~Analyzer ()
 Destructor (do nothing).

ApproxRaytracer::const_iterator getApertureStop (const ApproxRaytracer &inAxialRay) const
 Get the aperture stop of a system using the axial y-nu trace. More...

ApproxRaytracer::iterator getApertureStop (ApproxRaytracer &inAxialRay) const
 Get the aperture stop of a system using the axial y-nu trace. More...

ApproxRaytracer::const_iterator getFieldStop (const ApproxRaytracer &inChiefRay) const
 Get the field stop of a system using the chief y-nu trace. More...

ApproxRaytracer::iterator getFieldStop (ApproxRaytracer &inAxialRay) const
 Get the field stop of a system using the chief y-nu trace. More...

Pupil getEntrancePupil (const ApproxRaytracer &inAxialRay, ApproxRaytracer::const_iterator inApertureStop, const ApproxRaytracer &inChiefRay) const
 Get the entrance pupil of a system using the axial and chief y-nu trace. More...

Pupil getExitPupil (const ApproxRaytracer &inAxialRay, ApproxRaytracer::const_iterator inApertureStop, const ApproxRaytracer &inChiefRay) const
 Get the exit pupil of a system using the chief y-nu trace. More...

double getMagnification (const ApproxRaytracer &inChiefRay) const
 Get the magnification of a system using the chief y-nu trace. More...

double evaluateLastCurvature (const ApproxRaytracer &inMarginalRay) const
 Evaluation the last curvature of the optical system using the marginal y-nu trace. More...

bool traceChiefRay (const ApproxRaytracer &inAxialRay, ApproxRaytracer::const_iterator inApertureStop, ApproxRaytracer &outChiefRay, long double inCY0=1.0, long double inCU0=0.0) const
 Trace an chief ray using an axial raytrace. More...

bool traceMarginalRay (const ApproxRaytracer &inAxialRay, ApproxRaytracer::const_iterator inApertureStop, const ApproxRaytracer &inChiefRay, ApproxRaytracer &outMarginalRay) const
 Trace a marginal ray using an axial raytrace. More...


Detailed Description

LOSR::Analyzer is an high level tool to analyze optical systems.

LOSR::Analyzer is an high level tool to analyze optical systems. It provides different methods that analyze optical system using approximative raytrace tables, such marginal and chief ray.

Author:
Christian Gagné and Julie Beaulieu
Version:
0.2
Date:
9/05/2001


Member Function Documentation

double Analyzer::evaluateLastCurvature ( const ApproxRaytracer & inMarginalRay ) const
 

Evaluation the last curvature of the optical system using the marginal y-nu trace.

This method evaluate the value of the curvature of the last surface before the image space to get a clean image exactly on the image space. This mean that all the rays that are starting on the same point on the object will be on the point on the image (using approximative raytracing).

Returns:
Curvature of the last, before the image, curvature.
Parameters:
inMarginalRay   Marginal ray from which the last curvature is determined.
00187 {
00188 #ifndef NDEBUG
00189   if(inMarginalRay.size()<2) throw LOSR_RuntimeErrorM("Marginal ray must have at least two entries!");
00190 #endif // NDEBUG
00191   ApproxRaytracer::const_iterator lIterJ   = inMarginalRay.end()-1;
00192   ApproxRaytracer::const_iterator lIterJM1 = inMarginalRay.end()-2;
00193   return ( (lIterJ->mY * lIterJ->mN) + (lIterJM1->mNU * lIterJ->mT) ) /
00194            ( lIterJ->mT * lIterJ->mY * (lIterJ->mN- lIterJM1->mN) );
00195 }

ApproxRaytracer::iterator Analyzer::getApertureStop ( ApproxRaytracer & inAxialRay ) const
 

Get the aperture stop of a system using the axial y-nu trace.

Returns:
Iterator to the aperture stop.
Parameters:
inAxialRay   Axial ray from which the aperture stop is determined.
00081 {
00082   const ApproxRaytracer& lConstAxialRay = inAxialRay;
00083   ApproxRaytracer::const_iterator lConstApertureStop = getApertureStop(lConstAxialRay);
00084   return inAxialRay.begin() + ( lConstApertureStop - inAxialRay.begin() );
00085 }

ApproxRaytracer::const_iterator Analyzer::getApertureStop ( const ApproxRaytracer & inAxialRay ) const
 

Get the aperture stop of a system using the axial y-nu trace.

Returns:
Iterator to the aperture stop.
Parameters:
inAxialRay   Axial ray from which the aperture stop is determined.
00055 {
00056 #ifndef NDEBUG
00057   if(inAxialRay.size() < 3) throw LOSR_RuntimeErrorM("The axial ray must have at least 3 surfaces!");
00058 #endif // NDEBUG
00059   ApproxRaytracer::const_iterator lApertureStop = inAxialRay.begin()+1;
00060   double lMinimumRatio = DBL_MAX;
00061   for(ApproxRaytracer::const_iterator i = (inAxialRay.begin()+1); i != (inAxialRay.end()-2); i++) {
00062     if( (i->mR != 0) && (i->mY != 0) )  {
00063       double lRatio = fabs(i->mR / i->mY);
00064       if(lRatio < lMinimumRatio) {
00065         lMinimumRatio = lRatio;
00066         lApertureStop = i;
00067       }
00068     }
00069   }
00070   return lApertureStop;
00071 }

Pupil Analyzer::getEntrancePupil ( const ApproxRaytracer & inAxialRay,
ApproxRaytracer::const_iterator inApertureStop,
const ApproxRaytracer & inChiefRay ) const
 

Get the entrance pupil of a system using the axial and chief y-nu trace.

Returns:
Values of the entrance pupil.
Parameters:
inAxialRay   Axial ray from which the entrance pupil is determined.
inApertureStop   Iterator to the aperture stop of axial ray.
inChiefRay   Chief ray from which the entrance pupil is determined.
00123 {
00124 #ifndef NDEBUG
00125   if(inChiefRay.size() < 2) throw LOSR_RuntimeErrorM("Chief ray must have at least two entry!");
00126   if(inAxialRay.size() != inChiefRay.size())
00127     throw LOSR_RuntimeErrorM("Axial ray and chief ray are not of the same size!");
00128 #endif // NDEBUG
00129   ApproxRaytracer::const_iterator lApStopChief =
00130     inChiefRay.begin() + (inApertureStop - inAxialRay.begin());
00131   Pupil lPupil;
00132   lPupil.mM = lApStopChief->mU / inChiefRay.front().mU;
00133   lPupil.mR = lApStopChief->mR * lPupil.mM;
00134   lPupil.mT = inChiefRay.front().mT - ( inChiefRay[1].mY / inChiefRay.front().mU );
00135   return lPupil;
00136 }

Pupil Analyzer::getExitPupil ( const ApproxRaytracer & inAxialRay,
ApproxRaytracer::const_iterator inApertureStop,
const ApproxRaytracer & inChiefRay ) const
 

Get the exit pupil of a system using the chief y-nu trace.

Returns:
Values of the exit pupil.
Parameters:
inAxialRay   Axial ray from which the exit pupil is determined.
inApertureStop   Iterator to the aperture stop of axial ray.
inChiefRay   Chief ray from which the exit pupil is determined.
00148 {
00149 #ifndef NDEBUG
00150   if(inChiefRay.size() < 2) throw LOSR_RuntimeErrorM("Chief ray must have at least two entry!");
00151   if(inAxialRay.size() != inChiefRay.size())
00152     throw LOSR_RuntimeErrorM("Axial ray and chief ray are not of the same size!");
00153 #endif // NDEBUG
00154   ApproxRaytracer::const_iterator lApStopChief =
00155     inChiefRay.begin() + (inApertureStop - inAxialRay.begin());
00156   Pupil lPupil;
00157   lPupil.mM = lApStopChief->mU / inChiefRay.back().mU;
00158   lPupil.mR = lApStopChief->mR * lPupil.mM;
00159   lPupil.mT = (inChiefRay.end()-2)->mT + ( (inChiefRay.end()-2)->mY / (inChiefRay.end()-2)->mU );
00160   return lPupil;
00161 }

ApproxRaytracer::iterator Analyzer::getFieldStop ( ApproxRaytracer & inChiefRay ) const
 

Get the field stop of a system using the chief y-nu trace.

Returns:
Iterator to the field stop.
Parameters:
inChiefRay   Chief ray from which the field stop is determined.
00107 {
00108   const ApproxRaytracer& lConstChiefRay = inChiefRay;
00109   ApproxRaytracer::const_iterator lConstFieldStop = getFieldStop(lConstChiefRay);
00110   return inChiefRay.begin() + ( lConstFieldStop - inChiefRay.begin() );
00111 }

ApproxRaytracer::const_iterator Analyzer::getFieldStop ( const ApproxRaytracer & inChiefRay ) const
 

Get the field stop of a system using the chief y-nu trace.

Returns:
Iterator to the field stop.
Parameters:
inChiefRay   Chief ray from which the field stop is determined.
00094         {
00095   // The algorithm is the same than getting the aperture stop. Only the names are differents!
00096   return getApertureStop(inChiefRay);
00097 }

double Analyzer::getMagnification ( const ApproxRaytracer & inChiefRay ) const
 

Get the magnification of a system using the chief y-nu trace.

Returns:
Magnification of the system.
Parameters:
inChiefRay   Chief ray from which the magnification is determined.
00171 {
00172   return inChiefRay.back().mY / inChiefRay.front().mY;
00173 }

bool Analyzer::traceChiefRay ( const ApproxRaytracer & inAxialRay,
ApproxRaytracer::const_iterator inApertureStop,
ApproxRaytracer & outChiefRay,
long double inCY0 = 1.0,
long double inCU0 = 0.0 ) const
 

Trace an chief ray using an axial raytrace.

Note that one value of the inCY0 and inCU0 are used to calculate the optical invariant.

Returns:
Whether the axial ray was inside the apertures (true) or there was vigneting (false).
Parameters:
inAxialRay   Axial ray from which the chief ray will be trace.
inApertureStop   Iterator to the aperture stop of axial ray.
outChiefRay   Resulting chief ray trace.
inCY0   Height of the chief ray at the object.
inCU0   Angle of the chief ray at the object.
00211 {
00212   outChiefRay = inAxialRay;
00213   ApproxRaytracer::iterator lApStopChief =
00214     outChiefRay.begin() + (inApertureStop - inAxialRay.begin());
00215 
00216   // Evaluation the optical invariant to get the desired position at the object.
00217   long double lI  = ( inCY0 * outChiefRay.front().mN * outChiefRay.front().mU ) -
00218                 ( outChiefRay.front().mY * outChiefRay.front().mN * inCU0 );
00219   long double lCU = -lI / ( lApStopChief->mY * lApStopChief->mN );
00220 
00221   // Doing chief ray trace y-nu du chief ray
00222   return outChiefRay.trace(lApStopChief,0.0,lCU);
00223 }

bool Analyzer::traceMarginalRay ( const ApproxRaytracer & inAxialRay,
ApproxRaytracer::const_iterator inApertureStop,
const ApproxRaytracer & inChiefRay,
ApproxRaytracer & outMarginalRay ) const
 

Trace a marginal ray using an axial raytrace.

Returns:
Whether the axial ray was inside the apertures (true) or there was vigneting (false).
Parameters:
inAxialRay   Axial ray from which the marginal ray will be trace.
inApertureStop   Iterator to the aperture stop of axial ray.
inChiefRay   Chief ray from which the marginal ray will be trace.
outMarginalRay   Resulting marginal ray trace.
00236 {
00237   outMarginalRay = inAxialRay;
00238   Pupil lEntrancePupil = getEntrancePupil(inAxialRay,inApertureStop,inChiefRay);
00239   long double lU0 = lEntrancePupil.mR / lEntrancePupil.mT;
00240   return outMarginalRay.trace(outMarginalRay.begin(),0.0,lU0);
00241 }


The documentation for this class was generated from the following files:
Generated at Sat Dec 22 10:58:13 2001 for Library for Optical Systems Raytracing by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001