Stellarium 0.15.2
|
This is the common base class for all the main components of stellarium. More...
#include <StelModule.hpp>
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. More... | |
virtual void | deinit () |
Called before the module will be delete, and before the openGL context is suppressed. More... | |
virtual void | draw (StelCore *core) |
Execute all the drawing functions for this module. More... | |
virtual void | update (double deltaTime)=0 |
Update the module with respect to the time. More... | |
virtual QString | getModuleVersion () const |
Get the version of the module, default is stellarium main version. More... | |
virtual QString | getAuthorName () const |
Get the name of the module author. More... | |
virtual QString | getAuthorEmail () const |
Get the email adress of the module author. More... | |
virtual void | handleMouseClicks (class QMouseEvent *) |
Handle mouse clicks. More... | |
virtual void | handleMouseWheel (class QWheelEvent *) |
Handle mouse wheel. More... | |
virtual bool | handleMouseMoves (int x, int y, Qt::MouseButtons b) |
Handle mouse moves. More... | |
virtual void | handleKeys (class QKeyEvent *e) |
Handle key events. More... | |
virtual bool | handlePinch (qreal scale, bool started) |
Handle pinch gesture events. More... | |
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. More... | |
virtual bool | configureGui (bool show=true) |
Detect or show the configuration GUI elements for the module. More... | |
Protected Member Functions | |
class StelAction * | addAction (const QString &id, const QString &groupId, const QString &text, QObject *target, const char *slot, const QString &shortcut="", const QString &altShortcut="") |
convenience methods to add an action (call to slot) to the StelActionMgr object. More... | |
class StelAction * | addAction (const QString &id, const QString &groupId, const QString &text, const char *slot, const QString &shortcut="", const QString &altShortcut="") |
convenience methods to add an action (call to own slot) to the StelActionMgr object. More... | |
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.
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.
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 111 of file StelModule.hpp.
|
protected |
convenience methods to add an action (call to slot) to the StelActionMgr object.
id | unique identifier. Should be called actionMy_Action. (i.e., start with "action" and then "Capitalize_Underscore" style.) |
groupId | string to be used in the Help menu. The action will be listed in this group. |
text | short translatable description what the action does. |
target | recipient of the call |
slot | name of slot in target recipient |
shortcut | default shortcut. Can be reconfigured. |
altShortcut | default alternative shortcut. Can be reconfigured. |
|
inlineprotected |
convenience methods to add an action (call to own slot) to the StelActionMgr object.
id | unique identifier. Should be called actionMy_Action. (i.e., start with "action" and then "Capitalize_Underscore" style.) |
groupId | string to be used in the Help menu. The action will be listed in this group. |
text | short translatable description what the action does. |
slot | name of slot in target recipient |
shortcut | default shortcut. Can be reconfigured. |
altShortcut | default alternative shortcut. Can be reconfigured. |
Definition at line 166 of file StelModule.hpp.
|
inlinevirtual |
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.
show | if true, make the configuration GUI visible. If false, hide the config GUI if there is one. |
Reimplemented in ArchaeoLines, Satellites, Pulsars, Exoplanets, Quasars, MeteorShowersMgr, Novae, Supernovae, AngleMeasure, Oculars, PointerCoordinates, TelescopeControl, Scenery3dMgr, NavStars, SolarSystemEditor, EquationOfTime, RemoteControl, Observability, FOV, RemoteSync, and LogBook.
Definition at line 143 of file StelModule.hpp.
|
inlinevirtual |
Called before the module will be delete, and before the openGL context is suppressed.
Deinitialize all openGL texture in this method.
Reimplemented in SolarSystem, Satellites, MeteorShowersMgr, Pulsars, Oculars, Exoplanets, Quasars, PointerCoordinates, Supernovae, Scenery3dMgr, NavStars, TelescopeControl, SolarSystemEditor, EquationOfTime, FOV, CustomObjectMgr, and ToastMgr.
Definition at line 68 of file StelModule.hpp.
|
inlinevirtual |
Execute all the drawing functions for this module.
core | the core to use for the drawing |
Reimplemented in GridLinesMgr, ArchaeoLines, SolarSystem, NebulaMgr, Satellites, ScreenImageMgr, LandscapeMgr, MeteorShowersMgr, StarMgr, ConstellationMgr, Pulsars, Oculars, Exoplanets, Quasars, PointerCoordinates, AngleMeasure, StelMovementMgr, Supernovae, Novae, Scenery3dMgr, NavStars, TelescopeControl, SolarSystemEditor, ZodiacalLight, EquationOfTime, RemoteControl, Observability, LabelMgr, MeteorShowers, MilkyWay, CompassMarks, StelSkyLayerMgr, LogBook, CustomObjectMgr, StelObjectMgr, TextUserInterface, SporadicMeteorMgr, ToastMgr, HelloStelModule, and SimpleDrawLine.
Definition at line 72 of file StelModule.hpp.
|
inlinevirtual |
Get the email adress of the module author.
Definition at line 85 of file StelModule.hpp.
|
inlinevirtual |
Get the name of the module author.
Definition at line 82 of file StelModule.hpp.
|
inlinevirtual |
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 GridLinesMgr, ArchaeoLines, SolarSystem, NebulaMgr, Satellites, LandscapeMgr, ScreenImageMgr, StarMgr, MeteorShowersMgr, ConstellationMgr, Pulsars, StelMovementMgr, Exoplanets, Oculars, Quasars, PointerCoordinates, AngleMeasure, Supernovae, Novae, Scenery3dMgr, ZodiacalLight, NavStars, TelescopeControl, SolarSystemEditor, EquationOfTime, RemoteControl, Observability, LabelMgr, MilkyWay, FOV, StelSkyLayerMgr, RemoteSync, CompassMarks, LogBook, CustomObjectMgr, TextUserInterface, SporadicMeteorMgr, ToastMgr, HelloStelModule, and SimpleDrawLine.
Definition at line 137 of file StelModule.hpp.
|
virtual |
Get the version of the module, default is stellarium main version.
|
inlinevirtual |
Handle key events.
Please note that most of the interactions will be done through the GUI module.
e | the Key event |
Reimplemented in ArchaeoLines, Oculars, AngleMeasure, StelMovementMgr, Scenery3dMgr, RemoteControl, and TextUserInterface.
Definition at line 102 of file StelModule.hpp.
|
inlinevirtual |
Handle mouse clicks.
Please note that most of the interactions will be done through the GUI module.
Reimplemented in Oculars, StelMovementMgr, AngleMeasure, and CustomObjectMgr.
Definition at line 89 of file StelModule.hpp.
|
inlinevirtual |
Handle mouse moves.
Please note that most of the interactions will be done through the GUI module.
Reimplemented in AngleMeasure, and StelMovementMgr.
Definition at line 97 of file StelModule.hpp.
|
inlinevirtual |
Handle mouse wheel.
Please note that most of the interactions will be done through the GUI module.
Reimplemented in StelMovementMgr.
Definition at line 93 of file StelModule.hpp.
|
inlinevirtual |
Handle pinch gesture events.
scale | the value of the pinch gesture. |
started | define whether the pinch has just started. |
Reimplemented in StelMovementMgr.
Definition at line 108 of file StelModule.hpp.
|
pure virtual |
Initialize itself.
If the initialization takes significant time, the progress should be displayed on the loading bar.
Implemented in GridLinesMgr, ArchaeoLines, NebulaMgr, SolarSystem, Satellites, ScreenImageMgr, LandscapeMgr, MeteorShowersMgr, StarMgr, ConstellationMgr, Pulsars, Oculars, Exoplanets, Quasars, AngleMeasure, PointerCoordinates, Supernovae, Novae, Scenery3dMgr, StelMovementMgr, NavStars, TelescopeControl, ZodiacalLight, EquationOfTime, SolarSystemEditor, RemoteControl, Observability, LabelMgr, LogBook, FOV, RemoteSync, MilkyWay, CompassMarks, StelSkyLayerMgr, StelObjectMgr, CustomObjectMgr, TextUserInterface, SporadicMeteorMgr, StelGeodesicGridDrawer, ToastMgr, HelloStelModule, and SimpleDrawLine.
|
pure virtual |
Update the module with respect to the time.
deltaTime | the time increment in second since last call. |
Implemented in GridLinesMgr, ArchaeoLines, SolarSystem, NebulaMgr, Satellites, LandscapeMgr, ScreenImageMgr, StarMgr, MeteorShowersMgr, ConstellationMgr, Oculars, Pulsars, Exoplanets, Quasars, PointerCoordinates, AngleMeasure, Scenery3dMgr, Supernovae, Novae, StelMovementMgr, NavStars, ZodiacalLight, TelescopeControl, SolarSystemEditor, EquationOfTime, RemoteControl, Observability, LabelMgr, MilkyWay, LogBook, FOV, MeteorShowers, RemoteSync, StelSkyLayerMgr, CompassMarks, StelObjectMgr, CustomObjectMgr, TextUserInterface, SporadicMeteorMgr, StelGeodesicGridDrawer, ToastMgr, HelloStelModule, and SimpleDrawLine.