VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Attributes
DtLocation3D Class Reference

A location3D is a point in space, i.e. a geocentric coordinate.

Inheritance diagram for DtLocation3D:
Inheritance graph
[legend]

Public Member Functions

 DtLocation3D (const DtVector &vect)
 
 DtLocation3D (const DtGeodeticCoord &geodCoord)
 
 DtLocation3D (const DtLocation3D &orig)
 
 DtLocation3D ()
 
 ~DtLocation3D ()
 
DtLocation3Doperator= (const DtLocation3D &orig)
 
 DtLocation3D (const double latitude, const double longitude, const double altitudeMSL)
 
DtLocation3D makeCopy () const
 
DtVector getGeocentric () const
 
DtGeodeticCoord geodLocation () const
 
void setGeodeticFromVector (const DtVector &geodeticData)
 
DtVector getGeodeticVector (void) const
 
double distanceToLocation3D (const DtLocation3D &location) const
 
bool isNearLocation3D (const DtLocation3D &loc, const double error) const
 
bool isInsidePolygon (const std::vector< DtLocation3D > polyPoints) const
 
bool isLeftOfLine (const DtLocation3D &loc1, const DtLocation3D &loc2) const
 
DtVector3D vectorToLoc3D (const DtLocation3D &location) const
 
DtVectorGeoc3D vectorGeocToLoc3D (const DtLocation3D &location) const
 
DtLocation3D addVector3D (const DtVector3D &vec) const
 
DtLocation3D addVectorGeoc3D (const DtVectorGeoc3D &vec) const
 
void setGeocentric (double x, double y, double z)
 
void getGeocentricCoords (double &x, double &y, double &z) const
 
bool operator== (const DtLocation3D &) const
 
bool operator!= (const DtLocation3D &orig) const
 
double getLat () const
 
void setLat (const double lat)
 
double getLon () const
 
void setLon (const double lon)
 
double getAlt () const
 
void setAlt (const double alt)
 
- Public Member Functions inherited from DtAsciiSerializable
 DtAsciiSerializable ()
 
 DtAsciiSerializable (const DtAsciiSerializable &orig)
 
virtual ~DtAsciiSerializable ()
 
virtual std::string objectTypeC () const
 
virtual void init (void *userData)
 

Protected Attributes

DtGeodeticCoord myGeodLocation
 
DtString objectType () const
 
DtString serialize ()
 
bool deserialize (const DtString &data)
 
static DtAsciiSerializablecreator ()
 

Constructor & Destructor Documentation

DtLocation3D::DtLocation3D ( const DtVector vect)

Private constructor, visible to the interface but not for use in the scripts themselves.

The constructor using a DtVector assumes that the vector holds geocentric coordinates, not geodetic.

DtLocation3D::DtLocation3D ( const DtGeodeticCoord &  geodCoord)
DtLocation3D::DtLocation3D ( const DtLocation3D orig)
DtLocation3D::DtLocation3D ( )
DtLocation3D::~DtLocation3D ( )
DtLocation3D::DtLocation3D ( const double  latitude,
const double  longitude,
const double  altitudeMSL 
)

This constructor will be visible from the scripts. Lat an Lon in radians.

Member Function Documentation

DtLocation3D& DtLocation3D::operator= ( const DtLocation3D orig)
DtLocation3D DtLocation3D::makeCopy ( ) const

The assignment operator and copy constructor above, are useful in the expected way for C++ code, but Lua just copies the references to objects, so a special copy function is needed.

DtString DtLocation3D::objectType ( ) const
virtual

Inherited from DtAsciiSerializable.

Returns "DtLocation3D"

Implements DtAsciiSerializable.

DtString DtLocation3D::serialize ( )
virtual

Returns a string serialized version of this class.

Implements DtAsciiSerializable.

bool DtLocation3D::deserialize ( const DtString data)
virtual

Returns true if it could fill its members with the data contained in the string. False otherwise.

