Stellarium
HEAD
|
Provide a set of methods used to draw sky objects taking into account eyes adaptation, zoom level, instrument model and artificially set magnitude limits. More...
#include <StelSkyDrawer.hpp>
Public Slots | |
void | setRelativeStarScale (double b=1.0) |
Set the way brighter stars will look bigger as the fainter ones. | |
double | getRelativeStarScale () const |
Get the way brighter stars will look bigger as the fainter ones. | |
void | setAbsoluteStarScale (double b=1.0) |
Set the absolute star brightness scale. | |
double | getAbsoluteStarScale () const |
Get the absolute star brightness scale. | |
void | setTwinkleAmount (double b) |
Set source twinkle amount. | |
double | getTwinkleAmount () const |
Get source twinkle amount. | |
void | setFlagTwinkle (bool b) |
Set flag for source twinkling. | |
bool | getFlagTwinkle () const |
Get flag for source twinkling. | |
void | setFlagForcedTwinkle (bool b) |
Set flag for enable twinkling of stars without atmosphere. More... | |
bool | getFlagForcedTwinkle () const |
Get flag for enable twinkling of stars without atmosphere. More... | |
void | setLightPollutionLuminance (double luminance) |
Set the parameters so that the stars disappear at about the naked-eye limiting magnitude corresponding to the given zenith luminance at moonless night. More... | |
double | getLightPollutionLuminance () const |
Get the current zenith luminance at moonless night. | |
Q_DECL_DEPRECATED int | getBortleScaleIndex () const |
void | setFlagDrawBigStarHalo (bool b) |
Set flag for drawing a halo around bright stars. | |
bool | getFlagDrawBigStarHalo () const |
Get flag for drawing a halo around bright stars. | |
void | setFlagStarSpiky (bool b) |
Set flag to draw stars with rays. | |
bool | getFlagStarSpiky () const |
Get whether to draw stars with rays. | |
float | getLimitMagnitude () const |
Get the magnitude of the currently faintest visible point source It depends on the zoom level, on the eye adaptation and on the point source rendering parameters. More... | |
void | setFlagStarMagnitudeLimit (bool b) |
Toggle the application of user-defined star magnitude limit. More... | |
bool | getFlagStarMagnitudeLimit () const |
void | setFlagNebulaMagnitudeLimit (bool b) |
Toggle the application of user-defined deep-sky object magnitude limit. More... | |
bool | getFlagNebulaMagnitudeLimit () const |
void | setFlagPlanetMagnitudeLimit (bool b) |
Toggle the application of user-defined solar system object magnitude limit. More... | |
bool | getFlagPlanetMagnitudeLimit () const |
double | getCustomStarMagnitudeLimit () const |
Get the value used for forced star magnitude limiting. | |
void | setCustomStarMagnitudeLimit (double limit) |
Sets a lower limit for star magnitudes (anything fainter is ignored). More... | |
double | getCustomNebulaMagnitudeLimit () const |
Get the value used for forced nebula magnitude limiting. | |
void | setCustomNebulaMagnitudeLimit (double limit) |
Sets a lower limit for nebula magnitudes (anything fainter is ignored). More... | |
double | getCustomPlanetMagnitudeLimit () const |
Get the value used for forced solar system object magnitude limiting. | |
void | setCustomPlanetMagnitudeLimit (double limit) |
Sets a lower limit for solar system object magnitudes (anything fainter is ignored). More... | |
float | getLimitLuminance () const |
Get the luminance of the faintest visible object (e.g. More... | |
void | setFlagLuminanceAdaptation (bool b) |
Set the value of the eye adaptation flag. | |
bool | getFlagLuminanceAdaptation () const |
Get the current value of eye adaptation flag. | |
void | setDaylightLabelThreshold (double t) |
Set the label brightness threshold. | |
double | getDaylightLabelThreshold () const |
Get the current label brightness threshold. | |
double | getWorldAdaptationLuminance () const |
Return a brightness value based on objects in view (sky, sun, moon, ...) | |
void | setFlagHasAtmosphere (bool b) |
Informing the drawer whether atmosphere is displayed. More... | |
bool | getFlagHasAtmosphere () const |
This is used to decide whether to apply refraction/extinction before rendering point sources et al. | |
void | setExtinctionCoefficient (double extCoeff) |
Set extinction coefficient, mag/airmass (for extinction). | |
double | getExtinctionCoefficient () const |
Get extinction coefficient, mag/airmass (for extinction). | |
void | setAtmosphereTemperature (double celsius) |
Set atmospheric (ground) temperature in deg celsius (for refraction). | |
double | getAtmosphereTemperature () const |
Get atmospheric (ground) temperature in deg celsius (for refraction). | |
void | setAtmospherePressure (double mbar) |
Set atmospheric (ground) pressure in mbar (for refraction). | |
double | getAtmospherePressure () const |
Get atmospheric (ground) pressure in mbar (for refraction). | |
const Extinction & | getExtinction () const |
Get the current valid extinction computation object. | |
const Refraction & | getRefraction () const |
Get the current valid refraction computation object. | |
float | getBig3dModelHaloRadius () const |
Get the radius of the big halo texture used when a 3d model is very bright. | |
void | setBig3dModelHaloRadius (float r) |
Set the radius of the big halo texture used when a 3d model is very bright. | |
void | setFlagDrawSunAfterAtmosphere (bool val) |
bool | getFlagDrawSunAfterAtmosphere () const |
void | setFlagEarlySunHalo (bool val) |
bool | getFlagEarlySunHalo () const |
bool | getFlagTfromK (void) const |
void | setFlagTfromK (bool val) |
double | getT (void) const |
void | setT (double newT) |
Signals | |
void | relativeStarScaleChanged (double b) |
Emitted whenever the relative star scale changed. | |
void | absoluteStarScaleChanged (double b) |
Emitted whenever the absolute star scale changed. | |
void | twinkleAmountChanged (double b) |
Emitted whenever the twinkle amount changed. | |
void | flagTwinkleChanged (bool b) |
Emitted whenever the twinkle flag is toggled. | |
void | lightPollutionLuminanceChanged (double luminance) |
Emitted whenever light pollution luminance changed. | |
void | flagDrawBigStarHaloChanged (bool b) |
Emitted when flag to draw big halo around stars changed. | |
void | flagStarSpikyChanged (bool b) |
Emitted on change of star texture. | |
void | flagStarMagnitudeLimitChanged (bool b) |
Emitted whenever the star magnitude limit flag is toggled. | |
void | flagNebulaMagnitudeLimitChanged (bool b) |
Emitted whenever the nebula magnitude limit flag is toggled. | |
void | flagPlanetMagnitudeLimitChanged (bool b) |
Emitted whenever the planet magnitude limit flag is toggled. | |
void | customStarMagLimitChanged (double limit) |
Emitted whenever the star magnitude limit changed. | |
void | customNebulaMagLimitChanged (double limit) |
Emitted whenever the nebula magnitude limit changed. | |
void | customPlanetMagLimitChanged (double limit) |
Emitted whenever the planet magnitude limit changed. | |
void | flagLuminanceAdaptationChanged (bool b) |
Emitted whenever the luminance adaptation flag is toggled. | |
void | daylightLabelThresholdChanged (double t) |
Emitted when threshold value to draw info text in black is changed. | |
void | extinctionCoefficientChanged (double coeff) |
void | atmosphereTemperatureChanged (double celsius) |
void | atmospherePressureChanged (double mbar) |
void | flagTfromKChanged (bool b) |
void | flagDrawSunAfterAtmosphereChanged (bool b) |
void | flagEarlySunHaloChanged (bool b) |
void | turbidityChanged (double t) |
Public Member Functions | |
StelSkyDrawer (StelCore *core) | |
Constructor. | |
~StelSkyDrawer () override | |
Destructor. | |
void | init () |
Init parameters from config file. | |
void | update (double deltaTime) |
Update with respect to the time and StelProjector/StelToneReproducer state. More... | |
void | preDrawPointSource (StelPainter *p) |
Set the proper openGL state before making calls to drawPointSource. More... | |
void | postDrawPointSource (StelPainter *sPainter) |
Finalize the drawing of point sources. | |
bool | drawPointSource (StelPainter *sPainter, const Vec3d &v, const RCMag &rcMag, int bVindex, bool checkInScreen=false, float twinkleFactor=1.0f) |
Draw a point source halo. More... | |
bool | drawPointSource (StelPainter *sPainter, const Vec3d &v, const RCMag &rcMag, const Vec3f &bcolor, bool checkInScreen=false, float twinkleFactor=1.0f) |
Draw a point source halo. More... | |
void | drawSunCorona (StelPainter *painter, const Vec3f &v, float radius, const Vec3f &color, const float alpha, const float angle) |
Draw an image of the solar corona onto the screen at position v. More... | |
void | postDrawSky3dModel (StelPainter *p, const Vec3d &v, float illuminatedArea, float mag, const Vec3f &color=Vec3f(1.f, 1.f, 1.f), const bool isSun=false) |
Terminate drawing of a 3D model, draw the halo. More... | |
bool | computeRCMag (float mag, RCMag *) const |
Compute RMag and CMag from magnitude. More... | |
void | reportLuminanceInFov (float lum, bool fastAdaptation=false) |
Report that an object of luminance lum with an on-screen area of area pixels is currently displayed This information is used to determine the world adaptation luminance This method should be called during the update operations of the main loop. More... | |
void | preDraw () |
To be called before the drawing stage starts. | |
Static Public Member Functions | |
static float | surfaceBrightnessToLuminance (float sb) |
Compute the luminance for an extended source with the given surface brightness. More... | |
static float | luminanceToSurfacebrightness (float lum) |
Compute the surface brightness from the luminance of an extended source. More... | |
static float | indexToBV (unsigned char bV) |
Convert quantized B-V index to float B-V. | |
static const Vec3f & | indexToColor (int bV) |
Convert quantized B-V index to RGB colors. | |
Properties | |
double | relativeStarScale |
Sets how much brighter stars will be bigger than fainter stars. | |
double | absoluteStarScale |
The absolute star brightness scale. | |
double | twinkleAmount |
bool | flagStarTwinkle |
double | lightPollutionLuminance |
The current light pollution luminance. | |
bool | flagDrawBigStarHalo |
bool | flagStarSpiky |
bool | flagStarMagnitudeLimit |
Controls the application of the user-defined star magnitude limit. More... | |
bool | flagNebulaMagnitudeLimit |
Controls the application of the user-defined nebula magnitude limit. More... | |
bool | flagPlanetMagnitudeLimit |
Controls the application of the user-defined planet magnitude limit. More... | |
double | customStarMagLimit |
User-defined magnitude limit for stars. More... | |
double | customNebulaMagLimit |
User-defined magnitude limit for deep-sky objects. More... | |
double | customPlanetMagLimit |
User-defined magnitude limit for solar system objects. More... | |
bool | flagLuminanceAdaptation |
Simulate the eye's luminance adaptation? | |
double | daylightLabelThreshold |
a customizable value in cd/m^2 which is used to decide when to render the InfoText in black (when sky is brighter than this) | |
double | extinctionCoefficient |
double | atmosphereTemperature |
double | atmospherePressure |
bool | flagDrawSunAfterAtmosphere |
bool | flagEarlySunHalo |
bool | flagTfromK |
double | turbidity |
Provide a set of methods used to draw sky objects taking into account eyes adaptation, zoom level, instrument model and artificially set magnitude limits.
bool StelSkyDrawer::computeRCMag | ( | float | mag, |
RCMag * | |||
) | const |
Compute RMag and CMag from magnitude.
mag | the object integrated V magnitude |
rcMag | array of 2 floats containing the radius and luminance |
bool StelSkyDrawer::drawPointSource | ( | StelPainter * | sPainter, |
const Vec3d & | v, | ||
const RCMag & | rcMag, | ||
const Vec3f & | bcolor, | ||
bool | checkInScreen = false , |
||
float | twinkleFactor = 1.0f |
||
) |
Draw a point source halo.
sPainter | the StelPainter to use for drawing. |
v | the 3d position of the source in J2000 reference frame |
rcMag | the radius and luminance of the source as computed by computeRCMag() |
color | the RGB color value (0...1, 0...1, 0...1) |
checkInScreen | whether source in screen should be checked to avoid unnecessary drawing. |
twinkleFactor | allows height-dependent twinkling. Recommended value: min(1,1-0.9*sin(altitude)). Allowed values [0..1] |
|
inline |
Draw a point source halo.
sPainter | the StelPainter to use for drawing. |
v | the 3d position of the source in J2000 reference frame |
rcMag | the radius and luminance of the source as computed by computeRCMag() |
bVindex | the source B-V index (into the private colorTable. This is not the astronomical B-V value.) |
checkInScreen | whether source in screen should be checked to avoid unnecessary drawing. |
twinkleFactor | allows height-dependent twinkling. Recommended value: min(1,1-0.9*sin(altitude)). Allowed values [0..1] |
void StelSkyDrawer::drawSunCorona | ( | StelPainter * | painter, |
const Vec3f & | v, | ||
float | radius, | ||
const Vec3f & | color, | ||
const float | alpha, | ||
const float | angle | ||
) |
Draw an image of the solar corona onto the screen at position v.
radius | depends on the actually used texture and current disk size of the sun. |
alpha | opacity value. Set 1 for full visibility, but usually keep close to 0 except during solar eclipses. |
angle | includes parallactic angle (if alt/azimuth frame) and angle between solar polar axis and celestial equator. |
|
inlineslot |
Get flag for enable twinkling of stars without atmosphere.
|
inlineslot |
|
inlineslot |
|
inlineslot |
|
inlineslot |
Get the luminance of the faintest visible object (e.g.
RGB<0.05) It depends on the zoom level, on the eye adaptation and on the point source rendering parameters
|
inlineslot |
Get the magnitude of the currently faintest visible point source It depends on the zoom level, on the eye adaptation and on the point source rendering parameters.
|
static |
Compute the surface brightness from the luminance of an extended source.
lum | luminance in cd/m^2 |
void StelSkyDrawer::postDrawSky3dModel | ( | StelPainter * | p, |
const Vec3d & | v, | ||
float | illuminatedArea, | ||
float | mag, | ||
const Vec3f & | color = Vec3f(1.f, 1.f, 1.f) , |
||
const bool | isSun = false |
||
) |
Terminate drawing of a 3D model, draw the halo.
p | the StelPainter instance to use for this drawing operation |
v | the 3d position of the source in J2000 reference frame |
illuminatedArea | the illuminated area in arcmin^2 |
mag | the source integrated magnitude |
color | the object halo RGB color |
isSun | the object is the sun (will be drawn with different texture) |
void StelSkyDrawer::preDrawPointSource | ( | StelPainter * | p | ) |
Set the proper openGL state before making calls to drawPointSource.
p | a pointer to a valid instance of a Painter. The instance must be valid until postDrawPointSource() is called |
void StelSkyDrawer::reportLuminanceInFov | ( | float | lum, |
bool | fastAdaptation = false |
||
) |
Report that an object of luminance lum with an on-screen area of area pixels is currently displayed This information is used to determine the world adaptation luminance This method should be called during the update operations of the main loop.
lum | luminance in cd/m^2 |
fastAdaptation | adapt the eye quickly if true, other wise use a smooth adaptation |
|
inlineslot |
Sets a lower limit for nebula magnitudes (anything fainter is ignored).
In force only if flagNebulaMagnitudeLimit is set.
|
inlineslot |
Sets a lower limit for solar system object magnitudes (anything fainter is ignored).
In force only if flagPlanetMagnitudeLimit is set.
|
inlineslot |
Sets a lower limit for star magnitudes (anything fainter is ignored).
In force only if flagStarMagnitudeLimit is set.
|
inlineslot |
Set flag for enable twinkling of stars without atmosphere.
|
inlineslot |
Informing the drawer whether atmosphere is displayed.
This is used to avoid twinkling/simulate extinction/refraction.
|
inlineslot |
Toggle the application of user-defined deep-sky object magnitude limit.
If enabled, deep-sky objects fainter than the magnitude set with setCustomNebulaMagnitudeLimit() will not be displayed.
|
inlineslot |
Toggle the application of user-defined solar system object magnitude limit.
If enabled, planets, planetary moons, asteroids (KBO, ...) and comets fainter than the magnitude set with setCustomPlanetMagnitudeLimit() will not be displayed.
|
inlineslot |
Toggle the application of user-defined star magnitude limit.
If enabled, stars fainter than the magnitude set with setCustomStarMagnitudeLimit() will not be displayed.
|
slot |
Set the parameters so that the stars disappear at about the naked-eye limiting magnitude corresponding to the given zenith luminance at moonless night.
The limit is valid only at a given zoom level (around 60 deg)
|
static |
Compute the luminance for an extended source with the given surface brightness.
sb | surface brightness in V magnitude/arcmin^2 |
void StelSkyDrawer::update | ( | double | deltaTime | ) |
Update with respect to the time and StelProjector/StelToneReproducer state.
deltaTime | the time increment in second since last call. |
|
readwrite |
User-defined magnitude limit for deep-sky objects.
Interpreted as a lower limit - nebulae fainter than this value will not be displayed. Used if flagNebulaMagnitudeLimit is true.
|
readwrite |
User-defined magnitude limit for solar system objects.
Interpreted as a lower limit - planets fainter than this value will not be displayed. Used if flagPlanetMagnitudeLimit is true.
|
readwrite |
User-defined magnitude limit for stars.
Interpreted as a lower limit - stars fainter than this value will not be displayed. Used if flagStarMagnitudeLimit is true.
|
readwrite |
Controls the application of the user-defined nebula magnitude limit.
|
readwrite |
Controls the application of the user-defined planet magnitude limit.
|
readwrite |
Controls the application of the user-defined star magnitude limit.