GeoTessCPP  2.2
Software to facilitate storage and retrieval of 3D information about the Earth.
Public Member Functions | List of all members
geotess::GeoTessPointMap Class Reference

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...
 
GeoTessDatagetPointData (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...
 
GeoTessPolygongetPolygon ()
 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...
 
GeoTessPointMapoperator= (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...
 

Detailed Description

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).

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
polygona 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
polygonFileNamethe 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,
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: