Stellarium 0.11.4
Home · All Namespaces · All Classes · Functions · Coding Style · Scripting · Plugins · File Structure

StelSkyDrawer Class Reference

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

#include <StelSkyDrawer.hpp>

List of all members.

Public Slots

void setRelativeStarScale (double b=1.0)
 Set the way brighter stars will look bigger as the fainter ones.
float 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.
float getAbsoluteStarScale () const
 Get the absolute star brightness scale.
void setTwinkleAmount (double b)
 Set source twinkle amount.
float getTwinkleAmount () const
 Get source twinkle amount.
void setFlagTwinkle (bool b)
 Set flag for source twinkling.
bool getFlagTwinkle () const
 Get flag for source twinkling.
void setFlagPointStar (bool b)
 Set flag for displaying point sources as GLpoints (faster on some hardware but not so nice).
bool getFlagPointStar () const
 Get flag for displaying point sources as GLpoints (faster on some hardware but not so nice).
void setBortleScale (int index)
 Set the parameters so that the stars disapear 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.
int getBortleScale () const
 Get the current Bortle scale index.
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.
float getLimitLuminance () const
 Get the luminance of the faintest visible object (e.g.
void setFlagLuminanceAdaptation (bool b)
 Set the value of the eye adaptation flag.
bool getFlagLuminanceAdaptation () const
 Get the current value of eye adaptation flag.
void setFlagHasAtmosphere (bool b)
 Informing the drawer whether atmosphere is displayed.
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 ExtinctiongetExtinction () const
 Get the current valid extinction computation class.
const RefractiongetRefraction () const
 Get the current valid fefraction computation class.
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.

Public Member Functions

 StelSkyDrawer (StelCore *core)
 Constructor.
 ~StelSkyDrawer ()
 Destructor.
void init ()
 Init parameters from config file.
void update (double deltaTime)
 Update with respect to the time and StelProjector/StelToneReproducer state.
void preDrawPointSource (StelPainter *p)
 Set the proper openGL state before making calls to drawPointSource.
void postDrawPointSource (StelPainter *sPainter)
 Finalize the drawing of point sources.
bool drawPointSource (StelPainter *sPainter, const Vec3d &v, const float rcMag[2], unsigned int bV, bool checkInScreen=false)
 Draw a point source halo.
bool drawPointSource (StelPainter *sPainter, const Vec3d &v, const float rcMag[2], const Vec3f &bcolor, bool checkInScreen=false)
void postDrawSky3dModel (StelPainter *p, const Vec3d &v, float illuminatedArea, float mag, const Vec3f &color=Vec3f(1.f, 1.f, 1.f))
 Terminate drawing of a 3D model, draw the halo.
bool computeRCMag (float mag, float rcMag[2]) const
 Compute RMag and CMag from magnitude.
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.
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.
static float luminanceToSurfacebrightness (float lum)
 Compute the surface brightness from the luminance of an extended source.
static float indexToBV (unsigned char bV)
 Convert quantized B-V index to float B-V.
static const Vec3findexToColor (unsigned char bV)
 Convert quantized B-V index to RGB colors.

Detailed Description

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


Constructor & Destructor Documentation

StelSkyDrawer::StelSkyDrawer ( StelCore core  ) 

Constructor.

StelSkyDrawer::~StelSkyDrawer (  ) 

Destructor.


Member Function Documentation

bool StelSkyDrawer::computeRCMag ( float  mag,
float  rcMag[2] 
) const

Compute RMag and CMag from magnitude.

Parameters:
mag the object integrated V magnitude
rcMag array 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 Vec3d v,
const float  rcMag[2],
unsigned int  bV,
bool  checkInScreen = false 
) [inline]

Draw a point source halo.

Parameters:
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()
bV the source B-V index
checkInScreen whether source in screen should be checked to avoid unnecessary drawing.
Returns:
true if the source was actually visible and drawn
float StelSkyDrawer::getAbsoluteStarScale (  )  const [inline, slot]

Get the absolute star brightness scale.

double StelSkyDrawer::getAtmospherePressure (  )  const [inline, slot]

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

double StelSkyDrawer::getAtmosphereTemperature (  )  const [inline, slot]

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

float StelSkyDrawer::getBig3dModelHaloRadius (  )  const [inline, slot]

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

int StelSkyDrawer::getBortleScale (  )  const [inline, slot]

Get the current Bortle scale index.

const Extinction& StelSkyDrawer::getExtinction (  )  const [inline, slot]

Get the current valid extinction computation class.

double StelSkyDrawer::getExtinctionCoefficient (  )  const [inline, slot]

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

bool StelSkyDrawer::getFlagHasAtmosphere (  )  const [inline, slot]

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

bool StelSkyDrawer::getFlagLuminanceAdaptation (  )  const [inline, slot]

Get the current value of eye adaptation flag.

bool StelSkyDrawer::getFlagPointStar (  )  const [inline, slot]

Get flag for displaying point sources as GLpoints (faster on some hardware but not so nice).

bool StelSkyDrawer::getFlagTwinkle (  )  const [inline, slot]

Get flag for source twinkling.

float StelSkyDrawer::getLimitLuminance (  )  const [inline, slot]

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 [inline, slot]

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 [inline, slot]

Get the current valid fefraction computation class.

float StelSkyDrawer::getRelativeStarScale (  )  const [inline, slot]

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

float StelSkyDrawer::getTwinkleAmount (  )  const [inline, slot]

Get source twinkle amount.

static float StelSkyDrawer::indexToBV ( unsigned char  bV  )  [inline, static]

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

static const Vec3f& StelSkyDrawer::indexToColor ( unsigned char  bV  )  [inline, static]

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:
lum luminance 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 Vec3d 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:
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
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:
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.

Parameters:
lum luminance in cd/m^2
fastAdaptation adapt the eye quickly if true, other wise use a smooth adaptation
void StelSkyDrawer::setAbsoluteStarScale ( double  b = 1.0  )  [inline, slot]

Set the absolute star brightness scale.

void StelSkyDrawer::setAtmospherePressure ( double  mbar  )  [inline, slot]

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

void StelSkyDrawer::setAtmosphereTemperature ( double  celsius  )  [inline, slot]

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

void StelSkyDrawer::setBig3dModelHaloRadius ( float  r  )  [inline, slot]

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

void StelSkyDrawer::setBortleScale ( int  index  )  [slot]

Set the parameters so that the stars disapear 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::setExtinctionCoefficient ( double  extCoeff  )  [inline, slot]

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

void StelSkyDrawer::setFlagHasAtmosphere ( bool  b  )  [inline, slot]

Informing the drawer whether atmosphere is displayed.

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

void StelSkyDrawer::setFlagLuminanceAdaptation ( bool  b  )  [inline, slot]

Set the value of the eye adaptation flag.

void StelSkyDrawer::setFlagPointStar ( bool  b  )  [inline, slot]

Set flag for displaying point sources as GLpoints (faster on some hardware but not so nice).

void StelSkyDrawer::setFlagTwinkle ( bool  b  )  [inline, slot]

Set flag for source twinkling.

void StelSkyDrawer::setRelativeStarScale ( double  b = 1.0  )  [inline, slot]

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

void StelSkyDrawer::setTwinkleAmount ( double  b  )  [inline, slot]

Set source twinkle amount.

static float StelSkyDrawer::surfacebrightnessToLuminance ( float  sb  )  [static]

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

Parameters:
sb surface 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:
deltaTime the time increment in second since last call.
Generated on Sat Aug 25 22:13:33 2012 for Stellarium by  doxygen 1.6.3