|
GOAT (Geometrical optics application tool) 0.1
|
This abstract class is the basic class for all light sources used in this raytracing library. It provides all necessary interfaces. More...
#include <lightsrc.h>
Public Member Functions | |
| void | addObject (ObjectShape *obj) |
| add single object to the object list | |
| void | adjustDirection () |
| void | binRead (std::ifstream &is) |
| writes content of LightSrc in a binary file, represented by is | |
| virtual void | binReadItem (std::ifstream &os)=0 |
| reads content of LightSrc from a binary file, represented by os (has to be specified by the derived classes) | |
| void | binWrite (std::ofstream &os) |
| reads content of LightSrc from a binary file, represented by os | |
| virtual void | binWriteItem (std::ofstream &os)=0 |
| writes content of LightSrc in a binary file, represented by is (has to be specified by the derived classes)focuspos | |
| void | clearObjects () |
| clear object list | |
| double | getDensity () |
| returns the ray density, i.e. the number of rays per unit length (=D/N) | |
| maths::Vector< std::complex< double > > | getInitPol () |
| double | getIsum1 () |
| double | getIsum2 () |
| maths::Vector< double > | getk () |
| returns the main direction of the light source | |
| int | getNumObjs () |
| returns the number of Objects (only needed, when used seperately outside scene) | |
| int | getNumRays () |
| returns the number of rays (per direction in space) | |
| int | getNumRaysRT () |
| ObjectShape * | getObject (int i) |
| returns i-th item in the object list | |
| maths::Vector< double > | getPos () |
| returns the position of the light source. This is the center of the square area of the light source | |
| double | getWavelength () |
| double | getWavenumber () |
| LightSrc () | |
| LightSrc (const LightSrc &) | |
| Copy constructor. | |
| void | ObjectList (int Anz, std::vector< ObjectShape * > Obj) |
| int | rayType () |
| returns the current ray type | |
| void | removeObject (ObjectShape *obj) |
| remove object from the object list | |
| void | reset () |
| Reset everything (counting starts from the beginning) | |
| void | setD (double D) |
| sets the width of the light source (this resets also the ray counter) | |
| void | setD (double D1, double D2) |
| void | setk (const maths::Vector< double > &k) |
| sets the main direction of the light source | |
| void | setN0 (std::complex< double > n0) |
| sets the complex valued refractive index of the intermediate medium | |
| void | setNumRays (int N) |
| void | setNumRaysRT (int numRaysRT) |
| void | setObject (ObjectShape *O, int i=-1) |
| exchanges i-th object in the object list | |
| void | setPol (maths::Vector< std::complex< double > > pol) |
| sets the polarisation | |
| void | setPos (maths::Vector< double > P) |
| sets the position of the light source. This is the center of the square area of the light source | |
| void | setR0 (double r0) |
| sets the radius of the calculation sphere | |
| void | setWavelength (double wvl) |
| void | setWavenumber (double k0) |
| ~LightSrc (void) | |
| virtual int | next (RayBase *ray)=0 |
| virtual int | next (Ray_pow &ray)=0 |
| virtual int | next (IRay &ray)=0 |
| virtual int | next (tubedRay &ray)=0 |
| virtual double | area () |
Public Attributes | |
| double | D |
| width of the square light source area | |
| double | D1 |
| double | D2 |
| width in the e1- and the e2-direction (used only for _mc versions of LightSrc) | |
| double | density |
| ray density, i.e. distance between two neighboring rays | |
| maths::Vector< double > | e1 |
| maths::Vector< double > | e2 |
| unit vectors that span the light source area | |
| int | i1 |
| first index of the ray inside the starting area (for internal use, -1 if the calculation has not yet been started) | |
| int | i2 |
| second index of the ray inside the starting area (for internal use, -1 if the calculation has not yet been started) | |
| maths::Vector< std::complex< double > > | initPol |
| Polarisation, if the k-Vector points in z-direction. | |
| maths::Vector< double > | k |
| main direction of the light source | |
| int | N =10000 |
| number of rays (per direction) | |
| std::complex< double > | n0 |
| refractive index of the intermediate medium | |
| int | numObjs |
| number of objects | |
| std::vector< ObjectShape * > | Obj |
| list of all objects | |
| double | P0 =1.0 |
| power | |
| double | Pall |
| overall Power | |
| maths::Vector< std::complex< double > > | Pol |
| polarisation (default: (0.0, 1.0, 0.0) | |
| maths::Vector< std::complex< double > > | Pol2 |
| second polarisation (used by IRay) | |
| int | polType |
| Polarisationsrichtung (s.o.) | |
| maths::Vector< double > | Pos |
| position of the light source (center of the square area of the light source) | |
| double | r0 =1.0 |
| radius of the calculation sphere | |
| int | rayCounter =0 |
| int | raytype |
| Strahltyp : ray oder ISTRAHL (=RAY oder IRAY) | |
| bool | suppress_phase_progress = false |
| if set true, the phase won't be changed when calling a next method (needed for USP-calculations) | |
| int | type |
| type of the light source | |
Protected Attributes | |
| double | Isum1 |
| double | Isum2 |
| double | k0 |
| wavenumber (i.e. \( \frac{2\pi}{\lambda}\) | |
| int | numRaysRT =20 |
| used in GOATvis to determine number of rays for ray representation | |
| maths::Vector< double > | rotVec =maths::Vector<double>(1,0,0) |
| Vector which holds the spherical coordinates \(r\), \(\vartheta\) and \(\varphi\) of the direction vector k. | |
| double | wvl =1 |
| wavelength | |
Friends | |
| class | LightSrcGauss |
| class | LightSrcPlane |
| std::ostream & | operator<< (std::ostream &os, LightSrc *ls) |
This abstract class is the basic class for all light sources used in this raytracing library. It provides all necessary interfaces.
LightSrc: the virtual base class for describing light sources. Each light source is defined by a quadratic area as starting area for the corresponding rays and a reference point Pos in the middle of this area. The direction has to be defined separately in the derived class. It provides a standard programming interface for light sources. The virtual function next(...) gives the next ray with the light source dependent parameters (position, direction, strength of the electric field etc.). The return parameter has three possible values: LIGHTSRC_NOT_LAST_RAY: the created ray is not the last ray, LIGHTSRC_IS_LAST_RAY: the last ray was created (i.e. the raytracing is at its end) and LIGHTSRC_ERROR: an error occurs. The routine reset() resets the ray counter to its initial value, so the next call of the routine next() gives the first ray. Since the rays need information about the objects to be able to calculate the crossing points with the object surface, LightSrc provides routines to pass these informations to the rays. These routines are only needed for calculations without the raytracing process, especially without the Scene class.
Polarisation:
When calling the setPol function, the polarisation is set as if the direction would be in z-direction and afterwards the polarisation will be rotated according to the above picture. If the direction vector is changed using setk, the direction of the polarization is changed accordingly.
Definition at line 66 of file lightsrc.h.
| GOAT::raytracing::LightSrc::~LightSrc | ( | void | ) |
| GOAT::raytracing::LightSrc::LightSrc | ( | ) |
| GOAT::raytracing::LightSrc::LightSrc | ( | const LightSrc & | ) |
Copy constructor.
| void GOAT::raytracing::LightSrc::addObject | ( | ObjectShape * | obj | ) |
add single object to the object list
| void GOAT::raytracing::LightSrc::adjustDirection | ( | ) |
|
inlinevirtual |
Reimplemented in GOAT::raytracing::LightSrcGauss, GOAT::raytracing::LightSrcPlane, GOAT::raytracing::LightSrcRing, and GOAT::raytracing::LightSrcRingGauss_mc.
Definition at line 90 of file lightsrc.h.
| void GOAT::raytracing::LightSrc::binRead | ( | std::ifstream & | is | ) |
writes content of LightSrc in a binary file, represented by is
|
pure virtual |
reads content of LightSrc from a binary file, represented by os (has to be specified by the derived classes)
Implemented in GOAT::raytracing::LightSrcGauss, GOAT::raytracing::LightSrcLine, GOAT::raytracing::LightSrcLine_mc, GOAT::raytracing::LightSrcPlane, GOAT::raytracing::LightSrcPoint_mc, and GOAT::raytracing::LightSrcRing.
| void GOAT::raytracing::LightSrc::binWrite | ( | std::ofstream & | os | ) |
reads content of LightSrc from a binary file, represented by os
|
pure virtual |
writes content of LightSrc in a binary file, represented by is (has to be specified by the derived classes)focuspos
Implemented in GOAT::raytracing::LightSrcGauss, GOAT::raytracing::LightSrcLine, GOAT::raytracing::LightSrcLine_mc, GOAT::raytracing::LightSrcPlane, GOAT::raytracing::LightSrcPoint_mc, and GOAT::raytracing::LightSrcRing.
| void GOAT::raytracing::LightSrc::clearObjects | ( | ) |
clear object list
|
inline |
returns the ray density, i.e. the number of rays per unit length (=D/N)
Definition at line 101 of file lightsrc.h.
|
inline |
Definition at line 102 of file lightsrc.h.
|
inline |
Definition at line 178 of file lightsrc.h.
|
inline |
Definition at line 179 of file lightsrc.h.
|
inline |
returns the main direction of the light source
Definition at line 131 of file lightsrc.h.
|
inline |
returns the number of Objects (only needed, when used seperately outside scene)
Definition at line 96 of file lightsrc.h.
|
inline |
returns the number of rays (per direction in space)
Definition at line 132 of file lightsrc.h.
|
inline |
Definition at line 126 of file lightsrc.h.
|
inline |
returns i-th item in the object list
Definition at line 97 of file lightsrc.h.
|
inline |
returns the position of the light source. This is the center of the square area of the light source
Definition at line 146 of file lightsrc.h.
|
inline |
Definition at line 140 of file lightsrc.h.
|
inline |
Definition at line 142 of file lightsrc.h.
|
pure virtual |
Implemented in GOAT::raytracing::LightSrcGauss, GOAT::raytracing::LightSrcGauss_mc, GOAT::raytracing::LightSrcLine, GOAT::raytracing::LightSrcLine_mc, GOAT::raytracing::LightSrcPlane, GOAT::raytracing::LightSrcPlane_mc, GOAT::raytracing::LightSrcPoint_mc, GOAT::raytracing::LightSrcRing, GOAT::raytracing::LightSrcRing_mc, and GOAT::raytracing::LightSrcRingGauss_mc.
|
pure virtual |
Implemented in GOAT::raytracing::LightSrcGauss, GOAT::raytracing::LightSrcGauss_mc, GOAT::raytracing::LightSrcLine, GOAT::raytracing::LightSrcLine_mc, GOAT::raytracing::LightSrcPlane, GOAT::raytracing::LightSrcPlane_mc, GOAT::raytracing::LightSrcPoint_mc, GOAT::raytracing::LightSrcRing, GOAT::raytracing::LightSrcRing_mc, and GOAT::raytracing::LightSrcRingGauss_mc.
|
pure virtual |
These functions return the next ray of the light source for further calculations
| ray | next ray |
| LIGHTSRC_NOT_LAST_RAY,if | ray is not the last ray, LIGHTSRC_IS_LAST_RAY, if the ray is the last ray or LIGHTSRC_ERROR if an error occured |
Implemented in GOAT::raytracing::LightSrcGauss, GOAT::raytracing::LightSrcLine, GOAT::raytracing::LightSrcLine_mc, GOAT::raytracing::LightSrcPlane, GOAT::raytracing::LightSrcPoint_mc, and GOAT::raytracing::LightSrcRing.
|
pure virtual |
Implemented in GOAT::raytracing::LightSrcGauss, GOAT::raytracing::LightSrcGauss_mc, GOAT::raytracing::LightSrcLine, GOAT::raytracing::LightSrcLine_mc, GOAT::raytracing::LightSrcPlane, GOAT::raytracing::LightSrcPlane_mc, GOAT::raytracing::LightSrcPoint_mc, GOAT::raytracing::LightSrcRing, GOAT::raytracing::LightSrcRing_mc, and GOAT::raytracing::LightSrcRingGauss_mc.
| void GOAT::raytracing::LightSrc::ObjectList | ( | int | Anz, |
| std::vector< ObjectShape * > | Obj ) |
import object list
|
inline |
returns the current ray type
Definition at line 99 of file lightsrc.h.
| void GOAT::raytracing::LightSrc::removeObject | ( | ObjectShape * | obj | ) |
remove object from the object list
| void GOAT::raytracing::LightSrc::reset | ( | ) |
Reset everything (counting starts from the beginning)
|
inline |
sets the width of the light source (this resets also the ray counter)
| D | sets the width of the light source |
Definition at line 103 of file lightsrc.h.
|
inline |
| D2 | sets the width of the light source |
Definition at line 112 of file lightsrc.h.
| void GOAT::raytracing::LightSrc::setk | ( | const maths::Vector< double > & | k | ) |
sets the main direction of the light source
|
inline |
sets the complex valued refractive index of the intermediate medium
Definition at line 147 of file lightsrc.h.
|
inline |
| N | sets the number of rays (per direction in space) |
Definition at line 133 of file lightsrc.h.
|
inline |
Definition at line 121 of file lightsrc.h.
| void GOAT::raytracing::LightSrc::setObject | ( | ObjectShape * | O, |
| int | i = -1 ) |
exchanges i-th object in the object list
| void GOAT::raytracing::LightSrc::setPol | ( | maths::Vector< std::complex< double > > | pol | ) |
sets the polarisation
| void GOAT::raytracing::LightSrc::setPos | ( | maths::Vector< double > | P | ) |
sets the position of the light source. This is the center of the square area of the light source
| void GOAT::raytracing::LightSrc::setR0 | ( | double | r0 | ) |
sets the radius of the calculation sphere
|
inline |
Definition at line 139 of file lightsrc.h.
|
inline |
Definition at line 141 of file lightsrc.h.
|
friend |
Definition at line 173 of file lightsrc.h.
|
friend |
Definition at line 172 of file lightsrc.h.
|
friend |
| double GOAT::raytracing::LightSrc::D |
width of the square light source area
Definition at line 165 of file lightsrc.h.
| double GOAT::raytracing::LightSrc::D1 |
Definition at line 166 of file lightsrc.h.
| double GOAT::raytracing::LightSrc::D2 |
width in the e1- and the e2-direction (used only for _mc versions of LightSrc)
Definition at line 166 of file lightsrc.h.
| double GOAT::raytracing::LightSrc::density |
ray density, i.e. distance between two neighboring rays
Definition at line 153 of file lightsrc.h.
| maths::Vector<double> GOAT::raytracing::LightSrc::e1 |
Definition at line 167 of file lightsrc.h.
| maths::Vector<double> GOAT::raytracing::LightSrc::e2 |
unit vectors that span the light source area
Definition at line 167 of file lightsrc.h.
| int GOAT::raytracing::LightSrc::i1 |
first index of the ray inside the starting area (for internal use, -1 if the calculation has not yet been started)
Definition at line 156 of file lightsrc.h.
| int GOAT::raytracing::LightSrc::i2 |
second index of the ray inside the starting area (for internal use, -1 if the calculation has not yet been started)
Definition at line 157 of file lightsrc.h.
| maths::Vector<std::complex<double> > GOAT::raytracing::LightSrc::initPol |
Polarisation, if the k-Vector points in z-direction.
Definition at line 170 of file lightsrc.h.
|
protected |
Definition at line 185 of file lightsrc.h.
|
protected |
Definition at line 185 of file lightsrc.h.
| maths::Vector<double> GOAT::raytracing::LightSrc::k |
main direction of the light source
Definition at line 154 of file lightsrc.h.
|
protected |
wavenumber (i.e. \( \frac{2\pi}{\lambda}\)
Definition at line 183 of file lightsrc.h.
| int GOAT::raytracing::LightSrc::N =10000 |
number of rays (per direction)
Definition at line 155 of file lightsrc.h.
| std::complex<double> GOAT::raytracing::LightSrc::n0 |
refractive index of the intermediate medium
Definition at line 163 of file lightsrc.h.
| int GOAT::raytracing::LightSrc::numObjs |
number of objects
Definition at line 162 of file lightsrc.h.
|
protected |
used in GOATvis to determine number of rays for ray representation
Definition at line 186 of file lightsrc.h.
| std::vector<ObjectShape*> GOAT::raytracing::LightSrc::Obj |
list of all objects
Definition at line 148 of file lightsrc.h.
| double GOAT::raytracing::LightSrc::P0 =1.0 |
power
Definition at line 152 of file lightsrc.h.
| double GOAT::raytracing::LightSrc::Pall |
overall Power
Definition at line 171 of file lightsrc.h.
| maths::Vector<std::complex<double> > GOAT::raytracing::LightSrc::Pol |
polarisation (default: (0.0, 1.0, 0.0)
Definition at line 158 of file lightsrc.h.
| maths::Vector<std::complex<double> > GOAT::raytracing::LightSrc::Pol2 |
second polarisation (used by IRay)
Definition at line 159 of file lightsrc.h.
| int GOAT::raytracing::LightSrc::polType |
Polarisationsrichtung (s.o.)
Definition at line 169 of file lightsrc.h.
| maths::Vector<double> GOAT::raytracing::LightSrc::Pos |
position of the light source (center of the square area of the light source)
Definition at line 150 of file lightsrc.h.
| double GOAT::raytracing::LightSrc::r0 =1.0 |
radius of the calculation sphere
Definition at line 160 of file lightsrc.h.
| int GOAT::raytracing::LightSrc::rayCounter =0 |
Definition at line 176 of file lightsrc.h.
| int GOAT::raytracing::LightSrc::raytype |
Strahltyp : ray oder ISTRAHL (=RAY oder IRAY)
Definition at line 168 of file lightsrc.h.
|
protected |
Vector which holds the spherical coordinates \(r\), \(\vartheta\) and \(\varphi\) of the direction vector k.
Definition at line 184 of file lightsrc.h.
| bool GOAT::raytracing::LightSrc::suppress_phase_progress = false |
if set true, the phase won't be changed when calling a next method (needed for USP-calculations)
Definition at line 175 of file lightsrc.h.
| int GOAT::raytracing::LightSrc::type |
type of the light source
Definition at line 151 of file lightsrc.h.
|
protected |
wavelength
Definition at line 182 of file lightsrc.h.