SLProject 4.0.000
|
Encapsulation of a mobile device location set by the device's GPS sensor. More...
#include <SLDeviceLocation.h>
Public Member Functions | |
SLDeviceLocation () | |
void | init () |
void | onLocationLatLonAlt (SLdouble latDEG, SLdouble lonDEG, SLdouble altM, SLfloat accuracyM) |
Event handler for mobile device location update. More... | |
SLbool | calculateSolarAngles (SLVec3d locationLatLonAlt, std::time_t time) |
Calculates the solar angles at origin at local time. More... | |
SLVec3d | convertLatLonAlt2ENU (SLVec3d locLatLonAlt) const |
Converter method: the transferred wgs84 coordinate is converted to ENU frame and returned (does not change SLDeviceLocation) More... | |
void | isUsed (SLbool isUsed) |
Setter that turns on the device rotation sensor. More... | |
void | useOriginAltitude (SLbool useGLA) |
void | improveOrigin (SLbool impO) |
void | hasOrigin (SLbool hasOL) |
void | originLatLonAlt (int degreesLat, int minutesLat, double secondsLat, int degreesLon, int minutesLon, double secondsLon, double altitudeM) |
Origin coordinate setter in WGS84 Lat-Lon in degrees, minutes and seconds. More... | |
void | originLatLonAlt (SLdouble latDEG, SLdouble lonDEG, SLdouble altM) |
Set global origin in latitude, longitude and altitude at the ground level. More... | |
void | originLatLonAlt (SLVec3d lla) |
void | defaultLatLonAlt (int degreesLat, int minutesLat, double secondsLat, int degreesLon, int minutesLon, double secondsLon, double altitudeM) |
Default coordinate setter in WGS84 Lat-Lon in degrees, minutes and seconds. More... | |
void | defaultLatLonAlt (SLdouble latDEG, SLdouble lonDEG, SLdouble altM) |
Sets the default location in latitude, longitude and altitude. More... | |
void | defaultLatLonAlt (SLVec3d lla) |
void | locMaxDistanceM (SLfloat maxDist) |
void | sunLightNode (SLLightDirect *sln) |
void | loadGeoTiff (const SLstring &geoTiffFile) |
Loads a GeoTiff DEM (Digital Elevation Model) Image. More... | |
bool | geoTiffIsAvailableAndValid () const |
bool | posIsOnGeoTiff (SLdouble latDEG, SLdouble lonDEG) const |
Return true if the current GPS location is within the GeoTiff boundaries. More... | |
void | cameraHeightM (float camHeightM) |
void | offsetMode (SLLocOffsetMode lom) |
void | offsetENU (SLVec3d offsetENU) |
void | activeNamedLocation (SLint locIndex) |
SLbool | isUsed () const |
SLVec3d | locLatLonAlt () const |
SLVec3d | locECEF () const |
SLVec3d | locENU () const |
SLfloat | locAccuracyM () const |
SLfloat | locMaxDistanceM () const |
SLVec3d | defaultENU () const |
SLVec3d | originLatLonAlt () const |
SLVec3d | defaultLatLonAlt () const |
SLVec3d | originENU () const |
SLVec3d | offsetENU () const |
SLbool | hasOrigin () const |
SLbool | useOriginAltitude () const |
SLMat3d | wRecef () const |
SLfloat | improveTime () |
SLfloat | originSolarZenit () const |
SLfloat | originSolarAzimut () const |
SLfloat | originSolarSunrise () const |
SLfloat | originSolarSunset () const |
SLNode * | sunLightNode () const |
SLfloat | altDemM () const |
SLfloat | altGpsM () const |
SLfloat | cameraHeightM () const |
SLLocOffsetMode | offsetMode () |
SLstring | offsetModeStr () const |
Returns the device location offset mode as string. More... | |
SLVLocation & | nameLocations () |
SLint | activeNamedLocation () const |
Private Attributes | |
SLbool | _isUsed |
Flag if the devices GPS Sensor is used. More... | |
SLbool | _isFirstSensorValue |
Flag for the first sensor values. More... | |
SLVec3d | _locLatLonAlt |
Earth location in latitudeDEG, longitudeDEG & AltitudeM on WGS84 geoid. More... | |
SLVec3d | _locECEF |
Cartesian location in ECEF. More... | |
SLVec3d | _locENU |
Cartesian location in ENU frame. More... | |
SLfloat | _locAccuracyM |
Horizontal accuracy radius in m with 68% probability. More... | |
SLfloat | _locMaxDistanceM |
Max. allowed distance from origin. If higher it is ignored. More... | |
SLVec3d | _defaultLatLonAlt |
Default location of scene in LatLonAlt. More... | |
SLVec3d | _defaultENU |
Default location in ENU frame used if real location is too far away from origin. More... | |
SLVec3d | _originLatLonAlt |
Global origin location of scene in LatLonAlt. More... | |
SLVec3d | _originENU |
Origin location in ENU frame. More... | |
SLVec3d | _offsetENU |
Offset vector in ENU frame. More... | |
SLfloat | _originAccuracyM |
Accuracy radius of origin point. More... | |
SLfloat | _originSolarZenith |
Zenith angle of the sun in deg. (from up dir.) at origin at local time. More... | |
SLfloat | _originSolarAzimuth |
Azimuth angle of the sun in deg. (eastward from north) at origin at local time. More... | |
SLfloat | _originSolarSunrise |
Sunrise local time at origin. More... | |
SLfloat | _originSolarSunset |
Sunset local time at origin. More... | |
SLbool | _hasOrigin |
Flag if this scene has a global reference location. More... | |
SLbool | _useOriginAltitude |
Flag if global reference altitude should be used. More... | |
SLfloat | _altDemM |
Altitude in m from Digital Elevation Model. More... | |
SLfloat | _altGpsM |
Altitude in m from GPS. More... | |
SLfloat | _cameraHeightM |
Height from ground to the mobile camera in m. More... | |
SLbool | _improveOrigin |
Flag if origin should be improved over time & accuracy. More... | |
SLfloat | _improveTimeSEC |
Max. time in seconds for the origin improvement. More... | |
HighResTimer | _improveTimer |
Timer to measure the improve time. More... | |
SLMat3d | _wRecef |
ECEF frame to world frame rotation: rotates a point defined in ecef. More... | |
SLNode * | _sunLightNode |
Pointer to directional light node to be changed if solar angles are calculated. More... | |
CVImageGeoTiff | _demGeoTiff |
Digital Elevation Model from a Geo Tiff image. More... | |
SLLocOffsetMode | _offsetMode |
Location offset mode. More... | |
SLVLocation | _nameLocations |
Vector of fix locations for default view points. More... | |
SLint | _activeNamedLocation |
Index of the active named location as defaultENU;. More... | |
Encapsulation of a mobile device location set by the device's GPS sensor.
This class is only used if SLProject runs on a mobile device. Check out the app-Demo-SLProject/android and app_demo_slproject/ios how the sensor data is generated and passed to this object hold by AppDemo. The class stores the devices location that it gets from its GPS (global positioning system) sensor. The device location can be used in the active camera to apply it to the scene camera (s. SLCamera::setView).
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Calculates the solar angles at origin at local time.
Calculates the zenith and azimuth angle in deg. of the sun at the origin at the local time using the Solar Position Algorithm from: https://midcdmz.nrel.gov/spa/ that is part of libsl_external.
|
inline |
|
inline |
Converter method: the transferred wgs84 coordinate is converted to ENU frame and returned (does not change SLDeviceLocation)
|
inline |
|
inline |
void SLDeviceLocation::defaultLatLonAlt | ( | int | degreesLat, |
int | minutesLat, | ||
double | secondsLat, | ||
int | degreesLon, | ||
int | minutesLon, | ||
double | secondsLon, | ||
double | altitudeM | ||
) |
Default coordinate setter in WGS84 Lat-Lon in degrees, minutes and seconds.
Sets the default location in latitude, longitude and altitude.
It must be called after setting the origin. If no origin is set with it will be automatically set in onLocationLatLonAlt. The default location is used by the camera in SLCamera::setView if the current distance between _locENU and _originENU is greater than _locMaxDistanceM. Witch means that you are in real not near the location. /param latDEG Latitude (vertical) on WGS84 geoid in degrees /param lonDEG Longitude (horizontal) on WGS84 geoid in degrees /param altM Altitude over WGS84 geoid in meters
|
inline |
bool SLDeviceLocation::geoTiffIsAvailableAndValid | ( | ) | const |
|
inline |
void SLDeviceLocation::hasOrigin | ( | SLbool | hasOL | ) |
|
inline |
|
inline |
void SLDeviceLocation::init | ( | ) |
|
inline |
void SLDeviceLocation::isUsed | ( | SLbool | isUsed | ) |
Setter that turns on the device rotation sensor.
void SLDeviceLocation::loadGeoTiff | ( | const SLstring & | geoTiffFile | ) |
Loads a GeoTiff DEM (Digital Elevation Model) Image.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
SLstring SLDeviceLocation::offsetModeStr | ( | ) | const |
Returns the device location offset mode as string.
void SLDeviceLocation::onLocationLatLonAlt | ( | SLdouble | latDEG, |
SLdouble | lonDEG, | ||
SLdouble | altM, | ||
SLfloat | accuracyM | ||
) |
Event handler for mobile device location update.
Global event handler for device GPS location with longitude and latitude in degrees and altitude in meters. This location uses the World Geodetic System 1984 (WGS84). The accuracy in meters is a radius in which the location is with a probability of 68% (2 sigma). The altitude in m is the most inaccurate information. The option _useOriginAltitude allows to overwrite the current altitude with the origins altitude. If a geoTiff is available the altitude is is take from it. /param latDEG Latitude (vertical) on WGS84 geoid in degrees /param lonDEG Longitude (horizontal) on WGS84 geoid in degrees /param altM Altitude over WGS84 geoid in meters /param accuracyM Accuracy in meters is a radius
|
inline |
|
inline |
void SLDeviceLocation::originLatLonAlt | ( | int | degreesLat, |
int | minutesLat, | ||
double | secondsLat, | ||
int | degreesLon, | ||
int | minutesLon, | ||
double | secondsLon, | ||
double | altitudeM | ||
) |
Origin coordinate setter in WGS84 Lat-Lon in degrees, minutes and seconds.
Set global origin in latitude, longitude and altitude at the ground level.
The calculated values can be used for global camera positioning via GPS sensor. The origin is the zero point of the model. The origin should be defined in the model on the ground. /param latDEG Latitude (vertical) on WGS84 geoid in decimal degrees /param lonDEG Longitude (horizontal) on WGS84 geoid in decimal degrees /param altM Altitude over WGS84 geoid in meters
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Return true if the current GPS location is within the GeoTiff boundaries.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
private |
Index of the active named location as defaultENU;.
|
private |
Altitude in m from Digital Elevation Model.
|
private |
Altitude in m from GPS.
|
private |
Height from ground to the mobile camera in m.
|
private |
Default location in ENU frame used if real location is too far away from origin.
|
private |
Default location of scene in LatLonAlt.
|
private |
Digital Elevation Model from a Geo Tiff image.
|
private |
Flag if this scene has a global reference location.
|
private |
Flag if origin should be improved over time & accuracy.
|
private |
Timer to measure the improve time.
|
private |
Max. time in seconds for the origin improvement.
|
private |
Flag for the first sensor values.
|
private |
Flag if the devices GPS Sensor is used.
|
private |
Horizontal accuracy radius in m with 68% probability.
|
private |
Cartesian location in ECEF.
|
private |
Cartesian location in ENU frame.
|
private |
Earth location in latitudeDEG, longitudeDEG & AltitudeM on WGS84 geoid.
|
private |
Max. allowed distance from origin. If higher it is ignored.
|
private |
Vector of fix locations for default view points.
|
private |
Offset vector in ENU frame.
|
private |
Location offset mode.
|
private |
Accuracy radius of origin point.
|
private |
Origin location in ENU frame.
|
private |
Global origin location of scene in LatLonAlt.
|
private |
Azimuth angle of the sun in deg. (eastward from north) at origin at local time.
|
private |
Sunrise local time at origin.
|
private |
Sunset local time at origin.
|
private |
Zenith angle of the sun in deg. (from up dir.) at origin at local time.
|
private |
Pointer to directional light node to be changed if solar angles are calculated.
|
private |
Flag if global reference altitude should be used.
|
private |
ECEF frame to world frame rotation: rotates a point defined in ecef.