ESyS-Particle  2.3.4
Edge Class Reference

Class representing the edge of a polygon. More...

#include <Edge.h>

Inheritance diagram for Edge:
Collaboration diagram for Edge:

Public Member Functions

 Edge (int, int, const Vec3 &, const Vec3 &)
 
 Edge (int, int, const Vec3 &, const Vec3 &, Triangle *)
 
 Edge (int, int, const Vec3 &, const Vec3 &, Triangle *, Triangle *)
 
bool isValidContact (const Vec3 &) const
 
Vec3 getBoundingBoxMin () const
 
Vec3 getBoundingBoxMax () const
 
Vec3 getDirectionFromPoint (const Vec3 &) const
 
void moveNode (int, const Vec3 &)
 
void move (const Vec3 &)
 
void applyForce (const Vec3 &f)
 
pair< int, int > getIDs () const
 
- Public Member Functions inherited from AEdge
 AEdge (const Vec3 &, const Vec3 &)
 
virtual ~AEdge ()
 
double sep (const Vec3 &) const
 
pair< bool, double > dist (const Vec3 &) const
 
Vec3 getBoundingBoxMin () const
 
Vec3 getBoundingBoxMax () const
 

Private Attributes

Trianglem_t1
 
Trianglem_t2
 
int m_id1
 
int m_id2
 

Friends

ostream & operator<< (ostream &, const Edge &)
 

Additional Inherited Members

- Protected Attributes inherited from AEdge
Vec3 m_p0
 
Vec3 m_p1
 

Detailed Description

Class representing the edge of a polygon.

Author
Steffen Abe $Revision$ $Date$

Constructor & Destructor Documentation

◆ Edge() [1/3]

Edge::Edge ( int  id1,
int  id2,
const Vec3 p1,
const Vec3 p2 
)

Construct edge from 2 points. Set triangle pointers to NULL

Parameters
id1the id of p1
id2the id of p2
p1
p2

References m_id1, m_id2, m_t1, m_t2, and NULL.

◆ Edge() [2/3]

Edge::Edge ( int  id1,
int  id2,
const Vec3 p1,
const Vec3 p2,
Triangle t1 
)

Construct edge from 2 points and 1 triangle pointer. Set other triangle pointer to NULL

Parameters
id1the id of p1
id2the id of p2
p1
p2
t1

References m_id1, m_id2, m_t1, m_t2, and NULL.

◆ Edge() [3/3]

Edge::Edge ( int  id1,
int  id2,
const Vec3 p1,
const Vec3 p2,
Triangle t1,
Triangle t2 
)

Construct edge from 2 points and 2 triangle pointers.

Parameters
id1the id of p1
id2the id of p2
p1
p2
t1
t2

References m_id1, m_id2, m_t1, and m_t2.

Member Function Documentation

◆ applyForce()

void Edge::applyForce ( const Vec3 f)

References Triangle::applyForce(), m_t1, m_t2, and NULL.

Referenced by EEdgeInteraction::calcForces().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getBoundingBoxMax()

Vec3 Edge::getBoundingBoxMax ( ) const

Get min. corner of axis-aligned bounding box.

References cmax(), AEdge::m_p0, and AEdge::m_p1.

Here is the call graph for this function:

◆ getBoundingBoxMin()

Vec3 Edge::getBoundingBoxMin ( ) const

Get min. corner of axis-aligned bounding box.

References cmin(), AEdge::m_p0, and AEdge::m_p1.

Here is the call graph for this function:

◆ getDirectionFromPoint()

Vec3 Edge::getDirectionFromPoint ( const Vec3 p) const

get unit direction vector between a point and the closest point along the supporting line of the edge (pointing away from the edge).

Parameters
pthe point
Warning
does not check if the closest point is actually within the edge or that the point is not on the line (potential div by 0)

References AEdge::m_p0, AEdge::m_p1, and Vec3::unit().

Referenced by EEdgeInteraction::calcForces().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getIDs()

pair<int,int> Edge::getIDs ( ) const
inline

References m_id1, and m_id2.

◆ isValidContact()

bool Edge::isValidContact ( const Vec3 P) const

Check if any of the adjacent triangles (if there are any) has contact, i.e the perpendicular line from the supporting plane to the point hits the triangle, an thus makes the edge contact invalid

Parameters
Pthe point

References Triangle::dist(), m_t1, m_t2, and NULL.

Referenced by EEdgeInteraction::calcForces().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ move()

void Edge::move ( const Vec3 d)

Translate whole edge

Parameters
dthe amount of movement

References AEdge::m_p0, and AEdge::m_p1.

◆ moveNode()

void Edge::moveNode ( int  id,
const Vec3 d 
)

Move one of the corners. The identifier for the corner is the global node id. If the edge doesn't contain the node with the id , do nothing.

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

References m_id1, m_id2, AEdge::m_p0, and AEdge::m_p1.

Friends And Related Function Documentation

◆ operator<<

ostream& operator<< ( ostream &  ost,
const Edge E 
)
friend

output Edge to ostream

Member Data Documentation

◆ m_id1

int Edge::m_id1
private

Referenced by Edge(), getIDs(), and moveNode().

◆ m_id2

int Edge::m_id2
private

Referenced by Edge(), getIDs(), and moveNode().

◆ m_t1

Triangle* Edge::m_t1
private

◆ m_t2

Triangle * Edge::m_t2
private

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