SLBM  3.0
Regional Seismic Travel Time
Public Member Functions | Private Member Functions | Private Attributes | List of all members
slbm::Triangle Class Reference

#include <Triangle.h>

Public Member Functions

 Triangle ()
 Default constructor. More...
 
 Triangle (const int &index, GridProfile *loc0, GridProfile *loc1, GridProfile *loc2)
 
 ~Triangle ()
 Default destructor. More...
 
 Triangle (const Triangle &other)
 Copy constructor. More...
 
Triangleoperator= (const Triangle &other)
 Equal operator. More...
 
int getIndex ()
 
GridProfilegetNode (const int &i)
 Retrieve a handle to one of the 3 nodes that defines the corners of this triangle. More...
 
void setNeighbor (const int &i, Triangle *neighbor)
 
TrianglegetNeighbor (const int &i)
 
Trianglewalk (const Location &position, vector< double > &coefficients)
 
void findNodeNeighbors (const int &node0, set< int > &neighborNodes)
 Find the set of all nodes that are directly connected to node node0. More...
 
int findNeighborIndex (Triangle *neighbor)
 

Private Member Functions

void findNodeNeighbors (const int &node0, set< int > &neighborNodes, set< Triangle * > visitedTriangles)
 

Private Attributes

int index
 
GridProfilenodes [3]
 
Triangleneighbors [3]
 

Constructor & Destructor Documentation

slbm::Triangle::Triangle ( )

Default constructor.

slbm::Triangle::Triangle ( const int &  index,
GridProfile loc0,
GridProfile loc1,
GridProfile loc2 
)
slbm::Triangle::~Triangle ( )

Default destructor.

slbm::Triangle::Triangle ( const Triangle other)

Copy constructor.

Member Function Documentation

int slbm::Triangle::findNeighborIndex ( Triangle neighbor)
inline

If this triangle is triangle T with neighbor N, it must be true that T is one of N's neighbors. Return the index of triangle T in N's list of neighbors. Returns -1 if T is not a member of N's list of neighbors.

Parameters
neighborTriangle
Returns
int
void slbm::Triangle::findNodeNeighbors ( const int &  node0,
set< int > &  neighborNodes 
)
inline

Find the set of all nodes that are directly connected to nodenode0. It is assumed that the node with nodeId node0 ise on of the corners of this Triangle. This method will search all this Triangle's neighbors (and their neighbors if necessary) and add all nodes that are directly linked to node0 to the set neighborNodes.

void slbm::Triangle::findNodeNeighbors ( const int &  node0,
set< int > &  neighborNodes,
set< Triangle * >  visitedTriangles 
)
inlineprivate
int slbm::Triangle::getIndex ( )
inline
Triangle* slbm::Triangle::getNeighbor ( const int &  i)
inline

Retrieve a reference to the triangle which lies on the other side of the edge of this triangle defined by nodes i and (i+1)%3

Retrieve a reference to the triangle which lies on the other side of the edge of this triangle defined by nodes i and (i+1)%3

GridProfile* slbm::Triangle::getNode ( const int &  i)
inline

Retrieve a handle to one of the 3 nodes that defines the corners of this triangle.

Parameters
ithe index of the desired node. Must be in range 0 to 2 inclusive.
Triangle& slbm::Triangle::operator= ( const Triangle other)

Equal operator.

void slbm::Triangle::setNeighbor ( const int &  i,
Triangle neighbor 
)
inline

Specify a reference to the triangle which lies on the other side of the edge of this triangle defined by nodes i and (i+1)%3

Specify a reference to the triangle which lies on the other side of the edge of this triangle defined by nodes i and (i+1)%3

Triangle * slbm::Triangle::walk ( const Location position,
vector< double > &  coefficients 
)
inline

Search through this Triangle's neighbors and find the first one such that Location position is on the other side of the great circle that contains the edge that separates this Triangle from its neighbor. If no such triangle is identified, then position must reside within the boundaries of this triangle. In that case, compute the interpolation coefficients.

Parameters
positionGeoVector
coefficients
Returns
Triangle

Member Data Documentation

int slbm::Triangle::index
private
Triangle* slbm::Triangle::neighbors[3]
private
GridProfile* slbm::Triangle::nodes[3]
private

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