2
* Author and Copyright of this file and of the stellarium telescope feature:
3
* Johannes Gajdosik, 2006
5
* This program is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU General Public License
7
* as published by the Free Software Foundation; either version 2
8
* of the License, or (at your option) any later version.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20
#ifndef _TELESCOPE_MGR_H_
21
#define _TELESCOPE_MGR_H_
23
#include "StelObjectModule.hpp"
26
#include "STextureTypes.hpp"
41
class TelescopeMgr : public StelObjectModule {
44
virtual ~TelescopeMgr(void);
46
///////////////////////////////////////////////////////////////////////////
47
// Methods defined in the StelModule class
48
virtual void init(const InitParser& conf);
49
virtual double draw(StelCore *core);
50
virtual void update(double deltaTime);
51
virtual void setColorScheme(const InitParser& conf, const QString& section);
52
virtual double getCallOrder(StelModuleActionName actionName) const;
54
///////////////////////////////////////////////////////////////////////////
55
// Methods defined in the StelObjectModule class
56
virtual vector<StelObjectP> searchAround(const Vec3d& v, double limitFov, const StelCore* core) const;
57
virtual StelObjectP searchByNameI18n(const wstring& nameI18n) const;
58
virtual StelObjectP searchByName(const string& name) const;
60
virtual vector<wstring> listMatchingObjectsI18n(const wstring& objPrefix, unsigned int maxNbItem=5) const;
63
void communicate(void);
65
void set_names_fade_duration(float duration)
66
{name_fader.set_duration((int) (duration * 1000.f));}
68
void set_label_color(const Vec3f &c) {label_color = c;}
69
const Vec3f &getLabelColor(void) const {return label_color;}
71
void set_circle_color(const Vec3f &c) {circle_color = c;}
72
const Vec3f &getCircleColor(void) const {return circle_color;}
74
//! Set display flag for Telescopes
75
void setFlagTelescopes(bool b) {telescope_fader=b;}
76
//! Get display flag for Telescopes
77
bool getFlagTelescopes(void) const {return (bool)telescope_fader;}
79
//! Set display flag for Telescope names
80
void setFlagTelescopeName(bool b) {name_fader=b;}
81
//! Get display flag for Telescope names
82
bool getFlagTelescopeName(void) const {return name_fader==true;}
84
//! Define font size to use for telescope names display
85
void setFontSize(float font_size);
87
//! send a J2000-goto-command to the specified telescope
88
void telescopeGoto(int telescope_nr,const Vec3d &j2000_pos);
93
//! Draw a nice animated pointer around the object
94
void drawPointer(const Projector* prj, const Navigator * nav);
96
LinearFader name_fader;
97
LinearFader telescope_fader;
100
SFont *telescope_font;
101
STextureSP telescope_texture;
103
class TelescopeMap : public std::map<int,Telescope*> {
105
~TelescopeMap(void) {clear();}
108
TelescopeMap telescope_map;
109
STextureSP texPointer; // The selection pointer texture