GOAT (Geometrical optics application tool) 0.1
Loading...
Searching...
No Matches
GOAT::raytracing::ObjectShape Class Referenceabstract

Abstract base class for all volume objects This abstract class provides a template for all volume objects. The refractive index is complex to be able to consider absorption. More...

#include <objectshape.h>

Inheritance diagram for GOAT::raytracing::ObjectShape:
GOAT::raytracing::Box GOAT::raytracing::Cone GOAT::raytracing::Cylinder GOAT::raytracing::Ellipsoid GOAT::raytracing::VortexPlate GOAT::raytracing::asphericLens GOAT::raytracing::sphericLens GOAT::raytracing::surface

Public Member Functions

virtual void binRead (std::ifstream &os)=0
 binary reading from file
virtual void binWrite (std::ofstream &os)=0
 binary writing to file
virtual maths::Vector< double > calcCoM ()=0
 calculates center of mass (needed by setCenter2CoM () )
std::complex< double > getn ()
 returns refractive index for inelastic (RRT) calculation
std::complex< double > getninel ()
 returns refractive index
bool getVisible ()
 show the visiblity state (used in GOATvis)
virtual void initQuad ()=0
 calculates the circumferent cuboid (needed e.g. for the inelastic scattering calculations)
bool isActive ()
 returns true if the object should be considered for inelastic calculation
virtual bool isInside (const maths::Vector< double > &p)=0
 checks if point P is inside the object
bool isOutsideWorld ()
 Test if bounding box is (partly) outside the calculation space.
virtual bool next (const maths::Vector< double > &p, const maths::Vector< double > &k, maths::Vector< double > &pout)=0
 searches for the next (nearest) intersection of a ray with the object, p: current position of the ray, k: direction of the ray, pout: position of the crossing point. Returns true, if a crossing point was found.
virtual maths::Vector< double > norm (const maths::Vector< double > &P)=0
 surface normal at the point P
 ObjectShape ()
 ObjectShape (const maths::Vector< double > &P, std::complex< double > n, GOAT::maths::Matrix< std::complex< double > > alpha, const maths::Vector< double > &Ex=maths::ex, const maths::Vector< double > &Ey=maths::ey, const maths::Vector< double > &Ez=maths::ez, const int type=-1)
 Constructor, as template for all derived classes.
 ObjectShape (const ObjectShape &F)
void rotate (maths::Vector< double > A, double phi)
 sets the matrix for the transformation between object's coordinate system and outer coordinate system, A: rotation axis, phi: angle for rotation around A
void scale (double sf)
 sets scaling of the shape by the factor sf
void setActive (bool active)
 sets flag if the object is inelastic active, i.e. it will be considered for inelastic calculation
void setAlpha (double Alpha)
 sets rotation angle around x-axis
void setBeta (double Beta)
 sets rotation angle around y-axis
void setCenter (maths::Vector< double > P)
 sets Center to P (check, if function is necessary)
void setCenter2CoM ()
 Calculates the center of mass (CoM) and sets the object's reference point to the CoM.
void setGamma (double Gamma)
 sets rotation angle around z-axis
void setMatrix (double alpha, double beta, double gamma)
 sets the matrix for the transformation between object's coordinate system and outer coordinate system, alpha, beta, gamma: angles (rotation around x-, y- and z-axis) to calculate transformation matrix
void setMatrix (maths::Matrix< double > H)
 sets the matrix for the transformation between object's coordinate system and outer coordinate system, H: transformation matrix
void setn (std::complex< double > n)
 sets refractive index
void setninel (std::complex< double > ninel)
 sets refractive index for inelastic (RRT) calculation
void setPolMatrix (maths::Matrix< std::complex< double > >alpha)
 sets polarisability matrix
virtual void setPos (double x, double y, double z)=0
 sets reference point P
virtual void setPos (maths::Vector< double > r)=0
 sets reference point P
virtual void setr0 (double r0)=0
 defines the radius of the calculation sphere
void setVisible (bool visible)
 set visiblity (used in GOATvis)
int Type ()
 returns the object's type
virtual double volume ()=0
 returns the volume of the object

Public Attributes

bool Active
 should the object be considered for inelastic (RRT) calculations?
maths::Matrix< std::complex< double > > alpha
 polarisability matrix
maths::Vector< double > e [3]
 unity vectors, describing the directions of the local coordinate system
double Ealpha
double Ebeta
double Egamma
 angles through which the object was rotated (around the x- (Ealpha), then the y- (Ebeta) and finally the z-axis (Egamma))
maths::Matrix< double > H
std::complex< double > n
 refractive index of the object
std::function< std::complex< double >(double)> nfunc
NFUNCTYPE nfuncType =NFUNCTYPE::vacuum
std::complex< double > ninel
 refractive index of the object, used for inelastic (RRT) calculation
maths::Vector< double > P
 position of the object
maths::Vector< double > por
 corners of the circumferent cuboid (lower left corner and upper right corner)
maths::Vector< double > pul
maths::Matrix< double > R
 matrices for the transformation in the local coordinate system (H) and back to the calculation system (R)
double r0
 radius of the calculation sphere
