TelescopeMgr.hpp   TelescopeMgr.hpp 
skipping to change at line 24 skipping to change at line 24
* *
* 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 _TELESCOPEMGR_HPP_ #ifndef _TELESCOPEMGR_HPP_
#define _TELESCOPEMGR_HPP_ #define _TELESCOPEMGR_HPP_
#include "StelObjectModule.hpp" #include "StelObjectModule.hpp"
#include "Fader.hpp" #include "StelFader.hpp"
#include "vecmath.h" #include "VecMath.hpp"
#include "STextureTypes.hpp" #include "StelTextureTypes.hpp"
#include "StelProjectorType.hpp"
#include <map>
#include <QString> #include <QString>
#include <QStringList> #include <QStringList>
#include <QMap>
class Projector; class StelProjector;
class Navigator; class StelNavigator;
class SFont; class StelFont;
class StelObject; class StelObject;
class Telescope; class Telescope;
class QSettings; class StelPainter;
//! This class manages the controlling of one or more telescopes by one
//! instance of the stellarium program. "controlling a telescope"
//! means receiving position information from the telescope
//! and sending GOTO commands to the telescope.
//! No esoteric features like motor focus, electric heating and such.
//! The actual controlling of a telescope is left to the implementation
//! of the abstract base class Telescope.
class TelescopeMgr : public StelObjectModule class TelescopeMgr : public StelObjectModule
{ {
Q_OBJECT
public: public:
TelescopeMgr(void); TelescopeMgr(void);
virtual ~TelescopeMgr(void); virtual ~TelescopeMgr(void);
//////////////////////////////////////////////////////////////////// /////// //////////////////////////////////////////////////////////////////// ///////
// Methods defined in the StelModule class // Methods defined in the StelModule class
virtual void init(); virtual void init();
virtual void draw(StelCore *core); virtual void draw(StelCore *core);
virtual void update(double deltaTime); virtual void update(double deltaTime);
virtual void setStelStyle(const StelStyle& style); virtual void setStelStyle(const StelStyle& style);
virtual double getCallOrder(StelModuleActionName actionName) const; virtual double getCallOrder(StelModuleActionName actionName) const;
//////////////////////////////////////////////////////////////////// /////// //////////////////////////////////////////////////////////////////// ///////
// Methods defined in the StelObjectModule class // Methods defined in the StelObjectModule class
virtual QList<StelObjectP> searchAround(const Vec3d& v, double limit Fov, const StelCore* core) const; virtual QList<StelObjectP> searchAround(const Vec3d& v, double limit Fov, const StelCore* core) const;
virtual StelObjectP searchByNameI18n(const QString& nameI18n) const; virtual StelObjectP searchByNameI18n(const QString& nameI18n) const;
virtual StelObjectP searchByName(const QString& name) const; virtual StelObjectP searchByName(const QString& name) const;
virtual QStringList listMatchingObjectsI18n(const QString& objPrefix , int maxNbItem=5) const; virtual QStringList listMatchingObjectsI18n(const QString& objPrefix , int maxNbItem=5) const;
void communicate(void); ////////////////////////////////////////////////////////////////////
///////
void set_names_fade_duration(float duration) {nameFader.setDuration( // Methods specific to TelescopeMgr
(int) (duration * 1000.f));} //! Send a J2000-goto-command to the specified telescope
//! @param telescopeNr the number of the telescope
void setLabelColor(const Vec3f &c) {labelColor = c;} //! @param j2000Pos the direction in equatorial J2000 frame
const Vec3f &getLabelColor(void) const {return labelColor;} void telescopeGoto(int telescopeNr, const Vec3d &j2000Pos);
void set_circleColor(const Vec3f &c) {circleColor = c;} //! Remove all currently registered telescopes
const Vec3f &getCircleColor(void) const {return circleColor;} void deleteAllTelescopes();
public slots:
//! Set display flag for Telescopes //! Set display flag for Telescopes
void setFlagTelescopes(bool b) {telescopeFader=b;} void setFlagTelescopes(bool b) {telescopeFader=b;}
//! Get display flag for Telescopes //! Get display flag for Telescopes
bool getFlagTelescopes(void) const {return (bool)telescopeFader;} bool getFlagTelescopes() const {return (bool)telescopeFader;}
//! Set display flag for Telescope names //! Set display flag for Telescope names
void setFlagTelescopeName(bool b) {nameFader=b;} void setFlagTelescopeName(bool b) {nameFader=b;}
//! Get display flag for Telescope names //! Get display flag for Telescope names
bool getFlagTelescopeName(void) const {return nameFader==true;} bool getFlagTelescopeName() const {return nameFader==true;}
//! Set the telescope circle color
void setCircleColor(const Vec3f &c) {circleColor = c;}
//! Get the telescope circle color
const Vec3f& getCircleColor() const {return circleColor;}
//! Get the telescope labels color
const Vec3f& getLabelColor() const {return labelColor;}
//! Set the telescope labels color
void setLabelColor(const Vec3f &c) {labelColor = c;}
//! Define font size to use for telescope names display //! Define font size to use for telescope names display
void setFontSize(float fontSize); void setFontSize(float fontSize);
//! send a J2000-goto-command to the specified telescope //! For use from the GUI. The telescope number will be
void telescopeGoto(int telescope_nr,const Vec3d &j2000Pos); //! chosen according to the action which triggered the slot to be
//! triggered.
void moveTelescopeToSelected(void);
private: private:
//! Draw a nice animated pointer around the object //! Draw a nice animated pointer around the object
void drawPointer(const Projector* prj, const Navigator * nav); void drawPointer(const StelProjectorP& prj, const StelNavigator* nav
, const StelPainter& sPainter);
//! Perform the communication with the telescope servers
void communicate(void);
LinearFader nameFader; LinearFader nameFader;
LinearFader telescopeFader; LinearFader telescopeFader;
Vec3f circleColor; Vec3f circleColor;
Vec3f labelColor; Vec3f labelColor;
SFont *telescope_font; StelFont *telescope_font;
STextureSP telescopeTexture; StelTextureSP telescopeTexture;
class TelescopeMap : public std::map<int,Telescope*> QMap<int, Telescope*> telescope_map;
{
public:
~TelescopeMap(void) {clear();}
void clear(void);
};
TelescopeMap telescope_map;
// The selection pointer texture // The selection pointer texture
STextureSP texPointer; StelTextureSP texPointer;
}; };
#endif // _TELESCOPEMGR_HPP_ #endif // _TELESCOPEMGR_HPP_
 End of changes. 18 change blocks. 
32 lines changed or deleted 53 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/