|
ESyS-Particle
4.0.1
|
Class representing a Triangle. More...
#include <Triangle.h>
Public Types | |
| typedef Vec3(Triangle::* | VectorFieldFunction )() const |
| typedef double(Triangle::* | ScalarFieldFunction )() const |
Public Member Functions | |
| Triangle (int, int, int, const Vec3 &, const Vec3 &, const Vec3 &, int, int) | |
| double | sep (const Vec3 &) const |
| pair< bool, double > | dist (const Vec3 &) const |
| Vec3 | getBoundingBoxMin () const |
| Vec3 | getBoundingBoxMax () const |
| Vec3 | getNormal () const |
| Vec3 | toGlobal (const Vec3 &) |
| Vec3 | toLocal (const Vec3 &) |
| bool | containsEdge (const Vec3 &, const Vec3 &) const |
| void | moveNode (int, const Vec3 &) |
| void | move (const Vec3 &) |
| int | getID () |
| void | applyForce (const Vec3 &f) |
| void | zeroForce () |
| pair< int, Vec3 > | getP0 () const |
| pair< int, Vec3 > | getP1 () const |
| pair< int, Vec3 > | getP2 () const |
| Vec3 | getForce () const |
| double | getPressure () const |
Static Public Member Functions | |
| static VectorFieldFunction | getVectorFieldFunction (const string &) |
| static ScalarFieldFunction | getScalarFieldFunction (const string &) |
Friends | |
| ostream & | operator<< (ostream &, const Triangle &) |
| output for debugging purposes | |
Class representing a Triangle.
| Triangle::Triangle | ( | int | id0, |
| int | id1, | ||
| int | id2, | ||
| const Vec3 & | v0, | ||
| const Vec3 & | v1, | ||
| const Vec3 & | v2, | ||
| int | tri_id, | ||
| int | tag | ||
| ) |
Construct triangle from the corner coordinates. It is assumed that the corners are given anticlockwise and the normal is calculated accordingly.
| id0 | id of the first corner |
| id1 | id of the 2nd corner |
| id2 | id of the 3rd corner |
| v0 | first corner |
| v1 | second corner |
| v2 | third corner |
| tri_id | triangle id |
| tag | triangle tag |
References Matrix3::inv().

| bool Triangle::containsEdge | ( | const Vec3 & | p1, |
| const Vec3 & | p2 | ||
| ) | const |
check if an edge given by 2 points is in the triangle
| p1 | |
| p2 |
| pair< bool, double > Triangle::dist | ( | const Vec3 & | p | ) | const |
Get the signed distance between a point and the triangle. If the closest point on the supporting plane is outside the triangle, the first component of the return value is "false", otherwise "true"
| p | the point |
Referenced by ETriangleInteraction::calcForces(), and Edge::isValidContact().

| Vec3 Triangle::getBoundingBoxMax | ( | ) | const |
Get max. corner of axis-aligned bounding box of the triangle.
| Vec3 Triangle::getBoundingBoxMin | ( | ) | const |
Get min. corner of axis-aligned bounding box of the triangle.
| double Triangle::getPressure | ( | ) | const |
Get pressure on the triangle from interaction forces
Referenced by getScalarFieldFunction().

| Triangle::ScalarFieldFunction Triangle::getScalarFieldFunction | ( | const string & | name | ) | [static] |
Get the triangle member function which returns a scalar field of a given name. Returns NULL if a field with that name doesn't exist.
| name | the name of the field |
References getPressure().
Referenced by TSubLattice< T >::addScalarTriangleField().


| Triangle::VectorFieldFunction Triangle::getVectorFieldFunction | ( | const string & | name | ) | [static] |
Get the triangle member function which returns a vector field of a given name. Returns NULL if a field with that name doesn't exist.
| name | the name of the field |
Referenced by TSubLattice< T >::addVectorTriangleField().

| void Triangle::move | ( | const Vec3 & | d | ) |
Move (translate) whole triangle.
| d | the amount of movement |
| void Triangle::moveNode | ( | int | id, |
| const Vec3 & | d | ||
| ) |
Move one of the corners. The identifier for the corner is the global node id. If the node with the id is not in the triangle, do nothing.
| id | the global id of the node to be moved |
| d | the amount of movement |
References Matrix3::inv().

| double Triangle::sep | ( | const Vec3 & | p | ) | const |
Get distance between point and the triangle.
| p | the point |
| Vec3 Triangle::toGlobal | ( | const Vec3 & | p | ) |
Transform a point in local coordinates into global coordiantes. The local coordinate systems is formed by (P1-P0,P2-P0,N).
| p | the point to be transformed |
Referenced by BTriangleInteraction::calcForces().

| Vec3 Triangle::toLocal | ( | const Vec3 & | p | ) |
Transform a point in global coordinates into local coordiantes. The local coordinate systems is formed by (P1-P0,P2-P0,N).
| p | the point to be transformed |
Referenced by BTriangleInteraction::BTriangleInteraction().

| ostream& operator<< | ( | ostream & | ost, |
| const Triangle & | T | ||
| ) | [friend] |
output for debugging purposes
output Triangle to ostream
1.7.6.1