double rho
 mass density in \( kg/m^3 \)
double sf =1
 scaling factor, it is used to scale the shape of the object
int type
 type of the object
bool visible =true

Detailed Description

Abstract base class for all volume objects This abstract class provides a template for all volume objects. The refractive index is complex to be able to consider absorption.

Definition at line 60 of file objectshape.h.

Constructor & Destructor Documentation

◆ ObjectShape() [1/3]

GOAT::raytracing::ObjectShape::ObjectShape ( )

◆ ObjectShape() [2/3]

GOAT::raytracing::ObjectShape::ObjectShape ( const ObjectShape & F)

◆ ObjectShape() [3/3]

GOAT::raytracing::ObjectShape::ObjectShape ( const maths::Vector< double > & P,
std::complex< double > n,
GOAT::maths::Matrix< std::complex< double > > alpha,
const maths::Vector< double > & Ex = maths::ex,
const maths::Vector< double > & Ey = maths::ey,
const maths::Vector< double > & Ez = maths::ez,
const int type = -1 )

Constructor, as template for all derived classes.

Parameters
Pposition of the object (reference point)
nrefractive index (complex) @alpha polarizability matrix
Ex,Ey,Ezdirection of the object's coordinate system (default values: ex, ey and ez) @type type of the object, defines the shape (default value: -1, no shape)

Member Function Documentation

◆ binRead()

virtual void GOAT::raytracing::ObjectShape::binRead ( std::ifstream & os)
pure virtual

◆ binWrite()

virtual void GOAT::raytracing::ObjectShape::binWrite ( std::ofstream & os)
pure virtual

◆ calcCoM()

virtual maths::Vector< double > GOAT::raytracing::ObjectShape::calcCoM ( )
pure virtual

◆ getn()

std::complex< double > GOAT::raytracing::ObjectShape::getn ( )
inline

returns refractive index for inelastic (RRT) calculation

Definition at line 110 of file objectshape.h.

◆ getninel()

std::complex< double > GOAT::raytracing::ObjectShape::getninel ( )
inline

returns refractive index

Definition at line 109 of file objectshape.h.

◆ getVisible()

bool GOAT::raytracing::ObjectShape::getVisible ( )
inline

show the visiblity state (used in GOATvis)

Definition at line 118 of file objectshape.h.

◆ initQuad()

virtual void GOAT::raytracing::ObjectShape::initQuad ( )
pure virtual

◆ isActive()

bool GOAT::raytracing::ObjectShape::isActive ( )
inline

returns true if the object should be considered for inelastic calculation

Definition at line 112 of file objectshape.h.

◆ isInside()

virtual bool GOAT::raytracing::ObjectShape::isInside ( const maths::Vector< double > & p)
pure virtual

◆ isOutsideWorld()

bool GOAT::raytracing::ObjectShape::isOutsideWorld ( )

Test if bounding box is (partly) outside the calculation space.

◆ next()

virtual bool GOAT::raytracing::ObjectShape::next ( const maths::Vector< double > & p,
const maths::Vector< double > & k,
maths::Vector< double > & pout )
pure virtual

searches for the next (nearest) intersection of a ray with the object, p: current position of the ray, k: direction of the ray, pout: position of the crossing point. Returns true, if a crossing point was found.

Implemented in GOAT::raytracing::asphericLens, GOAT::raytracing::Box, GOAT::raytracing::Cone, GOAT::raytracing::Cylinder, GOAT::raytracing::Ellipsoid, GOAT::raytracing::sphericLens, GOAT::raytracing::surface, and GOAT::raytracing::VortexPlate.

◆ norm()

virtual maths::Vector< double > GOAT::raytracing::ObjectShape::norm ( const maths::Vector< double > & P)
pure virtual

◆ rotate()

void GOAT::raytracing::ObjectShape::rotate ( maths::Vector< double > A,
double phi )

sets the matrix for the transformation between object's coordinate system and outer coordinate system, A: rotation axis, phi: angle for rotation around A

◆ scale()

void GOAT::raytracing::ObjectShape::scale ( double sf)

sets scaling of the shape by the factor sf

◆ setActive()

void GOAT::raytracing::ObjectShape::setActive ( bool active)
inline

sets flag if the object is inelastic active, i.e. it will be considered for inelastic calculation

Definition at line 113 of file objectshape.h.

◆ setAlpha()

void GOAT::raytracing::ObjectShape::setAlpha ( double Alpha)
inline

sets rotation angle around x-axis

Definition at line 114 of file objectshape.h.

◆ setBeta()

void GOAT::raytracing::ObjectShape::setBeta ( double Beta)
inline

sets rotation angle around y-axis

Definition at line 115 of file objectshape.h.

◆ setCenter()

void GOAT::raytracing::ObjectShape::setCenter ( maths::Vector< double > P)

sets Center to P (check, if function is necessary)

◆ setCenter2CoM()

void GOAT::raytracing::ObjectShape::setCenter2CoM ( )

Calculates the center of mass (CoM) and sets the object's reference point to the CoM.

◆ setGamma()

void GOAT::raytracing::ObjectShape::setGamma ( double Gamma)
inline

