20 #ifndef _LANDSCAPE_HPP_ 21 #define _LANDSCAPE_HPP_ 23 #include "VecMath.hpp" 24 #include "StelToneReproducer.hpp" 25 #include "StelProjector.hpp" 27 #include "StelFader.hpp" 28 #include "StelUtils.hpp" 30 #include "StelLocation.hpp" 77 virtual void load(
const QSettings& landscapeIni,
const QString& landscapeId) = 0;
85 virtual void draw(
StelCore* core) = 0;
86 void update(
double deltaTime)
89 fogFader.update((
int)(deltaTime*1000));
173 virtual float getOpacity(
Vec3d azalt)
const { Q_ASSERT(0);
return (azalt[2]<0 ? 1.0f : 0.0f); }
191 void loadCommon(
const QSettings& landscapeIni,
const QString& landscapeId);
203 void createPolygonalHorizon(
const QString& lineFileName,
const float polyAngleRotateZ=0.0f,
const QString &listMode=
"azDeg_altDeg",
const bool polygonInverted=
false);
209 const QString
getTexturePath(
const QString& basename,
const QString& landscapeId)
const;
271 virtual void load(
const QSettings& landscapeIni,
const QString& landscapeId);
289 QVector<double> groundVertexArr;
290 QVector<float> groundTexCoordArr;
297 QVector<QImage*> sidesImages;
302 float decorAngleShift;
303 float groundAngleShift;
304 float groundAngleRotateZ;
315 QList<LOSSide> precomputedSides;
316 unsigned int memorySize;
333 virtual void load(
const QSettings& landscapeIni,
const QString& landscapeId);
353 virtual void load(
const QSettings& landscapeIni,
const QString& landscapeId);
365 void create(
const QString name,
const QString& maptex,
float texturefov,
float angleRotateZ);
366 void create(
const QString name,
float texturefov,
const QString& maptex,
const QString &_maptexFog=
"",
const QString& _maptexIllum=
"",
const float angleRotateZ=0.0f);
377 unsigned int memorySize;
395 virtual void load(
const QSettings& landscapeIni,
const QString& landscapeId);
413 void create(
const QString name,
const QString& maptex,
const QString &_maptexFog=
"",
const QString& _maptexIllum=
"",
const float _angleRotateZ=0.0f,
414 const float _mapTexTop=90.0f,
const float _mapTexBottom=-90.0f,
415 const float _fogTexTop=90.0f,
const float _fogTexBottom=-90.0f,
416 const float _illumTexTop=90.0f,
const float _illumTexBottom=-90.0f);
431 float illumTexBottom;
433 unsigned int memorySize;
436 #endif // _LANDSCAPE_HPP_ float getDefaultAtmosphericExtinction() const
Return default atmosperic extinction [mag/airmass], or -1 (no change)
int rows
Used to slowly fade in/out landscape feature labels.
bool getFlagShow() const
Get whether landscape is displayed (does not concern fog)
Store the informations for a location on a planet.
int defaultBortleIndex
OPTIONAL. If present, can be used to set location.
float minBrightness
Set during load. Required for consistent caching.
Store and manages the displaying of the Landscape.
QString getId() const
Get landscape id. This is the landscape directory name, used for cache handling.
int defaultFogSetting
May be given in landscape.ini:[location]light_pollution. Default: -1 (no change). ...
Implementation of StelFader which implements a linear transition.
virtual unsigned int getMemorySize() const
Return approximate memory footprint in bytes (required for cache cost estimate in LandscapeMgr) The r...
int getDefaultBortleIndex() const
Return default Bortle index (light pollution value) or -1 (unknown/no change)
virtual unsigned int getMemorySize() const
Return approximate memory footprint in bytes (required for cache cost estimate in LandscapeMgr) The r...
float defaultExtinctionCoefficient
May be given in landscape.ini:[location]display_fog: -1(no change), 0(off), 1(on). Default: -1.
QString description
Read from landscape.ini:[landscape]author.
A shared pointer on a SphericalRegion.
Define the StelTextureSP type.
float getLightscapeBrightness() const
Returns the lightscape brightness.
QString id
Read from landscape.ini:[landscape]description.
void setFlagShow(const bool b)
Set whether landscape is displayed (does not concern fog)
This was the original landscape, introduced for decorative purposes.
This uses a single image in fisheye projection.
float sinMinAltitudeLimit
[radians] This is a rotation changeable at runtime via setZRotation (called by LandscapeMgr::setZRota...
virtual unsigned int getMemorySize() const
Return approximate memory footprint in bytes (required for cache cost estimate in LandscapeMgr) The r...
int cols
horizontal rows. May be given in landscape.ini:[landscape]tesselate_rows. More indicates higher accur...
float getTargetLightscapeBrightness() const
Returns the lightscape brighness modulated with the fader's target state (i.e. binary on/off) ...
QString author
Read from landscape.ini:[landscape]name.
Vec3f labelColor
Used for landscape labels (optionally indicating landscape features)
azimuth[degrees] altitude[degrees]
Main class for Stellarium core processing.
bool getFlagShowLabels() const
Get whether labels are displayed.
QList< LandscapeLabel > landscapeLabels
for all horizon types, the horizonPolygon line, if specified, will be drawn in this color ...
void loadCommon(const QSettings &landscapeIni, const QString &landscapeId)
Load attributes common to all landscapes.
Vec3f horizonPolygonLineColor
Optional element describing the horizon line.
void drawLabels(StelCore *core, StelPainter *painter)
Draw optional labels on the landscape.
azimuth[radians] altitude[radians]
QString getDescription() const
Get landscape description.
float defaultTemperature
May be given in landscape.ini:[location]atmospheric_extinction_coefficient. Default -1 (no change)...
LinearFader fogFader
Used to slowly fade in/out landscape painting.
float getDefaultAtmosphericTemperature() const
Return configured atmospheric temperature [degrees Celsius], for refraction computation, or -1000 for "unknown/no change".
float landscapeBrightness
Read from landscape.ini:[landscape]minimal_brightness. Allows minimum visibility that cannot be under...
float getBrightness() const
Returns the current brightness level.
bool hasLocation() const
Return if the location is valid (a valid location has a valid planetName!)
LinearFader labelFader
Used to slowly fade in/out illumination painting.
QString planetName
English planet name.
bool getIsFullyVisible() const
Get whether the landscape is currently fully visible (i.e. opaque).
float getEffectiveLightscapeBrightness() const
Gets the currently effective lightscape brightness (modulated by the fader)
bool getFlagShowIllumination() const
Get whether illumination is displayed.
float lightScapeBrightness
brightness [0..1] to draw the landscape. Computed by the LandscapeMgr.
This uses a single panorama image in spherical (equirectangular) projection.
Provides functions for performing openGL drawing operations.
void setFlagShowLabels(const bool b)
Set whether labels are displayed.
float getSinMinAltitudeLimit() const
Get the sine of the limiting altitude (can be used to short-cut drawing below horizon, like star fields). There is no set here, value is only from landscape.ini.
virtual void load(const QSettings &landscapeIni, const QString &landscapeId)=0
Load landscape.
virtual unsigned int getMemorySize() const
Return approximate memory footprint in bytes (required for cache cost estimate in LandscapeMgr) The r...
float getLandscapeMinimalBrightness() const
Return minimal brightness for landscape returns -1 to signal "standard conditions" (use default value...
float angleRotateZOffset
[radians] if pano does not have its left border in the east, rotate in azimuth. Configured in landsca...
QString getName() const
Get landscape name.
LinearFader landFader
was a landscape loaded properly?
int getDefaultFogSetting() const
Return default fog setting (0/1) or -1 (no change)
LinearFader illumFader
Used to slowly fade in/out fog painting.
SphericalRegionP horizonPolygon
[mbar] May be given in landscape.ini:[location]atmospheric_pressure. Default -1.0 (compute from [loca...
azimuth[degrees] zenithDistance[degrees]
This uses the list of (usually measured) horizon altitudes to define the horizon. ...
void loadLabels(const QString &landscapeId)
Load descriptive labels from optional file gazetteer.LANG.utf8.
void setLabelFontSize(const int size)
change font and fontsize for landscape labels
azimuth[new_degrees] altitude[new_degrees] (may be found on theodolites)
float defaultPressure
[Celsius] May be given in landscape.ini:[location]atmospheric_temperature. default: -1000...
void createPolygonalHorizon(const QString &lineFileName, const float polyAngleRotateZ=0.0f, const QString &listMode="azDeg_altDeg", const bool polygonInverted=false)
Create a StelSphericalPolygon that describes a measured horizon line.
azimuth[radians] zenithDistance[radians]
virtual float getOpacity(Vec3d azalt) const
Find opacity in a certain direction.
bool getFlagShowFog() const
Get whether fog is displayed.
void setFlagShowFog(const bool b)
Set whether fog is displayed.
const QString getTexturePath(const QString &basename, const QString &landscapeId) const
search for a texture in landscape directory, else global textures directory
virtual unsigned int getMemorySize() const
Return approximate memory footprint in bytes (required for cache cost estimate in LandscapeMgr) The r...
void setFlagShowIllumination(const bool b)
Set whether illumination is displayed.
void setZRotation(float d)
Set an additional z-axis (azimuth) rotation after landscape has been loaded.
QSharedPointer< StelTexture > StelTextureSP
Use shared pointer to simplify memory managment.
float getDefaultAtmosphericPressure() const
Return configured atmospheric pressure [mbar], for refraction computation.
void setBrightness(const float b, const float pollutionBrightness=0.0f)
Set the brightness of the landscape plus brightness of optional add-on night lightscape.
const StelLocation & getLocation() const
Return the associated location (may be empty!)
StelLocation location
Minimal altitude of landscape cover. Can be used to construct bounding caps, so that e...
bool validLandscape
can be used to draw nightscape texture (e.g. city light pollution), if available. Computed by the Lan...
QString getAuthorName() const
Get landscape author name.
float angleRotateZ
vertical columns. May be given in landscape.ini:[landscape]tesselate_cols. More indicates higher accu...
horizonListMode
The list of azimuths (counted from True North towards East) and altitudes can come in various formats...
float getEffectiveLandFadeValue()
Returns the currently effective land fade value.