Implements DtAsciiSerializable.

static DtAsciiSerializable* DtLocation3D::creator ( )
static

Returns a new object of this type with default values.

DtVector DtLocation3D::getGeocentric ( ) const

These functions get the underlying DtVector representation; they are intended for use by functions that interface between the simulation infrastructure (e.g. VRF Objects) and scripts/behavior code, not by the scripts directly.

DtGeodeticCoord DtLocation3D::geodLocation ( ) const
void DtLocation3D::setGeodeticFromVector ( const DtVector geodeticData)

These functions initialize a location from a vector containing lat, lon, alt (rather than geocentric coordinates), and return a vector with lat, lon, alt. They are intended to allow storage in a DtVector, e.g in a PSR. When get... is used, it is assumed that a geodetic coordinate.

DtVector DtLocation3D::getGeodeticVector ( void  ) const
double DtLocation3D::getLat ( ) const

Gets or sets the latitude, longitude, and altitude above sea level. All angles are in radians.

void DtLocation3D::setLat ( const double  lat)

Gets or sets the latitude, longitude, and altitude above sea level. All angles are in radians.

double DtLocation3D::getLon ( ) const

Gets or sets the latitude, longitude, and altitude above sea level. All angles are in radians.

void DtLocation3D::setLon ( const double  lon)

Gets or sets the latitude, longitude, and altitude above sea level. All angles are in radians.

double DtLocation3D::getAlt ( ) const

Gets or sets the latitude, longitude, and altitude above sea level. All angles are in radians.

void DtLocation3D::setAlt ( const double  alt)

Gets or sets the latitude, longitude, and altitude above sea level. All angles are in radians.

double DtLocation3D::distanceToLocation3D ( const DtLocation3D location) const

Computes the distance between two locations in space.

bool DtLocation3D::isNearLocation3D ( const DtLocation3D loc,
const double  error 
) const
bool DtLocation3D::isInsidePolygon ( const std::vector< DtLocation3D polyPoints) const

Determines if this point is inside the given polygon. The polygon points can go around in either clockwise or counter clockwise direction. The polygon must be convex.

bool DtLocation3D::isLeftOfLine ( const DtLocation3D loc1,
const DtLocation3D loc2 
) const

Determines if this point is to the left of the line defined by the given two points. This implementation assumes "left" is from the point of view of an observer who is upright on the earth (at point 1).

DtVector3D DtLocation3D::vectorToLoc3D ( const DtLocation3D location) const

Computes the distance between two points, around a great circle path, with linear elevation change. double greatCircleDistanceToLocation3D(const DtLocation3D &location);.

Gets an vector in earth-relative coordinates to the given location. I.e., east-north or heading-distance. The inclination would be 0.0 if the two points were at the same altitude, even around the curve of the earth.

DtVectorGeoc3D DtLocation3D::vectorGeocToLoc3D ( const DtLocation3D location) const

Gets an absolute, i.e. geocentric, line-of-sight, vector to the location.

DtLocation3D DtLocation3D::addVector3D ( const DtVector3D vec) const

Adds a vector in earth-relative coordinates to the given location.

DtLocation3D DtLocation3D::addVectorGeoc3D ( const DtVectorGeoc3D vec) const

Adds an absolute, i.e. geocentric, vector to the location. Returns the new location.

void DtLocation3D::setGeocentric ( double  x,
double  y,
double  z 
)

Sets the location using geocentric coordinates.

void DtLocation3D::getGeocentricCoords ( double x,
double y,
double z 
) const

Gets the location in geocentric coordinates.

bool DtLocation3D::operator== ( const DtLocation3D ) const
bool DtLocation3D::operator!= ( const DtLocation3D orig) const
inline

Member Data Documentation

DtGeodeticCoord DtLocation3D::myGeodLocation
protected

The private data. Kept in geodetic (lat, lon, alt) (units radians, radians, meters) assuming that more computations are going to be done in topo coordinates.


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

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)