Home · All Namespaces · All Classes · Functions · Coding Style · Plugins · File Structure

LandscapeMgr Class Reference

Manages all the rendering a the level of the observer's surrounding. More...

#include <LandscapeMgr.hpp>

Inherits StelModule.

List of all members.

Public Slots

QStringList getAllLandscapeNames () const
QStringList getAllLandscapeIDs () const
const QString & getCurrentLandscapeID () const
bool setCurrentLandscapeID (const QString &id, bool inThread=false)
QString getCurrentLandscapeName () const
bool setCurrentLandscapeName (const QString &name, bool inThread=false)
const QString & getDefaultLandscapeID () const
bool setDefaultLandscapeID (const QString &id)
QString getCurrentLandscapeHtmlDescription () const
bool getFlagLandscape () const
void setFlagLandscape (bool b)
bool getFlagFog () const
void setFlagFog (bool b)
bool getFlagLandscapeSetsLocation () const
void setFlagLandscapeSetsLocation (bool b)
bool getFlagCardinalsPoints () const
void setFlagCardinalsPoints (bool b)
Vec3f getColorCardinalPoints () const
void setColorCardinalPoints (const Vec3f &v)
bool getFlagAtmosphere () const
void setFlagAtmosphere (bool b)
float getAtmosphereFadeDuration () const
void setAtmosphereFadeDuration (float f)
void setAtmosphereBortleLightPollution (int bIndex)
void setZRotation (double d)

Signals

void requestSetCurrentLandscapeID (const QString &id)
void requestCompleteSetCurrentLandscapeID (bool success)
void requestSetCurrentLandscapeName (const QString &name)
void requestCompleteSetCurrentLandscapeName (bool success)

Public Member Functions

virtual void init ()
virtual void draw (StelCore *core)
virtual void update (double deltaTime)
virtual void updateI18n ()
virtual void updateSkyCulture (const QString &skyCultureDir)
virtual void setStelStyle (const StelStyle &style)
virtual double getCallOrder (StelModuleActionName actionName) const
float getLuminance (void)
bool loadLandscape (QMap< QString, QString > &param)
LandscapecreateFromFile (const QString &landscapeFile, const QString &landscapeId)


Detailed Description

Manages all the rendering a the level of the observer's surrounding.

This includes landscape textures, fog, atmosphere and cardinal points I decided to put all these elements together in a single class because they are inherently linked, especially when we start moving the observer in altitude.


Member Function Documentation

virtual void LandscapeMgr::init (  )  [virtual]

Initialize the LandscapeManager class.

Operations performed:

  • Load the default landscape as specified in the application configuration
  • Set up landscape-releated display flags from ini parser object

Implements StelModule.

virtual void LandscapeMgr::draw ( StelCore core  )  [virtual]

Draw the landscape graphics, cardinal points and atmosphere.

Implements StelModule.

virtual void LandscapeMgr::update ( double  deltaTime  )  [virtual]

Update time-dependent state.

Includes:

  • Landscape, atmosphere and cardinal point on/off fading.
  • Atmophere colour calulation based on location, position of sun and moon.
  • updates adaptation lumenescence lased on visible bright objects.

Implements StelModule.

virtual void LandscapeMgr::updateI18n (  )  [virtual]

Translate labels to new language settings.

Reimplemented from StelModule.

virtual void LandscapeMgr::updateSkyCulture ( const QString &  skyCultureDir  )  [inline, virtual]

Called for all registered modules if the sky culture changes.

Parameters:
skyCultureDir the name of the directory containing the sky culture to use.

Reimplemented from StelModule.

virtual void LandscapeMgr::setStelStyle ( const StelStyle style  )  [virtual]

Load a color scheme from a configuration object.

Reimplemented from StelModule.

virtual double LandscapeMgr::getCallOrder ( StelModuleActionName  actionName  )  const [virtual]

Get the order in which this module will draw it's objects relative to other modules.

Reimplemented from StelModule.

float LandscapeMgr::getLuminance ( void   ) 

Return the global landscape luminance, for being used e.g for setting eye adaptation.

bool LandscapeMgr::loadLandscape ( QMap< QString, QString > &  param  ) 

Load a landscape based on a hash of parameters mirroring the landscape.ini file and make it the current landscape.

Landscape* LandscapeMgr::createFromFile ( const QString &  landscapeFile,
const QString &  landscapeId 
)

Create a new landscape from the files which describe it.

Reads a landscape.ini file which is passed as the first parameter, determines the landscape type, and creates a new object for the landscape of the proper type. The load member is then called, passing both parameters.

Parameters:
landscapeFile This is the path to a landscape.ini file.
landscapeId This is the landscape ID, which is also the name of the directory in which the files (textures and so on) for the landscape reside.
Returns:
A pointer to the newly created landscape object.

