GOAT (Geometrical optics application tool) 0.1
Loading...
Searching...
No Matches
raybase.h
Go to the documentation of this file.
1#pragma once
2#include "vector.h"
3#include "objectshape.h"
4
5namespace GOAT
6{
7 namespace raytracing
8 {
9#define RAYBASE_STATUS_NONE 0
10#define RAYBASE_STATUS_FIRST_STEP 1
11#define RAYBASE_STATUS_TIR 2
16 class RayBase {
17 public:
18 virtual bool next() = 0;
22 virtual bool isInObject() = 0;
23 virtual int objectIndex() = 0;
24 virtual void reflectRay(RayBase*& tray, maths::Vector<double> n, std::complex<double> n1, std::complex<double> n2) = 0;
26 bool inObject=false;
27 std::vector<ObjectShape*> Obj;
28 int numObj=0;
29 int objIndex=0;
30 std::complex<double> n, n0;
31 double k0=2.0*M_PI;
32 double r0=1.0, rc=1.0;
33 int iR=0;
36 };
37 }
38}
Template class for threedimensional vectors.
Definition vector.h:57
Abstract base class for all rays used for the raytracing process. This abstract base class for all ra...
Definition raybase.h:16
int objIndex
index of the current object
Definition raybase.h:29
virtual maths::Vector< double > getk()=0
gives back direction Vector
std::complex< double > n0
current refractive index and refractive index of the host material
Definition raybase.h:30
bool inObject
is in an object
Definition raybase.h:26
virtual void reflectRay(RayBase *&tray, maths::Vector< double > n, std::complex< double > n1, std::complex< double > n2)=0
reflects ray
std::complex< double > n
Definition raybase.h:30
virtual bool isInObject()=0
true if ray is in an object otherwise false
virtual bool next()=0
make the next step (has to include phase progress)
int numObj
number of objects
Definition raybase.h:28
std::vector< ObjectShape * > Obj
list of all objects
Definition raybase.h:27
bool suppress_phase_progress
suppress phase change in next(), needed for short pulse consideration
Definition raybase.h:34
virtual int objectIndex()=0
index of the current object or -1
virtual maths::Vector< double > getP()=0
gives back position
virtual maths::Vector< std::complex< double > > getE()=0
gives back electric field strength
RayBase * tray
transmitted ray (used by the raytracer, for internal use only)
Definition raybase.h:25
double k0
wave number
Definition raybase.h:31
double rc
radius of the calculation sphere
Definition raybase.h:32
int iR
number of reflections already done
Definition raybase.h:33
Raytracer used for ultrashort pulse calculation with raytracing only.
Definition asphericLens.h:6
This class is used for the iray class. This class is intended for internal use only....
Definition fresnel.h:7
#define RAYBASE_STATUS_NONE
Definition raybase.h:9
This file contains the Vector template class and some useful functions around this class.