GeoTessCPP  2.0.0
Software to facilitate storage and retrieval of 3D information about the Earth.
 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)
int getNodeIndex (int pointIndex)
GeoTessDatagetPointData (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)
GeoTessPolygongetPolygon ()
int getTessId (int pointIndex)
int getVertexIndex (int pointIndex)
bool isNaN (int pointIndex, int attributeIndex)
bool isPopulated ()
bool operator!= (const GeoTessPointMap &other)
GeoTessPointMapoperator= (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.
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.
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: