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

« back to all changes in this revision

Viewing changes to src/stel_object.h

  • 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
 
 * Stellarium
3
 
 * Copyright (C) 2002 Fabien Chereau
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 _STEL_OBJECT_H_
21
 
#define _STEL_OBJECT_H_
22
 
 
23
 
#include "vecmath.h"
24
 
#include "projector.h"
25
 
#include "navigator.h"
26
 
#include "s_texture.h"
27
 
 
28
 
 
29
 
class Navigator;
30
 
 
31
 
class StelObject
32
 
{
33
 
public:
34
 
        enum STEL_OBJECT_TYPE
35
 
        {
36
 
                STEL_OBJECT_STAR,
37
 
                STEL_OBJECT_PLANET,
38
 
                STEL_OBJECT_NEBULA,
39
 
                STEL_OBJECT_CONSTELLATION,
40
 
                STEL_OBJECT_TELESCOPE
41
 
        };
42
 
 
43
 
        virtual ~StelObject() {;}
44
 
        virtual void update(void) {return;}
45
 
        void draw_pointer(int delta_time, const Projector* prj, const Navigator * nav);
46
 
 
47
 
        //! Write I18n information about the object in wstring. 
48
 
        virtual wstring getInfoString(const Navigator * nav) const = 0;
49
 
        
50
 
        //! The returned wstring can typically be used for object labeling in the sky
51
 
        virtual wstring getShortInfoString(const Navigator * nav) const = 0;
52
 
        
53
 
        //! Return object's type
54
 
        virtual STEL_OBJECT_TYPE get_type(void) const = 0;
55
 
        
56
 
        //! Get position in earth equatorial frame
57
 
        virtual Vec3d get_earth_equ_pos(const Navigator *nav) const = 0;
58
 
 
59
 
        //! observer centered J2000 coordinates
60
 
        virtual Vec3d getObsJ2000Pos(const Navigator *nav) const = 0;
61
 
 
62
 
        //! Return object's magnitude
63
 
        virtual float get_mag(const Navigator * nav) const = 0;
64
 
        
65
 
        //! Get object main color, used to display infos
66
 
        virtual Vec3f get_RGB(void) const {return Vec3f(1.,1.,1.);}
67
 
        
68
 
        //! Return the best FOV in degree to use for a close view of the object
69
 
        virtual double get_close_fov(const Navigator * nav) const {return 10.;}
70
 
        
71
 
        //! Return the best FOV in degree to use for a global view of the object satellite system (if there are satellites)
72
 
        virtual double get_satellites_fov(const Navigator * nav) const {return -1.;}
73
 
 
74
 
        static void init_textures(void);
75
 
        static void delete_textures(void);
76
 
protected:
77
 
        virtual float get_on_screen_size(const Projector* prj, const Navigator * nav = NULL) {return 0;}
78
 
private:
79
 
        static int local_time;
80
 
        static s_texture * pointer_star;
81
 
        static s_texture * pointer_planet;
82
 
        static s_texture * pointer_nebula;
83
 
        static s_texture * pointer_telescope;
84
 
 
85
 
};
86
 
 
87
 
#endif // _STEL_OBJECT_H_