![]() |
VR-Forces 4.6 Class Documentation
|
A location3D is a point in space, i.e. a geocentric coordinate. More...

Public Member Functions | |
| DtLocation3D (const DtVector &vect) | |
| Private constructor, visible to the interface but not for use in the scripts themselves. | |
| DtLocation3D (const DtGeodeticCoord &geodCoord) | |
| DtLocation3D (const DtLocation3D &orig) | |
| DtLocation3D () | |
| ~DtLocation3D () | |
| DtLocation3D & | operator= (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. | |
| 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. | |
| 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. | |
| 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. | |
| DtVector | getGeodeticVector (void) const |
| double | distanceToLocation3D (const DtLocation3D &location) const |
| Computes the distance between two locations in space. | |
| 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. | |
| 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. | |
| DtVector3D | vectorToLoc3D (const DtLocation3D &location) const |
| Computes the distance between two points, around a great circle path, with linear elevation change. | |
| DtVectorGeoc3D | vectorGeocToLoc3D (const DtLocation3D &location) const |
| Gets an absolute, i.e. geocentric, line-of-sight, vector to the location. | |
| DtLocation3D | addVector3D (const DtVector3D &vec) const |
| Adds a vector in earth-relative coordinates to the given location. | |
| DtLocation3D | addVectorGeoc3D (const DtVectorGeoc3D &vec) const |
| Adds an absolute, i.e. | |
| void | setGeocentric (double x, double y, double z) |
| Sets the location using geocentric coordinates. | |
| void | getGeocentricCoords (double &x, double &y, double &z) const |
| Gets the location in geocentric coordinates. | |
| 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. | |
| 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. | |
| DtAsciiSerializable (const DtAsciiSerializable &orig) | |
| virtual | ~DtAsciiSerializable () |
| virtual std::string | objectTypeC () const |
| Returns a std::string version of the objectType. | |
| virtual void | init (void *userData) |
| This function is called right after the object is constructed during the deserialization process, but before deserialize() is called. | |
Protected Attributes | |
| DtGeodeticCoord | myGeodLocation |
| The private data. | |
| DtString | objectType () const |
| Inherited from DtAsciiSerializable. | |
| DtString | serialize () |
| Returns a string serialized version of this class. | |
| bool | deserialize (const DtString &data) |
| Returns true if it could fill its members with the data contained in the string. | |
| static DtAsciiSerializable * | creator () |
| Returns a new object of this type with default values. | |
Additional Inherited Members | |
Static Public Member Functions inherited from DtObjectDebugger< DtAsciiSerializable > | |
| static DtObjectCounter::CounterType | ObjectCount () |
| static const DtObjectContainer * | ObjectContainer () |
Static Public Member Functions inherited from DtObjectDebugger< DtLocation3D > | |
| static DtObjectCounter::CounterType | ObjectCount () |
| static const DtObjectContainer * | ObjectContainer () |
Protected Member Functions inherited from DtObjectDebugger< DtAsciiSerializable > | |
| DtObjectDebugger () | |
| DtObjectDebugger (const DtObjectDebugger &) | |
| ~DtObjectDebugger () | |
Protected Member Functions inherited from DtObjectDebugger< DtLocation3D > | |
| DtObjectDebugger () | |
| DtObjectDebugger (const DtObjectDebugger &) | |
| ~DtObjectDebugger () | |
A location3D is a point in space, i.e. a geocentric coordinate.
| 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.
| 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.
|
virtual |
|
virtual |
Returns a string serialized version of this class.
Implements DtAsciiSerializable.
Returns true if it could fill its members with the data contained in the string.
False otherwise.
Implements DtAsciiSerializable.
|
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.
Sets the location using geocentric coordinates.
Gets the location in geocentric coordinates.
| bool DtLocation3D::operator== | ( | const DtLocation3D & | ) | const |
|
inline |
|
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.