StelObjectMgr.hpp   StelObjectMgr.hpp 
skipping to change at line 25 skipping to change at line 25
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA.
*/ */
#ifndef _STELOBJECTMGR_HPP_ #ifndef _STELOBJECTMGR_HPP_
#define _STELOBJECTMGR_HPP_ #define _STELOBJECTMGR_HPP_
#include <QList> #include <QList>
#include <QString> #include <QString>
#include "vecmath.h" #include "VecMath.hpp"
#include "StelModule.hpp" #include "StelModule.hpp"
#include "StelObject.hpp" #include "StelObject.hpp"
class StelObjectModule; class StelObjectModule;
class StelCore; class StelCore;
//! @class StelObjectMgr //! @class StelObjectMgr
//! Manage the selection and queries on one or more StelObjects. //! Manage the selection and queries on one or more StelObjects.
//! When the user requests selection of an object, the selectedObjectChange CallBack method //! When the user requests selection of an object, the selectedObjectChange CallBack method
//! of all the StelModule which are registered is called. //! of all the StelModule which are registered is called.
skipping to change at line 57 skipping to change at line 57
virtual void update(double deltaTime) {;} virtual void update(double deltaTime) {;}
//! Handle mouse click events. //! Handle mouse click events.
virtual void handleMouseClicks(class QMouseEvent* event); virtual void handleMouseClicks(class QMouseEvent* event);
//////////////////////////////////////////////////////////////////// /////// //////////////////////////////////////////////////////////////////// ///////
//! Add a new StelObject manager into the list of supported modules. //! Add a new StelObject manager into the list of supported modules.
//! Registered modules can have selected objects //! Registered modules can have selected objects
void registerStelObjectMgr(StelObjectModule* mgr); void registerStelObjectMgr(StelObjectModule* mgr);
//! Find and select an object near given equatorial position. //! Find and select an object near given equatorial J2000 position.
//! @param core the StelCore instance to use for computations
//! @param pos the direction vector around which to search in equato
rial J2000
//! @param action define whether to add to, replace, or remove from the existing selection //! @param action define whether to add to, replace, or remove from the existing selection
//! @return true if a object was found at position (this does not ne cessarily means it is selected) //! @return true if a object was found at position (this does not ne cessarily means it is selected)
bool findAndSelect(const StelCore* core, const Vec3d& pos, StelModul e::StelModuleSelectAction action=StelModule::ReplaceSelection); bool findAndSelect(const StelCore* core, const Vec3d& pos, StelModul e::StelModuleSelectAction action=StelModule::ReplaceSelection);
//! Find and select an object near given screen position. //! Find and select an object near given screen position.
//! @param core the StelCore instance to use for computations
//! @param x the x screen position in pixel
//! @param y the y screen position in pixel
//! @param action define whether to add to, replace, or remove from the existing selection //! @param action define whether to add to, replace, or remove from the existing selection
//! @return true if a object was found at position (this does not ne cessarily means it is selected) //! @return true if a object was found at position (this does not ne cessarily means it is selected)
bool findAndSelect(const StelCore* core, int x, int y, StelModule::S telModuleSelectAction action=StelModule::ReplaceSelection); bool findAndSelect(const StelCore* core, int x, int y, StelModule::S telModuleSelectAction action=StelModule::ReplaceSelection);
//! Find and select an object from its translated name. //! Find and select an object from its translated name.
//! @param action define whether to add to, replace, or remove from the existing selection //! @param action define whether to add to, replace, or remove from the existing selection
//! @param nameI18n the case sensitive object translated name //! @param nameI18n the case sensitive object translated name
//! @return true if a object with the passed name was found //! @return true if a object with the passed name was found
bool findAndSelectI18n(const QString &nameI18n, StelModule::StelModu leSelectAction action=StelModule::ReplaceSelection); bool findAndSelectI18n(const QString &nameI18n, StelModule::StelModu leSelectAction action=StelModule::ReplaceSelection);
skipping to change at line 92 skipping to change at line 97
//! @return a list of matching object names by order of relevance, o r an empty list if nothing match //! @return a list of matching object names by order of relevance, o r an empty list if nothing match
QStringList listMatchingObjectsI18n(const QString& objPrefix, unsign ed int maxNbItem=5) const; QStringList listMatchingObjectsI18n(const QString& objPrefix, unsign ed int maxNbItem=5) const;
//! Return whether an object was selected during last selection rela ted event. //! Return whether an object was selected during last selection rela ted event.
bool getWasSelected(void) const {return !lastSelectedObjects.empty() ;} bool getWasSelected(void) const {return !lastSelectedObjects.empty() ;}
//! Notify that we want to unselect any object. //! Notify that we want to unselect any object.
void unSelect(void); void unSelect(void);
//! Notify that we want to select the given object. //! Notify that we want to select the given object.
//! @param obj the StelObject to select
//! @param action action define whether to add to, replace, or remov e from the existing selection //! @param action action define whether to add to, replace, or remov e from the existing selection
//! @return true if at least 1 object was sucessfully selected //! @return true if at least 1 object was sucessfully selected
bool setSelectedObject(const StelObjectP obj, StelModule::StelModule SelectAction action=StelModule::ReplaceSelection); bool setSelectedObject(const StelObjectP obj, StelModule::StelModule SelectAction action=StelModule::ReplaceSelection);
//! Notify that we want to select the given objects. //! Notify that we want to select the given objects.
//! @param objs a vector of objects to select //! @param objs a vector of objects to select
//! @param action define whether to add to, replace, or remove from the existing selection //! @param action define whether to add to, replace, or remove from the existing selection
//! @return true if at least 1 object was sucessfully selected //! @return true if at least 1 object was sucessfully selected
bool setSelectedObject(const QList<StelObjectP>& objs, StelModule::S telModuleSelectAction action=StelModule::ReplaceSelection); bool setSelectedObject(const QList<StelObjectP>& objs, StelModule::S telModuleSelectAction action=StelModule::ReplaceSelection);
//! Get the list objects which was recently selected by the user. //! Get the list objects which was recently selected by the user.
const QList<StelObjectP>& getSelectedObject() const {return lastSele ctedObjects;} const QList<StelObjectP>& getSelectedObject() const {return lastSele ctedObjects;}
//! Return the list objects of type "withType" which was recently se lected by the user. //! Return the list objects of type "withType" which was recently se lected by the user.
//! @param type return only objects of the given type //! @param type return only objects of the given type
QList<StelObjectP> getSelectedObject(const QString& type); QList<StelObjectP> getSelectedObject(const QString& type);
//! Set whether a pointer is to be drawn over selected object. //! Set whether a pointer is to be drawn over selected object.
void setFlagSelectedObjectPointer(bool b) { objectPointerVisibility = b; } void setFlagSelectedObjectPointer(bool b) { objectPointerVisibility = b; }
//! Find any kind of object by its translated name.
StelObjectP searchByNameI18n(const QString &name) const;
//! Find any kind of object by its standard program name.
StelObjectP searchByName(const QString &name) const;
private: private:
// The list of StelObjectModule that are referenced in Stellarium // The list of StelObjectModule that are referenced in Stellarium
QList<StelObjectModule*> objectsModule; QList<StelObjectModule*> objectsModule;
// The last selected object in stellarium // The last selected object in stellarium
QList<StelObjectP> lastSelectedObjects; QList<StelObjectP> lastSelectedObjects;
// Should selected object pointer be drawn // Should selected object pointer be drawn
bool objectPointerVisibility; bool objectPointerVisibility;
//! Find any kind of object by its translated name.
StelObjectP searchByNameI18n(const QString &name) const;
//! Find any kind of object by its standard program name.
StelObjectP searchByName(const QString &name) const;
//! Find in a "clever" way an object from its equatorial position. //! Find in a "clever" way an object from its equatorial position.
StelObjectP cleverFind(const StelCore* core, const Vec3d& pos) const ; StelObjectP cleverFind(const StelCore* core, const Vec3d& pos) const ;
//! Find in a "clever" way an object from its screen position. //! Find in a "clever" way an object from its screen position.
StelObjectP cleverFind(const StelCore* core, int x, int y) const; StelObjectP cleverFind(const StelCore* core, int x, int y) const;
}; };
#endif // _SELECTIONMGR_HPP_ #endif // _SELECTIONMGR_HPP_
 End of changes. 6 change blocks. 
8 lines changed or deleted 15 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/