~ubuntu-branches/debian/squeeze/stellarium/squeeze

« back to all changes in this revision

Viewing changes to src/TelescopeMgr.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Cédric Delfosse
  • Date: 2008-05-19 21:28:23 UTC
  • mfrom: (3.1.5 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080519212823-m5nfiuntxstxzxj7
Tags: 0.9.1-4
Add libxcursor-dev, libxfixes-dev, libxinerama-dev, libqt4-opengl-dev to
build-deps (Closes: #479906)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Author and Copyright of this file and of the stellarium telescope feature:
 
3
 * Johannes Gajdosik, 2006
 
4
 *
 
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.
 
9
 * 
 
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.
 
14
 * 
 
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.
 
18
 */
 
19
 
 
20
#ifndef _TELESCOPE_MGR_H_
 
21
#define _TELESCOPE_MGR_H_
 
22
 
 
23
#include "StelObjectModule.hpp"
 
24
#include "Fader.hpp"
 
25
#include "vecmath.h"
 
26
#include "STextureTypes.hpp"
 
27
 
 
28
#include <vector>
 
29
#include <map>
 
30
#include <string>
 
31
 
 
32
using namespace std;
 
33
 
 
34
class InitParser;
 
35
class Projector;
 
36
class Navigator;
 
37
class SFont;
 
38
class StelObject;
 
39
class Telescope;
 
40
 
 
41
class TelescopeMgr : public StelObjectModule {
 
42
public:
 
43
  TelescopeMgr(void);
 
44
  virtual ~TelescopeMgr(void);
 
45
  
 
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;
 
53
        
 
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;
 
59
 
 
60
        virtual vector<wstring> listMatchingObjectsI18n(const wstring& objPrefix, unsigned int maxNbItem=5) const;
 
61
 
 
62
 
 
63
  void communicate(void);
 
64
   
 
65
  void set_names_fade_duration(float duration)
 
66
    {name_fader.set_duration((int) (duration * 1000.f));}
 
67
  
 
68
  void set_label_color(const Vec3f &c) {label_color = c;}
 
69
  const Vec3f &getLabelColor(void) const {return label_color;}
 
70
 
 
71
  void set_circle_color(const Vec3f &c) {circle_color = c;}
 
72
  const Vec3f &getCircleColor(void) const {return circle_color;}
 
73
  
 
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;}  
 
78
  
 
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;}
 
83
  
 
84
  //! Define font size to use for telescope names display
 
85
  void setFontSize(float font_size);
 
86
 
 
87
  //! send a J2000-goto-command to the specified telescope
 
88
  void telescopeGoto(int telescope_nr,const Vec3d &j2000_pos);
 
89
private:
 
90
#ifdef WIN32
 
91
  bool wsa_ok;
 
92
#endif
 
93
        //! Draw a nice animated pointer around the object
 
94
        void drawPointer(const Projector* prj, const Navigator * nav);
 
95
 
 
96
  LinearFader name_fader;
 
97
  LinearFader telescope_fader;
 
98
  Vec3f circle_color;
 
99
  Vec3f label_color;
 
100
  SFont *telescope_font;
 
101
  STextureSP telescope_texture;
 
102
 
 
103
  class TelescopeMap : public std::map<int,Telescope*> {
 
104
  public:
 
105
    ~TelescopeMap(void) {clear();}
 
106
    void clear(void);
 
107
  };
 
108
  TelescopeMap telescope_map;
 
109
  STextureSP texPointer;                        // The selection pointer texture
 
110
};
 
111
 
 
112
 
 
113
#endif