Stellarium 0.11.1
Home · All Namespaces · All Classes · Functions · Coding Style · Scripting · Plugins · File Structure
Signals | Public Member Functions
StelObjectMgr Class Reference

#include <StelObjectMgr.hpp>

List of all members.

Signals

void selectedObjectChanged (StelModule::StelModuleSelectAction)

Public Member Functions

virtual void init ()
virtual void draw (StelCore *)
virtual void update (double)
void registerStelObjectMgr (StelObjectModule *mgr)
bool findAndSelect (const StelCore *core, const Vec3d &pos, StelModule::StelModuleSelectAction action=StelModule::ReplaceSelection)
bool findAndSelect (const StelCore *core, int x, int y, StelModule::StelModuleSelectAction action=StelModule::ReplaceSelection)
bool findAndSelectI18n (const QString &nameI18n, StelModule::StelModuleSelectAction action=StelModule::ReplaceSelection)
bool findAndSelect (const QString &name, StelModule::StelModuleSelectAction action=StelModule::ReplaceSelection)
QStringList listMatchingObjectsI18n (const QString &objPrefix, unsigned int maxNbItem=5) const
bool getWasSelected (void) const
void unSelect (void)
bool setSelectedObject (const StelObjectP obj, StelModule::StelModuleSelectAction action=StelModule::ReplaceSelection)
bool setSelectedObject (const QList< StelObjectP > &objs, StelModule::StelModuleSelectAction action=StelModule::ReplaceSelection)
const QList< StelObjectP > & getSelectedObject () const
QList< StelObjectPgetSelectedObject (const QString &type)
void setFlagSelectedObjectPointer (bool b)
bool getFlagSelectedObjectPointer (void)
StelObjectP searchByNameI18n (const QString &name) const
StelObjectP searchByName (const QString &name) const
void setObjectSearchRadius (float radius)
void setDistanceWeight (float newDistanceWeight)

Detailed Description

Manage the selection and queries on one or more StelObjects.

Each module is then free to manage object selection as it wants.


Member Function Documentation

virtual void StelObjectMgr::draw ( StelCore core) [inline, virtual]

Execute all the drawing functions for this module.

Parameters:
corethe core to use for the drawing

Reimplemented from StelModule.

Find and select an object near given equatorial J2000 position.

Parameters:
corethe StelCore instance to use for computations
posthe direction vector around which to search in equatorial J2000
actiondefine whether to add to, replace, or remove from the existing selection
Returns:
true if a object was found at position (this does not necessarily means it is selected)

Find and select an object near given screen position.

Parameters:
corethe StelCore instance to use for computations
xthe x screen position in pixel
ythe y screen position in pixel
actiondefine whether to add to, replace, or remove from the existing selection
Returns:
true if a object was found at position (this does not necessarily means it is selected)

Find and select an object from its standard program name.

Parameters:
actiondefine whether to add to, replace, or remove from the existing selection
namethe case sensitive object translated name
Returns:
true if a object with the passed name was found

Find and select an object from its translated name.

Parameters:
actiondefine whether to add to, replace, or remove from the existing selection
nameI18nthe case sensitive object translated name
Returns:
true if a object with the passed name was found
QList<StelObjectP> StelObjectMgr::getSelectedObject ( const QString &  type)

Return the list objects of type "withType" which was recently selected by the user.

Parameters:
typereturn only objects of the given type
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.

Parameters:
objPrefixthe case insensitive first letters of the searched object
maxNbItemthe maximum number of returned object names.
Returns:
a list of matching object names by order of relevance, or an empty list if nothing match

Add a new StelObject manager into the list of supported modules.

Registered modules can have selected objects

Indicate that the selected StelObjects has changed.

Parameters:
actiondefine 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.

Notify that we want to select the given object.

Parameters:
objthe StelObject to select
actionaction define whether to add to, replace, or remove from the existing selection
Returns:
true if at least 1 object was sucessfully selected

Notify that we want to select the given objects.

Parameters:
objsa vector of objects to select
actiondefine whether to add to, replace, or remove from the existing selection
Returns:
true if at least 1 object was sucessfully selected
virtual void StelObjectMgr::update ( double  deltaTime) [inline, virtual]

Update the module with respect to the time.

Parameters:
deltaTimethe time increment in second since last call.

Implements StelModule.