Stellarium 0.13.0
List of all members | Classes | Public Slots | Public Member Functions | Static Public Member Functions
StelSkyDrawer Class Reference

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. More...
 
float getRelativeStarScale () const
 Get the way brighter stars will look bigger as the fainter ones. More...
 
void setAbsoluteStarScale (double b=1.0)
 Set the absolute star brightness scale. More...
 
float getAbsoluteStarScale () const
 Get the absolute star brightness scale. More...
 
void setTwinkleAmount (double b)
 Set source twinkle amount. More...
 
float getTwinkleAmount () const
 Get source twinkle amount. More...
 
void setFlagTwinkle (bool b)
 Set flag for source twinkling. More...
 
bool getFlagTwinkle () const
 Get flag for source twinkling. More...
 
void setBortleScaleIndex (int index)
 Set the parameters so that the stars disappear at about the limit given by the bortle scale The limit is valid only at a given zoom level (around 60 deg) See http://en.wikipedia.org/wiki/Bortle_Dark-Sky_Scale. More...
 
int getBortleScaleIndex () const
 Get the current Bortle scale index. More...
 
float getLimitMagnitude () const
 Get the magnitude of the currently faintest visible point source It depends on the zoom level, on the eye adapation and on the point source rendering parameters. More...
 
void setFlagStarMagnitudeLimit (bool b)
 Toggle the application of user-defined star magnitude limit. More...
 
void setFlagNebulaMagnitudeLimit (bool b)
 Toggle the application of user-defined deep-sky object magnitude limit. More...
 
bool getFlagStarMagnitudeLimit () const
 
bool getFlagNebulaMagnitudeLimit () const
 
float getCustomStarMagnitudeLimit () const
 Get the value used for forced star magnitude limiting. More...
 
void setCustomStarMagnitudeLimit (double limit)
 Sets a lower limit for star magnitudes (anything fainter is ignored). More...
 
float getCustomNebulaMagnitudeLimit () const
 Get the value used for forced nebula magnitude limiting. More...
 
void setCustomNebulaMagnitudeLimit (double limit)
 Sets a lower limit for nebula 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. More...
 
bool getFlagLuminanceAdaptation () const
 Get the current value of eye adaptation flag. More...
 
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. More...
 
void setExtinctionCoefficient (double extCoeff)
 Set extinction coefficient, mag/airmass (for extinction). More...
 
double getExtinctionCoefficient () const
 Get extinction coefficient, mag/airmass (for extinction). More...
 
void setAtmosphereTemperature (double celsius)
 Set atmospheric (ground) temperature in deg celsius (for refraction). More...
 
double getAtmosphereTemperature () const
 Get atmospheric (ground) temperature in deg celsius (for refraction). More...
 
void setAtmospherePressure (double mbar)
 Set atmospheric (ground) pressure in mbar (for refraction). More...
 
double getAtmospherePressure () const
 Get atmospheric (ground) pressure in mbar (for refraction). More...
 
const ExtinctiongetExtinction () const
 Get the current valid extinction computation object. More...
 
const RefractiongetRefraction () const
 Get the current valid refraction computation object. More...
 
float getBig3dModelHaloRadius () const
 Get the radius of the big halo texture used when a 3d model is very bright. More...
 
void setBig3dModelHaloRadius (float r)
 Set the radius of the big halo texture used when a 3d model is very bright. More...
 

Public Member Functions

 StelSkyDrawer (StelCore *core)
 Constructor. More...
 
 ~StelSkyDrawer ()
 Destructor. More...
 
void init ()
 Init parameters from config file. More...
 
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. More...
 
bool drawPointSource (StelPainter *sPainter, const Vec3f &v, const RCMag &rcMag, unsigned int bV, bool checkInScreen=false)
 Draw a point source halo. More...
 
bool drawPointSource (StelPainter *sPainter, const Vec3f &v, const RCMag &rcMag, const Vec3f &bcolor, bool checkInScreen=false)
 
void postDrawSky3dModel (StelPainter *p, const Vec3f &v, float illuminatedArea, float mag, const Vec3f &color=Vec3f(1.f, 1.f, 1.f))
 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. More...
 

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. More...
 
static const Vec3findexToColor (unsigned char bV)
 Convert quantized B-V index to RGB colors. More...
 

Detailed Description

