Stellarium  HEAD
Public Member Functions
LandscapeFisheye Class Reference

This uses a single image in fisheye projection. More...

#include <Landscape.hpp>

Public Member Functions

 LandscapeFisheye (float radius=1.f)
 
void load (const QSettings &landscapeIni, const QString &landscapeId) override
 Load landscape. More...
 
void draw (StelCore *core, bool onlyPolygon) override
 Draw the landscape. If onlyPolygon, only draw the landscape polygon, if one is defined. If no polygon is defined, the.
 
float getOpacity (Vec3d azalt) const override
 Sample landscape texture for transparency/opacity. More...
 
void create (const QString name, const QString &maptex, float texturefov, float angleRotateZ)
 create a fisheye landscape from basic parameters (no ini file needed). More...
 
void create (const QString name, float texturefov, const QString &maptex, const QString &_maptexFog="", const QString &_maptexIllum="", const float angleRotateZ=0.0f)
 
- Public Member Functions inherited from Landscape
 Landscape (float _radius=2.f)
 
virtual void initGL ()
 
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...
 
void update (double deltaTime)
 
void setBrightness (const double b, const double pollutionBrightness=0.0)
 Set the brightness of the landscape plus brightness of optional add-on night lightscape. More...
 
double getBrightness () const
 Returns the current brightness level.
 
double getLightscapeBrightness () const
 Returns the lightscape brightness.
 
double getTargetLightscapeBrightness () const
 Returns the lightscape brightness modulated with the fader's target state (i.e. binary on/off)
 
double getEffectiveLightscapeBrightness () const
 Gets the currently effective lightscape brightness (modulated by the fader)
 
void setFlagShow (const bool b)
 Set whether landscape is displayed (does not concern fog)
 
bool getFlagShow () const
 Get whether landscape is displayed (does not concern fog)
 
float getEffectiveLandFadeValue () const
 Returns the currently effective land fade value.
 
void setFlagShowFog (const bool b)
 Set whether fog is displayed.
 
bool getFlagShowFog () const
 Get whether fog is displayed.
 
void setFlagShowIllumination (const bool b)
 Set whether illumination is displayed.
 
bool getFlagShowIllumination () const
 Get whether illumination is displayed.
 
void setFlagShowLabels (const bool b)
 Set whether labels are displayed.
 
bool getFlagShowLabels () const
 Get whether labels are displayed.
 
void setLabelFontSize (const int size)
 Change font and fontsize for landscape labels.
 
int getLabelFontSize ()
 Get fontsize for landscape labels.
 
Vec3f getLabelColor () const
 Get color for landscape labels.
 
void setLabelColor (const Vec3f &c)
 Set color for landscape labels.
 
QString getName () const
 Get landscape name.
 
QString getAuthorName () const
 Get landscape author name.
 
QString getDescription () const
 Get landscape description.
 
QString getId () const
 Get landscape id. This is the landscape directory name, used for cache handling.
 
const StelLocationgetLocation () const
 Return the associated location (may be empty!)
 
bool hasLocation () const
 Return if the location is valid (a valid location has a valid planetName!)
 
QVariant getDefaultLightPollutionLuminance () const
 Return default light pollution luminance in cd/m², if present.
 
int getDefaultFogSetting () const
 Return default fog setting (0/1) or -1 (no change)
 
double getDefaultAtmosphericExtinction () const
 Return default atmosperic extinction [mag/airmass], or -1 (no change)
 
double getDefaultAtmosphericTemperature () const
 Return configured atmospheric temperature [degrees Celsius], for refraction computation, or -1000 for "unknown/no change".
 
double getDefaultAtmosphericPressure () const
 Return configured atmospheric pressure [mbar], for refraction computation. More...
 
double getLandscapeMinimalBrightness () const
 Return minimal brightness for landscape returns -1 to signal "standard conditions" (use default value from config.ini)
 
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).
 
double 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.
 
void setTransparency (const double f)
 
void loadLabels (const QString &landscapeId)
 Load descriptive labels from optional file gazetteer.LANG.utf8.
 
bool hasLandscapePolygon () const
 

Additional Inherited Members

