![]() |
Home · All Namespaces · All Classes · Functions · Coding Style · Plugins · File Structure |
#include <StelModule.hpp>
Inherited by GridLinesMgr, LabelMgr, LandscapeMgr, MeteorMgr, MilkyWay, ScreenImageMgr, StelGeodesicGridDrawer, StelGui, StelMovementMgr, StelObjectMgr, StelObjectModule, StelSkyImageMgr, and TextUI.
Public Types | |
enum | StelModuleSelectAction { AddToSelection, ReplaceSelection, RemoveFromSelection } |
enum | StelModuleActionName { ActionDraw, ActionUpdate, ActionHandleMouseClicks, ActionHandleMouseMoves, ActionHandleKeys } |
Public Member Functions | |
virtual void | init ()=0 |
virtual void | draw (StelCore *core)=0 |
virtual void | update (double deltaTime)=0 |
virtual void | updateI18n () |
virtual void | updateSkyCulture (const QString &skyCultureDir) |
virtual QString | getModuleVersion () const |
virtual QString | getAuthorName () const |
virtual QString | getAuthorEmail () const |
virtual void | handleMouseClicks (class QMouseEvent *e) |
virtual void | handleMouseWheel (class QWheelEvent *e) |
virtual bool | handleMouseMoves (int x, int y, Qt::MouseButtons b) |
virtual void | handleKeys (class QKeyEvent *e) |
virtual void | selectedObjectChangeCallBack (StelModuleSelectAction action=ReplaceSelection) |
virtual void | setStelStyle (const StelStyle &style) |
virtual void | glWindowHasBeenResized (int w, int h) |
virtual double | getCallOrder (StelModuleActionName actionName) const |
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.
Plugins for documentation on how to develop external plugins.
Enum used when selecting objects to define whether to add to, replace, or remove from the existing selection list.
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. |
Define the possible action for which an order is defined.
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. |
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 StelMovementMgr, StelObjectMgr, StelSkyImageMgr, StelGui, ConstellationMgr, GridLinesMgr, LabelMgr, LandscapeMgr, MeteorMgr, MilkyWay, NebulaMgr, ScreenImageMgr, SolarSystem, StarMgr, TelescopeMgr, and TextUI.
virtual void StelModule::draw | ( | StelCore * | core | ) | [pure virtual] |
Execute all the drawing functions for this module.
core | the core to use for the drawing |
Implemented in StelMovementMgr, StelObjectMgr, StelSkyImageMgr, StelGui, ConstellationMgr, GridLinesMgr, LabelMgr, LandscapeMgr, MeteorMgr, MilkyWay, NebulaMgr, ScreenImageMgr, SolarSystem, StarMgr, TelescopeMgr, and TextUI.
virtual void StelModule::update | ( | double | deltaTime | ) | [pure virtual] |
Update the module with respect to the time.
deltaTime | the time increment in second since last call. |
Implemented in StelMovementMgr, StelObjectMgr, StelSkyImageMgr, StelGui, ConstellationMgr, GridLinesMgr, LabelMgr, LandscapeMgr, MeteorMgr, MilkyWay, NebulaMgr, ScreenImageMgr, SolarSystem, StarMgr, TelescopeMgr, and TextUI.
virtual void StelModule::updateI18n | ( | ) | [inline, virtual] |
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.
Reimplemented in StelSkyImageMgr, StelGui, ConstellationMgr, LandscapeMgr, MilkyWay, NebulaMgr, SolarSystem, and StarMgr.
virtual void StelModule::updateSkyCulture | ( | const QString & | skyCultureDir | ) | [inline, virtual] |
Update sky culture, i.e.
load data if necessary and translate them to current sky language if needed.
skyCultureDir | the name of the directory containing the sky culture to use. |
Reimplemented in ConstellationMgr, LandscapeMgr, MilkyWay, NebulaMgr, and StarMgr.
virtual QString StelModule::getModuleVersion | ( | ) | const [virtual] |
Get the version of the module, default is stellarium main version.
virtual QString StelModule::getAuthorName | ( | ) | const [inline, virtual] |
Get the name of the module author.
virtual QString StelModule::getAuthorEmail | ( | ) | const [inline, virtual] |
Get the email adress of the module author.
virtual void StelModule::handleMouseClicks | ( | class QMouseEvent * | e | ) | [inline, virtual] |
Handle mouse clicks.
Please note that most of the interactions will be done through the GUI module.
Reimplemented in StelMovementMgr, and StelObjectMgr.
virtual void StelModule::handleMouseWheel | ( | class QWheelEvent * | e | ) | [inline, virtual] |
Handle mouse wheel.
Please note that most of the interactions will be done through the GUI module.
Reimplemented in StelMovementMgr.
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.
Reimplemented in StelMovementMgr, and StelGui.
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.
event | the Key event |
Reimplemented in StelMovementMgr.
virtual void StelModule::selectedObjectChangeCallBack | ( | StelModuleSelectAction | action = ReplaceSelection |
) | [inline, virtual] |
Indicate that the user requested selection of StelObjects.
The StelModule should then manage by themself how they handle the event
action | define if the user requested that the objects are added to the selection or just replace it |
Reimplemented in StelMovementMgr, ConstellationMgr, and SolarSystem.
virtual void StelModule::setStelStyle | ( | const StelStyle & | style | ) | [inline, virtual] |
Load the given color style.
style | the style object containing all necessary information on how to style widgets and text |
Reimplemented in StelGui, ConstellationMgr, GridLinesMgr, LandscapeMgr, NebulaMgr, SolarSystem, StarMgr, and TelescopeMgr.
virtual void StelModule::glWindowHasBeenResized | ( | int | w, | |
int | h | |||
) | [inline, virtual] |
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.
actionName | the name of the action for which we want the call order |
Reimplemented in StelSkyImageMgr, StelGui, ConstellationMgr, GridLinesMgr, LabelMgr, LandscapeMgr, MeteorMgr, MilkyWay, NebulaMgr, ScreenImageMgr, SolarSystem, StarMgr, TelescopeMgr, and TextUI.