GeoTessCPP
2.2
Software to facilitate storage and retrieval of 3D information about the Earth.
|
Relationships between vertices (2D positions in a tessellation), nodes (1D positions along a radial Profile) and points (3D positions in a model). More...
#include <GeoTessPointMap.h>
Public Member Functions | |
GeoTessPointMap (GeoTessModel &m) | |
Constructor. More... | |
GeoTessPointMap (GeoTessPointMap &other) | |
Copy constructor. More... | |
~GeoTessPointMap () | |
Destructor. More... | |
void | clear () |
Clears all the information in this pointMap and the pointIndex values of all nodes in the model. More... | |
double | getDistance3D (int pointIndex1, int pointIndex2) |
Retrieve the straight-line distance between two points in km. More... | |
int | getLayerIndex (int pointIndex) |
Retrieve the index of the layer that corresponds to the specified pointIndex. More... | |
LONG_INT | getMemory () |
int | getNodeIndex (int pointIndex) |
Retrieve the index of the node that corresponds to the specified pointIndex. More... | |
GeoTessData * | getPointData (int pointIndex) |
Retrieve a reference to the Data object associated with the specified point. More... | |
double | getPointDepth (int pointIndex) |
Retrieve the radius of the specified point. More... | |
int | getPointIndex (int vertex, int layer, int node) |
Retrieve the pointIndex of the point that corresponds to the specified vertex, layer and node. More... | |
int | getPointIndexFirst (int vertex, int layer) |
Retrieve the pointIndex of the point that corresponds to the first node in profile[vertex][layer]. More... | |
int | getPointIndexLast (int vertex, int layer) |
Retrieve the pointIndex of the point that corresponds to the last node in profile[vertex][layer]. More... | |
const vector< int > & | getPointIndices (int pointIndex) |
Retrieve a reference to the index map for the specified pointIndex. More... | |
string | getPointLatLonString (int pointIndex) |
Retrieve nicely formated string with lat, lon of the point in degrees. More... | |
void | getPointNeighbors (set< int > &pointNeighbors, int pointIndex) |
Append the input new values array to the profile at pointIndex. More... | |
double | getPointRadius (int pointIndex) |
Retrieve the radius of the specified point. More... | |
const double * | getPointUnitVector (int pointIndex) const |
Retrieve a reference to the unit vector for the specified point. More... | |
double | getPointValue (int pointIndex, int attributeIndex) |
Retrieve the value of the specified attribute at the specified point. More... | |
byte | getPointValueByte (int pointIndex, int attributeIndex) |
Retrieve the value of the specified attribute at the specified point cast to byte if necessary. More... | |
double | getPointValueDouble (int pointIndex, int attributeIndex) |
Retrieve the value of the specified attribute at the specified point cast to double if necessary. More... | |
float | getPointValueFloat (int pointIndex, int attributeIndex) |
Retrieve the value of the specified attribute at the specified point cast to float if necessary. More... | |
int | getPointValueInt (int pointIndex, int attributeIndex) |
Retrieve the value of the specified attribute at the specified point cast to int if necessary. More... | |
LONG_INT | getPointValueLong (int pointIndex, int attributeIndex) |
Retrieve the value of the specified attribute at the specified point cast to LONG_INT if necessary. More... | |
short | getPointValueShort (int pointIndex, int attributeIndex) |
Retrieve the value of the specified attribute at the specified point cast to short if necessary. More... | |
void | getPointVector (int pointIndex, double *v) |
Retrieve a vector representation of the specified point (not a unit vector). More... | |
GeoTessPolygon * | getPolygon () |
Retrieve the pointer to the Polygon or Polygon3D object that supports this PointMap. More... | |
int | getTessId (int pointIndex) |
Retrieve the index of the tessellation that corresponds to the specified pointIndex. More... | |
int | getVertexIndex (int pointIndex) |
Retrieve the index of the vertex that corresponds to the specified pointIndex. More... | |
bool | isNaN (int pointIndex, int attributeIndex) |
Return true if the value of the specified attribute at the specified point is NaN. More... | |
bool | isPopulated () |
Determine whether or not this PointMap is populated. More... | |
bool | operator!= (const GeoTessPointMap &other) |
Overloaded inequality operator. More... | |
GeoTessPointMap & | operator= (const GeoTessPointMap &other) |
Overloaded assignment operator. More... | |
bool | operator== (const GeoTessPointMap &other) |
Overloaded equality operator. More... | |
void | setActiveRegion () |
Populates the PointMap such that every node in the entire model is within the active region. More... | |
void | 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. More... | |
void | setActiveRegion (const string &polygonFileName) |
Populate the PointMap such that nodes located within the specified Polygon are active and all others are inactive. More... | |
void | setPointData (int pointIndex, GeoTessData *data) |
Replace the Data object associated with the specified point. More... | |
template<typename T > | |
void | setPointValue (int pointIndex, int attributeIndex, T value) |
Set the value of the specified attribute at the specified point to the specified value. More... | |
int | size () |
Retrieve the number of points supported by this model. More... | |
string | toString (int pointIndex) |
Retrieve a nicely formated string with lat, lon, depth of the point in degrees and km. More... | |
Relationships between vertices (2D positions in a tessellation), nodes (1D positions along a radial Profile) and points (3D positions in a model).
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).
geotess::GeoTessPointMap::GeoTessPointMap | ( | GeoTessModel & | m | ) |
Constructor.
PointMap is initialized but not populated by this method.
geotess::GeoTessPointMap::GeoTessPointMap | ( | GeoTessPointMap & | other | ) |
Copy constructor.
geotess::GeoTessPointMap::~GeoTessPointMap | ( | ) |
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.
|
inline |
Retrieve the straight-line distance between two points in km.
pointIndex1 | |
pointIndex2 |
|
inline |
Retrieve the index of the layer that corresponds to the specified pointIndex.
pointIndex |
|
inline |
|
inline |
Retrieve the index of the node that corresponds to the specified pointIndex.
Nodes refer to Data object, not radii.
pointIndex |
|
inline |
Retrieve a reference to the Data object associated with the specified point.
pointIndex |
|
inline |
Retrieve the radius of the specified point.
pointIndex |
|
inline |
Retrieve the pointIndex of the point that corresponds to the specified vertex, layer and node.
vertex | |
layer | |
node |
|
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 |
|
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 |
|
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 |
|
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.
}
|
inline |
Retrieve the radius of the specified point.
pointIndex |
|
inline |
Retrieve a reference to the unit vector for the specified point.
pointIndex |
|
inline |
Retrieve the value of the specified attribute at the specified point.
pointIndex | |
attributeIndex |
|
inline |
Retrieve the value of the specified attribute at the specified point cast to byte if necessary.
pointIndex | |
attributeIndex |
|
inline |
Retrieve the value of the specified attribute at the specified point cast to double if necessary.
pointIndex | |
attributeIndex |
|
inline |
Retrieve the value of the specified attribute at the specified point cast to float if necessary.
pointIndex | |
attributeIndex |
|
inline |
Retrieve the value of the specified attribute at the specified point cast to int if necessary.
pointIndex | |
attributeIndex |
|
inline |
Retrieve the value of the specified attribute at the specified point cast to LONG_INT if necessary.
pointIndex | |
attributeIndex |
|
inline |
Retrieve the value of the specified attribute at the specified point cast to short if necessary.
pointIndex | |
attributeIndex |
|
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 |
|
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.
|
inline |
Retrieve the index of the tessellation that corresponds to the specified pointIndex.
pointIndex |
|
inline |
Retrieve the index of the vertex that corresponds to the specified pointIndex.
pointIndex |
|
inline |
Return true if the value of the specified attribute at the specified point is NaN.
pointIndex | |
attributeIndex |
|
inline |
Determine whether or not this PointMap is populated.
|
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.
void geotess::GeoTessPointMap::setActiveRegion | ( | ) |
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 |
|
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. |
|
inline |
Replace the Data object associated with the specified point.
|
inline |
Set the value of the specified attribute at the specified point to the specified value.
pointIndex | |
attributeIndex | |
value |
|
inline |
Retrieve the number of points supported by this model.
|
inline |
Retrieve a nicely formated string with lat, lon, depth of the point in degrees and km.
pointIndex |