- Public Types inherited from Landscape
enum  horizonListMode {
  invalid =-1 , 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 setupCurrentVAO ()
 
void bindVAO ()
 
void releaseVAO ()
 
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.
 
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...
 
void drawHorizonLine (StelCore *core, StelPainter &painter)
 
- Static Protected Member Functions inherited from Landscape
static const QString getTexturePath (const QString &basename, const QString &landscapeId)
 search for a texture in landscape directory, else global textures directory More...
 
- Protected Attributes inherited from Landscape
std::unique_ptr< QOpenGLVertexArrayObject > vao
 
std::unique_ptr< QOpenGLBuffer > vbo
 
StelProjectorP prevProjector
 
std::unique_ptr< QOpenGLShaderProgram > renderProgram
 
double radius
 
QString name
 
QString author
 Read from landscape.ini:[landscape]name.
 
QString description
 Read from landscape.ini:[landscape]author.
 
QString id
 Read from landscape.ini:[landscape]description.
 
float minBrightness
 Set during load. Required for consistent caching.
 
float landscapeBrightness
 Read from landscape.ini:[landscape]minimal_brightness. Allows minimum visibility that cannot be underpowered.
 
float lightScapeBrightness
 brightness [0..1] to draw the landscape. Computed by the LandscapeMgr.
 
bool validLandscape
 can be used to draw nightscape texture (e.g. city light pollution), if available. Computed by the LandscapeMgr.
 
LinearFader landFader
 was a landscape loaded properly?
 
LinearFader fogFader
 Used to slowly fade in/out landscape painting.
 
LinearFader illumFader
 Used to slowly fade in/out fog painting.
 
LinearFader labelFader
 Used to slowly fade in/out illumination painting.
 
unsigned int rows
 Used to slowly fade in/out landscape feature labels.
 
unsigned int cols
 horizontal rows. May be given in landscape.ini:[landscape]tesselate_rows. More indicates higher accuracy, but is slower.
 
float angleRotateZ
 vertical columns. May be given in landscape.ini:[landscape]tesselate_cols. More indicates higher accuracy, but is slower.
 
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)
 
double sinMinAltitudeLimit
 [radians] This is a rotation changeable at runtime via setZRotation (called by LandscapeMgr::setZRotation). More...
 
double landscapeTransparency
 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).
 
StelLocation location
 
QVariant defaultLightPollutionLuminance
 OPTIONAL. If present, can be used to set location. More...
 
int defaultFogSetting
 
double defaultExtinctionCoefficient
 May be given in landscape.ini:[location]display_fog: -1(no change), 0(off), 1(on). Default: -1.
 
double defaultTemperature
 May be given in landscape.ini:[location]atmospheric_extinction_coefficient. Default -1 (no change).
 
double defaultPressure
 [Celsius] May be given in landscape.ini:[location]atmospheric_temperature. default: -1000.0 (no change)
 
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".
 
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)
 
unsigned int memorySize
 Color for the landscape labels. More...
 
bool multisamplingEnabled_
 
bool initialized = false
 

Detailed Description

This uses a single image in fisheye projection.

The image is typically square, ...

Parameters
texFovfield of view (opening angle) of the square texture, radians. If
angleRotateZ==0,thetop image border is due south.

Member Function Documentation

◆ create()

void LandscapeFisheye::create ( const QString  name,
const QString &  maptex,
float  texturefov,
float  angleRotateZ 
)

create a fisheye landscape from basic parameters (no ini file needed).

Parameters
nameLandscape name
maptexthe fisheye texture
maptexIllumthe fisheye texture that is overlaid in the night (streetlights, skyglow, ...)
texturefovfield of view for the photo, degrees
angleRotateZazimuth rotation angle, degrees

◆ getOpacity()

float LandscapeFisheye::getOpacity ( Vec3d  azalt) const
overridevirtual

Sample landscape texture for transparency/opacity.

May be used for visibility, sunrise etc.

Parameters
azaltnormalized direction in alt-az frame

Reimplemented from Landscape.

◆ load()

void LandscapeFisheye::load ( const QSettings &  landscapeIni,
const QString &  landscapeId 
)
overridevirtual

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.