GeoTessCPP
2.0.0
Software to facilitate storage and retrieval of 3D information about the Earth.
|
#include <GeoTessPointMap.h>
Public Member Functions | |
GeoTessPointMap (GeoTessModel &m) | |
GeoTessPointMap (GeoTessPointMap &other) | |
~GeoTessPointMap () | |
void | clear () |
double | getDistance3D (int pointIndex1, int pointIndex2) |
int | getLayerIndex (int pointIndex) |
int | getNodeIndex (int pointIndex) |
GeoTessData * | getPointData (int pointIndex) |
double | getPointDepth (int pointIndex) |
int | getPointIndex (int vertex, int layer, int node) |
int | getPointIndexFirst (int vertex, int layer) |
int | getPointIndexLast (int vertex, int layer) |
const vector< int > & | getPointIndices (int pointIndex) |
string | getPointLatLonString (int pointIndex) |
void | getPointNeighbors (set< int > &pointNeighbors, int pointIndex) |
double | getPointRadius (int pointIndex) |
const double * | getPointUnitVector (int pointIndex) const |
double | getPointValue (int pointIndex, int attributeIndex) |
void | getPointVector (int pointIndex, double *v) |
GeoTessPolygon * | getPolygon () |
int | getTessId (int pointIndex) |
int | getVertexIndex (int pointIndex) |
bool | isNaN (int pointIndex, int attributeIndex) |
bool | isPopulated () |
bool | operator!= (const GeoTessPointMap &other) |
GeoTessPointMap & | operator= (const GeoTessPointMap &other) |
bool | operator== (const GeoTessPointMap &other) |
void | setActiveRegion () |
void | setActiveRegion (GeoTessPolygon *polygon) |
void | setActiveRegion (const string &polygonFileName) |
void | setPointData (int pointIndex, GeoTessData *data) |
template<typename T > | |
void | setPointValue (int pointIndex, int attributeIndex, T value) |
int | size () |
string | toString (int pointIndex) |
Class that manages relationships between vertices (2D positions in a tessellation), nodes (1D positions along a radial Profile) and points (3D positions in a model).
Constructor. PointMap is initialized but not populated by this method.
Copy constructor.
Destructor.
void geotess::GeoTessPointMap::clear | ( | ) |
Clears all the information in this pointMap and the pointIndex values of all nodes in the model. Following this call, isPopulated() will return false. The pointIndex values in all model nodes and profiles will be set to -1.
double geotess::GeoTessPointMap::getDistance3D | ( | int | pointIndex1, |
int | pointIndex2 | ||
) | [inline] |
Retrieve the straight-line distance between two points in km.
pointIndex1 | |
pointIndex2 |
int geotess::GeoTessPointMap::getLayerIndex | ( | int | pointIndex | ) | [inline] |
Retrieve the index of the layer that corresponds to the specified pointIndex.
pointIndex |
int geotess::GeoTessPointMap::getNodeIndex | ( | int | pointIndex | ) | [inline] |
Retrieve the index of the node that corresponds to the specified pointIndex. Nodes refer to Data object, not radii.
pointIndex |
GeoTessData* geotess::GeoTessPointMap::getPointData | ( | int | pointIndex | ) | [inline] |
Retrieve a reference to the Data object associated with the specified point.
pointIndex |
double geotess::GeoTessPointMap::getPointDepth | ( | int | pointIndex | ) | [inline] |
Retrieve the radius of the specified point.
pointIndex |
int geotess::GeoTessPointMap::getPointIndex | ( | int | vertex, |
int | layer, | ||
int | node | ||
) | [inline] |
Retrieve the pointIndex of the point that corresponds to the specified vertex, layer and node.
vertex | |
layer | |
node |
int geotess::GeoTessPointMap::getPointIndexFirst | ( | int | vertex, |
int | layer | ||
) | [inline] |
Retrieve the pointIndex of the point that corresponds to the first node in profile[vertex][layer]. The first node is the one with the smallest radius (i.e., the deepest node).
vertex | |
layer |
int geotess::GeoTessPointMap::getPointIndexLast | ( | int | vertex, |
int | layer | ||
) | [inline] |
Retrieve the pointIndex of the point that corresponds to the last node in profile[vertex][layer]. The last node is the one with the largest radius (i.e., the shallowest node).
vertex | |
layer |
const vector<int>& geotess::GeoTessPointMap::getPointIndices | ( | int | pointIndex | ) | [inline] |
Retrieve a reference to the index map for the specified pointIndex. This is a 3-element array consisting of 0:vertexIndex, 1:layerIndex, 2:nodeIndex.
pointIndex |
string geotess::GeoTessPointMap::getPointLatLonString | ( | int | pointIndex | ) | [inline] |
Retrieve nicely formated string with lat, lon of the point in degrees.
pointIndex |
void geotess::GeoTessPointMap::getPointNeighbors | ( | set< int > & | pointNeighbors, |
int | pointIndex | ||
) |
Append the input new values array to the profile at pointIndex Find all the points that are first-order neighbors of the specified point. First, find all the vertices that are first order neighbors of the vertex of the supplied point (vertices connected by a single triangle edge). For each of those vertices, find the Profile that occupies the same layer and find the index of the radius in that Profile that is closest to the radius of the supplied point. Build the set of all such node index values. Finally, convert the node indexes to point indexes. There will generally be 6 such points, but that number is not guaranteed.
Here is an example of using a HashSetInteger object:
import gov.sandia.gmp.util.containers.hash.sets.HashSetInteger;
import gov.sandia.gmp.util.containers.hash.sets.HashSetInteger.Iterator;
Iterator it = getPointNeighbors(pointIndex).iterator();
while (it.hasNext())
{
int pointIndex = it.next();
// do stuff with pointIndex.
}
double geotess::GeoTessPointMap::getPointRadius | ( | int | pointIndex | ) | [inline] |
Retrieve the radius of the specified point.
pointIndex |
const double* geotess::GeoTessPointMap::getPointUnitVector | ( | int | pointIndex | ) | const [inline] |
Retrieve a reference to the unit vector for the specified point.
pointIndex |
double geotess::GeoTessPointMap::getPointValue | ( | int | pointIndex, |
int | attributeIndex | ||
) | [inline] |
Retrieve the value of the specified attribute at the specified point.
pointIndex | |
attributeIndex |
void geotess::GeoTessPointMap::getPointVector | ( | int | pointIndex, |
double * | v | ||
) | [inline] |
Retrieve a vector representation of the specified point (not a unit vector). The length of the vector is in km. This is a new double[], not a reference to an existing variable.
pointIndex | |
v | (output) a vector representation of the specified point |
GeoTessPolygon* geotess::GeoTessPointMap::getPolygon | ( | ) | [inline] |
Retrieve the pointer to the Polygon or Polygon3D object that supports this PointMap. May be NULL.
Polygon implements referenceCounting so if you wish to retain a copy of this polygon, be sure to addReference() and delete it when you are done with it.
int geotess::GeoTessPointMap::getTessId | ( | int | pointIndex | ) | [inline] |
Retrieve the index of the tessellation that corresponds to the specified pointIndex.
pointIndex |
int geotess::GeoTessPointMap::getVertexIndex | ( | int | pointIndex | ) | [inline] |
Retrieve the index of the vertex that corresponds to the specified pointIndex.
pointIndex |
bool geotess::GeoTessPointMap::isNaN | ( | int | pointIndex, |
int | attributeIndex | ||
) | [inline] |
Return true if the value of the specified attribute at the specified point is NaN.
pointIndex | |
attributeIndex |
bool geotess::GeoTessPointMap::isPopulated | ( | ) | [inline] |
Determine whether or not this PointMap is populated.
bool geotess::GeoTessPointMap::operator!= | ( | const GeoTessPointMap & | other | ) | [inline] |
Overloaded inequality operator
GeoTessPointMap& geotess::GeoTessPointMap::operator= | ( | const GeoTessPointMap & | other | ) |
Overloaded assignment operator
bool geotess::GeoTessPointMap::operator== | ( | const GeoTessPointMap & | other | ) |
Overloaded equality operator. Throws and exception if other is not populated.
Populates the PointMap such that every node in the entire model is within the active region. The pointIndex value of every node in the model will be set a unique positive value.
void geotess::GeoTessPointMap::setActiveRegion | ( | GeoTessPolygon * | polygon | ) |
Populate the PointMap such that all nodes associated with Profiles attached to grid vertices that are within the 2D polygon are active. The pointIndex values of nodes within the polygon will be set to unique positive values. All nodes outside the polygon will have pointIndex values equal to -1.
polygon | a 2D Polygon object |
void geotess::GeoTessPointMap::setActiveRegion | ( | const string & | polygonFileName | ) | [inline] |
Populate the PointMap such that nodes located within the specified Polygon are active and all others are inactive. The pointIndex values of nodes within the polygon will be set to unique positive values. All nodes outside the polygon will have pointIndex values equal to -1.
polygonFileName | the name of a file that contains a 2D or 3D polygon. |
void geotess::GeoTessPointMap::setPointData | ( | int | pointIndex, |
GeoTessData * | data | ||
) | [inline] |
Replace the Data object associated with the specified point.
void geotess::GeoTessPointMap::setPointValue | ( | int | pointIndex, |
int | attributeIndex, | ||
T | value | ||
) | [inline] |
Set the value of the specified attribute at the specified point to the specified value.
pointIndex | |
attributeIndex | |
value |
int geotess::GeoTessPointMap::size | ( | ) | [inline] |
Retrieve the number of points supported by this model.
string geotess::GeoTessPointMap::toString | ( | int | pointIndex | ) | [inline] |
Retrieve a nicely formated string with lat, lon, depth of the point in degrees and km.
pointIndex |