SLBM: slbm::Triangle Class Reference

SLBM 3.0 Regional Seismic Travel Time

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

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...
Triangle & | operator= (const Triangle &other)
| Equal operator. More...
int | getIndex ()
GridProfile * | getNode (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)
Triangle * | getNeighbor (const int &i)
Triangle * | walk (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
GridProfile * | nodes [3]
Triangle * | neighbors [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

  neighbor | Triangle

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

  i | the 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

  position | GeoVector
  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:

- /nfs/tonto2/devlpool/sballar/RSTT/SLBM_Root.3.0.5/install/SLBM_Root.3.0.5.Linux/SLBM/include/Triangle.h