Isis Developer Reference
|
Implementation interface API for NAIF's DSK plate model. More...
#include <NaifDskPlateModel.h>
Public Member Functions | |
NaifDskPlateModel () | |
Default empty constructor. | |
NaifDskPlateModel (const QString &dskfile) | |
Construct given a file name - the only way to create with a DSK file. | |
virtual | ~NaifDskPlateModel () |
bool | isValid () const |
Checks validity of the object. | |
QString | filename () const |
Returns the nane of the NAIF DSK file. | |
int | size () const |
Returns the number of plates in the DSK file - mostly for conformity. | |
SpiceInt | numberPlates () const |
Returns the number of plates in the model. | |
SpiceInt | numberVertices () const |
Returns the number of vertices in the plate model. | |
SurfacePoint * | point (const Latitude &lat, const Longitude &lon) const |
Get surface intersection for a lat/lon grid point. | |
Intercept * | intercept (const NaifVertex &vertex, const NaifVector &raydir) const |
Determine a target body intercept point from an observer and look direction. | |
bool | isPlateIdValid (const SpiceInt plateid) const |
Determines if the plate ID is valid. | |
SpiceInt | plateIdOfIntercept (const NaifVertex &vertex, const NaifVector &raydir, NaifVertex &xpoint) const |
Primary API to determine ray intercept from observer/look direction. | |
NaifTriangle | plate (SpiceInt plateid) const |
Retrieve the triangular plate identified by its ID. | |
NaifDskPlateModel * | clone () const |
Implementation interface API for NAIF's DSK plate model.
This class implements a thread safe version of the NAIF DSK plate model API. This version is coded using the "alpha" version of the DSK library toolkit as release in 2010.
Part of the design of this implementation is the abilty to efficiently clone the object so that it is suitable for use in a threaded environment. Note that files is only closed when the last reference is released.
It is recommended that a shared or scoped pointer that provides the necessary elements for efficient safe thread computing.
Isis::NaifDskPlateModel::NaifDskPlateModel | ( | ) |
Default empty constructor.
Isis::NaifDskPlateModel::NaifDskPlateModel | ( | const QString & | dskfile | ) |
Construct given a file name - the only way to create with a DSK file.
References _FILEINFO_, isValid(), and Isis::IException::User.
|
virtual |
NaifDskPlateModel * Isis::NaifDskPlateModel::clone | ( | ) | const |
QString Isis::NaifDskPlateModel::filename | ( | ) | const |
Returns the nane of the NAIF DSK file.
References isValid().
Intercept * Isis::NaifDskPlateModel::intercept | ( | const NaifVertex & | vertex, |
const NaifVector & | raydir ) const |
Determine a target body intercept point from an observer and look direction.
This method will compute an intercept point on the target body given a body fixed vertex of an observer and a look direction. This implements a true ray intersection algortihm.
If an intercept point cannot be found a null pointer is returned.
vertex | Body fixed X/Y/Z coordinate of the observer |
raydir | Vector that specifies a look direction |
References isPlateIdValid(), plate(), and plateIdOfIntercept().
Referenced by Isis::NaifDskShape::intersectSurface().
bool Isis::NaifDskPlateModel::isPlateIdValid | ( | const SpiceInt | plateid | ) | const |
Determines if the plate ID is valid.
A valid plateId is between the values of 1 and the number of plates in the model.
This method is useful for checking for errors when determining the plate of intersection. Valid intersections are initially return by the NAID DSK API as identifying the plate ID where the intersection occurs. A DSK routine then retreives the triangle plate (TIN) by this ID number.
plateid | Plate ID to check for validity |
References isValid().
Referenced by intercept(), plate(), and point().
bool Isis::NaifDskPlateModel::isValid | ( | ) | const |
Checks validity of the object.
Referenced by filename(), isPlateIdValid(), NaifDskPlateModel(), numberPlates(), numberVertices(), plate(), plateIdOfIntercept(), and point().
int Isis::NaifDskPlateModel::numberPlates | ( | ) | const |
int Isis::NaifDskPlateModel::numberVertices | ( | ) | const |
Returns the number of vertices in the plate model.
References isValid().
NaifTriangle Isis::NaifDskPlateModel::plate | ( | SpiceInt | plateid | ) | const |
Retrieve the triangular plate identified by its ID.
This method can be used to retrieve a particular plate specified by its ID. This is useful for general retrieval and can be used to easily read all plates in a DSK file.
plateid | Valid id of the plate to retrieve |
References _FILEINFO_, Isis::NaifStatus::CheckErrors(), isPlateIdValid(), isValid(), plate(), and Isis::IException::Programmer.
Referenced by intercept(), and plate().
SpiceInt Isis::NaifDskPlateModel::plateIdOfIntercept | ( | const NaifVertex & | vertex, |
const NaifVector & | raydir, | ||
NaifVertex & | xpoint ) const |
Primary API to determine ray intercept from observer/look direction.
This method determines an intercept point given an observer position and a look direction vector. It uses the NAIF DSK API to determine the ray intercept point given the position and look direction from the observer.
vertex | Position in body fixed coordinates of observer |
raydir | Look direction vector to use as intercept ray |
xpoint | Output of point of intercept in body fixed coordinates if an intercept point is found |
References _FILEINFO_, Isis::NaifStatus::CheckErrors(), isValid(), Isis::IException::Programmer, and Isis::validate().
Referenced by intercept().
SurfacePoint * Isis::NaifDskPlateModel::point | ( | const Latitude & | lat, |
const Longitude & | lon ) const |
Get surface intersection for a lat/lon grid point.
This method will return a surface point intercept given a lat/lon coordinate. Primary use of this method is to determine radius values at the grid point.
Essentially a fixed body ray is created from the lat/lon location that extends beyond the highest radius of the body as defined by the plate model. The endpoint of this ray serves as the observer position. A look direction vector is created from the observer point by reversing the direction of the vector from the center of the body to the observer point. Theoretically, this routine should not fail based upon this technique.
lat | Latitide of the grid coordinate point |
lon | Longitude of the grid coordinate point |
References _FILEINFO_, Isis::NaifStatus::CheckErrors(), isPlateIdValid(), isValid(), Isis::IException::Programmer, and Isis::Angle::Radians.
Referenced by Isis::NaifDskShape::localRadius().
int Isis::NaifDskPlateModel::size | ( | ) | const |
Returns the number of plates in the DSK file - mostly for conformity.
References numberPlates().