Stellarium 0.11.4 | |||
Home · All Namespaces · All Classes · Functions · Coding Style · Scripting · Plugins · File Structure |
Allows for creation of custom labels on objects or coordinates. More...
#include <LabelMgr.hpp>
Public Slots | |
int | labelObject (const QString &text, const QString &objectName, bool visible=true, float fontSize=14, const QString &fontColor="#999999", const QString &side="E", double labelDistance=-1.0, const QString &style="TextOnly") |
Create a label which is attached to a StelObject. | |
int | labelScreen (const QString &text, int x, int y, bool visible=true, float fontSize=14, const QString &fontColor="#999999") |
Create a label at fixed screen coordinates. | |
bool | getLabelShow (int id) |
find out if a label identified by id is presently shown | |
void | setLabelShow (int id, bool show) |
set a label identified by id to be shown or not | |
void | setLabelText (int id, const QString &newText) |
set text of label identified by id to be newText | |
bool | deleteLabel (int id) |
Delete a label by the ID which was returned from addLabel. | |
int | deleteAllLabels (void) |
Delete all labels. | |
Public Member Functions | |
LabelMgr () | |
Construct a LabelMgr object. | |
virtual void | init () |
Initialize the LabelMgr object. | |
virtual void | draw (StelCore *core) |
Draw user labels. | |
virtual void | update (double deltaTime) |
Update time-dependent parts of the module. | |
virtual double | getCallOrder (StelModuleActionName actionName) const |
Defines the order in which the various modules are drawn. |
Allows for creation of custom labels on objects or coordinates.
Because this class is intended for use in scripting (although other uses are also fine), all label types and so on are specified by QString descriptions. TODO: when QT4.5 is out, change implementation to use QGraphicsTextItem. (QT4.5 should allow for opacity changes for fades, but it is not currently implemented.
LabelMgr::LabelMgr | ( | ) |
Construct a LabelMgr object.
int LabelMgr::deleteAllLabels | ( | void | ) | [slot] |
Delete all labels.
bool LabelMgr::deleteLabel | ( | int | id | ) | [slot] |
Delete a label by the ID which was returned from addLabel.
..
virtual void LabelMgr::draw | ( | StelCore * | core | ) | [virtual] |
Draw user labels.
Reimplemented from StelModule.
virtual double LabelMgr::getCallOrder | ( | StelModuleActionName | actionName | ) | const [virtual] |
Defines the order in which the various modules are drawn.
Reimplemented from StelModule.
bool LabelMgr::getLabelShow | ( | int | id | ) | [slot] |
find out if a label identified by id is presently shown
virtual void LabelMgr::init | ( | ) | [virtual] |
Initialize the LabelMgr object.
Implements StelModule.
int LabelMgr::labelObject | ( | const QString & | text, | |
const QString & | objectName, | |||
bool | visible = true , |
|||
float | fontSize = 14 , |
|||
const QString & | fontColor = "#999999" , |
|||
const QString & | side = "E" , |
|||
double | labelDistance = -1.0 , |
|||
const QString & | style = "TextOnly" | |||
) | [slot] |
Create a label which is attached to a StelObject.
text | the text to display | |
objectName | the English name of the object to attach to | |
visible | if true, the label starts displayed, else it starts hidden | |
fontSize | size of the font to use | |
fontColor | HTML-like color spec, e.g. "#ffff00" for yellow | |
side | where the label appears in relation to object:
|
int LabelMgr::labelScreen | ( | const QString & | text, | |
int | x, | |||
int | y, | |||
bool | visible = true , |
|||
float | fontSize = 14 , |
|||
const QString & | fontColor = "#999999" | |||
) | [slot] |
Create a label at fixed screen coordinates.
text | the text to display | |
x | the horizontal position on the screen, in pixels, from the left of the screen | |
y | the vertical position on the screen, in pixels, from the top of the screen | |
visible | if true, the label starts displayed, else it starts hidden | |
fontSize | size of the font to use | |
fontColor | HTML-like color spec, e.g. "#ffff00" for yellow |
void LabelMgr::setLabelShow | ( | int | id, | |
bool | show | |||
) | [slot] |
set a label identified by id to be shown or not
void LabelMgr::setLabelText | ( | int | id, | |
const QString & | newText | |||
) | [slot] |
set text of label identified by id to be newText
virtual void LabelMgr::update | ( | double | deltaTime | ) | [virtual] |
Update time-dependent parts of the module.
Implements StelModule.