![]() |
Stellarium 0.13.3
|
Store and manages the displaying of the Landscape. More...
#include <Landscape.hpp>
Public Types | |
enum | horizonListMode { azDeg_altDeg = 0, azDeg_zdDeg = 1, azRad_altRad = 2, azRad_zdRad = 3, azGrad_altGrad = 4, azGrad_zdGrad = 5 } |
The list of azimuths (counted from True North towards East) and altitudes can come in various formats. We read the first two elements, which can be of formats: More... | |
Public Member Functions | |
Landscape (float _radius=2.f) | |
virtual void | load (const QSettings &landscapeIni, const QString &landscapeId)=0 |
Load landscape. More... | |
virtual void | draw (StelCore *core)=0 |
void | update (double deltaTime) |
void | setBrightness (const float b, const float pollutionBrightness=0.0f) |
Set the brightness of the landscape plus brightness of optional add-on night lightscape. More... | |
float | getBrightness () const |
Returns the current brightness level. More... | |
float | getLightscapeBrightness () const |
Returns the lightscape brightness. More... | |
float | getTargetLightscapeBrightness () const |
Returns the lightscape brighness modulated with the fader's target state (i.e. binary on/off) More... | |
float | getEffectiveLightscapeBrightness () const |
Gets the currently effective lightscape brightness (modulated by the fader) More... | |
void | setFlagShow (const bool b) |
Set whether landscape is displayed (does not concern fog) More... | |
bool | getFlagShow () const |
Get whether landscape is displayed (does not concern fog) More... | |
float | getEffectiveLandFadeValue () |
Returns the currently effective land fade value. More... | |
void | setFlagShowFog (const bool b) |
Set whether fog is displayed. More... | |
bool | getFlagShowFog () const |
Get whether fog is displayed. More... | |
void | setFlagShowIllumination (const bool b) |
Set whether illumination is displayed. More... | |
bool | getFlagShowIllumination () const |
Get whether illumination is displayed. More... | |
QString | getName () const |
Get landscape name. More... | |
QString | getAuthorName () const |
Get landscape author name. More... | |
QString | getDescription () const |
Get landscape description. More... | |
const StelLocation & | getLocation () const |
Return the associated location (may be empty!) More... | |
bool | hasLocation () const |
Return if the location is valid (a valid location has a valid planetName!) More... | |
int | getDefaultBortleIndex () const |
Return default Bortle index (light pollution value) or -1 (unknown/no change) More... | |
int | getDefaultFogSetting () const |
Return default fog setting (0/1) or -1 (no change) More... | |
float | getDefaultAtmosphericExtinction () const |
Return default atmosperic extinction [mag/airmass], or -1 (no change) More... | |
float | getDefaultAtmosphericTemperature () const |
Return configured atmospheric temperature [degrees Celsius], for refraction computation, or -1000 for "unknown/no change". More... | |
float | getDefaultAtmosphericPressure () const |
Return configured atmospheric pressure [mbar], for refraction computation. More... | |
float | getLandscapeMinimalBrightness () const |
Return minimal brightness for landscape returns -1 to signal "standard conditions" (use default value from config.ini) More... | |
void | setZRotation (float d) |
Set an additional z-axis (azimuth) rotation after landscape has been loaded. More... | |
bool | getIsFullyVisible () const |
Get whether the landscape is currently fully visible (i.e. opaque). More... | |
virtual float | getOpacity (Vec3d azalt) const |
can be used to find sunrise or visibility questions on the real-world landscape horizon. More... | |
Protected Member Functions | |
void | loadCommon (const QSettings &landscapeIni, const QString &landscapeId) |
Load attributes common to all landscapes. More... | |
void | createPolygonalHorizon (const QString &lineFileName, const float polyAngleRotateZ=0.0f, const QString &listMode="azDeg_altDeg") |
Create a StelSphericalPolygon that describes a measured horizon line. More... | |
const QString | getTexturePath (const QString &basename, const QString &landscapeId) const |
search for a texture in landscape directory, else global textures directory More... | |
Protected Attributes | |
float | radius |
QString | name |
QString | author |
Read from landscape.ini:[landscape]name. More... | |
QString | description |
Read from landscape.ini:[landscape]author. More... | |
float | minBrightness |
Read from landscape.ini:[landscape]description. More... | |
float | landscapeBrightness |
Read from landscape.ini:[landscape]minimal_brightness. Allows minimum visibility that cannot be underpowered. More... | |
float | lightScapeBrightness |
brightness [0..1] to draw the landscape. Computed by the LandscapeMgr. More... | |
bool | validLandscape |
can be used to draw nightscape texture (e.g. city light pollution), if available. Computed by the LandscapeMgr. More... | |
LinearFader | landFader |
was a landscape loaded properly? More... | |
LinearFader | fogFader |
Used to slowly fade in/out landscape painting. More... | |
LinearFader | illumFader |
Used to slowly fade in/out fog painting. More... | |
int | rows |
Used to slowly fade in/out illumination painting. More... | |
int | cols |
horizontal rows. May be given in landscape.ini:[landscape]tesselate_rows. More indicates higher accuracy, but is slower. More... | |
float | angleRotateZ |
vertical columns. May be given in landscape.ini:[landscape]tesselate_cols. More indicates higher accuracy, but is slower. More... | |
float | angleRotateZOffset |
[radians] if pano does not have its left border in the east, rotate in azimuth. Configured in landscape.ini[landscape]angle_rotatez (or decor_angle_rotatez for old_style landscapes) More... | |
StelLocation | location |
[radians] This is a rotation changeable at runtime via setZRotation (called by LandscapeMgr::setZRotation). More... | |
int | defaultBortleIndex |
OPTIONAL. If present, can be used to set location. More... | |
int | defaultFogSetting |
May be given in landscape.ini:[location]light_pollution. Default: -1 (no change). More... | |
float | defaultExtinctionCoefficient |
May be given in landscape.ini:[location]display_fog: -1(no change), 0(off), 1(on). Default: -1. More... | |
float | defaultTemperature |
May be given in landscape.ini:[location]atmospheric_extinction_coefficient. Default -1 (no change). More... | |
float | defaultPressure |
[Celsius] May be given in landscape.ini:[location]atmospheric_temperature. default: -1000.0 (no change) More... | |
SphericalRegionP | horizonPolygon |
[mbar] May be given in landscape.ini:[location]atmospheric_pressure. Default -1.0 (compute from [location]/altitude), use -2 to indicate "no change". More... | |
Vec3f | horizonPolygonLineColor |
Optional element describing the horizon line. More... | |
Store and manages the displaying of the Landscape.
Don't use this class directly, use the LandscapeMgr. A landscape's most important element is a photo panorama, or at least a polygon that describes the true horizon visible from your observing location. Optional components include:
We discern:
LandscapeId | The directory name of the landscape. |
name | The landscape name as specified in the LandscapeIni (may contain spaces, UTF8, ...) |
Definition at line 60 of file Landscape.hpp.
The list of azimuths (counted from True North towards East) and altitudes can come in various formats. We read the first two elements, which can be of formats:
Definition at line 146 of file Landscape.hpp.
|
protected |
Create a StelSphericalPolygon that describes a measured horizon line.
If present, this can be used to draw a horizon line or simplify the functionality to discern if an object is below the horizon.
_lineFileName | A text file with lines that are either empty or comment lines starting with # or azimuth altitude [degrees] |
_polyAngleRotateZ | possibility to set some final calibration offset like meridian convergence correction. |
|
inline |
Get landscape author name.
Definition at line 107 of file Landscape.hpp.
|
inline |
Returns the current brightness level.
Definition at line 82 of file Landscape.hpp.
|
inline |
Return default atmosperic extinction [mag/airmass], or -1 (no change)
Definition at line 120 of file Landscape.hpp.
|
inline |
Return configured atmospheric pressure [mbar], for refraction computation.
returns -1 to signal "standard conditions" [compute from altitude], or -2 for "unknown/invalid/no change"
Definition at line 125 of file Landscape.hpp.
|
inline |
Return configured atmospheric temperature [degrees Celsius], for refraction computation, or -1000 for "unknown/no change".
Definition at line 122 of file Landscape.hpp.
|
inline |
Return default Bortle index (light pollution value) or -1 (unknown/no change)
Definition at line 116 of file Landscape.hpp.
|
inline |
Return default fog setting (0/1) or -1 (no change)
Definition at line 118 of file Landscape.hpp.
|
inline |
Get landscape description.
Definition at line 109 of file Landscape.hpp.
|
inline |
Returns the currently effective land fade value.
Definition at line 95 of file Landscape.hpp.
|
inline |
Gets the currently effective lightscape brightness (modulated by the fader)
Definition at line 88 of file Landscape.hpp.
|
inline |
Get whether landscape is displayed (does not concern fog)
Definition at line 93 of file Landscape.hpp.
|
inline |
Get whether fog is displayed.
Definition at line 99 of file Landscape.hpp.
|
inline |
Get whether illumination is displayed.
Definition at line 103 of file Landscape.hpp.
|
inline |
Get whether the landscape is currently fully visible (i.e. opaque).
Definition at line 139 of file Landscape.hpp.
|
inline |
Return minimal brightness for landscape returns -1 to signal "standard conditions" (use default value from config.ini)
Definition at line 128 of file Landscape.hpp.
|
inline |
Returns the lightscape brightness.
Definition at line 84 of file Landscape.hpp.
|
inline |
Return the associated location (may be empty!)
Definition at line 112 of file Landscape.hpp.
|
inline |
Get landscape name.
Definition at line 105 of file Landscape.hpp.
|
inlinevirtual |
can be used to find sunrise or visibility questions on the real-world landscape horizon.
Default implementation indicates the horizon equals math horizon.
Reimplemented in LandscapeSpherical, LandscapeFisheye, LandscapePolygonal, and LandscapeOldStyle.
Definition at line 144 of file Landscape.hpp.
|
inline |
Returns the lightscape brighness modulated with the fader's target state (i.e. binary on/off)
Definition at line 86 of file Landscape.hpp.
|
protected |
search for a texture in landscape directory, else global textures directory
basename | The name of a texture file, e.g. "fog.png" |
landscapeId | The landscape ID (directory name) to which the texture belongs |
misc | possibility of throwing "file not found" exceptions |
|
inline |
Return if the location is valid (a valid location has a valid planetName!)
Definition at line 114 of file Landscape.hpp.
|
pure virtual |
Load landscape.
landscapeIni | A reference to an existing QSettings object which describes the landscape |
landscapeId | The name of the directory for the landscape files (e.g. "ocean") |
Implemented in LandscapeSpherical, LandscapeFisheye, LandscapePolygonal, and LandscapeOldStyle.
|
protected |
Load attributes common to all landscapes.
landscapeIni | A reference to an existing QSettings object which describes the landscape |
landscapeId | The name of the directory for the landscape files (e.g. "ocean") |
|
inline |
Set the brightness of the landscape plus brightness of optional add-on night lightscape.
This is called in each draw().
Definition at line 79 of file Landscape.hpp.
|
inline |
Set whether landscape is displayed (does not concern fog)
Definition at line 91 of file Landscape.hpp.
|
inline |
Set whether fog is displayed.
Definition at line 97 of file Landscape.hpp.
|
inline |
Set whether illumination is displayed.
Definition at line 101 of file Landscape.hpp.
|
inline |
Set an additional z-axis (azimuth) rotation after landscape has been loaded.
This is intended for special uses such as when the landscape consists of a vehicle which might change orientation over time (e.g. a ship). It is called e.g. by the LandscapeMgr. Contrary to that, the purpose of the azimuth rotation (landscape/[decor_]angle_rotatez) in landscape.ini is to orient the pano.
d | the rotation angle in degrees. |
Definition at line 136 of file Landscape.hpp.
|
protected |
vertical columns. May be given in landscape.ini:[landscape]tesselate_cols. More indicates higher accuracy, but is slower.
Definition at line 185 of file Landscape.hpp.
|
protected |
[radians] if pano does not have its left border in the east, rotate in azimuth. Configured in landscape.ini[landscape]angle_rotatez (or decor_angle_rotatez for old_style landscapes)
Definition at line 186 of file Landscape.hpp.
|
protected |
Read from landscape.ini:[landscape]name.
Definition at line 173 of file Landscape.hpp.
|
protected |
horizontal rows. May be given in landscape.ini:[landscape]tesselate_rows. More indicates higher accuracy, but is slower.
Definition at line 184 of file Landscape.hpp.
|
protected |
OPTIONAL. If present, can be used to set location.
Definition at line 190 of file Landscape.hpp.
|
protected |
May be given in landscape.ini:[location]display_fog: -1(no change), 0(off), 1(on). Default: -1.
Definition at line 192 of file Landscape.hpp.
|
protected |
May be given in landscape.ini:[location]light_pollution. Default: -1 (no change).
Definition at line 191 of file Landscape.hpp.
|
protected |
[Celsius] May be given in landscape.ini:[location]atmospheric_temperature. default: -1000.0 (no change)
Definition at line 194 of file Landscape.hpp.
|
protected |
May be given in landscape.ini:[location]atmospheric_extinction_coefficient. Default -1 (no change).
Definition at line 193 of file Landscape.hpp.
|
protected |
Read from landscape.ini:[landscape]author.
Definition at line 174 of file Landscape.hpp.
|
protected |
Used to slowly fade in/out landscape painting.
Definition at line 181 of file Landscape.hpp.
|
protected |
[mbar] May be given in landscape.ini:[location]atmospheric_pressure. Default -1.0 (compute from [location]/altitude), use -2 to indicate "no change".
Definition at line 197 of file Landscape.hpp.
|
protected |
Optional element describing the horizon line.
Data shall be read from the file given as landscape.ini[landscape]polygonal_horizon_list For LandscapePolygonal, this is the only horizon data item.
Definition at line 200 of file Landscape.hpp.
|
protected |
Used to slowly fade in/out fog painting.
Definition at line 182 of file Landscape.hpp.
|
protected |
was a landscape loaded properly?
Definition at line 180 of file Landscape.hpp.
|
protected |
Read from landscape.ini:[landscape]minimal_brightness. Allows minimum visibility that cannot be underpowered.
Definition at line 177 of file Landscape.hpp.
|
protected |
brightness [0..1] to draw the landscape. Computed by the LandscapeMgr.
Definition at line 178 of file Landscape.hpp.
|
protected |
[radians] This is a rotation changeable at runtime via setZRotation (called by LandscapeMgr::setZRotation).
Not in landscape.ini: Used in special cases where the horizon may rotate, e.g. on a ship.
Definition at line 189 of file Landscape.hpp.
|
protected |
Read from landscape.ini:[landscape]description.
Definition at line 176 of file Landscape.hpp.
|
protected |
Used to slowly fade in/out illumination painting.
Definition at line 183 of file Landscape.hpp.
|
protected |
can be used to draw nightscape texture (e.g. city light pollution), if available. Computed by the LandscapeMgr.
Definition at line 179 of file Landscape.hpp.