Provide a set of methods used to draw sky objects taking into account eyes adaptation, zoom level, instrument model and artificially set magnitude limits.

Constructor & Destructor Documentation

StelSkyDrawer::StelSkyDrawer ( StelCore core)

Constructor.

StelSkyDrawer::~StelSkyDrawer ( )

Destructor.

Member Function Documentation

bool StelSkyDrawer::computeRCMag ( float  mag,
RCMag  
) const

Compute RMag and CMag from magnitude.

Parameters
magthe object integrated V magnitude
rcMagarray of 2 floats containing the radius and luminance
Returns
false if the object is too faint to be displayed
bool StelSkyDrawer::drawPointSource ( StelPainter sPainter,
const Vec3f v,
const RCMag rcMag,
unsigned int  bV,
bool  checkInScreen = false 
)
inline

Draw a point source halo.

Parameters
sPainterthe StelPainter to use for drawing.
vthe 3d position of the source in J2000 reference frame
rcMagthe radius and luminance of the source as computed by computeRCMag()
bVthe source B-V index
checkInScreenwhether source in screen should be checked to avoid unnecessary drawing.
Returns
true if the source was actually visible and drawn
float StelSkyDrawer::getAbsoluteStarScale ( ) const
inlineslot

Get the absolute star brightness scale.

double StelSkyDrawer::getAtmospherePressure ( ) const
inlineslot

Get atmospheric (ground) pressure in mbar (for refraction).

double StelSkyDrawer::getAtmosphereTemperature ( ) const
inlineslot

Get atmospheric (ground) temperature in deg celsius (for refraction).

float StelSkyDrawer::getBig3dModelHaloRadius ( ) const
inlineslot

Get the radius of the big halo texture used when a 3d model is very bright.

int StelSkyDrawer::getBortleScaleIndex ( ) const
inlineslot

Get the current Bortle scale index.

float StelSkyDrawer::getCustomNebulaMagnitudeLimit ( ) const
inlineslot

Get the value used for forced nebula magnitude limiting.

float StelSkyDrawer::getCustomStarMagnitudeLimit ( ) const
inlineslot

Get the value used for forced star magnitude limiting.

const Extinction& StelSkyDrawer::getExtinction ( ) const
inlineslot

Get the current valid extinction computation object.

double StelSkyDrawer::getExtinctionCoefficient ( ) const
inlineslot

Get extinction coefficient, mag/airmass (for extinction).

bool StelSkyDrawer::getFlagHasAtmosphere ( ) const
inlineslot

This is used to decide whether to apply refraction/extinction before rendering point sources et al.

bool StelSkyDrawer::getFlagLuminanceAdaptation ( ) const
inlineslot

Get the current value of eye adaptation flag.

bool StelSkyDrawer::getFlagNebulaMagnitudeLimit ( ) const
inlineslot
Returns
true if the user-defined nebula magnitude limit is in force.
bool StelSkyDrawer::getFlagStarMagnitudeLimit ( ) const
inlineslot
Returns
true if the user-defined star magnitude limit is in force.
bool StelSkyDrawer::getFlagTwinkle ( ) const
inlineslot

Get flag for source twinkling.

float StelSkyDrawer::getLimitLuminance ( ) const
inlineslot

Get the luminance of the faintest visible object (e.g.

RGB<0.05) It depends on the zoom level, on the eye adapation and on the point source rendering parameters

Returns
the limit V luminance at which an object will be visible
float StelSkyDrawer::getLimitMagnitude ( ) const
inlineslot

Get the magnitude of the currently faintest visible point source It depends on the zoom level, on the eye adapation and on the point source rendering parameters.

Returns
the limit V mag at which a point source will be displayed
const Refraction& StelSkyDrawer::getRefraction ( ) const
inlineslot

Get the current valid refraction computation object.

float StelSkyDrawer::getRelativeStarScale ( ) const
inlineslot

Get the way brighter stars will look bigger as the fainter ones.

float StelSkyDrawer::getTwinkleAmount ( ) const
inlineslot

Get source twinkle amount.

static float StelSkyDrawer::indexToBV ( unsigned char  bV)
inlinestatic

Convert quantized B-V index to float B-V.

static const Vec3f& StelSkyDrawer::indexToColor ( unsigned char  bV)
inlinestatic

Convert quantized B-V index to RGB colors.

