Stellarium  23.4
Public Slots | Public Member Functions
MarkerMgr Class Reference

Allows for creation of custom markers on objects or coordinates. More...

#include <MarkerMgr.hpp>

Public Slots

int markerObject (const QString &objectName, bool visible=true, const QString &mtype="cross", const QString &color="#ffff66", const float size=6.f, bool autoDelete=false, int autoDeleteTimeoutMs=0)
 Create a marker which is attached to a StelObject. More...
 
int markerEquatorial (const QString &RA, const QString &Dec, bool j2000epoch=true, bool visible=true, const QString &mtype="cross", const QString &color="#ffff66", const float size=6.f, bool autoDelete=false, int autoDeleteTimeoutMs=0, bool withAberration=true)
 Create a marker with mean equatorial coordinates. More...
 
int markerHorizon (const QString &az, const QString &alt, bool visible=true, const QString &mtype="cross", const QString &color="#ffff66", const float size=6.f, bool autoDelete=false, int autoDeleteTimeoutMs=0)
 Create a marker with horizontal coordinates. More...
 
bool getMarkerShow (int id) const
 find out if a marker identified by id is presently shown
 
void setMarkerShow (int id, bool show)
 set a marker identified by a positive id to be shown or not
 
void deleteMarker (int id)
 Delete a marker identified by positive ID. More...
 
int deleteAllMarkers (void)
 Delete all markers. More...
 

Public Member Functions

 MarkerMgr ()
 Construct a MarkerMgr object.
 
virtual void init () Q_DECL_OVERRIDE
 Initialize the MarkerMgr object.
 
virtual void draw (StelCore *core) Q_DECL_OVERRIDE
 Draw user labels.
 
virtual void update (double deltaTime) Q_DECL_OVERRIDE
 Update time-dependent parts of the module.
 
virtual double getCallOrder (StelModuleActionName actionName) const Q_DECL_OVERRIDE
 Defines the order in which the various modules are drawn.
 
- Public Member Functions inherited from StelModule
 StelModule ()
 Constructor. Every derived class MUST call setObjectName(className) in its constructor.
 
virtual void deinit ()
 Called before the module will be deleted, and before the OpenGL context is suppressed. More...
 
virtual QSettings * getSettings ()
 Return module-specific settings. More...
 
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 address of the module author.
 
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 bool configureGui (bool show=true)
 Detect or show the configuration GUI elements for the module. More...
 

Additional Inherited Members

- Public Types inherited from StelModule
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...
 
