36#ifndef LIBCORR3D_OBJECT_H
37#define LIBCORR3D_OBJECT_H
53#include "GeoTessUtils.h"
54#include "GeoTessException.h"
55#include "GeoTessModel.h"
56#include "GeoTessPosition.h"
57#include "GeoTessOptimizationType.h"
70class GeoTessInterpolatorType;
123 double lc3dCurrIntrpVector[3];
129 double lc3dCurrIntrpRadius;
138 double lc3dCurrIntrpTime;
147 string lc3dGTRootPath;
154 string lc3dOldRootPath;
161 string lc3dGTRelGridPath;
168 string lc3dOldRelTessPath;
174 vector<string> lc3dModelFileName;
186 map<string, int> lc3dModelMap;
200 vector<LibCorr3DModel*> lc3dModelList;
208 map<string, GeoTessPosition*> lc3dPositionMap;
217 vector<GeoTessPosition*> lc3dPositionList;
227 string lc3dCurrErrMsg;
233 void checkPath(
const string& fname,
string& pth,
string& relGrid);
241 GeoTessInterpolatorType
const* geographicInterpolatorType;
249 GeoTessInterpolatorType
const* radialInterpolatorType;
269 LibCorr3D(
const string& newRootPath,
const string& oldRootPath);
283 LibCorr3D(
const string& newRootPath,
const string& newRelGridPath,
284 const string& oldRootPath,
const string& oldRelGridPath);
349 int loadModel(
const string& fname,
const GeoTessOptimizationType& optimizationType = GeoTessOptimizationType::SPEED)
353 vector<int> attributeFilter;
354 return loadModel(fname, attributeFilter, optimizationType);
381 int loadModel(
const string& fname, vector<int>& attributeFilter,
382 const GeoTessOptimizationType& optimizationType = GeoTessOptimizationType::SPEED);
395 return lc3dCurrIntrpVector;
404 return GeoTessUtils::getLatDegrees(lc3dCurrIntrpVector);
413 return GeoTessUtils::getLonDegrees(lc3dCurrIntrpVector);
422 return lc3dCurrIntrpRadius;
431 return GeoTessUtils::getEarthRadius(lc3dCurrIntrpVector)-lc3dCurrIntrpRadius;
440 return lc3dCurrIntrpTime;
452 os << fixed << setprecision(5);
453 os << setw(11) << getCurrentInterpolationLon();
454 os <<
" " << setw(10) << getCurrentInterpolationLat();
455 os << fixed << setprecision(3);
456 os <<
" " << setw(7) << getCurrentInterpolationDepth();
457 os <<
" " << setw(7) << getCurrentInterpolationTime();
475 if (lat < -90 || lat > 90)
478 os << fixed << setprecision(6);
479 os << endl <<
"ERROR in LibCorr3D::setInterpolationLocation" << endl
480 <<
"latitude (" << lat <<
") is out of range" << endl;
481 throw GeoTessException(os, __FILE__, __LINE__, 109);
484 GeoTessUtils::getVectorDegrees(lat, lon, lc3dCurrIntrpVector);
485 lc3dCurrIntrpRadius = GeoTessUtils::getEarthRadius(lc3dCurrIntrpVector)-depth;
486 lc3dCurrIntrpTime = time;
505 lc3dCurrIntrpVector[0] = unitVector[0];
506 lc3dCurrIntrpVector[1] = unitVector[1];
507 lc3dCurrIntrpVector[2] = unitVector[2];
508 lc3dCurrIntrpRadius = radius < 0. ? GeoTessUtils::getEarthRadius(unitVector) : radius;
509 lc3dCurrIntrpTime = time;
526 void setInterpolator(GeoTessInterpolatorType
const* intrpGeographic, GeoTessInterpolatorType
const* intrpRadial);
534 return *geographicInterpolatorType;
543 return *radialInterpolatorType;
596 return lc3dGTRootPath;
609 return lc3dOldRootPath;
621 return lc3dGTRelGridPath;
633 return lc3dOldRelTessPath;
661 return lc3dCurrErrCode;
671 return lc3dCurrErrMsg;
Definition: LibCorr3D.h:62
This class is responsible for loading, removing, and interpolating LibCorr3D model objects for travel...
Definition: LibCorr3D.h:117
int getCurrentErrorCode() const
Return current error code.
Definition: LibCorr3D.h:659
const GeoTessInterpolatorType & getGeographicInterpolatorType() const
Returns the current geographic interpolator type.
Definition: LibCorr3D.h:532
bool getModelResult(int handle, double &modelValue, double &modelUncertainty)
The access function used to retrieve the model attribute and associated uncertainty results at the cu...
int loadModel(const string &fname, const GeoTessOptimizationType &optimizationType=GeoTessOptimizationType::SPEED)
Loads a new model from the specified file and returns an associated handle to the caller for later ac...
Definition: LibCorr3D.h:349
const double * getCurrentInterpolationLocation() const
Retrieve the current interpolation location as a unit vector.
Definition: LibCorr3D.h:393
const string & getOldRootPath() const
Returns the old (LibCorr2D) path corrections root path to the caller.
Definition: LibCorr3D.h:607
const string & getOldRelGridPath() const
Returns the path where all old LibCorr2D tessellation files are stored relative to the old root path ...
Definition: LibCorr3D.h:631
LibCorr3DModel * getModel(int handle)
void setInterpolator(GeoTessInterpolatorType const *intrpGeographic, GeoTessInterpolatorType const *intrpRadial)
Sets the geographic and radial interpolators to the specified types.
void removeModel(int handle)
Removes the specified model from the list of supported models and deletes it from memory.
double getCurrentInterpolationLat()
Retrieve the latitude of the current interpolation location in degrees.
Definition: LibCorr3D.h:402
int loadModel(const string &fname, vector< int > &attributeFilter, const GeoTessOptimizationType &optimizationType=GeoTessOptimizationType::SPEED)
Loads a new model from the specified file and returns an associated handle to the caller for later ac...
const string & getRootPath() const
Returns the primary (new GeoTess) root path to the caller.
Definition: LibCorr3D.h:594
virtual ~LibCorr3D()
Destructor.
const GeoTessInterpolatorType & getRadialInterpolatorType() const
Returns the current geographic interpolator type.
Definition: LibCorr3D.h:541
double getCurrentInterpolationRadius()
Retrieve the radius of the current interpolation location in km .
Definition: LibCorr3D.h:420
string getCurrentInterpolationLocation()
Retrieve a string representation of the current interpolation location (lon, lat, depth,...
Definition: LibCorr3D.h:449
LibCorr3D(const string &newRootPath, const string &oldRootPath)
Standard constructor.
const string & getCurrentErrorMessage() const
Return the errorMessage generated by the most recent call to getModelResult().
Definition: LibCorr3D.h:669
const string & getRelGridPath() const
Returns the path where all the grid files are stored (new GeoTess) relative to the input root path (l...
Definition: LibCorr3D.h:619
LONG_INT getMemory()
Return the amount of memory currently occupied by this LibCorr3D object, including all of the LibCorr...
static string getVersion()
Definition: LibCorr3D.h:294
LibCorr3D(const string &rootPath)
Standard constructor.
LibCorr3D * setInterpolationLocation(double lon, double lat, double depth=0.0, double time=NA_VALUE)
Sets the current interpolation location/time.
Definition: LibCorr3D.h:472
double getCurrentInterpolationLon()
Retrieve the longitude of the current interpolation location in degrees.
Definition: LibCorr3D.h:411
LibCorr3D(const string &newRootPath, const string &newRelGridPath, const string &oldRootPath, const string &oldRelGridPath)
Standard constructor.
double getCurrentInterpolationDepth()
Retrieve the depth of the current interpolation location in km .
Definition: LibCorr3D.h:429
LibCorr3D * setInterpolationLocation(double *unitVector, double radius=-1., double time=NA_VALUE)
Sets the current interpolation location/time.
Definition: LibCorr3D.h:502
double getCurrentInterpolationTime()
Retrieve the epoch time of the current interpolation location in seconds since 1970.
Definition: LibCorr3D.h:438
This is a LibCorr3D extension of the GeoTessModel for use by LibCorr3D.
Definition: LibCorr3DModel.h:85