136 void findNodeNeighbors(
const int& node0, set<int>& neighborNodes);
145 int findNeighborIndex(
Triangle* neighbor);
155 void findNodeNeighbors(
const int& node0,
156 set<int>& neighborNodes,
157 set<Triangle*> visitedTriangles);
170 if (coeff[i] > 1e-15)
175 return neighbors[j]->walk(position, coeff);
183 if (coeff[i] > 0.) coeff[i] = 0.;
193 inline void Triangle::findNodeNeighbors(
const int& node0, set<int>& neighborNodes)
195 set<Triangle*> visitedTriangles;
196 findNodeNeighbors(node0, neighborNodes, visitedTriangles);
199 inline void Triangle::findNodeNeighbors(
const int& node0, set<int>& neighborNodes,
200 set<Triangle*> visitedTriangles)
202 visitedTriangles.insert(
this);
204 for (
int i=0; i<3; i++)
210 if (nodes[i]->getNodeId() == node0)
212 for (
int j=0; j<3; j++)
213 if (nodes[j]->getNodeId() != node0)
214 neighborNodes.insert(nodes[j]->getNodeId());
215 for (
int j=0; j<3; j++)
216 if (visitedTriangles.find(neighbors[j]) == visitedTriangles.end())
217 neighbors[j]->findNodeNeighbors(node0, neighborNodes, visitedTriangles);
222 inline int Triangle::findNeighborIndex(
Triangle* neighbor)
224 for (
int i=0; i<3; i++)
Manages all information related to a single node in a Grid object.
The Location Class manages a single point in/on the Earth, which is described by the GRS80 ellipsoid.
double scalarTripleProduct(const Location &loc1, const Location &loc2) const
~Triangle()
Default destructor.
GridProfile * getNode(const int &i)
Retrieve a handle to one of the 3 nodes that defines the corners of this triangle.
Triangle(const int &index, GridProfile *loc0, GridProfile *loc1, GridProfile *loc2)
void setNeighbor(const int &i, Triangle *neighbor)
Triangle * getNeighbor(const int &i)
Triangle(const Triangle &other)
Copy constructor.
Triangle()
Default constructor.
Triangle & operator=(const Triangle &other)
Equal operator.