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>
|
| GeoTessPointMap (GeoTessModel &m) |
|
| GeoTessPointMap (GeoTessPointMap &other) |
|
GeoTessPointMap & | operator= (const GeoTessPointMap &other) |
|
bool | operator== (const GeoTessPointMap &other) |
|
bool | operator!= (const GeoTessPointMap &other) |
|
| ~GeoTessPointMap () |
|
LONG_INT | getMemory () |
|
void | setActiveRegion () |
|
void | setActiveRegion (GeoTessPolygon *polygon) |
|
void | setActiveRegion (const string &polygonFileName) |
|
GeoTessPolygon * | getPolygon () |
|
void | clear () |
|
bool | isPopulated () |
|
int | size () |
|
int | getVertexIndex (int pointIndex) |
|
int | getTessId (int pointIndex) |
|
int | getLayerIndex (int pointIndex) |
|
int | getNodeIndex (int pointIndex) |
|
const vector< int > & | getPointIndices (int pointIndex) |
|
int | getPointIndex (int vertex, int layer, int node) |
|
int | getPointIndexLast (int vertex, int layer) |
|
int | getPointIndexFirst (int vertex, int layer) |
|
void | setPointData (int pointIndex, GeoTessData *data) |
|
GeoTessData * | getPointData (int pointIndex) |
|
template<typename T > |
void | setPointValue (int pointIndex, int attributeIndex, T value) |
|
double | getPointValue (int pointIndex, int attributeIndex) |
|
double | getPointValueDouble (int pointIndex, int attributeIndex) |
|
float | getPointValueFloat (int pointIndex, int attributeIndex) |
|
LONG_INT | getPointValueLong (int pointIndex, int attributeIndex) |
|
int | getPointValueInt (int pointIndex, int attributeIndex) |
|
short | getPointValueShort (int pointIndex, int attributeIndex) |
|
byte | getPointValueByte (int pointIndex, int attributeIndex) |
|
bool | isNaN (int pointIndex, int attributeIndex) |
|
void | getPointVector (int pointIndex, double *v) |
|
const double * | getPointUnitVector (int pointIndex) const |
|
double | getPointRadius (int pointIndex) |
|
double | getPointDepth (int pointIndex) |
|
double | getDistance3D (int pointIndex1, int pointIndex2) |
|
void | getPointNeighbors (set< int > &pointNeighbors, int pointIndex) |
|
string | getPointLatLonString (int pointIndex) |
|
string | toString (int pointIndex) |
|
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).
Definition at line 74 of file GeoTessPointMap.h.
◆ GeoTessPointMap() [1/2]
geotess::GeoTessPointMap::GeoTessPointMap |
( |
GeoTessModel & |
m | ) |
|
Constructor. PointMap is initialized but not populated by this method.
◆ GeoTessPointMap() [2/2]
◆ ~GeoTessPointMap()
geotess::GeoTessPointMap::~GeoTessPointMap |
( |
| ) |
|
◆ clear()
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.
◆ getDistance3D()
double geotess::GeoTessPointMap::getDistance3D |
( |
int |
pointIndex1, |
|
|
int |
pointIndex2 |
|
) |
| |
|
inline |
Retrieve the straight-line distance between two points in km.
- Parameters
-
- Returns
- the straight-line distance between two points in km.
Definition at line 553 of file GeoTessPointMap.h.
◆ getLayerIndex()
int geotess::GeoTessPointMap::getLayerIndex |
( |
int |
pointIndex | ) |
|
|
inline |
Retrieve the index of the layer that corresponds to the specified pointIndex.
- Parameters
-
- Returns
- the index of the layer that corresponds to the specified pointIndex.
Definition at line 261 of file GeoTessPointMap.h.
◆ getMemory()
LONG_INT geotess::GeoTessPointMap::getMemory |
( |
| ) |
|
|
inline |
◆ getNodeIndex()
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.
- Parameters
-
- Returns
- the index of the node that corresponds to the specified pointIndex.
Definition at line 274 of file GeoTessPointMap.h.
◆ getPointData()
GeoTessData* geotess::GeoTessPointMap::getPointData |
( |
int |
pointIndex | ) |
|
|
inline |
Retrieve a reference to the Data object associated with the specified point.
- Parameters
-
- Returns
Definition at line 351 of file GeoTessPointMap.h.
◆ getPointDepth()
double geotess::GeoTessPointMap::getPointDepth |
( |
int |
pointIndex | ) |
|
|
inline |
Retrieve the radius of the specified point.
- Parameters
-
- Returns
- radius of specified point, in km.
Definition at line 538 of file GeoTessPointMap.h.
◆ getPointIndex()
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.
- Parameters
-
- Returns
- the pointIndex of the point that corresponds to the specified vertex, layer and node.
Definition at line 302 of file GeoTessPointMap.h.
◆ getPointIndexFirst()
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).
- Parameters
-
- Returns
- the pointIndex of the point that corresponds to the first node in profile[vertex][layer].
Definition at line 332 of file GeoTessPointMap.h.
◆ getPointIndexLast()
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).
- Parameters
-
- Returns
- the pointIndex of the point that corresponds to the last node in profile[vertex][layer].
Definition at line 317 of file GeoTessPointMap.h.
◆ getPointIndices()
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.
- Parameters
-
- Returns
- the index map for the specified pointIndex.
Definition at line 287 of file GeoTessPointMap.h.
◆ getPointLatLonString()
string geotess::GeoTessPointMap::getPointLatLonString |
( |
int |
pointIndex | ) |
|
|
inline |
Retrieve nicely formated string with lat, lon of the point in degrees.
- Parameters
-
- Returns
- string with lat, lon in degrees.
Definition at line 603 of file GeoTessPointMap.h.
◆ getPointNeighbors()
void geotess::GeoTessPointMap::getPointNeighbors |
( |
set< int > & |
pointNeighbors, |
|
|
int |
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.
}
◆ getPointRadius()
double geotess::GeoTessPointMap::getPointRadius |
( |
int |
pointIndex | ) |
|
|
inline |
Retrieve the radius of the specified point.
- Parameters
-
- Returns
- radius of specified point, in km.
Definition at line 526 of file GeoTessPointMap.h.
◆ getPointUnitVector()
const double* geotess::GeoTessPointMap::getPointUnitVector |
( |
int |
pointIndex | ) |
const |
|
inline |
Retrieve a reference to the unit vector for the specified point.
- Parameters
-
- Returns
- a reference to the unit vector for the specified point.
Definition at line 515 of file GeoTessPointMap.h.
◆ getPointValue()
double geotess::GeoTessPointMap::getPointValue |
( |
int |
pointIndex, |
|
|
int |
attributeIndex |
|
) |
| |
|
inline |
Retrieve the value of the specified attribute at the specified point.
- Parameters
-
pointIndex | |
attributeIndex | |
- Returns
- the value of the specified attribute at the specified point.
Definition at line 380 of file GeoTessPointMap.h.
◆ getPointValueByte()
byte geotess::GeoTessPointMap::getPointValueByte |
( |
int |
pointIndex, |
|
|
int |
attributeIndex |
|
) |
| |
|
inline |
Retrieve the value of the specified attribute at the specified point cast to byte if necessary.
- Parameters
-
pointIndex | |
attributeIndex | |
- Returns
- the value of the specified attribute at the specified point cast to byte if necessary.
Definition at line 470 of file GeoTessPointMap.h.
◆ getPointValueDouble()
double geotess::GeoTessPointMap::getPointValueDouble |
( |
int |
pointIndex, |
|
|
int |
attributeIndex |
|
) |
| |
|
inline |
Retrieve the value of the specified attribute at the specified point cast to double if necessary.
- Parameters
-
pointIndex | |
attributeIndex | |
- Returns
- the value of the specified attribute at the specified point cast to double if necessary.
Definition at line 395 of file GeoTessPointMap.h.
◆ getPointValueFloat()
float geotess::GeoTessPointMap::getPointValueFloat |
( |
int |
pointIndex, |
|
|
int |
attributeIndex |
|
) |
| |
|
inline |
Retrieve the value of the specified attribute at the specified point cast to float if necessary.
- Parameters
-
pointIndex | |
attributeIndex | |
- Returns
- the value of the specified attribute at the specified point cast to float if necessary.
Definition at line 410 of file GeoTessPointMap.h.
◆ getPointValueInt()
int geotess::GeoTessPointMap::getPointValueInt |
( |
int |
pointIndex, |
|
|
int |
attributeIndex |
|
) |
| |
|
inline |
Retrieve the value of the specified attribute at the specified point cast to int if necessary.
- Parameters
-
pointIndex | |
attributeIndex | |
- Returns
- the value of the specified attribute at the specified point cast to int if necessary.
Definition at line 440 of file GeoTessPointMap.h.
◆ getPointValueLong()
LONG_INT geotess::GeoTessPointMap::getPointValueLong |
( |
int |
pointIndex, |
|
|
int |
attributeIndex |
|
) |
| |
|
inline |
Retrieve the value of the specified attribute at the specified point cast to LONG_INT if necessary.
- Parameters
-
pointIndex | |
attributeIndex | |
- Returns
- the value of the specified attribute at the specified point cast to LONG_INT if necessary.
Definition at line 425 of file GeoTessPointMap.h.
◆ getPointValueShort()
short geotess::GeoTessPointMap::getPointValueShort |
( |
int |
pointIndex, |
|
|
int |
attributeIndex |
|
) |
| |
|
inline |
Retrieve the value of the specified attribute at the specified point cast to short if necessary.
- Parameters
-
pointIndex | |
attributeIndex | |
- Returns
- the value of the specified attribute at the specified point cast to short if necessary.
Definition at line 455 of file GeoTessPointMap.h.
◆ getPointVector()
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.
- Parameters
-
pointIndex | |
v | (output) a vector representation of the specified point |
Definition at line 499 of file GeoTessPointMap.h.
◆ getPolygon()
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.
Definition at line 200 of file GeoTessPointMap.h.
◆ getTessId()
int geotess::GeoTessPointMap::getTessId |
( |
int |
pointIndex | ) |
|
|
inline |
Retrieve the index of the tessellation that corresponds to the specified pointIndex.
- Parameters
-
- Returns
- the index of the tessellation that corresponds to the specified pointIndex.
Definition at line 248 of file GeoTessPointMap.h.
◆ getVertexIndex()
int geotess::GeoTessPointMap::getVertexIndex |
( |
int |
pointIndex | ) |
|
|
inline |
Retrieve the index of the vertex that corresponds to the specified pointIndex.
- Parameters
-
- Returns
- the index of the vertex that corresponds to the specified pointIndex.
Definition at line 235 of file GeoTessPointMap.h.
◆ isNaN()
bool geotess::GeoTessPointMap::isNaN |
( |
int |
pointIndex, |
|
|
int |
attributeIndex |
|
) |
| |
|
inline |
Return true if the value of the specified attribute at the specified point is NaN.
- Parameters
-
pointIndex | |
attributeIndex | |
- Returns
- true if the value of the specified attribute at the specified point is NaN.
Definition at line 485 of file GeoTessPointMap.h.
◆ isPopulated()
bool geotess::GeoTessPointMap::isPopulated |
( |
| ) |
|
|
inline |
Determine whether or not this PointMap is populated.
- Returns
- true if populated
Definition at line 215 of file GeoTessPointMap.h.
◆ operator!=()
◆ operator=()
Overloaded assignment operator
◆ operator==()
Overloaded equality operator. Throws and exception if other is not populated.
◆ setActiveRegion() [1/3]
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.
◆ setActiveRegion() [2/3]
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.
- Parameters
-
polygonFileName | the name of a file that contains a 2D or 3D polygon. |
Definition at line 187 of file GeoTessPointMap.h.
◆ setActiveRegion() [3/3]
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.
- Parameters
-
polygon | a 2D Polygon object |
◆ setPointData()
void geotess::GeoTessPointMap::setPointData |
( |
int |
pointIndex, |
|
|
GeoTessData * |
data |
|
) |
| |
|
inline |
Replace the Data object associated with the specified point.
Definition at line 340 of file GeoTessPointMap.h.
◆ setPointValue()
template<typename T >
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.
- Parameters
-
pointIndex | |
attributeIndex | |
value | |
Definition at line 366 of file GeoTessPointMap.h.
◆ size()
int geotess::GeoTessPointMap::size |
( |
| ) |
|
|
inline |
Retrieve the number of points supported by this model.
- Returns
- the number of points supported by this model.
Definition at line 222 of file GeoTessPointMap.h.
◆ toString()
string geotess::GeoTessPointMap::toString |
( |
int |
pointIndex | ) |
|
|
inline |
Retrieve a nicely formated string with lat, lon, depth of the point in degrees and km.
- Parameters
-
- Returns
- string with lat, lon, depth
Definition at line 613 of file GeoTessPointMap.h.
The documentation for this class was generated from the following file: