GeoTessCPP: geotess::GeoTessModel 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 | Static Public Member Functions
geotess::GeoTessModel Class Reference

`#include <GeoTessModel.h>`

List of all members.

## Public Member Functions
| GeoTessModel ()
| GeoTessModel (const string &inputFile, const string &relativeGridPath)
| GeoTessModel (const string &modelInputFile)
| GeoTessModel (vector< int > &attributeFilter)
| GeoTessModel (const string &inputFile, const string &relativeGridPath, vector< int > &attributeFilter)
| GeoTessModel (const string &modelInputFile, vector< int > &attributeFilter)
| GeoTessModel (const string &gridFileName, GeoTessMetaData *metaData)
| GeoTessModel (GeoTessGrid *grid, GeoTessMetaData *metaData)
virtual | ~GeoTessModel ()
const set< int > & | getConnectedVertices (int layerIndex)
double | getDepth (int vertexId, int layerId, int nodeId)
double | getDepth (int pointIndex)
EarthShape & | getEarthShape ()
const GeoTessGrid & | getGrid () const
GeoTessGrid & | getGrid ()
void | getLayerCount (bool activeOnly, int *layerCount)
void | getLayerCount (vector< int > &layerCount, const bool &activeOnly)
virtual LONG_INT | getMemory ()
GeoTessMetaData & | getMetaData ()
int | getNAttributes ()
int | getNData (int vertexId, int layerId)
int | getNLayers () const
int | getNPoints ()
int | getNRadii (int vertexId, int layerId)
int | getNVertices () const
double | getPathIntegral (const int &attribute, const map< int, double > &weights)
double | getPathIntegral (const int &attribute, double **rayPath, double *radii, int *layerIds, const int &numPoints, const GeoTessInterpolatorType &horizontalType, const GeoTessInterpolatorType &radialType, map< int, double > *weights=NULL)
double | getPathIntegral (const int &attribute, const vector< double * > &rayPath, const vector< double > &radii, const vector< int > &layerIds, const GeoTessInterpolatorType &horizontalType, const GeoTessInterpolatorType &radialType, map< int, double > *weights=NULL)
double | getPathIntegral2D (const int &attribute, const double *firstPoint, const double *lastPoint, double pointSpacing, double earthRadius, const GeoTessInterpolatorType &horizontalType, map< int, double > *weights=NULL)
double | getPathIntegral2D (const int &attribute, GeoTessGreatCircle &greatCircle, double pointSpacing, double earthRadius, const GeoTessInterpolatorType &horizontalType, map< int, double > *weights=NULL)
GeoTessPointMap * | getPointMap ()
GeoTessPolygon * | getPolygon ()
GeoTessPosition * | getPosition ()
GeoTessPosition * | getPosition (const GeoTessInterpolatorType &horizontalType)
GeoTessPosition * | getPosition (const GeoTessInterpolatorType &horizontalType, const GeoTessInterpolatorType &radialType)
GeoTessProfile * | getProfile (int vertex, int layer)
GeoTessProfile ** | getProfiles (int vertex)
GeoTessProfile *** | getProfiles () const
double | getRadius (int vertexId, int layerId, int nodeId)
double | getRadius (int pointIndex)
byte | getValueByte (int vertexId, int layerId, int nodeId, int attributeIndex)
byte | getValueByte (int pointIndex, int attributeIndex)
double | getValueDouble (int vertexId, int layerId, int nodeId, int attributeIndex)
double | getValueDouble (int pointIndex, int attributeIndex)
float | getValueFloat (int vertexId, int layerId, int nodeId, int attributeIndex)
float | getValueFloat (int pointIndex, int attributeIndex)
int | getValueInt (int vertexId, int layerId, int nodeId, int attributeIndex)
int | getValueInt (int pointIndex, int attributeIndex)
LONG_INT | getValueLong (int vertexId, int layerId, int nodeId, int attributeIndex)
LONG_INT | getValueLong (int pointIndex, int attributeIndex)
short | getValueShort (int vertexId, int layerId, int nodeId, int attributeIndex)
short | getValueShort (int pointIndex, int attributeIndex)
void | getWeights (const double *pointA, const double *pointB, const double &pointSpacing, const double &radius, const GeoTessInterpolatorType &horizontalType, map< int, double > &weights)
void | getWeights (GeoTessGreatCircle &greatCircle, const double &pointSpacing, const double &radius, const GeoTessInterpolatorType &horizontalType, map< int, double > &weights)
void | getWeights (const vector< double * > &rayPath, const vector< double > &radii, const vector< int > &layerIds, const GeoTessInterpolatorType &horizontalType, const GeoTessInterpolatorType &radialType, map< int, double > &weights)
void | getWeights (double **rayPath, double *radii, int *layerIds, const int &numPoints, const GeoTessInterpolatorType &horizontalType, const GeoTessInterpolatorType &radialType, map< int, double > &weights)
template<typename T >
void | initializeData (const vector< string > &attributeNames, const vector< string > &attributeUnits, T fillValue)
template<typename T >
void | initializeData (const string &attributeNames, const string &attributeUnits, T fillValue)
bool | is2D ()
bool | is3D ()
GeoTessModel * | loadModel (const string &inputFile, const string &relGridFilePath="")
virtual bool | operator!= (const GeoTessModel &other) const
virtual bool | operator== (const GeoTessModel &other) const
void | profileCount (vector< vector< int > > &count)
void | setActiveRegion ()
void | setActiveRegion (const string &polygon)
void | setActiveRegion (GeoTessPolygon *polygon)
void | setEarthShape (const string &earthShapeName)
void | setProfile (int vertex, int layer, GeoTessProfile *profile)
template<typename T >
void | setProfile (int vertex, int layer, vector< float > &radii, vector< vector< T > > &values)
template<typename T >
void | setProfile (const int &vertex, const int &layer, float *radii, const int &nRadii, T **values, const int &nNodes, const int &nAttributes)
void | setProfile (int vertex, int layer, vector< float > &radii)
template<typename T >
void | setProfile (const int &vertex, const int &layer, float *radii, const int &nRadii)
template<typename T >
void | setProfile (const int &vertex, vector< T > &values)
template<typename T >
void | setProfile (const int &vertex, T *values, const int &nAttributes)
void | setProfile (const int &vertex)
template<typename T >
void | setValue (int vertexId, int layerId, int nodeId, int attributeIndex, T value)
template<typename T >
void | setValue (int pointIndex, int attributeIndex, T value)
string | toString ()
void | writeModel (const string &outputFile)
void | writeModel (const string &outputFile, const string &gridFileName)

## Static Public Member Functions
static string | class_name ()
static void | clearReuseGrid ()
static LONG_INT | getReuseGridMapMemory ()
static int | getReuseGridMapSize ()
static bool | isGeoTessModel (const string &fileName)

## Detailed Description

GeoTessModel manages the grid and data that comprise a 3D Earth model. The Earth is assumed to be composed of a number of layers each of which spans the entire geographic extent of the Earth. It is assumed that layer boundaries do not fold back on themselves, i.e., along any radial profile through the model, each layer boundary is intersected exactly one time. Layers may have zero thickness over some or all of their geographic extent. Earth properties stored in the model are assumed to be continuous within a layer, both geographically and radially, but may be discontinuous across layer boundaries.

A GeoTessModel is comprised of 3 major components:

- The model grid (geometry and topology) is managed by a GeoTessGrid object. The grid is made up of one or more 2D triangular tessellations of a unit sphere.

- The data are managed by a 2D array of Profile objects. A Profile is essentially a list of radii and Data objects distributed along a radial profile that spans a single layer at a single vertex of the 2D grid. The 2D Profile array has dimensions nVertices by nLayers.

- Important metadata about the model, such as the names of the major layers, the names of the data attributes stored in the model, etc., are managed by a GeoTessMetaData object.

The term 'vertex' refers to a position in the 2D tessellation. They are 2D positions represented by unit vectors on a unit sphere. The term 'node' refers to a 1D position on a radial profile associated with a vertex and a layer in the model. Node indexes are unique only within a given profile (all profiles have a node with index 0 for example). The term 'point' refers to all the nodes in all the profiles of the model. There is only one 'point' in the model with index 0. PointMap is introduced to manage all these different indexes.

Author:
  Sandy Ballard

## Constructor & Destructor Documentation

geotess::GeoTessModel::GeoTessModel | ( |  | ) |

Default constructor.

geotess::GeoTessModel::GeoTessModel | ( | const string & | inputFile,
|  | const string & | relativeGridPath
| ) |  |

Construct a new GeoTessModel object and populate it with information from the specified file.

Parameters:

  inputFile | name of file containing the model.
  relativeGridPath | the relative path from the directory where the model is stored to the directory where the grid is stored. Often, the model and grid are stored together in the same file in which case this parameter is ignored. Sometimes, however, the grid is stored in a separate file and only the name of the grid file (without path information) is stored in the model file. In this case, the code needs to know which directory to search for the grid file. The default is "" (empty string), which will cause the code to search for the grid file in the same directory in which the model file resides. Bottom line is that the default value is appropriate when the grid is stored in the same file as the model, or the model file is in the same directory as the model file.

geotess::GeoTessModel::GeoTessModel | ( | const string & | modelInputFile | ) |

Construct a new GeoTessModel object and populate it with information from the specified file.

relativeGridPath is assumed to be "" (empty string), which is appropriate when the grid information is stored in the same file as the model or when the grid is stored in a separate file located in the same directory as the model file.

Parameters:

  modelInputFile | name of file containing the model.

geotess::GeoTessModel::GeoTessModel | ( | vector< int > & | attributeFilter | ) |

Default constructor.

Parameters:

  attributeFilter | the indexes of available attributes that should be loaded into memory.

geotess::GeoTessModel::GeoTessModel | ( | const string & | inputFile,
|  | const string & | relativeGridPath,
|  | vector< int > & | attributeFilter
| ) |  |

Construct a new GeoTessModel object and populate it with information from the specified file.

Parameters:

  inputFile | name of file containing the model.
  relativeGridPath | the relative path from the directory where the model is stored to the directory where the grid is stored. Often, the model and grid are stored together in the same file in which case this parameter is ignored. Sometimes, however, the grid is stored in a separate file and only the name of the grid file (without path information) is stored in the model file. In this case, the code needs to know which directory to search for the grid file. The default is "" (empty string), which will cause the code to search for the grid file in the same directory in which the model file resides. Bottom line is that the default value is appropriate when the grid is stored in the same file as the model, or the model file is in the same directory as the model file.
  attributeFilter | the indexes of available attributes that should be loaded into memory.

geotess::GeoTessModel::GeoTessModel | ( | const string & | modelInputFile,
|  | vector< int > & | attributeFilter
| ) |  |

Construct a new GeoTessModel object and populate it with information from the specified file.

relativeGridPath is assumed to be "" (empty string), which is appropriate when the grid information is stored in the same file as the model or when the grid is stored in a separate file located in the same directory as the model file.

Parameters:

  modelInputFile | name of file containing the model.
  attributeFilter | the indexes of available attributes that should be loaded into memory.

geotess::GeoTessModel::GeoTessModel | ( | const string & | gridFileName,
|  | GeoTessMetaData * | metaData
| ) |  |

Parameterized constructor, specifying the grid and metadata for the model. The grid is constructed and the data structures are initialized based on information supplied in metadata. The data structures are not populated with any information however (all Profiles are null). The application should populate the new model's Profiles after this constructor completes.

Before calling this constructor, the supplied MetaData object must be populated with required information by calling the following MetaData methods:

- setDescription()
- setLayerNames()
- setAttributes()
- setDataType()
- setLayerTessIds() (only required if grid has more than one multi-level tessellation)

Parameters:

  gridFileName | name of file from which to load the grid.
  metaData | MetaData the new GeoTessModel instantiates a reference to the supplied metaData. No copy is made.

Exceptions:

  GeoTessException | if metadata is incomplete.

geotess::GeoTessModel::GeoTessModel | ( | GeoTessGrid * | grid,
|  | GeoTessMetaData * | metaData
| ) |  |

Parameterized constructor, specifying the grid and metadata for the model. The grid is constructed and the data structures are initialized based on information supplied in metadata. The data structures are not populated with any information however (all Profiles are null). The application should populate the new model's Profiles after this constructor completes.

Before calling this constructor, the supplied MetaData object must be populated with required information by calling the following MetaData methods:

- setDescription()
- setLayerNames()
- setAttributes()
- setDataType()
- setLayerTessIds() (only required if grid has more than one multi-level tessellation)
- setSoftwareVersion()
- setGenerationDate()

Parameters:

  grid | a pointer to the GeoTessGrid that will support this GeoTessModel. GeoTessModel assumes ownership of the supplied grid object and will delete it when it is done with it.
  metaData | MetaData the new GeoTessModel instantiates a reference to the supplied metaData. No copy is made.

Exceptions:

  GeoTessException | if metadata is incomplete.

virtual geotess::GeoTessModel::~GeoTessModel | ( |  | ) |
| virtual

Destructor.

## Member Function Documentation

static string geotess::GeoTessModel::class_name | ( |  | ) |
| inlinestatic

Returns the class name.

Returns:
  class name

static void geotess::GeoTessModel::clearReuseGrid | ( |  | ) |
| inlinestatic

GeoTessModel will attempt to reuse grids that it has already loaded into memory when a new model tries to reload the same grid. This method clears the map that supports this functionality.

const set<int>& geotess::GeoTessModel::getConnectedVertices | ( | int | layerIndex | ) |
| inline

Return a reference to the set<int> of the indexes of all the vertices that are connected together by triangles in the specified layer of the model.

Parameters:

  layerIndex |

Returns:
  a reference to the set<int> of the indexes of all the vertices that are connected together by triangles in the specified layer of the model.

double geotess::GeoTessModel::getDepth | ( | int | vertexId,
|  | int | layerId,
|  | int | nodeId
| ) |  |
| inline

Return the depth below surface of current EarthShape in km of the node at vertexId, layerId, nodeId.

Parameters:

  vertexId | the vertex index
  layerId | the layer index
  nodeId | the node index

Returns:
  the depth in km of the node at vertexId, layerId, nodeId.

double geotess::GeoTessModel::getDepth | ( | int | pointIndex | ) |
| inline

Return the depth below surface of WGS84 ellipsoid in km of the node at pointIndex.

Parameters:

  pointIndex |

Returns:
  the depth in km of the node at pointIndex.

EarthShape& geotess::GeoTessModel::getEarthShape | ( |  | ) |
| inline

Retrieve a reference to the ellipsoid that is stored in this GeoTessModel. This EarthShape object can be used to convert between geographic and geocentric latitude, and between radius and depth in the Earth.

The following EarthShapes are supported:

- SPHERE - Geocentric and geographic latitudes are identical and conversion between depth and radius assume the Earth is a sphere with constant radius of 6371 km.
- GRS80 - Conversion between geographic and geocentric latitudes, and between depth and radius are performed using the parameters of the GRS80 ellipsoid.
- GRS80_RCONST - Conversion between geographic and geocentric latitudes are performed using the parameters of the GRS80 ellipsoid. Conversions between depth and radius assume the Earth is a sphere with radius 6371.
- WGS84 - Conversion between geographic and geocentric latitudes, and between depth and radius are performed using the parameters of the WGS84 ellipsoid.
- WGS84_RCONST - Conversion between geographic and geocentric latitudes are performed using the parameters of the WGS84 ellipsoid. Conversions between depth and radius assume the Earth is a sphere with radius 6371.
- IERS2003 - Conversion between geographic and geocentric latitudes, and between depth and radius are performed using the parameters of the IERS2003 ellipsoid.
- IERS2003_RCONST - Conversion between geographic and geocentric latitudes are performed using the parameters of the IERS2003 ellipsoid. Conversions between depth and radius assume the Earth is a sphere with radius 6371.

Returns:
  a reference to the EarthShape currently in use.

const GeoTessGrid& geotess::GeoTessModel::getGrid | ( |  | ) | const
| inline

Return a reference to the grid object.

Returns:
  a reference to the grid object that cannot be modified.

GeoTessGrid& geotess::GeoTessModel::getGrid | ( |  | ) |
| inline

Return a reference to the grid object.

Returns:
  a reference to the grid object.

void geotess::GeoTessModel::getLayerCount | ( | bool | activeOnly,
|  | int * | layerCount
| ) |  |
| inline

Retrieve the number of points in each layer of the model.

Parameters:

  activeOnly | if true, counts only active nodes otherwise counts all nodes.
  layerCount | an int array with at least nLayers elements which will be populated with the number of nodes in each layer.

Returns:
  the number of points in each layer of the model.

void geotess::GeoTessModel::getLayerCount | ( | vector< int > & | layerCount,
|  | const bool & | activeOnly
| ) |  |
| inline

Retrieve the number of points in each layer of the model.

Parameters:

  activeOnly | if true, counts only active nodes otherwise counts all nodes.
  layerCount | the number of points in each layer of the model.

virtual LONG_INT geotess::GeoTessModel::getMemory | ( |  | ) |
| inlinevirtual

Return the amount of memory currently occupied by this GeoTessModel object NOT INCLUDING THE GRID. The returned value includes the memory needed for the GeoTessMetaData, all the Profiles (including all the radii and Data objects), and memory for the PointMap.

To retrieve the size of the grid call model.getGrid().getMemory(). Note that multiple GeoTessModels may reference the same GeoTessGrid object so if you are working with multiple models and they might be sharing references to the same grids then the best way to find the memory requirements of the set of GeoTessGrid objects currently in use is to call the static method GeoTessModel::getReuseGridMapMemory().

Returns:
  memory in bytes.

GeoTessMetaData& geotess::GeoTessModel::getMetaData | ( |  | ) |
| inline

Return a reference to the GeoTessMetaData object associated with this model. The metadata object stores information about the models such as a description of the model, the layer names, attribute names, attribute units, the data type, etc.

Returns:
  a reference to the meta data object

int geotess::GeoTessModel::getNAttributes | ( |  | ) |
| inline

Return the number of attributes that are associated with each node in the model.

Returns:
  the number of attributes that are associated with each node in the model.

int geotess::GeoTessModel::getNData | ( | int | vertexId,
|  | int | layerId
| ) |  |
| inline

Return the number of Data objects that are specified in the Profile at vertexId, layerId

Parameters:

  vertexId | the vertex index
  layerId | the layer index

Returns:
  the number of Data that are specified in profile[vertexId][layerId]

int geotess::GeoTessModel::getNLayers | ( |  | ) | const
| inline

Return the number of layers that comprise the model.

Returns:
  the number of layers that comprise the model.

int geotess::GeoTessModel::getNPoints | ( |  | ) |
| inline

Retrieve the number of points in the model, including all nodes along all profiles at all grid vertices.

Returns:
  number of points in the model.

int geotess::GeoTessModel::getNRadii | ( | int | vertexId,
|  | int | layerId
| ) |  |
| inline

Return the number of radii that are specified in the Profile at vertexId, layerId.

Parameters:

  vertexId | the vertex index
  layerId | the layer index

Returns:
  the number of radii that are specified in profile[vertexId][layerId]

int geotess::GeoTessModel::getNVertices | ( |  | ) | const
| inline

Return number of vertices in the 2D geographic grid.

Returns:
  number of vertices in the 2D geographic grid.

double geotess::GeoTessModel::getPathIntegral | ( | const int & | attribute,
|  | const map< int, double > & | weights
| ) |  |

Compute the path integral of the specified attribute along the specified rayPath. The ray path is comprised of a bunch of pointIndex -> interpolation coefficient pairs computed by one of the getWeights() functions.

Parameters:

  attribute | the index of the attribute that is to be integrated. If a value greater than or equal to zero is specified then the path integral of the specified attribute is returned. Otherwise the function returns the total length of the rayPath in km.
  weights | (input) map from pointIndex to weight. The sum of the weights will equal the length of the ray path in km.

Returns:
  the path integral.

double geotess::GeoTessModel::getPathIntegral | ( | const int & | attribute,
|  | double ** | rayPath,
|  | double * | radii,
|  | int * | layerIds,
|  | const int & | numPoints,
|  | const GeoTessInterpolatorType & | horizontalType,
|  | const GeoTessInterpolatorType & | radialType,
|  | map< int, double > * | weights = `NULL`
| ) |  |

Compute the path integral of the specified attribute along the specified rayPath. The following procedure is implemented:

1. find the midpoint of each increment of the path (line segment between adjacent positions on the path).
2. find the straight line distance between the two points, in km.
3. calculate the interpolated value of the specified attribute at the center of the path increment.
4. sum the length of the path increment times the attribute value, along the path.

Parameters:

  attribute | the index of the attribute that is to be integrated. If a value less than zero is specified then only the length of the path increments is summed and the function returns the total length of the rayPath in km.
  rayPath | input array of 3-component unit vectors that define points along the ray path.
  radii | input array of radius values, in km, that define the radius of each unit_vector supplied in 'rayPath'.
  layerIds | input array of layer indices that specify the index of the layer in which path increment i resides where i is the path increment between points i and i+1 that define the ray path. If layerIds is null or layerIds[i] is less than zero, then the layer in which the path increment resides will be determined from the position and radius of the midpoint.
  numPoints | the number of elements in rayPath, radii, and layerIds
  horizontalType | (input) the type of interpolator to use in the geographic dimensions, either LINEAR or NATURAL_NEIGHBOR
  radialType | (input) the type of interpolator to use in the radial dimension, either LINEAR or CUBIC_SPLINE
  weights | (optional) If specified, then weight is a map from an integer point index to the weight accrued by that point.

Returns:
  the value of the path integral

double geotess::GeoTessModel::getPathIntegral | ( | const int & | attribute,
|  | const vector< double * > & | rayPath,
|  | const vector< double > & | radii,
|  | const vector< int > & | layerIds,
|  | const GeoTessInterpolatorType & | horizontalType,
|  | const GeoTessInterpolatorType & | radialType,
|  | map< int, double > * | weights = `NULL`
| ) |  |

Compute the path integral of the specified attribute along the specified rayPath. The following procedure is implemented:

1. find the midpoint of each increment of the path (line segment between adjacent positions on the path).
2. find the straight line distance between the two points, in km.
3. calculate the interpolated value of the specified attribute at the center of the path increment.
4. sum the length of the path increment times the attribute value, along the path.

Parameters:

  attribute | the index of the attribute that is to be integrated. If a value less than zero is specified then only the length of the path increments is summed and the function returns the total length of the rayPath in km.
  rayPath | input array of 3-component unit vectors that define points along the ray path.
  radii | input array of radius values, in km, that define the radius of each unit_vector supplied in 'rayPath'.
  layerIds | input array of layer indices that specify the index of the layer in which path increment i resides where i is the path increment between points i and i+1 that define the ray path. If layerIds is null or layerIds[i] is less than zero, then the layer in which the path increment resides will be determined from the position and radius of the midpoint.
  horizontalType | (input) the type of interpolator to use in the geographic dimensions, either LINEAR or NATURAL_NEIGHBOR
  radialType | (input) the type of interpolator to use in the radial dimension, either LINEAR or CUBIC_SPLINE
  weights | (optional) If specified, then weight is a map from an integer point index to the weight accrued by that point.

Returns:
  the value of the path integral

double geotess::GeoTessModel::getPathIntegral2D | ( | const int & | attribute,
|  | const double * | firstPoint,
|  | const double * | lastPoint,
|  | double | pointSpacing,
|  | double | earthRadius,
|  | const GeoTessInterpolatorType & | horizontalType,
|  | map< int, double > * | weights = `NULL`
| ) |  |

Compute the path integral of the specified attribute along the specified rayPath and optionally the weights on each model point that results from interpolating positions along the specified ray path. If weights is null on input, no weights are computed. This method only applies to 2D GeoTessModels.

The following procedure is implemented:

1. divide the great circle path from firstPoint to lastPoint into nIntervals which each are of length less than or equal to pointSpacing.
2. multiply the length of the interval by the radius of the earth at the center of the interval, which converts the length of the interval into km.
3. interpolate the value of the specified attribute at the center of the path increment.
4. sum the length of the path increment times the attribute value, along the path.
5. find the interpolation coefficients of all the model points that are 'touched' by the midpoint of the increment.

Parameters:

  attribute | index of the attribute to be integrated. If a value less than zero is specified then only the length of the path increments is summed and the function returns the total length of the rayPath in km.
  firstPoint | unit vector of the first point on the great circle path
  lastPoint | unit vector of the last point on the great circle path
  pointSpacing | maximum point separation in radians. The actual point spacing will generally be slightly less than the specified value so that there will be an integral number of uniformly spaced points along the path.
  earthRadius | the radius of the great circle path, in km. If the value is less than or equal to zero then the radius of the Earth determined by the current EarthShape is used. See getEarthShape() and setEarathShape() for more information about EarthShapes.
  horizontalType | either InterpolatorType.NATURAL_NEIGHBOR or InterpolatorType.LINEAR.
  weights | (optional) If specified, then weight is a map from an integer point index to the weight accrued by that point.

Returns:
  attribute value integrated along the specified great circle path.

Exceptions:

  GeoTessException | if the model is not a 2D model.

double geotess::GeoTessModel::getPathIntegral2D | ( | const int & | attribute,
|  | GeoTessGreatCircle & | greatCircle,
|  | double | pointSpacing,
|  | double | earthRadius,
|  | const GeoTessInterpolatorType & | horizontalType,
|  | map< int, double > * | weights = `NULL`
| ) |  |

Compute the path integral of the specified attribute along the specified rayPath and optionally the weights on each model point that results from interpolating positions along the specified ray path. If weights is null on input, no weights are computed. This method only applies to 2D GeoTessModels.

The following procedure is implemented:

1. divide the great circle path from firstPoint to lastPoint into nIntervals which each are of length less than or equal to pointSpacing.
2. multiply the length of the interval by the radius of the earth at the center of the interval, which converts the length of the interval into km.
3. interpolate the value of the specified attribute at the center of the path increment.
4. sum the length of the path increment times the attribute value, along the path.
5. find the interpolation coefficients of all the model points that are 'touched' by the midpoint of the increment.

Parameters:

  attribute | index of the attribute to be integrated. If a value less than zero is specified then only the length of the path increments is summed and the function returns the total length of the rayPath in km.
  greatCircle | a GreatCircle object specifying the path to be integrated.
  pointSpacing | maximum point separation in radians. The actual point spacing will generally be slightly less than the specified value so that there will be an integral number of uniformly spaced points along the path.
  earthRadius | the radius of the great circle path, in km. If the value is less than or equal to zero then the radius of the Earth determined by the current EarthShape is used. See getEarthShape() and setEarathShape() for more information about EarthShapes.
  horizontalType | either InterpolatorType.NATURAL_NEIGHBOR or InterpolatorType.LINEAR.
  weights | (optional) If specified, then weight is a map from an integer point index to the weight accrued by that point.

Returns:
  attribute value integrated along the specified great circle path.

Exceptions:

  GeoTessException | if the model is not a 2D model.

GeoTessPointMap* geotess::GeoTessModel::getPointMap | ( |  | ) |
| inline

Retrieve a pointer to the pointMap, which is an nPoints by 3 array of indexes. For each point in the 3D grid, pointMap stores 3 indexes: the vertex index, the layer index, and the node index.

The term 'vertex' refers to a position in the 2D tessellation. A vertex is a 2D point represented by unit vectors on a unit sphere. The term 'node' refers to a Data object on a radial profile associated with a vertex and a layer in the model. Node indexes are unique only within a given profile (all profiles have a node with index 0 for example). The term 'point' refers to all the nodes in all the profiles of the model. There is only one 'point' in the model with index 0. PointMap is introduced to help map back and forth between all these different indexes.

Users should not delete this pointer.

Returns:
  a reference to the PointMap object that supports this model.

GeoTessPolygon* geotess::GeoTessModel::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.

GeoTessPosition* geotess::GeoTessModel::getPosition | ( |  | ) |

Retrieve a pointer to a new GeoTessPosition object that knows how to interpolate information from the model. Linear interpolation will be performed in both the horizontal and radial dimensions

It is the caller's responsibility to delete this object when it is no longer needed.

Returns:
  a GeoTessPosition object.

GeoTessPosition* geotess::GeoTessModel::getPosition | ( | const GeoTessInterpolatorType & | horizontalType | ) |

Retrieve a pointer to a new GeoTessPosition object that knows how to interpolate information from the model. If the horizontal InterpolatorType is LINEAR then the radial InterpolatorType will be LINEAR as well. If the horizontal InterpolatorType is NATUAL_NEIGHBOR then the radial InterpolatorType will be CUBIC_SPLINE.

It is the caller's responsibility to delete this object when it is no longer needed.

Parameters:

  horizontalType | the type of interpolation that is to be used for interpolation in the geographic dimensions; either InterpolatorType:LINEAR or InterpolatorType::NATURAL_NEIGHBOR

Returns:
  a GeoTessPosition object.

GeoTessPosition* geotess::GeoTessModel::getPosition | ( | const GeoTessInterpolatorType & | horizontalType,
|  | const GeoTessInterpolatorType & | radialType
| ) |  |

Retrieve a pointer to a new GeoTessPosition object that knows how to interpolate information from the model.

It is the caller's responsibility to delete this object when it is no longer needed.

Parameters:

  horizontalType | the type of interpolation that is to be used for interpolation in the geographic dimensions; either InterpolatorType:LINEAR or InterpolatorType::NATURAL_NEIGHBOR
  radialType | the type of interpolation that is to be used in the radia dimension; either InterpolatorType:LINEAR or InterpolatorType::CUBIC_SPLINE

Returns:
  a GeoTessPosition object.

GeoTessProfile* geotess::GeoTessModel::getProfile | ( | int | vertex,
|  | int | layer
| ) |  |
| inline

Get a reference to the Profile object for the specified vertex and layer.

Parameters:

  vertex | index of a vertex in the 2D grid
  layer | index of one of the layers that comprise the model

Returns:
  a reference to a Profile object that contains the radii and Data values stored in profile[vertex][layer].

GeoTessProfile** geotess::GeoTessModel::getProfiles | ( | int | vertex | ) |
| inline

Get a reference to the array of Profile objects for the specified vertex.

Parameters:

  vertex | index of a vertex in the 2D grid

Returns:
  a reference to an array of Profile objects that contains the radii and Data values for all the Profiles at the specified vertex.

GeoTessProfile*** geotess::GeoTessModel::getProfiles | ( |  | ) | const
| inline

Get a reference to all Profile objects.

Returns:
  a reference to all Profile objects.

double geotess::GeoTessModel::getRadius | ( | int | vertexId,
|  | int | layerId,
|  | int | nodeId
| ) |  |
| inline

Return the radius in km of the node at vertexId, layerId, nodeId.

Parameters:

  vertexId | the vertex index
  layerId | the layer index
  nodeId | the node index

Returns:
  the radius in km of the node at vertexId, layerId, nodeId.

double geotess::GeoTessModel::getRadius | ( | int | pointIndex | ) |
| inline

Return the radius in km of the node at pointIndex.

Parameters:

  pointIndex |

Returns:
  the radius in km of the node at pointIndex.

static LONG_INT geotess::GeoTessModel::getReuseGridMapMemory | ( |  | ) |
| inlinestatic

GeoTessModel will attempt to reuse grids that it has already loaded into memory when a new model tries to reload the same grid. This method returns the amount of memory required by all the grids stored.

Returns:
  memory requirements in bytes.

static int geotess::GeoTessModel::getReuseGridMapSize | ( |  | ) |
| inlinestatic

GeoTessModel will attempt to reuse grids that it has already loaded into memory when a new model tries to reload the same grid. This method returns the size of the map that supports this functionality.

Returns:
  size of reuseGridMap.

byte geotess::GeoTessModel::getValueByte | ( | int | vertexId,
|  | int | layerId,
|  | int | nodeId,
|  | int | attributeIndex
| ) |  |
| inline

Return the value of the attribute at the specified vertexId, layerId, nodeId, attributeIndex, cast to a byte if necessary.

Parameters:

  vertexId | the vertex index
  layerId | the layer index
  nodeId | the node index
  attributeIndex | the attributeIndex

Returns:
  the value of the specifed attribute, cast to byte if necessary

byte geotess::GeoTessModel::getValueByte | ( | int | pointIndex,
|  | int | attributeIndex
| ) |  |
| inline

Return the value of the attribute at the specified pointIndex, attributeIndex, cast to a byte if necessary.

Parameters:

  pointIndex |
  attributeIndex | the attributeIndex

Returns:
  the value of the specifed attribute, cast to byte if necessary

double geotess::GeoTessModel::getValueDouble | ( | int | vertexId,
|  | int | layerId,
|  | int | nodeId,
|  | int | attributeIndex
| ) |  |
| inline

Return the value of the attribute at the specified vertexId, layerId, nodeId, attributeIndex, cast to a double if necessary.

Parameters:

  vertexId | the vertex index
  layerId | the layer index
  nodeId | the node index
  attributeIndex | the attributeIndex

Returns:
  the value of the specifed attribute, cast to double if necessary

double geotess::GeoTessModel::getValueDouble | ( | int | pointIndex,
|  | int | attributeIndex
| ) |  |
| inline

Return the value of the attribute at the specified pointIndex, attributeIndex, cast to a double if necessary.

Parameters:

  pointIndex |
  attributeIndex | the attributeIndex

Returns:
  the value of the specifed attribute, cast to double if necessary

float geotess::GeoTessModel::getValueFloat | ( | int | vertexId,
|  | int | layerId,
|  | int | nodeId,
|  | int | attributeIndex
| ) |  |
| inline

Return the value of the attribute at the specified vertexId, layerId, nodeId, attributeIndex, cast to a float if necessary.

Parameters:

  vertexId | the vertex index
  layerId | the layer index
  nodeId | the node index
  attributeIndex | the attributeIndex

Returns:
  the value of the specifed attribute, cast to float if necessary

float geotess::GeoTessModel::getValueFloat | ( | int | pointIndex,
|  | int | attributeIndex
| ) |  |
| inline

Return the value of the attribute at the specified pointIndex, attributeIndex, cast to a float if necessary.

Parameters:

  pointIndex |
  attributeIndex | the attributeIndex

Returns:
  the value of the specifed attribute, cast to float if necessary

int geotess::GeoTessModel::getValueInt | ( | int | vertexId,
|  | int | layerId,
|  | int | nodeId,
|  | int | attributeIndex
| ) |  |
| inline

Return the value of the attribute at the specified vertexId, layerId, nodeId, attributeIndex, cast to a int if necessary.

Parameters:

  vertexId | the vertex index
  layerId | the layer index
  nodeId | the node index
  attributeIndex | the attributeIndex

Returns:
  the value of the specifed attribute, cast to int if necessary

int geotess::GeoTessModel::getValueInt | ( | int | pointIndex,
|  | int | attributeIndex
| ) |  |
| inline

Return the value of the attribute at the specified pointIndex, attributeIndex, cast to a int if necessary.

Parameters:

  pointIndex |
  attributeIndex | the attributeIndex

Returns:
  the value of the specifed attribute, cast to int if necessary

LONG_INT geotess::GeoTessModel::getValueLong | ( | int | vertexId,
|  | int | layerId,
|  | int | nodeId,
|  | int | attributeIndex
| ) |  |
| inline

Return the value of the attribute at the specified vertexId, layerId, nodeId, attributeIndex, cast to a LONG_INT if necessary.

Parameters:

  vertexId | the vertex index
  layerId | the layer index
  nodeId | the node index
  attributeIndex | the attributeIndex

Returns:
  the value of the specifed attribute, cast to LONG_INT if necessary

LONG_INT geotess::GeoTessModel::getValueLong | ( | int | pointIndex,
|  | int | attributeIndex
| ) |  |
| inline

Return the value of the attribute at the specified pointIndex, attributeIndex, cast to a LONG_INT if necessary.

Parameters:

  pointIndex |
  attributeIndex | the attributeIndex

Returns:
  the value of the specifed attribute, cast to LONG_INT if necessary

short geotess::GeoTessModel::getValueShort | ( | int | vertexId,
|  | int | layerId,
|  | int | nodeId,
|  | int | attributeIndex
| ) |  |
| inline

Return the value of the attribute at the specified vertexId, layerId, nodeId, attributeIndex, cast to a short if necessary.

Parameters:

  vertexId | the vertex index
  layerId | the layer index
  nodeId | the node index
  attributeIndex | the attributeIndex

Returns:
  the value of the specifed attribute, cast to short if necessary

short geotess::GeoTessModel::getValueShort | ( | int | pointIndex,
|  | int | attributeIndex
| ) |  |
| inline

Return the value of the attribute at the specified pointIndex, attributeIndex, cast to a short if necessary.

Parameters:

  pointIndex |
  attributeIndex | the attributeIndex

Returns:
  the value of the specifed attribute, cast to short if necessary

void geotess::GeoTessModel::getWeights | ( | const double * | pointA,
|  | const double * | pointB,
|  | const double & | pointSpacing,
|  | const double & | radius,
|  | const GeoTessInterpolatorType & | horizontalType,
|  | map< int, double > & | weights
| ) |  |

Compute the weights on each model point that results from interpolating positions along the specified ray path. This method is only applicable to 2D GeoTessModels.

The following procedure is implemented:

1. divide the great circle path from pointA to pointB into nIntervals which each are of length less than or equal to pointSpacing.
2. multiply the length of each interval by the radius of the earth at the center of the interval, which converts the length of the interval into km.
3. interpolate the value of the specified attribute at the center of the interval.
4. sum the length of the interval times the attribute value, along the path.

Parameters:

  pointA | the unit vector defining the beginning of the great circle path
  pointB | the unit vector defining the end of the great circle path
  pointSpacing | the maximum spacing between points, in radians. The actual spacing will generally be slightly less than the specified value in order for there to be an integral number of uniform intervals along the great circle path.
  radius | the radius of the great circle path, in km. If the value is less than or equal to zero then the radius of the Earth determined by the current EarthShape is used. See getEarthShape() and setEarathShape() for more information about EarthShapes.
  horizontalType | either InterpolatorType::LINEAR, or InterpolatorType::NATURAL_NEIGHBOR
  weights | (output) map from pointIndex to weight. The sum of the weights will equal the length of the ray path in km.

void geotess::GeoTessModel::getWeights | ( | GeoTessGreatCircle & | greatCircle,
|  | const double & | pointSpacing,
|  | const double & | radius,
|  | const GeoTessInterpolatorType & | horizontalType,
|  | map< int, double > & | weights
| ) |  |

Compute the weights on each model point that results from interpolating positions along the specified ray path. This method is only applicable to 2D GeoTessModels.

The following procedure is implemented:

1. divide the great circle path from pointA to pointB into nIntervals which each are of length less than or equal to pointSpacing.
2. multiply the length of each interval by the radius of the earth at the center of the interval, which converts the length of the interval into km.
3. interpolate the value of the specified attribute at the center of the interval.
4. sum the length of the interval times the attribute value, along the path.

Parameters:

  greatCircle | a GreatCircle object that specifies the ray path.
  pointSpacing | the maximum spacing between points, in radians. The actual spacing will generally be slightly less than the specified value in order for there to be an integral number of uniform intervals along the great circle path.
  radius | the radius of the great circle path, in km. If the value is less than or equal to zero then the radius of the Earth determined by the current EarthShape is used. See getEarthShape() and setEarathShape() for more information about EarthShapes.
  horizontalType | either InterpolatorType::LINEAR, or InterpolatorType::NATURAL_NEIGHBOR
  weights | (output) map from pointIndex to weight. The sum of the weights will equal the length of the ray path in km.

void geotess::GeoTessModel::getWeights | ( | const vector< double * > & | rayPath,
|  | const vector< double > & | radii,
|  | const vector< int > & | layerIds,
|  | const GeoTessInterpolatorType & | horizontalType,
|  | const GeoTessInterpolatorType & | radialType,
|  | map< int, double > & | weights
| ) |  |

Compute the weights on each model point that results from interpolating positions along the specified ray path. The following procedure is implemented:

1. find the midpoint of each increment of the path (line segment between adjacent positions on the path).
2. find the interpolation coefficients of all the model points that are 'touched' by the midpoint of the increment.
3. find the length of the path increment in km.
4. find the product of the length of the path increment times each interpolation coefficient and sum that value for each model point.

Parameters:

  rayPath | (input) an ordered list of unit vectors that define a ray path through the model space
  radii | (input) an ordered list of the radii in km of each point that defines the ray path
  layerIds | (input) array of layer indices that specify the index of the layer in which path increment i resides where i is the path increment between points i and i+1 that define the ray path. If layerIds is empty, or layerIds[i] is less than zero, then the layer in which the path increment resides will be determined from the position and radius of the midpoint.
  horizontalType | (input) either InterpolatorType::LINEAR, or InterpolatorType::NATURAL_NEIGHBOR
  radialType | (input) either InterpolatorType::LINEAR, or InterpolatorType::CUBIC_SPLINE
  weights | (output) map from pointIndex to weight. The sum of the weights will equal the length of the ray path in km.

void geotess::GeoTessModel::getWeights | ( | double ** | rayPath,
|  | double * | radii,
|  | int * | layerIds,
|  | const int & | numPoints,
|  | const GeoTessInterpolatorType & | horizontalType,
|  | const GeoTessInterpolatorType & | radialType,
|  | map< int, double > & | weights
| ) |  |

Compute the weights on each model point that results from interpolating positions along the specified ray path. The following procedure is implemented:

1. find the midpoint of each increment of the path (line segment between adjacent positions on the path).
2. find the interpolation coefficients of all the model points that are 'touched' by the midpoint of the increment.
3. find the length of the path increment in km.
4. find the product of the length of the path increment times each interpolation coefficient and sum that value for each model point.

Parameters:

  rayPath | (input) an ordered list of unit vectors that define a ray path through the model space
  radii | (input) an ordered list of the radii in km of each point that defines the ray path
  layerIds | (input) array of layer indices that specify the index of the layer in which path increment i resides where i is the path increment between points i and i+1 that define the ray path. If layerIds is empty, or layerIds[i] is less than zero, then the layer in which the path increment resides will be determined from the position and radius of the midpoint.
  numPoints | the number of points that define the raypath
  horizontalType | (input) either InterpolatorType::LINEAR, or InterpolatorType::NATURAL_NEIGHBOR
  radialType | (input) either InterpolatorType::LINEAR, or InterpolatorType::CUBIC_SPLINE
  weights | (output) map from pointIndex to weight. The sum of the weights will equal the length of the ray path in km. Input map will be cleared before population.

template<typename T >

void geotess::GeoTessModel::initializeData | ( | const vector< string > & | attributeNames,
|  | const vector< string > & | attributeUnits,
|  | T | fillValue
| ) |  |
| inline

Reset all the Data objects in the model. The number of attributes in the new Data objects will equal the number of elements in the supplied lists of attributeNames and attributeUnits (which must be equal in length).

The DataType of the new Data objects will be the type of the supplied fillValue. Data values will be copied from the old to the new Data objects with casting to the type of the new data objects. It is the responsibility of the caller to ensure that casting of data values does not result in corruption of data values or the loss of important information.

If the number of attributes in the new Data objects is less than the number in the old Data objects, old data values are lost. If the number of attributes in the new Data objects is greater than the number in the old Data objects, new values are populated with fillValue.

This method can only modify the Data objects associated with existing Profiles. It does not instantiate Profiles, change the ProfileType of existing profiles, modify the number of nodes in existing Profiles, or modify the radii within a Profile. To do any of those things requires replacing the Profile.

Parameters:

  attributeNames | new names of the attributes. These names will replace the old names in the MetaData object.
  attributeUnits | new units of the attributes. These units will replace the old units in the MetaData object. The number of attributeNames and attributeUntis must be the same.
  fillValue | a value of type double, float, LONG_INT, int, short or byte. All data values in this models' Data objects will be of this type after this method executes. The supplied value is used to populate data values that are not copied from the old Data object.

Exceptions:

  GeoTessException | if the model has not been populated with Profiles or if the number of attributeNames and attributeUnits is not the same.

template<typename T >

void geotess::GeoTessModel::initializeData | ( | const string & | attributeNames,
|  | const string & | attributeUnits,
|  | T | fillValue
| ) |  |
| inline

Replace all the Data objects in the entire model. All current Data is lost. The new Data objects will be of the same type as fillValue. The length of the Data arrays will be equal to the number of attributeNames and units supplied.

AttributeNames and attributeUnits must contain the same number of entries.

Parameters:

  attributeNames | a semi-colon delimeted list of attribute names.
  attributeUnits | a semi-colon delimeted list of attribute units.
  fillValue | value to populate the model with

bool geotess::GeoTessModel::is2D | ( |  | ) |
| inline

bool geotess::GeoTessModel::is3D | ( |  | ) |
| inline

static bool geotess::GeoTessModel::isGeoTessModel | ( | const string & | fileName | ) |
| static

Test a file to see if it is a GeoTessModel file.

Parameters:

  fileName |

Returns:
  true if inputFile is a GeoTessModel file.

GeoTessModel* geotess::GeoTessModel::loadModel | ( | const string & | inputFile,
|  | const string & | relGridFilePath = `""`
| ) |  |

Read model data and grid from a file.

Parameters:

  inputFile | the path to the file that contains the model.
  relGridFilePath | if the grid is stored in a separate file then relGridFilePath is the relative path from the directory where the model located to the directory where the grid is located. The default value for relGridFilePath is "" which indicates that the grid file resides in the same directory as the model file.

Returns:
  returns a pointer to this

virtual bool geotess::GeoTessModel::operator!= | ( | const GeoTessModel & | other | ) | const
| inlinevirtual

Return true if this and the input other model are not equal. i.e., their grids have different gridIDs, they have different number of layers, or any of their Profiles are not equal. For profiles to be equal, they must be of the same type and size, and all of their radii must be equal and all of their data must be equal.

Parameters:

  other | the other model to which this model is to be compared for equality.

Returns:
  true if this and other are not equal.

virtual bool geotess::GeoTessModel::operator== | ( | const GeoTessModel & | other | ) | const
| virtual

Return true if this and the input other model are equal. i.e., their grids have the same gridIDs, they have the same number of layers, and all their Profiles are equal. For profiles to be equal, they must be of the same type and size, and all of their radii must be equal and all of their data must be equal.

Parameters:

  other | the other model to which this model is to be compared for equality.

Returns:
  true if this and other are equal.

void geotess::GeoTessModel::profileCount | ( | vector< vector< int > > & | count | ) |
| inline

Retrieve the number of Profiles of each ProfileType in each layer of the model. Also returns the total number of profiles of each type independent of layer.

Parameters:

  count | is a 2D vector of ints with dimensions (nLayers+1) x nProfileTypes.

void geotess::GeoTessModel::setActiveRegion | ( |  | ) |
| inline

Set the active region such that it encompasses all the nodes in the model.

Returns:
  a reference to the updated PointMap that has been configured to support the specified active region.

void geotess::GeoTessModel::setActiveRegion | ( | const string & | polygon | ) |
| inline

Set the active region to encompass only the nodes contained within the specified Polygon.

KML and KMZ formats are not supported by the C++ code. See GeoTessExplorer (Java) which can convert KML/KMZ files to ascii.

Parameters:

  polygon | the name of a file containing a valid Polygon2D or Polygon3D object, in ascii format.

Returns:
  a reference to the updated PointMap that has been configured to support the specified active region.

Exceptions:

  PolygonException |

void geotess::GeoTessModel::setActiveRegion | ( | GeoTessPolygon * | polygon | ) |
| inline

Set the active region to encompass only the nodes contained within the specified Polygon object.

Polygon implements reference counting. This instance of GeoTessModel will increment polygon's reference count. When this model is done with the polygon, it will decrement polygon's reference count and delete the polygon if its reference count is zero.

Parameters:

  polygon | a Polygon object.

Returns:
  a reference to the updated PointMap that has been configured to support the specified active region.

void geotess::GeoTessModel::setEarthShape | ( | const string & | earthShapeName | ) |
| inline

Specify the name of the ellipsoid that is to be used to convert between geocentric and geographic latitude and between depth and radius. This ellipsoid will be save in this GeoTessModel if it is written to file. The following EarthShapes are supported:

