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

StelModule Class Reference

This is the common base class for all the main components of stellarium. More...

#include <StelModule.hpp>

List of all members.

Public Types

enum  StelModuleSelectAction { AddToSelection, ReplaceSelection, RemoveFromSelection }
 

Enum used when selecting objects to define whether to add to, replace, or remove from the existing selection list.

More...
enum  StelModuleActionName {
  ActionDraw, ActionUpdate, ActionHandleMouseClicks, ActionHandleMouseMoves,
  ActionHandleKeys
}
 

Define the possible action for which an order is defined.

More...

Public Member Functions

virtual void init ()=0
 Initialize itself.
virtual void deinit ()
 Called before the module will be deleted, and before the renderer is destroyed.
virtual void draw (StelCore *core, class StelRenderer *renderer)
 Execute all the drawing functions for this module.
virtual bool drawPartial (StelCore *core, class StelRenderer *renderer)
 Iterate through the drawing sequence.
virtual void update (double deltaTime)=0
 Update the module with respect to the time.
virtual QString getModuleVersion () const
 Get the version of the module, default is stellarium main version.
virtual QString getAuthorName () const
 Get the name of the module author.
virtual QString getAuthorEmail () const
 Get the email adress of the module author.
virtual void handleMouseClicks (class QMouseEvent *)
 Handle mouse clicks.
virtual void handleMouseWheel (class QWheelEvent *)
 Handle mouse wheel.
virtual bool handleMouseMoves (int x, int y, Qt::MouseButtons b)
 Handle mouse moves.
virtual void handleKeys (class QKeyEvent *e)
 Handle key events.
virtual double getCallOrder (StelModuleActionName actionName) const
 Return the value defining the order of call for the given action For example if stars.callOrder[ActionDraw] == 10 and constellation.callOrder[ActionDraw] == 11, the stars module will be drawn before the constellations.
virtual bool configureGui (bool show=true)
 Detect or show the configuration GUI elements for the module.

Detailed Description

This is the common base class for all the main components of stellarium.

Standard StelModules are the one displaying the stars, the constellations, the planets etc.. Every new module derived class should implement the methods defined in StelModule.hpp. Once a module is registered into the StelModuleMgr, it is automatically managed by the program. It can be called using the GETSTELMODULE macro, passing as argument its name, which is also the QObject name Because StelModules are very generic components, it is also possible to load them dynamically, thus enabling creation of external plug-ins for stellarium.

See also:
StelObjectModule for StelModule managing collections of StelObject.
Plugins for documentation on how to develop external plugins.

There are several signals that StelApp emits that subclasses may be interested in: laguageChanged() Update i18n strings from english names according to current global sky and application language. This method also reload the proper fonts depending on the language. The translation shall be done using the StelTranslator provided by the StelApp singleton instance. skyCultureChanged(const QString&) Update sky culture, i.e. load data if necessary and translate them to current sky language if needed. colorSchemeChanged(const QString&) Load the given color style

Definition at line 49 of file StelModule.hpp.


Member Enumeration Documentation

Define the possible action for which an order is defined.

Enumerator:
ActionDraw 

Action associated to the draw() method.

ActionUpdate 

Action associated to the update() method.

ActionHandleMouseClicks 

Action associated to the handleMouseClicks() method.

ActionHandleMouseMoves 

Action associated to the handleMouseMoves() method.

ActionHandleKeys 

Action associated to the handleKeys() method.

Definition at line 121 of file StelModule.hpp.

Enum used when selecting objects to define whether to add to, replace, or remove from the existing selection list.

Enumerator:
AddToSelection 

Add the StelObject to the current list of selected ones.

ReplaceSelection 

Set the StelObject as the new list of selected ones.

RemoveFromSelection 

Subtract the StelObject from the current list of selected ones.

Definition at line 113 of file StelModule.hpp.


Member Function Documentation

virtual bool StelModule::configureGui ( bool  show = true  )  [inline, virtual]

Detect or show the configuration GUI elements for the module.

This is to be used with plugins to display a configuration dialog from the plugin list window.

Parameters:
show if true, make the configuration GUI visible. If false, hide the config GUI if there is one.
Returns:
true if the module has a configuration GUI, else false.

Definition at line 141 of file StelModule.hpp.

virtual void StelModule::deinit (  )  [inline, virtual]

Called before the module will be deleted, and before the renderer is destroyed.

Deinitialize all textures in this method.

Definition at line 65 of file StelModule.hpp.