void StelSkyDrawer::init ( )

Init parameters from config file.

static float StelSkyDrawer::luminanceToSurfacebrightness ( float  lum)
static

Compute the surface brightness from the luminance of an extended source.

Parameters
lumluminance in cd/m^2
Returns
surface brightness in V magnitude/arcmin^2
void StelSkyDrawer::postDrawPointSource ( StelPainter sPainter)

Finalize the drawing of point sources.

void StelSkyDrawer::postDrawSky3dModel ( StelPainter p,
const Vec3f v,
float  illuminatedArea,
float  mag,
const Vec3f color = Vec3f(1.f, 1.f, 1.f) 
)

Terminate drawing of a 3D model, draw the halo.

Parameters
pthe StelPainter instance to use for this drawing operation
vthe 3d position of the source in J2000 reference frame
illuminatedAreathe illuminated area in arcmin^2
magthe source integrated magnitude
colorthe object halo RGB color
void StelSkyDrawer::preDraw ( )

To be called before the drawing stage starts.

void StelSkyDrawer::preDrawPointSource ( StelPainter p)

Set the proper openGL state before making calls to drawPointSource.

Parameters
pa 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.

Parameters
lumluminance in cd/m^2
fastAdaptationadapt the eye quickly if true, other wise use a smooth adaptation
void StelSkyDrawer::setAbsoluteStarScale ( double  b = 1.0)
inlineslot

Set the absolute star brightness scale.

void StelSkyDrawer::setAtmospherePressure ( double  mbar)
inlineslot

Set atmospheric (ground) pressure in mbar (for refraction).

void StelSkyDrawer::setAtmosphereTemperature ( double  celsius)
inlineslot

Set atmospheric (ground) temperature in deg celsius (for refraction).

void StelSkyDrawer::setBig3dModelHaloRadius ( float  r)
inlineslot

Set the radius of the big halo texture used when a 3d model is very bright.

void StelSkyDrawer::setBortleScaleIndex ( int  index)
slot

Set the parameters so that the stars disappear at about the limit given by the bortle scale The limit is valid only at a given zoom level (around 60 deg) See http://en.wikipedia.org/wiki/Bortle_Dark-Sky_Scale.

void StelSkyDrawer::setCustomNebulaMagnitudeLimit ( double  limit)
inlineslot

Sets a lower limit for nebula magnitudes (anything fainter is ignored).

In force only if flagNebulaMagnitudeLimit is set.

void StelSkyDrawer::setCustomStarMagnitudeLimit ( double  limit)
inlineslot

Sets a lower limit for star magnitudes (anything fainter is ignored).

In force only if flagStarMagnitudeLimit is set.

void StelSkyDrawer::setExtinctionCoefficient ( double  extCoeff)
inlineslot

Set extinction coefficient, mag/airmass (for extinction).

void StelSkyDrawer::setFlagHasAtmosphere ( bool  b)
inlineslot

Informing the drawer whether atmosphere is displayed.

This is used to avoid twinkling/simulate extinction/refraction.

void StelSkyDrawer::setFlagLuminanceAdaptation ( bool  b)
inlineslot

Set the value of the eye adaptation flag.

void StelSkyDrawer::setFlagNebulaMagnitudeLimit ( bool  b)
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.

void StelSkyDrawer::setFlagStarMagnitudeLimit ( bool  b)
inlineslot

Toggle the application of user-defined star magnitude limit.

If enabled, stars fainter than the magnitude set with setCustomStarMagnitudeLimit() will not be displayed.

void StelSkyDrawer::setFlagTwinkle ( bool  b)
inlineslot

Set flag for source twinkling.

void StelSkyDrawer::setRelativeStarScale ( double  b = 1.0)
inlineslot

Set the way brighter stars will look bigger as the fainter ones.

void StelSkyDrawer::setTwinkleAmount ( double  b)
inlineslot

Set source twinkle amount.

static float StelSkyDrawer::surfacebrightnessToLuminance ( float  sb)
static

Compute the luminance for an extended source with the given surface brightness.

Parameters
sbsurface brightness in V magnitude/arcmin^2
Returns
the luminance in cd/m^2
void StelSkyDrawer::update ( double  deltaTime)

Update with respect to the time and StelProjector/StelToneReproducer state.

Parameters
deltaTimethe time increment in second since last call.