- SPHERE - Geocentric and geographic latitudes are identical and conversion between depth and radius assume the Earth is a sphere with constant radius of 6371 km.
- GRS80 - Conversion between geographic and geocentric latitudes, and between depth and radius are performed using the parameters of the GRS80 ellipsoid.
- GRS80_RCONST - Conversion between geographic and geocentric latitudes are performed using the parameters of the GRS80 ellipsoid. Conversions between depth and radius assume the Earth is a sphere with radius 6371.
- WGS84 - Conversion between geographic and geocentric latitudes, and between depth and radius are performed using the parameters of the WGS84 ellipsoid.
- WGS84_RCONST - Conversion between geographic and geocentric latitudes are performed using the parameters of the WGS84 ellipsoid. Conversions between depth and radius assume the Earth is a sphere with radius 6371.
- IERS2003 - Conversion between geographic and geocentric latitudes, and between depth and radius are performed using the parameters of the IERS2003 ellipsoid.
- IERS2003_RCONST - Conversion between geographic and geocentric latitudes are performed using the parameters of the IERS2003 ellipsoid. Conversions between depth and radius assume the Earth is a sphere with radius 6371.

Parameters:

  earthShapeName | the name of the ellipsoid that is to be used.

void geotess::GeoTessModel::setProfile | ( | int | vertex,
|  | int | layer,
|  | GeoTessProfile * | profile
| ) |  |

Replace the Profile object at the specified vertex and layer with a new one. Profile is checked to ensure that radii are monotonically increasing.

GeoTessModel assumes ownership of the Profile object and will delete it when it is no longer needed. Caller should not delete the Profile object.

Parameters:

  vertex | index of a vertex in the 2D grid
  layer | index of one of the layers that comprise the model
  profile | a pointer to a Profile object that contains the radii and Data values to be stored in profile[vertex][layer].

template<typename T >

void geotess::GeoTessModel::setProfile | ( | int | vertex,
|  | int | layer,
|  | vector< float > & | radii,
|  | vector< vector< T > > & | values
| ) |  |
| inline

Replace the Profile object at the specified vertex and layer with a new one. All radius and data values are copied out of the supplied vector<>s. GeoTessModel does not keep any references to the vectors<>

If vertex is not connected to other vertices by any triangles in the specified layer, than the values are ignored and a ProfileEmpty object is instantiated with just the first and last radii provided.

Parameters:

  vertex | index of a vertex in the 2D grid
  layer | index of one of the layers that comprise the model
  radii | the radius values in km
  values | nNodes x nAttributes array of model values.

template<typename T >

void geotess::GeoTessModel::setProfile | ( | const int & | vertex,
|  | const int & | layer,
|  | float * | radii,
|  | const int & | nRadii,
|  | T ** | values,
|  | const int & | nNodes,
|  | const int & | nAttributes
| ) |  |
| inline

Replace the Profile object at the specified vertex and layer with a new one. All radius and data values are copied out of the supplied vector<>s. GeoTessModel does not keep any references to the vectors<> If vertex is not connected to other vertices by any triangles in the specified layer, than the values are ignored and a ProfileEmpty object is instantiated with just the first and last radii provided.

Parameters:

  vertex | index of a vertex in the 2D grid
  layer | index of one of the layers that comprise the model
  radii | the radius values in km
  nRadii | the number of radius values provided
  values | nNodes x nAttributes array of model values.
  nNodes |
  nAttributes |

void geotess::GeoTessModel::setProfile | ( | int | vertex,
|  | int | layer,
|  | vector< float > & | radii
| ) |  |
| inline

Replace the Profile object at the specified vertex and layer with a new ProfileEmpty object.

Parameters:

  vertex | index of a vertex in the 2D grid
  layer | index of one of the layers that comprise the model
  radii | the radius values in km. The only ones used are radii[0] and radii[radii.size()-1];

template<typename T >

void geotess::GeoTessModel::setProfile | ( | const int & | vertex,
|  | const int & | layer,
|  | float * | radii,
|  | const int & | nRadii
| ) |  |
| inline

Replace the Profile object at the specified vertex and layer with a new ProfileEmpty object.

Parameters:

  vertex | index of a vertex in the 2D grid
  layer | index of one of the layers that comprise the model
  radii | the radius values in km
  nRadii | number of radii provided. The only ones used are radii[0] and radii[nRadii-1];

template<typename T >

void geotess::GeoTessModel::setProfile | ( | const int & | vertex,
|  | vector< T > & | values
| ) |  |
| inline

Replace the Profile object at the specified vertex with a new one of type ProfileSurface, which supports 2D Earth models. All data values are copied out of the supplied vector<>. GeoTessModel does not keep any references to the vectors<>

Parameters:

  vertex | index of a vertex in the 2D grid
  values | array of model values with nAttribute elements.

template<typename T >

void geotess::GeoTessModel::setProfile | ( | const int & | vertex,
|  | T * | values,
|  | const int & | nAttributes
| ) |  |
| inline

Replace the Profile object at the specified vertex with a new one of type ProfileSurface, which supports 2D Earth models. All data values are copied out of the supplied vector<>. GeoTessModel does not keep any references to the array

Parameters:

  vertex | index of a vertex in the 2D grid
  values | array of model values with nAttribute elements.
  nAttributes | length of values array

void geotess::GeoTessModel::setProfile | ( | const int & | vertex | ) |
| inline

Replace the Profile object at the specified vertex with a new one of type ProfileSurfEmpty, which supports 2D Earth models.

Parameters:

  vertex | index of a vertex in the 2D grid

template<typename T >

void geotess::GeoTessModel::setValue | ( | int | vertexId,
|  | int | layerId,
|  | int | nodeId,
|  | int | attributeIndex,
|  | T | value
| ) |  |
| inline

Modify the attribute value stored at the specified vertex, layer, node, attribute.

Parameters:

  vertexId | the vertex index
  layerId | the layer index
  nodeId | the node index
  attributeIndex | the attributeIndex
  value | the new attribute value (must be of type double, float, LONG_INT, int, short or byte).

template<typename T >

void geotess::GeoTessModel::setValue | ( | int | pointIndex,
|  | int | attributeIndex,
|  | T | value
| ) |  |
| inline

Modify the attribute value stored at the specified vertex, layer, node, attribute.

Parameters:

  pointIndex |
  attributeIndex | the attributeIndex
  value | the new attribute value (must be of type double, float, LONG_INT, int, short or byte).

string geotess::GeoTessModel::toString | ( |  | ) |

To string method.

Returns:
  string with information about this model.

void geotess::GeoTessModel::writeModel | ( | const string & | outputFile | ) |
| inline

Write the model to file. Grid information will be included in the specified output file.

Parameters:

  outputFile | name of the file to receive the model

Exceptions:

  IOException |

void geotess::GeoTessModel::writeModel | ( | const string & | outputFile,
|  | const string & | gridFileName
| ) |  |

Write the model to file. The data (radii and attribute values) are written to outputFile. If gridFileName is '*' or omitted then the grid information is written to the same file as the data. If gridFileName is something else, it should be the name of the file that contains the grid information (just the name; no path information). In the latter case, the gridFile referenced by gridFileName is not overwritten; all that happens is that the name of the grid file (with no path information) is stored in the data file.

Parameters:

  outputFile | name of the file to receive the model
  gridFileName | name of file to receive the grid (no path info), or "*"

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

- include/GeoTessModel.h