VR-Forces 4.10 Class Documentation
 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. More...

Inheritance diagram for DtLocation3D:
Inheritance graph
[legend]

Public Member Functions

 DtLocation3D (const DtVector &vect)
 Private constructor, visible to the interface but not for use in the scripts themselves. More...
 
 DtLocation3D (const DtGeodeticCoord &geodCoord)
 
 DtLocation3D (const DtLocation3D &orig)
 
 DtLocation3D ()
 
 ~DtLocation3D ()
 
DtLocation3Doperator= (const DtLocation3D &orig)
 
 DtLocation3D (const double latitude, const double longitude, const double altitudeMSL)
 This constructor will be visible from the scripts. Lat an Lon in radians. More...
 
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. More...
 
DtVector getGeocentric () const
 These functions get the underlying DtVector representation; they are intended for use by functions that interface between the simulation infrastructure (e.g. More...
 
DtGeodeticCoord geodLocation () const
 
void 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. More...
 
DtVector getGeodeticVector (void) const
 
double distanceToLocation3D (const DtLocation3D &location) const
 Computes the distance between two locations in space. More...
 
bool isNearLocation3D (const DtLocation3D &loc, const double error) const
 
bool isInsidePolygon (const std::vector< DtLocation3D > polyPoints) const
 Determines if this point is inside the given polygon. More...
 
bool 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. More...
 
DtVector3D vectorToLoc3D (const DtLocation3D &location) const
 Computes the distance between two points, around a great circle path, with linear elevation change. More...
 
DtVectorGeoc3D vectorGeocToLoc3D (const DtLocation3D &location) const
 Gets an absolute, i.e. geocentric, line-of-sight, vector to the location. More...
 
DtLocation3D addVector3D (const DtVector3D &vec) const
 Adds a vector in earth-relative coordinates to the given location. More...
 
DtLocation3D addVectorGeoc3D (const DtVectorGeoc3D &vec) const
 Adds an absolute, i.e. More...
 
void setGeocentric (double x, double y, double z)
 Sets the location using geocentric coordinates. More...
 
void getGeocentricCoords (double &x, double &y, double &z) const
 Gets the location in geocentric coordinates. More...
 
bool operator== (const DtLocation3D &) const
 
bool operator!= (const DtLocation3D &orig) const
 
double getLat () const
 Gets or sets the latitude, longitude, and altitude above sea level. More...
 
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 ()
 The implementer of this interface should be sure to create a creator function to create an empty object that returns a pointer to this interface. More...
 
 DtAsciiSerializable (const DtAsciiSerializable &orig)
 
virtual ~DtAsciiSerializable ()
 
virtual std::string objectTypeC () const
 Returns a std::string version of the objectType. More...
 
virtual void init (void *userData)
 This function is called right after the object is constructed during the deserialization process, but before deserialize() is called. More...
 

Protected Attributes

DtGeodeticCoord myGeodLocation
 The private data. More...
 
DtString objectType () const
 Inherited from DtAsciiSerializable. More...
 
DtString serialize ()
 Returns a string serialized version of this class. More...
 
bool deserialize (const DtString &data)
 Returns true if it could fill its members with the data contained in the string. More...
 
static DtAsciiSerializablecreator ()
 Returns a new object of this type with default values. More...
 

Detailed Description

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

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)
double DtLocation3D::getLon ( ) const
void DtLocation3D::setLon ( const double  lon)
double DtLocation3D::getAlt ( ) const
void DtLocation3D::setAlt ( const double  alt)
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 Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)