Stellarium 0.15.2
List of all members | Public Member Functions
LandscapeSpherical Class Reference

This uses a single panorama image in spherical (equirectangular) projection. More...

#include <Landscape.hpp>

+ Inheritance diagram for LandscapeSpherical:
+ Collaboration diagram for LandscapeSpherical:

Public Member Functions

 LandscapeSpherical (float radius=1.f)
 
virtual void load (const QSettings &landscapeIni, const QString &landscapeId)
 Load landscape. More...
 
virtual unsigned int getMemorySize () const
 Return approximate memory footprint in bytes (required for cache cost estimate in LandscapeMgr) The returned value is only approximate, content of QStrings and other small containers like the horizon polygon are not put in in detail. More...
 
virtual void draw (StelCore *core)
 
virtual float getOpacity (Vec3d azalt) const
 Sample landscape texture for transparency/opacity. More...
 
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). More...
 
- Public Member Functions inherited from Landscape
 Landscape (float _radius=2.f)
 
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...
 
void setFlagShowLabels (const bool b)
 Set whether labels are displayed. More...
 
bool getFlagShowLabels () const
 Get whether labels are displayed. More...
 
void setLabelFontSize (const int size)
 change font and fontsize for landscape labels More...
 
QString getName () const
 Get landscape name. More...
 
QString getAuthorName () const
 Get landscape author name. More...
 
QString getDescription () const
 Get landscape description. More...
 
QString getId () const
 Get landscape id. This is the landscape directory name, used for cache handling. More...
 
const StelLocationgetLocation () 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...
 
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. More...
 
void loadLabels (const QString &landscapeId)
 Load descriptive labels from optional file gazetteer.LANG.utf8. More...
 

Additional Inherited Members

- Public Types inherited from Landscape
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...
 
- Protected Member Functions inherited from Landscape
void loadCommon (const QSettings &landscapeIni, const QString &landscapeId)
 Load attributes common to all landscapes. More...
 
void drawLabels (StelCore *core, StelPainter *painter)
 Draw optional labels on the landscape. More...
 
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. 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 inherited from Landscape
float radius
 
QString name
 
QString author
 Read from landscape.ini:[landscape]name. More...
 
QString description
 Read from landscape.ini:[landscape]author. More...
 
QString id
 Read from landscape.ini:[landscape]description. More...
 
float minBrightness
 Set during load. Required for consistent caching. 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...
 
LinearFader labelFader
 Used to slowly fade in/out illumination painting. More...
 
int rows
 Used to slowly fade in/out landscape feature labels. 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...
 
float sinMinAltitudeLimit
 [radians] This is a rotation changeable at runtime via setZRotation (called by LandscapeMgr::setZRotation). More...
 
StelLocation location
 Minimal altitude of landscape cover. Can be used to construct bounding caps, so that e.g. no stars are drawn below this altitude. Default -0.035, i.e. sin(-2 degrees). 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...
 
QList< LandscapeLabellandscapeLabels
 for all horizon types, the horizonPolygon line, if specified, will be drawn in this color More...
 
int fontSize
 
Vec3f labelColor
 Used for landscape labels (optionally indicating landscape features) More...
 

Detailed Description

This uses a single panorama image in spherical (equirectangular) projection.

A complete image is rectangular with the horizon forming a horizontal line centered vertically, and vertical altitude angles linearly mapped in image height. Since 0.13 and Qt5, large images of 8192x4096 pixels are available, but they still may not work on every hardware. If

Parameters
angleRotateZ==0,theleft/right image border is due east. It is possible to remove empty top or bottom parts of the textures (main texture: only top part should meaningfully be cut away!) The textures should still be power-of-two, so maybe 8192x1024 for the fog, or 8192x2048 for the light pollution. (It's OK to stretch the textures. They just have to fit, geometrically!) TODO: Allow a horizontal split for 2 or even 4 parts, i.e. super-large, super-accurate panos.

Definition at line 390 of file Landscape.hpp.

Member Function Documentation

void LandscapeSpherical::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).

Parameters
nameLandscape name
maptexthe equirectangular texture
maptexIllumthe equirectangular texture that is overlaid in the night (streetlights, skyglow, ...)
angleRotateZazimuth rotation angle, degrees [0]
_mapTexTopaltitude angle of top edge of texture, degrees [90]
_mapTexBottomaltitude angle of bottom edge of texture, degrees [-90]
_fogTexTopaltitude angle of top edge of fog texture, degrees [90]
_fogTexBottomaltitude angle of bottom edge of fog texture, degrees [-90]
_illumTexTopaltitude angle of top edge of light pollution texture, degrees [90]
_illumTexBottomaltitude angle of bottom edge of light pollution texture, degrees [-90]
virtual unsigned int LandscapeSpherical::getMemorySize ( ) const
inlinevirtual

Return approximate memory footprint in bytes (required for cache cost estimate in LandscapeMgr) The returned value is only approximate, content of QStrings and other small containers like the horizon polygon are not put in in detail.

However, texture image sizes must be computed in subclasses. The value returned is a sum of RAM and texture memory requirements.

Reimplemented from Landscape.

Definition at line 396 of file Landscape.hpp.

virtual float LandscapeSpherical::getOpacity ( Vec3d  azalt) const
virtual

Sample landscape texture for transparency/opacity.

May be used for visibility, sunrise etc.

Parameters
azaltnormalized direction in alt-az frame
Return values
alpha(0=fully transparent, 1=fully opaque. Trees, leaves, glass etc may have intermediate values.)

Reimplemented from Landscape.

virtual void LandscapeSpherical::load ( const QSettings &  landscapeIni,
const QString &  landscapeId 
)
virtual

Load landscape.

Parameters
landscapeIniA reference to an existing QSettings object which describes the landscape
landscapeIdThe name of the directory for the landscape files (e.g. "ocean")

Implements Landscape.


The documentation for this class was generated from the following file: