GeoTessCPP: geotess::GeoTessPointMap Class Reference

GeoTessCPP 2.1 Software to facilitate storage and retrieval of 3D information about the Earth.

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Friends Macros
Public Member Functions
geotess::GeoTessPointMap Class Reference

`#include <GeoTessPointMap.h>`

List of all members.

## Public Member Functions
| GeoTessPointMap (GeoTessModel &m)
| GeoTessPointMap (GeoTessPointMap &other)
| ~GeoTessPointMap ()
void | clear ()
double | getDistance3D (int pointIndex1, int pointIndex2)
int | getLayerIndex (int pointIndex)
LONG_INT | getMemory ()
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)
byte | getPointValueByte (int pointIndex, int attributeIndex)
double | getPointValueDouble (int pointIndex, int attributeIndex)
float | getPointValueFloat (int pointIndex, int attributeIndex)
int | getPointValueInt (int pointIndex, int attributeIndex)
LONG_INT | getPointValueLong (int pointIndex, int attributeIndex)
short | getPointValueShort (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)

## Detailed Description

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 & Destructor Documentation

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.

## Member Function Documentation

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.

Parameters:

  pointIndex1 |
  pointIndex2 |

Returns:
  the straight-line distance between two points in km.

int geotess::GeoTessPointMap::getLayerIndex | ( | int | pointIndex | ) |
| inline

Retrieve the index of the layer that corresponds to the specified pointIndex.

Parameters:

  pointIndex |

Returns:
  the index of the layer that corresponds to the specified pointIndex.

LONG_INT geotess::GeoTessPointMap::getMemory | ( |  | ) |
| inline

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:

  pointIndex |

Returns:
  the index of the node that corresponds to the specified pointIndex.

GeoTessData* geotess::GeoTessPointMap::getPointData | ( | int | pointIndex | ) |
| inline

Retrieve a reference to the Data object associated with the specified point.

Parameters:

  pointIndex |

Returns:

double geotess::GeoTessPointMap::getPointDepth | ( | int | pointIndex | ) |
| inline

Retrieve the radius of the specified point.

Parameters:

  pointIndex |

Returns:
  radius of specified point, in km.

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:

  vertex |
  layer |
  node |

Returns:
  the pointIndex of the point that corresponds to the specified vertex, layer and 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).

Parameters:

  vertex |
  layer |

Returns:
  the pointIndex of the point that corresponds to the first node in profile[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).

Parameters:

  vertex |
  layer |

Returns:
  the pointIndex of the point that corresponds to the last node in profile[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.

Parameters:

  pointIndex |

Returns:
  the index map for the specified pointIndex.

string geotess::GeoTessPointMap::getPointLatLonString | ( | int | pointIndex | ) |
| inline

Retrieve nicely formated string with lat, lon of the point in degrees.

Parameters:

  pointIndex |

Returns:
  string with lat, lon in degrees.

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.

Parameters:

  pointIndex |

Returns:
  radius of specified point, in km.

const double* geotess::GeoTessPointMap::getPointUnitVector | ( | int | pointIndex | ) | const
| inline

Retrieve a reference to the unit vector for the specified point.

Parameters:

  pointIndex |

Returns:
  a reference to the unit vector for the specified point.

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.

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.

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.

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.

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.

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.

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.

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

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.

Parameters:

  pointIndex |

Returns:
  the index of the tessellation that corresponds to the specified pointIndex.

int geotess::GeoTessPointMap::getVertexIndex | ( | int | pointIndex | ) |
| inline

Retrieve the index of the vertex that corresponds to the specified pointIndex.

Parameters:

  pointIndex |

Returns:
  the index of the vertex that corresponds to the specified 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.

Parameters:

  pointIndex |
  attributeIndex |

Returns:
  true if the value of the specified attribute at the specified point is NaN.

bool geotess::GeoTessPointMap::isPopulated | ( |  | ) |
| inline

Determine whether or not this PointMap is populated.

Returns:
  true if 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.

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.

Parameters:

  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.

Parameters:

  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.

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 |

int geotess::GeoTessPointMap::size | ( |  | ) |
| inline

Retrieve the number of points supported by this model.

Returns:
  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.

Parameters:

  pointIndex |

Returns:
  string with lat, lon, depth

The documentation for this class was generated from the following file:

- include/GeoTessPointMap.h