virtual void StelModule::draw ( StelCore core,
class StelRenderer renderer 
) [inline, virtual]

Execute all the drawing functions for this module.

Parameters:
core the core to use for the drawing
renderer Renderer to draw with.

Reimplemented in ConstellationMgr, GridLinesMgr, LabelMgr, LandscapeMgr, MeteorMgr, MilkyWay, NebulaMgr, SolarSystem, StarMgr, StelMovementMgr, StelObjectMgr, StelSkyLayerMgr, and ScreenImageMgr.

Definition at line 70 of file StelModule.hpp.

virtual bool StelModule::drawPartial ( StelCore core,
class StelRenderer renderer 
) [virtual]

Iterate through the drawing sequence.

This allow us to split the slow drawing operation into small parts, we can then decide to pause the painting for this frame and used the cached image instead.

Returns:
true if we should continue drawing (by calling the method again)
virtual QString StelModule::getAuthorEmail (  )  const [inline, virtual]

Get the email adress of the module author.

Definition at line 93 of file StelModule.hpp.

virtual QString StelModule::getAuthorName (  )  const [inline, virtual]

Get the name of the module author.

Definition at line 90 of file StelModule.hpp.

virtual double StelModule::getCallOrder ( StelModuleActionName  actionName  )  const [inline, virtual]

Return the value defining the order of call for the given action For example if stars.callOrder[ActionDraw] == 10 and constellation.callOrder[ActionDraw] == 11, the stars module will be drawn before the constellations.

Parameters:
actionName the name of the action for which we want the call order
Returns:
the value defining the order. The closer to 0 the earlier the module's action will be called

Reimplemented in ConstellationMgr, GridLinesMgr, LabelMgr, LandscapeMgr, MeteorMgr, MilkyWay, NebulaMgr, SolarSystem, StarMgr, StelSkyLayerMgr, and ScreenImageMgr.

Definition at line 135 of file StelModule.hpp.

virtual QString StelModule::getModuleVersion (  )  const [virtual]

Get the version of the module, default is stellarium main version.

virtual void StelModule::handleKeys ( class QKeyEvent *  e  )  [inline, virtual]

Handle key events.

Please note that most of the interactions will be done through the GUI module.

Parameters:
e the Key event
Returns:
set the event as accepted if it was intercepted

Reimplemented in StelMovementMgr.

Definition at line 110 of file StelModule.hpp.

virtual void StelModule::handleMouseClicks ( class QMouseEvent *   )  [inline, virtual]

Handle mouse clicks.

Please note that most of the interactions will be done through the GUI module.

Returns:
set the event as accepted if it was intercepted

Reimplemented in StelMovementMgr.

Definition at line 97 of file StelModule.hpp.

virtual bool StelModule::handleMouseMoves ( int  x,
int  y,
Qt::MouseButtons  b 
) [inline, virtual]

Handle mouse moves.

Please note that most of the interactions will be done through the GUI module.

Returns:
true if the event was intercepted

Reimplemented in StelMovementMgr.

Definition at line 105 of file StelModule.hpp.

virtual void StelModule::handleMouseWheel ( class QWheelEvent *   )  [inline, virtual]

Handle mouse wheel.

Please note that most of the interactions will be done through the GUI module.

Returns:
set the event as accepted if it was intercepted

Reimplemented in StelMovementMgr.

Definition at line 101 of file StelModule.hpp.

virtual void StelModule::init (  )  [pure virtual]

Initialize itself.

If the initialization takes significant time, the progress should be displayed on the loading bar.

Implemented in ConstellationMgr, StelGeodesicGridDrawer, GridLinesMgr, LabelMgr, LandscapeMgr, MeteorMgr, MilkyWay, NebulaMgr, SolarSystem, StarMgr, StelMovementMgr, StelObjectMgr, StelSkyLayerMgr, and ScreenImageMgr.

virtual void StelModule::update ( double  deltaTime  )  [pure virtual]

Update the module with respect to the time.

Parameters:
deltaTime the time increment in second since last call.

Implemented in ConstellationMgr, StelGeodesicGridDrawer, GridLinesMgr, LabelMgr, LandscapeMgr, MeteorMgr, MilkyWay, NebulaMgr, SolarSystem, StarMgr, StelMovementMgr, StelObjectMgr, StelSkyLayerMgr, and ScreenImageMgr.


The documentation for this class was generated from the following file:
Generated on Thu Jan 31 14:05:45 2013 for Stellarium by  doxygen 1.6.3