![]() |
Stellarium 0.11.4 | ||
| Home · All Namespaces · All Classes · Functions · Coding Style · Scripting · Plugins · File Structure |
Manage the selection and queries on one or more StelObjects. More...
#include <StelObjectMgr.hpp>
Signals | |
| void | selectedObjectChanged (StelModule::StelModuleSelectAction) |
| Indicate that the selected StelObjects has changed. | |
Public Member Functions | |
| virtual void | init () |
| Initialize itself. | |
| virtual void | draw (StelCore *) |
| Execute all the drawing functions for this module. | |
| virtual void | update (double) |
| Update the module with respect to the time. | |
| void | registerStelObjectMgr (StelObjectModule *mgr) |
| Add a new StelObject manager into the list of supported modules. | |
| bool | findAndSelect (const StelCore *core, const Vec3d &pos, StelModule::StelModuleSelectAction action=StelModule::ReplaceSelection) |
| Find and select an object near given equatorial J2000 position. | |
| bool | findAndSelect (const StelCore *core, int x, int y, StelModule::StelModuleSelectAction action=StelModule::ReplaceSelection) |
| Find and select an object near given screen position. | |
| bool | findAndSelectI18n (const QString &nameI18n, StelModule::StelModuleSelectAction action=StelModule::ReplaceSelection) |
| Find and select an object from its translated name. | |
| bool | findAndSelect (const QString &name, StelModule::StelModuleSelectAction action=StelModule::ReplaceSelection) |
| Find and select an object from its standard program name. | |
| QStringList | listMatchingObjectsI18n (const QString &objPrefix, unsigned int maxNbItem=5) const |
| Find and return the list of at most maxNbItem objects auto-completing the passed object I18n name. | |
| bool | getWasSelected (void) const |
| Return whether an object was selected during last selection related event. | |
| void | unSelect (void) |
| Notify that we want to unselect any object. | |
| bool | setSelectedObject (const StelObjectP obj, StelModule::StelModuleSelectAction action=StelModule::ReplaceSelection) |
| Notify that we want to select the given object. | |
| bool | setSelectedObject (const QList< StelObjectP > &objs, StelModule::StelModuleSelectAction action=StelModule::ReplaceSelection) |
| Notify that we want to select the given objects. | |
| const QList< StelObjectP > & | getSelectedObject () const |
| Get the list objects which was recently selected by the user. | |
| QList< StelObjectP > | getSelectedObject (const QString &type) |
| Return the list objects of type "withType" which was recently selected by the user. | |
| void | setFlagSelectedObjectPointer (bool b) |
| Set whether a pointer is to be drawn over selected object. | |
| bool | getFlagSelectedObjectPointer (void) |
| Get whether a pointer is to be drawn over selected object. | |
| StelObjectP | searchByNameI18n (const QString &name) const |
| Find any kind of object by its translated name. | |
| StelObjectP | searchByName (const QString &name) const |
| Find any kind of object by its standard program name. | |
| void | setObjectSearchRadius (float radius) |
| Set the radius in pixel in which objects will be searched when clicking on a point in sky. | |
| void | setDistanceWeight (float newDistanceWeight) |
| Set the weight of the distance factor when choosing the best object to select. | |
Manage the selection and queries on one or more StelObjects.
Each module is then free to manage object selection as it wants.
| virtual void StelObjectMgr::draw | ( | StelCore * | core | ) | [inline, virtual] |
Execute all the drawing functions for this module.
| core | the core to use for the drawing |
Reimplemented from StelModule.
| bool StelObjectMgr::findAndSelect | ( | const QString & | name, | |
| StelModule::StelModuleSelectAction | action = StelModule::ReplaceSelection | |||
| ) |
Find and select an object from its standard program name.
| action | define whether to add to, replace, or remove from the existing selection | |
| name | the case sensitive object translated name |
| bool StelObjectMgr::findAndSelect | ( | const StelCore * | core, | |
| int | x, | |||
| int | y, | |||
| StelModule::StelModuleSelectAction | action = StelModule::ReplaceSelection | |||
| ) |
Find and select an object near given screen position.
| core | the StelCore instance to use for computations | |
| x | the x screen position in pixel | |
| y | the y screen position in pixel | |
| action | define whether to add to, replace, or remove from the existing selection |
| bool StelObjectMgr::findAndSelect | ( | const StelCore * | core, | |
| const Vec3d & | pos, | |||
| StelModule::StelModuleSelectAction | action = StelModule::ReplaceSelection | |||
| ) |
Find and select an object near given equatorial J2000 position.
| core | the StelCore instance to use for computations | |
| pos | the direction vector around which to search in equatorial J2000 | |
| action | define whether to add to, replace, or remove from the existing selection |
| bool StelObjectMgr::findAndSelectI18n | ( | const QString & | nameI18n, | |
| StelModule::StelModuleSelectAction | action = StelModule::ReplaceSelection | |||
| ) |
Find and select an object from its translated name.
| action | define whether to add to, replace, or remove from the existing selection | |
| nameI18n | the case sensitive object translated name |
| bool StelObjectMgr::getFlagSelectedObjectPointer | ( | void | ) | [inline] |
Get whether a pointer is to be drawn over selected object.
| QList<StelObjectP> StelObjectMgr::getSelectedObject | ( | const QString & | type | ) |
Return the list objects of type "withType" which was recently selected by the user.
| type | return only objects of the given type |
| const QList<StelObjectP>& StelObjectMgr::getSelectedObject | ( | ) | const [inline] |
Get the list objects which was recently selected by the user.
| bool StelObjectMgr::getWasSelected | ( | void | ) | const [inline] |
Return whether an object was selected during last selection related event.
| virtual void StelObjectMgr::init | ( | ) | [inline, virtual] |
Initialize itself.
If the initialization takes significant time, the progress should be displayed on the loading bar.
Implements StelModule.
| QStringList StelObjectMgr::listMatchingObjectsI18n | ( | const QString & | objPrefix, | |
| unsigned int | maxNbItem = 5 | |||
| ) | const |
Find and return the list of at most maxNbItem objects auto-completing the passed object I18n name.
| objPrefix | the case insensitive first letters of the searched object | |
| maxNbItem | the maximum number of returned object names. |
| void StelObjectMgr::registerStelObjectMgr | ( | StelObjectModule * | mgr | ) |
Add a new StelObject manager into the list of supported modules.
Registered modules can have selected objects
| StelObjectP StelObjectMgr::searchByName | ( | const QString & | name | ) | const |
Find any kind of object by its standard program name.
| StelObjectP StelObjectMgr::searchByNameI18n | ( | const QString & | name | ) | const |
Find any kind of object by its translated name.
| void StelObjectMgr::selectedObjectChanged | ( | StelModule::StelModuleSelectAction | ) | [signal] |
Indicate that the selected StelObjects has changed.
| action | define if the user requested that the objects are added to the selection or just replace it |
| void StelObjectMgr::setDistanceWeight | ( | float | newDistanceWeight | ) | [inline] |
Set the weight of the distance factor when choosing the best object to select.
Default to 1.
| void StelObjectMgr::setFlagSelectedObjectPointer | ( | bool | b | ) | [inline] |
Set whether a pointer is to be drawn over selected object.
| void StelObjectMgr::setObjectSearchRadius | ( | float | radius | ) | [inline] |
Set the radius in pixel in which objects will be searched when clicking on a point in sky.
| bool StelObjectMgr::setSelectedObject | ( | const QList< StelObjectP > & | objs, | |
| StelModule::StelModuleSelectAction | action = StelModule::ReplaceSelection | |||
| ) |
Notify that we want to select the given objects.
| objs | a vector of objects to select | |
| action | define whether to add to, replace, or remove from the existing selection |
| bool StelObjectMgr::setSelectedObject | ( | const StelObjectP | obj, | |
| StelModule::StelModuleSelectAction | action = StelModule::ReplaceSelection | |||
| ) |
Notify that we want to select the given object.
| obj | the StelObject to select | |
| action | action define whether to add to, replace, or remove from the existing selection |
| void StelObjectMgr::unSelect | ( | void | ) |
Notify that we want to unselect any object.
| virtual void StelObjectMgr::update | ( | double | deltaTime | ) | [inline, virtual] |
Update the module with respect to the time.
| deltaTime | the time increment in second since last call. |
Implements StelModule.
1.6.3