- Protected Member Functions inherited from StelModule
class StelActionaddAction (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 StelActionaddAction (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...
 
StelActionaddAction (const QString &id, const QString &groupId, const QString &text, QObject *contextObject, std::function< void()> lambda, const QString &shortcut="", const QString &altShortcut="")
 convenience methods to add an action (call to Lambda functor) to the StelActionMgr object. More...
 

Detailed Description

Allows for creation of custom markers on objects or coordinates.

Because this class is intended for use in scripting (although other uses are also fine), all marker types and so on are specified by QString descriptions. The markers are painted very late, i.e. also sky object markers will be written over the landscape.

Note
The "Markers" which can be set interactively by mouse click are actually CustomObjects and managed by the CustomObjectMgr.

Member Function Documentation

◆ deleteAllMarkers

int MarkerMgr::deleteAllMarkers ( void  )
slot

Delete all markers.

Returns
the number of markers deleted

◆ deleteMarker

void MarkerMgr::deleteMarker ( int  id)
slot

Delete a marker identified by positive ID.

Returns
true if the id existed and was deleted, else false

◆ markerEquatorial

int MarkerMgr::markerEquatorial ( const QString &  RA,
const QString &  Dec,
bool  j2000epoch = true,
bool  visible = true,
const QString &  mtype = "cross",
const QString &  color = "#ffff66",
const float  size = 6.f,
bool  autoDelete = false,
int  autoDeleteTimeoutMs = 0,
bool  withAberration = true 
)
slot

Create a marker with mean equatorial coordinates.

Parameters
RAright ascension (e.g. 5h10m31s)
Decdeclination (e.g. 25d30m30s)
j2000epochif true, the coordinates are equatorial for epoch J2000.0. If false, they represent equatorial coordinates for equinox of current date and will be converted to J2000 coordinates at time of creation.
Note
It is not possible to create a marker in equatorial coordinate of date which changes with precession.
Parameters
visibleif true, the marker starts displayed, else it starts hidden
mtypethe type of marker. Keys:
  • cross: simple cross
  • circle: simple circle
  • ellipse: simple horizontal ellipse
  • square: simple square
  • dotted-circle: simple circle drawn by dots
  • circled-cross (or circled-plus): simple circle with cross inside the circle
  • dashed-square: simple square, drawing by dashed line
  • squared-dotted-circle (or squared-dcircle): simple circle, drawing by dotted line
  • crossed-circle: the cross under circle
  • target: the target shape
  • gear: the gear shape
  • disk: the disk shape
colorHTML-like color spec, e.g. "#ffff00" for yellow
sizethe size of marker.
autoDeletethe marker will be automatically deleted after it is displayed once
autoDeleteTimeoutMsif not zero, the marker will be automatically deleted after autoDeleteTimeoutMs ms
withAberrationThe coordinates will be subject to aberration. If false, they represent strict frame coordinates.
Returns
a unique ID which can be used to refer to the marker. returns -1 if the marker could not be created (e.g. object not found)

◆ markerHorizon

int MarkerMgr::markerHorizon ( const QString &  az,
const QString &  alt,
bool  visible = true,
const QString &  mtype = "cross",
const QString &  color = "#ffff66",
const float  size = 6.f,
bool  autoDelete = false,
int  autoDeleteTimeoutMs = 0 
)
slot

Create a marker with horizontal coordinates.

Parameters
azazimuth (e.g. 125d30m30s)
altaltitude (e.g. 25d30m30s)
visibleif true, the marker starts displayed, else it starts hidden
mtypethe type of marker. Keys:
  • cross: simple cross
  • circle: simple circle
  • ellipse: simple horizontal ellipse
  • square: simple square
  • dotted-circle: simple circle drawn by dots
  • circled-cross (or circled-plus): simple circle with cross inside the circle
  • dashed-square: simple square, drawing by dashed line
  • squared-dotted-circle (or squared-dcircle): simple circle, drawing by dotted line
  • crossed-circle: the cross under circle
  • target: the target shape
  • gear: the gear shape
  • disk: the disk shape
colorHTML-like color spec, e.g. "#ffff00" for yellow
sizethe size of marker.
autoDeletethe marker will be automatically deleted after it is displayed once
autoDeleteTimeoutMsif not zero, the marker will be automatically deleted after autoDeleteTimeoutMs ms
Returns
a unique ID which can be used to refer to the marker. returns -1 if the marker could not be created (e.g. object not found)

◆ markerObject

int MarkerMgr::markerObject ( const QString &  objectName,
bool  visible = true,
const QString &  mtype = "cross",
const QString &  color = "#ffff66",
const float  size = 6.f,
bool  autoDelete = false,
int  autoDeleteTimeoutMs = 0 
)
slot

Create a marker which is attached to a StelObject.

Parameters
objectNamethe English name of the object to attach to
visibleif true, the marker starts displayed, else it starts hidden
mtypethe type of marker. Keys:
  • cross: simple cross
  • circle: simple circle
  • ellipse: simple horizontal ellipse
  • square: simple square
  • dotted-circle: simple circle drawn by dots
  • circled-cross (or circled-plus): simple circle with cross inside the circle
  • dashed-square: simple square, drawing by dashed line
  • squared-dotted-circle (or squared-dcircle): simple circle, drawing by dotted line
  • crossed-circle: the cross under circle
  • target: the target shape
  • gear: the gear shape
  • disk: the disk shape
colorHTML-like color spec, e.g. "#ffff00" for yellow
sizethe size of marker.
autoDeletethe marker will be automatically deleted after it is displayed once
autoDeleteTimeoutMsif not zero, the marker will be automatically deleted after autoDeleteTimeoutMs ms
Returns
a unique ID which can be used to refer to the marker. returns -1 if the marker could not be created (e.g. object not found)
Note
The marker will be placed on the object's J2000 coordinates at time of marker creation and will undergo aberration correction.