sets rotation angle around z-axis

Definition at line 116 of file objectshape.h.

◆ setMatrix() [1/2]

void GOAT::raytracing::ObjectShape::setMatrix ( double alpha,
double beta,
double gamma )

sets the matrix for the transformation between object's coordinate system and outer coordinate system, alpha, beta, gamma: angles (rotation around x-, y- and z-axis) to calculate transformation matrix

◆ setMatrix() [2/2]

void GOAT::raytracing::ObjectShape::setMatrix ( maths::Matrix< double > H)

sets the matrix for the transformation between object's coordinate system and outer coordinate system, H: transformation matrix

◆ setn()

void GOAT::raytracing::ObjectShape::setn ( std::complex< double > n)
inline

sets refractive index

Definition at line 107 of file objectshape.h.

◆ setninel()

void GOAT::raytracing::ObjectShape::setninel ( std::complex< double > ninel)
inline

sets refractive index for inelastic (RRT) calculation

Definition at line 108 of file objectshape.h.

◆ setPolMatrix()

void GOAT::raytracing::ObjectShape::setPolMatrix ( maths::Matrix< std::complex< double > > alpha)
inline

sets polarisability matrix

Definition at line 111 of file objectshape.h.

◆ setPos() [1/2]

virtual void GOAT::raytracing::ObjectShape::setPos ( double x,
double y,
double z )
pure virtual

◆ setPos() [2/2]

◆ setr0()

virtual void GOAT::raytracing::ObjectShape::setr0 ( double r0)
pure virtual

◆ setVisible()

void GOAT::raytracing::ObjectShape::setVisible ( bool visible)
inline

set visiblity (used in GOATvis)

Definition at line 117 of file objectshape.h.

◆ Type()

int GOAT::raytracing::ObjectShape::Type ( )
inline

returns the object's type

Definition at line 97 of file objectshape.h.

◆ volume()

Member Data Documentation

◆ Active

bool GOAT::raytracing::ObjectShape::Active

should the object be considered for inelastic (RRT) calculations?

Definition at line 130 of file objectshape.h.

◆ alpha

maths::Matrix<std::complex<double> > GOAT::raytracing::ObjectShape::alpha

polarisability matrix

Definition at line 123 of file objectshape.h.

◆ e

maths::Vector<double> GOAT::raytracing::ObjectShape::e[3]

unity vectors, describing the directions of the local coordinate system

Definition at line 126 of file objectshape.h.

◆ Ealpha

double GOAT::raytracing::ObjectShape::Ealpha

Definition at line 127 of file objectshape.h.

◆ Ebeta

double GOAT::raytracing::ObjectShape::Ebeta

Definition at line 127 of file objectshape.h.

◆ Egamma

double GOAT::raytracing::ObjectShape::Egamma

angles through which the object was rotated (around the x- (Ealpha), then the y- (Ebeta) and finally the z-axis (Egamma))

Definition at line 127 of file objectshape.h.

◆ H

maths::Matrix<double> GOAT::raytracing::ObjectShape::H

Definition at line 120 of file objectshape.h.

◆ n

std::complex<double> GOAT::raytracing::ObjectShape::n

refractive index of the object

Definition at line 121 of file objectshape.h.

◆ nfunc

std::function<std::complex<double>(double)> GOAT::raytracing::ObjectShape::nfunc

Definition at line 138 of file objectshape.h.

◆ nfuncType

NFUNCTYPE GOAT::raytracing::ObjectShape::nfuncType =NFUNCTYPE::vacuum

Definition at line 139 of file objectshape.h.

◆ ninel

std::complex<double> GOAT::raytracing::ObjectShape::ninel

refractive index of the object, used for inelastic (RRT) calculation

Definition at line 122 of file objectshape.h.

◆ P

maths::Vector<double> GOAT::raytracing::ObjectShape::P

position of the object

Definition at line 119 of file objectshape.h.

◆ por

maths::Vector<double> GOAT::raytracing::ObjectShape::por

corners of the circumferent cuboid (lower left corner and upper right corner)

Definition at line 125 of file objectshape.h.

◆ pul

maths::Vector<double> GOAT::raytracing::ObjectShape::pul

Definition at line 125 of file objectshape.h.

◆ R

maths::Matrix<double> GOAT::raytracing::ObjectShape::R

matrices for the transformation in the local coordinate system (H) and back to the calculation system (R)

Definition at line 120 of file objectshape.h.

◆ r0

double GOAT::raytracing::ObjectShape::r0

radius of the calculation sphere

Definition at line 128 of file objectshape.h.

◆ rho

double GOAT::raytracing::ObjectShape::rho

mass density in \( kg/m^3 \)

Definition at line 131 of file objectshape.h.

◆ sf

double GOAT::raytracing::ObjectShape::sf =1

scaling factor, it is used to scale the shape of the object

Definition at line 129 of file objectshape.h.

◆ type

int GOAT::raytracing::ObjectShape::type

type of the object

Definition at line 124 of file objectshape.h.

◆ visible

bool GOAT::raytracing::ObjectShape::visible =true

Definition at line 137 of file objectshape.h.


The documentation for this class was generated from the following file: