25#define SQRT3 1.73205080756887729352744634150587236694280525381038062805580
28#define OBJECTSHAPE_SURFACE_FILETYPE_NONE -1
29#define OBJECTSHAPE_SURFACE_FILETYPE_SRF 0
30#define OBJECTSHAPE_SURFACE_FILETYPE_STL 1
76 std::complex<double>
n,
96 std::complex<double>
n,
186 int octreeRecursions=5;
187 void setOctreeRecursiondepth (
int octreeRecursions);
This class represents a threedimensional (numeric) Matrix as a template.
Template class for threedimensional vectors.
double sf
scaling factor, it is used to scale the shape of the object
maths::Vector< double > por
corners of the circumferent cuboid (lower left corner and upper right corner)
maths::Matrix< std::complex< double > > alpha
polarisability matrix
maths::Vector< double > pul
maths::Vector< double > P
position of the object
double r0
radius of the calculation sphere
std::complex< double > n
refractive index of the object
This template class is used for internal purposes and represents an octree.
This class represents objects those surface is described by triangles.
void setCenter2CoM()
Sets the Position to the center of mass (CoM)
void setPos(maths::Vector< double > r)
Set position of the object to r.
std::string getFilename()
returns the current file name
void setFilename(std::string FName)
void binRead(std::ifstream &is)
Reads object from binary file represented by istream is.
triangle & getTriangle(int i)
Returns the i-th triangle in the internal triangle list.
void initBounds(maths::Vector< double > &pul, maths::Vector< double > &por)
Calculates the bounding box (=circumferent cuboid) but without rotation. The cuboid is represented by...
maths::Vector< double > calcCoM()
calculates center of mass (needed by setCenter2CoM () )
int createsurface(std::string FName)
reads the triangle list from a file (proprietary file format, SRF)
void addTriangle(triangle *S, int num)
Adds triangles to the internal list of triangles.
void clearS()
clears the internal list of triangles
bool isInside(const maths::Vector< double > &p)
checks if point P is inside the object
void binWrite(std::ofstream &os)
Writes object to binary file represented by ostream os.
surface nosurface()
returns copy of the object without triangles
void setCenter(maths::Vector< double > P)
bool next(const maths::Vector< double > &r, const maths::Vector< double > &k, maths::Vector< double > &p)
Calculates the intersection point between a straight line and the surface object. The straight line i...
int getCurrentIndex()
Returns the index of the triangle that was last hit.
int importBinSTL(std::string FName)
import triangle list from binary STL-file
int filetype
type of the file connected with this surface object
surface & operator=(const surface &)
int currentIndex
Index of the triangle that was last hit.
triangle * S
list of all triangles
void setr0(double r0)
sets the radius of the calculation sphere (necessary only if this class is used outside Scene)
void exportSRF(std::string FName)
export triangle list to proprietary file format SRF
surface(const maths::Vector< double > &P, std::complex< double > n, const maths::Matrix< std::complex< double > > alpha=maths::CUNITY, const maths::Vector< double > Ex=GOAT::maths::ex, const maths::Vector< double > Ey=GOAT::maths::ey, const maths::Vector< double > Ez=GOAT::maths::ez)
void getMinMax(double &min, double &max)
calculates center of mass
void setPos(double x, double y, double z)
Set position of the object to a position vector represented by its components x,y and z.
maths::Matrix< double > computeInertia()
Calculates the inertia of the object.
double volume()
Calculates the volume of the object.
surface(const maths::Vector< double > &P, std::complex< double > n, int num, triangle *list, const maths::Matrix< std::complex< double > > alpha=maths::CUNITY, const maths::Vector< double > Ex=maths::ex, const maths::Vector< double > Ey=maths::ey, const maths::Vector< double > Ez=maths::ez)
maths::Vector< double > norm(const maths::Vector< double > &P)
Surface normal at point P (There is no check, if P is on the surface. This function is used for inter...
surface(maths::Vector< double > Oh)
Empty surface object with position Oh.
int numTriangles
number of triangles
maths::Vector< double > currentnorm
Normal vector of the triangle that was last hit.
int createsurface()
Creates a list of triangles, which describes the surface, from standard input.
void initQuad()
Boundaries of the circumferent cuboid is calculated. The cuboid is represented by the upper right cor...
std::string FName
File name (used to save the internal triangle list)
void scale(double sf)
scale the lengths of all triangles
surface(const surface &Su)
This class describes a triangle, represented by its corner points. It is intented for internal purpos...
const Matrix< double > UNITY
Unity matrix (double-valued)
const Matrix< std::complex< double > > CUNITY
Unity matrix (complex-valued)
Raytracer used for ultrashort pulse calculation with raytracing only.
surface operator-(const surface &s, const maths::Vector< double > &v)
subtracts vector v from all corners of the triangle list of the surface object s
surface generateHollowHexagonalCylinder(double a, double h, double t, maths::Matrix< double > M=maths::UNITY)
generates a cylinder with hexagonal cross section. At the upper and lower faces, there are pyramidal ...
void getMinMax(int numTriangles, triangle *S, double &min, double &max)
calculates the longest and shortest side length
surface generatePill(double a, double b, double h, int N, double r0=1.0, maths::Matrix< double > M=maths::UNITY)
Generates a cylinder with ellipsoidal caps.
surface generateEllipsoid(double a, double b, int N, double r0=1.0, maths::Matrix< double > M=maths::UNITY)
Generiert einen hexagonalen Zylinder mit Seitenl�nge a und H�he h und einer pyramidalen Spitze.
surface operator+(const surface &s, const maths::Vector< double > &v)
{
surface generateHexagonCylinder(double a, double h, maths::Matrix< double > M=maths::UNITY)
}
surface & generateBullet(double a, double h, double t, maths::Matrix< double > M=maths::UNITY)
generates a cylinder with hexagonal cross section with a pyramid-shaped tip on the upper surface.
std::ostream & operator<<(std::ostream &os, Box B)
output operator for the Box class
surface operator*(const maths::Matrix< double > &M, const surface &s)
surface generatePolyBullet(int n, double a, double h, double t, maths::Matrix< double > M=maths::UNITY)
This class is used for the iray class. This class is intended for internal use only....
#define OBJECTSHAPE_SURFACE_FILETYPE_NONE
This file contains the Vector template class and some useful functions around this class.