ESyS-Particle  4.0.1
Public Types | Public Member Functions | Static Public Member Functions | Friends
Triangle Class Reference

Class representing a Triangle. More...

#include <Triangle.h>

List of all members.

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, Vec3getP0 () const
pair< int, Vec3getP1 () const
pair< int, Vec3getP2 () 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

Detailed Description

Class representing a Triangle.

Author:
Steffen Abe $Revision$ $$Date$

Constructor & Destructor Documentation

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.

Parameters:
id0id of the first corner
id1id of the 2nd corner
id2id of the 3rd corner
v0first corner
v1second corner
v2third corner
tri_idtriangle id
tagtriangle tag

References Matrix3::inv().

Here is the call graph for this function:


Member Function Documentation

bool Triangle::containsEdge ( const Vec3 p1,
const Vec3 p2 
) const

check if an edge given by 2 points is in the triangle

Parameters:
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"

Parameters:
pthe point

Referenced by ETriangleInteraction::calcForces(), and Edge::isValidContact().

Here is the caller graph for this function:

Get max. corner of axis-aligned bounding box of the triangle.

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().

Here is the caller graph for this function:

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.

Parameters:
namethe name of the field

References getPressure().

Referenced by TSubLattice< T >::addScalarTriangleField().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters:
namethe name of the field

Referenced by TSubLattice< T >::addVectorTriangleField().

Here is the caller graph for this function:

void Triangle::move ( const Vec3 d)

Move (translate) whole triangle.

Parameters:
dthe 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.

Parameters:
idthe global id of the node to be moved
dthe amount of movement

References Matrix3::inv().

Here is the call graph for this function:

double Triangle::sep ( const Vec3 p) const

Get distance between point and the triangle.

Parameters:
pthe 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).

Parameters:
pthe point to be transformed

Referenced by BTriangleInteraction::calcForces().

Here is the caller graph for this function:

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).

Parameters:
pthe point to be transformed

Referenced by BTriangleInteraction::BTriangleInteraction().

Here is the caller graph for this function:


Friends And Related Function Documentation

ostream& operator<< ( ostream &  ost,
const Triangle T 
) [friend]

output for debugging purposes

output Triangle to ostream


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