QStringList LandscapeMgr::getAllLandscapeNames (  )  const [slot]

Retrieve list of the names of all the available landscape in the file search path sub-directories of the landscape area.

Returns:
the names of the landscapes, which are the values of the name parameter in the landscape.ini files

QStringList LandscapeMgr::getAllLandscapeIDs (  )  const [slot]

Retrieve list of the names of all the available landscape in the file search path sub-directories of the landscape area.

Returns:
the names of the landscapes, which are the values of the name parameter in the landscape.ini files

const QString& LandscapeMgr::getCurrentLandscapeID (  )  const [inline, slot]

Get the current landscape ID.

bool LandscapeMgr::setCurrentLandscapeID ( const QString &  id,
bool  inThread = false 
) [slot]

Change the current landscape to the landscape with the ID specified.

Parameters:
id the ID of the new landscape
inThread should be false when this is called from a script or a thread outside the main program thread. Note that if inThread is false, the return value will always be true. The return value may be retrieved asynchronously by connecting the requestCompleteSetCurrentLandscapeID signal to the calling code.
Returns:
false if the new landscape could not be set (e.g. no landscape of that ID was found). True on success or if inThread == false.

QString LandscapeMgr::getCurrentLandscapeName (  )  const [slot]

Get the current landscape name.

bool LandscapeMgr::setCurrentLandscapeName ( const QString &  name,
bool  inThread = false 
) [slot]

Change the current landscape to the landscape with the name specified.

Parameters:
name the name of the new landscape, as found in the landscape:name key of the landscape.ini file.
inThread should be false when this is called from a script or a thread outside the main program thread. Note that if inThread is false, the return value will always be true. The return value may be retrieved asynchronously by connecting the requestCompleteSetCurrentLandscapeID signal to the calling code.
Returns:
false if the new landscape could not be set (e.g. no landscape of that ID was found). True on success or if inThread == false.

const QString& LandscapeMgr::getDefaultLandscapeID (  )  const [inline, slot]

Get the default landscape ID.

bool LandscapeMgr::setDefaultLandscapeID ( const QString &  id  )  [slot]

Change the default landscape to the landscape with the ID specified.

Parameters:
id the ID of the landscape to use by default
Returns:
false if the new landscape could not be set (e.g. no landscape of that ID was found). True on success.

QString LandscapeMgr::getCurrentLandscapeHtmlDescription (  )  const [slot]

Return a pseudo HTML formated string with all informations on the current landscape.

bool LandscapeMgr::getFlagLandscape (  )  const [slot]

Get flag for displaying Landscape.

void LandscapeMgr::setFlagLandscape ( bool  b  )  [slot]

Set flag for displaying Landscape.

bool LandscapeMgr::getFlagFog (  )  const [slot]

Get flag for displaying Fog.

void LandscapeMgr::setFlagFog ( bool  b  )  [slot]

Set flag for displaying Fog.

bool LandscapeMgr::getFlagLandscapeSetsLocation (  )  const [inline, slot]

Return the value of the flag determining if a change of landscape will update the observer location.

void LandscapeMgr::setFlagLandscapeSetsLocation ( bool  b  )  [inline, slot]

Set the value of the flag determining if a change of landscape will update the observer location.

bool LandscapeMgr::getFlagCardinalsPoints (  )  const [slot]

Get flag for displaying Cardinals Points.

void LandscapeMgr::setFlagCardinalsPoints ( bool  b  )  [slot]

Set flag for displaying Cardinals Points.

Vec3f LandscapeMgr::getColorCardinalPoints (  )  const [slot]

Get Cardinals Points color.

void LandscapeMgr::setColorCardinalPoints ( const Vec3f v  )  [slot]

Set Cardinals Points color.

bool LandscapeMgr::getFlagAtmosphere (  )  const [slot]

Get flag for displaying Atmosphere.

void LandscapeMgr::setFlagAtmosphere ( bool  b  )  [slot]

Set flag for displaying Atmosphere.

float LandscapeMgr::getAtmosphereFadeDuration (  )  const [slot]

Get atmosphere fade duration in s.

void LandscapeMgr::setAtmosphereFadeDuration ( float  f  )  [slot]

Set atmosphere fade duration in s.

void LandscapeMgr::setAtmosphereBortleLightPollution ( int  bIndex  )  [slot]

Set the light pollution following the Bortle Scale.

void LandscapeMgr::setZRotation ( double  d  )  [slot]

Set the rotation of the landscape about the z-axis.

This is intended for special uses such as when the landscape consists of a vehicle which might change orientation over time (e.g. a ship).

Parameters:
d the rotation angle in degrees as an offset from the originally loaded value.


Generated on Mon Mar 9 16:16:16 2009 for Stellarium by  doxygen 1.5.5