public |
Inheritance Graph
graph BT
Tetrahedron
click Tetrahedron "classGeometry_1_1Tetrahedron"
Description
Tetrahedron defined by four vertices.
Author: Benjamin Eikel, Claudius Jähn
Date: 2011-12-03
* b
* /|\
* / | \
* / | - -\--- pA
* / pD | pC \
* c- - - -|- - - -d
* \ | /
* \ | - - /----- pB
* \ | /
* \| /
* a
*
Creation
Tetrahedron() Default constructor. |
|
Tetrahedron(const vec3_t & vertexA, const vec3_t & vertexB, const vec3_t & vertexC, const vec3_t & vertexD) Default constructor with vertices. |
Operators
bool | operator==(const Tetrahedron & other) const Equality operator. |
Information
const vec3_t & | getVertexA() const Return the first vertex. |
const vec3_t & | getVertexB() const Return the second vertex. |
const vec3_t & | getVertexC() const Return the third vertex. |
const vec3_t & | getVertexD() const Return the fourth vertex. |
Triangle < vec3_t > | getFaceA() const Return the first face. |
Triangle < vec3_t > | getFaceB() const Return the second face. |
Triangle < vec3_t > | getFaceC() const Return the third face. |
Triangle < vec3_t > | getFaceD() const Return the fourth face. |
const _Plane < value_t > & | getPlaneA() const Return the first plane. |
const _Plane < value_t > & | getPlaneB() const Return the second plane. |
const _Plane < value_t > & | getPlaneC() const Return the third plane. |
const _Plane < value_t > & | getPlaneD() const Return the fourth plane. |
Modification
void | setVertexA(const vec3_t & v) Assign the first vertex. |
void | setVertexB(const vec3_t & v) Assign the second vertex. |
void | setVertexC(const vec3_t & v) Assign the third vertex. |
void | setVertexD(const vec3_t & v) Assign the fourth vertex. |
Calculation
std::pair< bool, vec4_t > | calcBarycentricCoordinates(const vec3_t & _p) const |
vec3_t | calcPointFromBarycentricCoordinates(const vec4_t & bary) const |
float | calcVolume() const |
bool | containsPoint(const vec3_t & point, value_t epsilon) const |
value_t | distanceSquared(const vec3_t & point) const |
Serialization
Public Types
typedef T_ | value_t |
typedef _Vec3 < value_t > | vec3_t |
typedef _Vec4 < value_t > | vec4_t |
typedef _Matrix4x4 < value_t > | matrix4x4_t |
Documentation
function
Geometry::Tetrahedron::Tetrahedron
public | inline |
Tetrahedron( | ) |
Default constructor.
Defined in Geometry/Tetrahedron.h:82
function
Geometry::Tetrahedron::Tetrahedron
public | inline |
Tetrahedron( | const vec3_t & | vertexA, |
const vec3_t & | vertexB, | |
const vec3_t & | vertexC, | |
const vec3_t & | vertexD | |
) |
Default constructor with vertices.
Defined in Geometry/Tetrahedron.h:86
function
Geometry::Tetrahedron::operator==
public | const | inline |
bool operator==( | const Tetrahedron & | other ) const |
Equality operator.
Defined in Geometry/Tetrahedron.h:95
function
Geometry::Tetrahedron::getVertexA
public | const | inline |
const vec3_t & getVertexA( | ) const |
Return the first vertex.
Defined in Geometry/Tetrahedron.h:104
function
Geometry::Tetrahedron::getVertexB
public | const | inline |
const vec3_t & getVertexB( | ) const |
Return the second vertex.
Defined in Geometry/Tetrahedron.h:108
function
Geometry::Tetrahedron::getVertexC
public | const | inline |
const vec3_t & getVertexC( | ) const |
Return the third vertex.
Defined in Geometry/Tetrahedron.h:112
function
Geometry::Tetrahedron::getVertexD
public | const | inline |
const vec3_t & getVertexD( | ) const |
Return the fourth vertex.
Defined in Geometry/Tetrahedron.h:116
function
Geometry::Tetrahedron::getFaceA
public | const | inline |
Triangle < vec3_t > getFaceA( | ) const |
Return the first face.
Defined in Geometry/Tetrahedron.h:121
function
Geometry::Tetrahedron::getFaceB
public | const | inline |
Triangle < vec3_t > getFaceB( | ) const |
Return the second face.
Defined in Geometry/Tetrahedron.h:125
function
Geometry::Tetrahedron::getFaceC
public | const | inline |
Triangle < vec3_t > getFaceC( | ) const |
Return the third face.
Defined in Geometry/Tetrahedron.h:129
function
Geometry::Tetrahedron::getFaceD
public | const | inline |
Triangle < vec3_t > getFaceD( | ) const |
Return the fourth face.
Defined in Geometry/Tetrahedron.h:133
function
Geometry::Tetrahedron::getPlaneA
public | const | inline |
const _Plane < value_t > & getPlaneA( | ) const |
Return the first plane.
Defined in Geometry/Tetrahedron.h:138
function
Geometry::Tetrahedron::getPlaneB
public | const | inline |
const _Plane < value_t > & getPlaneB( | ) const |
Return the second plane.
Defined in Geometry/Tetrahedron.h:142
function
Geometry::Tetrahedron::getPlaneC
public | const | inline |
const _Plane < value_t > & getPlaneC( | ) const |
Return the third plane.
Defined in Geometry/Tetrahedron.h:146
function
Geometry::Tetrahedron::getPlaneD
public | const | inline |
const _Plane < value_t > & getPlaneD( | ) const |
Return the fourth plane.
Defined in Geometry/Tetrahedron.h:150
function
Geometry::Tetrahedron::setVertexA
public | inline |
void setVertexA( | const vec3_t & | v ) |
Assign the first vertex.
Defined in Geometry/Tetrahedron.h:158
function
Geometry::Tetrahedron::setVertexB
public | inline |
void setVertexB( | const vec3_t & | v ) |
Assign the second vertex.
Defined in Geometry/Tetrahedron.h:163
function
Geometry::Tetrahedron::setVertexC
public | inline |
void setVertexC( | const vec3_t & | v ) |
Assign the third vertex.
Defined in Geometry/Tetrahedron.h:168
function
Geometry::Tetrahedron::setVertexD
public | inline |
void setVertexD( | const vec3_t & | v ) |
Assign the fourth vertex.
Defined in Geometry/Tetrahedron.h:173
function
Geometry::Tetrahedron::calcBarycentricCoordinates
public | const | inline |
std::pair< bool, vec4_t > calcBarycentricCoordinates( | const vec3_t & | _p ) const |
Calculate the barycentric coordinates of the given pointpwith reference to this tetrahedron.
Parameters
- p
- Position in Cartesian coordinates that should be converted to barycentric coordinates
Returns
pair(success as bool,Barycentric coordinates as vec4) success is false, iff the tetrahedron is degenerated.
See also: http://steve.hollasch.net/cgindex/geometry/ptintet.html
Defined in Geometry/Tetrahedron.h:190
function
Geometry::Tetrahedron::calcPointFromBarycentricCoordinates
public | const | inline |
vec3_t calcPointFromBarycentricCoordinates( | const vec4_t & | bary ) const |
Defined in Geometry/Tetrahedron.h:208
function
Geometry::Tetrahedron::calcVolume
public | const | inline |
float calcVolume( | ) const |
Returns the volume of the tetrahedron.
Returns
The volume.
Defined in Geometry/Tetrahedron.h:217
function
Geometry::Tetrahedron::containsPoint
public | const | inline |
bool containsPoint( | const vec3_t & | point, |
value_t | epsilon | |
) const |
Check if the given point is inside, or on the surface of this tetrahedron.
Parameters
- point
- Query position
- epsilon
- Safety margin around the tetrahedron that is still considered to be inside. Set this to zero, if you do not want to have a safety margin.
Returns
true
if the point is inside or on the surface,false
if it is outside
Defined in Geometry/Tetrahedron.h:232
function
Geometry::Tetrahedron::distanceSquared
public | const | inline |
value_t distanceSquared( | const vec3_t & | point ) const |
Calculate the minimum squared distance of the point to the tetrahedron. If the point is inside or on the surface of the tetrahedron, the distance will be zero.
Parameters
- point
- Query position
Returns
Minimum squared distance of the point to the tetrahedron
Defined in Geometry/Tetrahedron.h:244
typedef
Geometry::Tetrahedron::value_t
public |
typedef T_ value_t |
Defined in Geometry/Tetrahedron.h:47
typedef
Geometry::Tetrahedron::vec3_t
public |
typedef _Vec3 < value_t > vec3_t |
Defined in Geometry/Tetrahedron.h:48
typedef
Geometry::Tetrahedron::vec4_t
public |
typedef _Vec4 < value_t > vec4_t |
Defined in Geometry/Tetrahedron.h:49
typedef
Geometry::Tetrahedron::matrix4x4_t
public |
typedef _Matrix4x4 < value_t > matrix4x4_t |
Defined in Geometry/Tetrahedron.h:50