|
GOAT (Geometrical optics application tool) 0.1
|
This class describes a triangle, represented by its corner points. It is intented for internal purposes. The triangle class is mainly used in class surface. More...
#include <triangle.h>
Public Member Functions | |
| double | area () |
| void | binRead (std::ifstream &is) |
| void | binWrite (std::ofstream &os) |
| int | calcIntersectionPoint (maths::Vector< double > r, maths::Vector< double > k, double &t, maths::Vector< double > &p, double eps=1E-5) |
| int | calcIntersectionPoint (maths::Vector< double > r, maths::Vector< double > k, maths::Vector< double > &p, double eps=1E-5) |
| Calculates the intersection point between the triangle and a straight line represented by a point r and the direction vector k. | |
| void | calcSideVectors () |
| double | distance (maths::Vector< double > p, maths::Vector< double > k) |
| maths::Vector< double > | getnorm (void) |
| returns the surface normal n | |
| triangle & | operator= (const triangle &dr) |
| Assignment operator. | |
| maths::Vector< double > & | operator[] (int i) |
| const maths::Vector< double > & | operator[] (int i) const |
| Operator, gives back the Position of i-th corner. | |
| void | setnorm (maths::Vector< double > n) |
| sets the surface normal n to the given value | |
| void | setnorm (void) |
| calculates the surface normal n with help of the corner points | |
| triangle () | |
| triangle (const triangle &d) | |
| Copy constructor. | |
| triangle (maths::Vector< double > ip1, maths::Vector< double > ip2, maths::Vector< double > ip3, maths::Vector< double > P) | |
| triangle (maths::Vector< double > P1, maths::Vector< double > P2, maths::Vector< double > P3) | |
| ~triangle () | |
| Destructor. | |
Public Attributes | |
| maths::Vector< double > | f [3] |
| vectors which represents the sides of the triangle. For details refer to function calcSideVectors() | |
| maths::Vector< double > | n |
| normal of the triangle | |
| maths::Vector< double > | P [3] |
| corner points of the triangle | |
| double | u |
| double | v |
| auxiliary variables for internal use | |
Friends | |
| class | surface |
This class describes a triangle, represented by its corner points. It is intented for internal purposes. The triangle class is mainly used in class surface.
Definition at line 12 of file triangle.h.
| GOAT::raytracing::triangle::triangle | ( | ) |
| GOAT::raytracing::triangle::triangle | ( | maths::Vector< double > | P1, |
| maths::Vector< double > | P2, | ||
| maths::Vector< double > | P3 ) |
Constructor of the class triangle
| P1,P2,P3 | : corner points of the triangle |
| GOAT::raytracing::triangle::triangle | ( | maths::Vector< double > | ip1, |
| maths::Vector< double > | ip2, | ||
| maths::Vector< double > | ip3, | ||
| maths::Vector< double > | P ) |
Constructor of the class triangle, the triangle is represented by a reference point and the three distance vectors between the reference point and the three corners of the triangle.
| P0 | reference point |
| ip1,ip2,ip3 | : Vectors from the reference point P0 to the corner points |
| GOAT::raytracing::triangle::triangle | ( | const triangle & | d | ) |
Copy constructor.
| GOAT::raytracing::triangle::~triangle | ( | ) |
Destructor.
|
inline |
this function returns the surface area of the triangle
Definition at line 23 of file triangle.h.
| void GOAT::raytracing::triangle::binRead | ( | std::ifstream & | is | ) |
| void GOAT::raytracing::triangle::binWrite | ( | std::ofstream & | os | ) |
| int GOAT::raytracing::triangle::calcIntersectionPoint | ( | maths::Vector< double > | r, |
| maths::Vector< double > | k, | ||
| double & | t, | ||
| maths::Vector< double > & | p, | ||
| double | eps = 1E-5 ) |
| int GOAT::raytracing::triangle::calcIntersectionPoint | ( | maths::Vector< double > | r, |
| maths::Vector< double > | k, | ||
| maths::Vector< double > & | p, | ||
| double | eps = 1E-5 ) |
Calculates the intersection point between the triangle and a straight line represented by a point r and the direction vector k.
| r | reference point on the straight line |
| k | direction vector of the straight line |
| p | intersection point (return parameter) |
| eps | accuracy (optional) |
|
inline |
Definition at line 31 of file triangle.h.
| double GOAT::raytracing::triangle::distance | ( | maths::Vector< double > | p, |
| maths::Vector< double > | k ) |
| maths::Vector< double > GOAT::raytracing::triangle::getnorm | ( | void | ) |
returns the surface normal n
| maths::Vector< double > & GOAT::raytracing::triangle::operator[] | ( | int | i | ) |
This operator returns the i-th corner point of the triangle
| i |
| const maths::Vector< double > & GOAT::raytracing::triangle::operator[] | ( | int | i | ) | const |
Operator, gives back the Position of i-th corner.
This operator returns the i-th corner point of the triangle
| i |
|
inline |
sets the surface normal n to the given value
Definition at line 49 of file triangle.h.
| void GOAT::raytracing::triangle::setnorm | ( | void | ) |
calculates the surface normal n with help of the corner points
|
friend |
Definition at line 81 of file triangle.h.
| maths::Vector<double> GOAT::raytracing::triangle::f[3] |
vectors which represents the sides of the triangle. For details refer to function calcSideVectors()
Definition at line 18 of file triangle.h.
| maths::Vector<double> GOAT::raytracing::triangle::n |
normal of the triangle
Definition at line 17 of file triangle.h.
| maths::Vector<double> GOAT::raytracing::triangle::P[3] |
corner points of the triangle
Definition at line 16 of file triangle.h.
| double GOAT::raytracing::triangle::u |
Definition at line 15 of file triangle.h.
| double GOAT::raytracing::triangle::v |
auxiliary variables for internal use
Definition at line 15 of file triangle.h.