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;
78 virtual void draw(
StelCore* core) = 0;
79 void update(
double deltaTime)
82 fogFader.update((
int)(deltaTime*1000));
164 virtual float getOpacity(
Vec3d azalt)
const { Q_ASSERT(0);
return (azalt[2]<0 ? 1.0f : 0.0f); }
182 void loadCommon(
const QSettings& landscapeIni,
const QString& landscapeId);
192 void createPolygonalHorizon(
const QString& lineFileName,
const float polyAngleRotateZ=0.0f,
const QString &listMode=
"azDeg_altDeg");
198 const QString
getTexturePath(
const QString& basename,
const QString& landscapeId)
const;
259 virtual void load(
const QSettings& landscapeIni,
const QString& landscapeId);
276 QVector<double> groundVertexArr;
277 QVector<float> groundTexCoordArr;
284 QVector<QImage*> sidesImages;
289 float decorAngleShift;
290 float groundAngleShift;
291 float groundAngleRotateZ;
302 QList<LOSSide> precomputedSides;
319 virtual void load(
const QSettings& landscapeIni,
const QString& landscapeId);
338 virtual void load(
const QSettings& landscapeIni,
const QString& landscapeId);
349 void create(
const QString name,
const QString& maptex,
float texturefov,
float angleRotateZ);
350 void create(
const QString name,
float texturefov,
const QString& maptex,
const QString &_maptexFog=
"",
const QString& _maptexIllum=
"",
const float angleRotateZ=0.0f);
378 virtual void load(
const QSettings& landscapeIni,
const QString& landscapeId);
395 void create(
const QString name,
const QString& maptex,
const QString &_maptexFog=
"",
const QString& _maptexIllum=
"",
const float _angleRotateZ=0.0f,
396 const float _mapTexTop=90.0f,
const float _mapTexBottom=-90.0f,
397 const float _fogTexTop=90.0f,
const float _fogTexBottom=-90.0f,
398 const float _illumTexTop=90.0f,
const float _illumTexBottom=-90.0f);
413 float illumTexBottom;
417 #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.
virtual float getOpacity(Vec3d azalt) const
Sample landscape texture for transparency/opacity.
int defaultBortleIndex
OPTIONAL. If present, can be used to set location.
float minBrightness
Read from landscape.ini:[landscape]description.
Store and manages the displaying of the Landscape.
int defaultFogSetting
May be given in landscape.ini:[location]light_pollution. Default: -1 (no change). ...
Implementation of StelFader which implements a linear transition.
int getDefaultBortleIndex() const
Return default Bortle index (light pollution value) or -1 (unknown/no change)
virtual void load(const QSettings &landscapeIni, const QString &landscapeId)
Load landscape.
virtual float getOpacity(Vec3d azalt) const
Find opacity in a certain direction.
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.
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...
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.
virtual void load(const QSettings &landscapeIni, const QString &landscapeId)
Load landscape.
Vec3f labelColor
Used for landscape labels (optionally indicating landscape features)
azimuth[degrees] altitude[degrees]
Main class for Stellarium core processing.
void create(const QString name, const QString &maptex, float texturefov, float angleRotateZ)
create a fisheye landscape from basic parameters (no ini file needed).
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.
void create(const QString name, const QString &maptex, const QString &_maptexFog="", const QString &_maptexIllum="", const float _angleRotateZ=0.0f, const float _mapTexTop=90.0f, const float _mapTexBottom=-90.0f, const float _fogTexTop=90.0f, const float _fogTexBottom=-90.0f, const float _illumTexTop=90.0f, const float _illumTexBottom=-90.0f)
create a spherical landscape from basic parameters (no ini file needed).
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.
virtual float getOpacity(Vec3d azalt) const
Find opacity in a certain direction.
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.
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.
virtual void load(const QSettings &landscapeIni, const QString &landscapeId)
Load landscape.
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...
virtual void load(const QSettings &landscapeIni, const QString &landscapeId)
Load landscape.
virtual float getOpacity(Vec3d azalt) const
Sample landscape texture for transparency/opacity.
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
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.
void createPolygonalHorizon(const QString &lineFileName, const float polyAngleRotateZ=0.0f, const QString &listMode="azDeg_altDeg")
Create a StelSphericalPolygon that describes a measured horizon line.
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.