]> git.mxchange.org Git - simgear.git/blob - simgear/ephemeris/ephemeris.hxx
74594e3b5cc470b4fedcbab25d628d9b4d9212bf
[simgear.git] / simgear / ephemeris / ephemeris.hxx
1 // ephemeris.hxx -- Top level class for calculating current positions of
2 //                  astronomical objects
3 //
4 // Written by Curtis Olson, started March 2000.
5 //
6 // Copyright (C) 2000  Curtis L. Olson - curt@flightgear.org
7 //
8 // This program is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU General Public License as
10 // published by the Free Software Foundation; either version 2 of the
11 // License, or (at your option) any later version.
12 //
13 // This program is distributed in the hope that it will be useful, but
14 // WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16 // General Public License for more details.
17 //
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the Free Software
20 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 //
22 // $Id$
23
24
25 #ifndef _EPHEMERIS_HXX
26 #define _EPHEMERIS_HXX
27
28
29 #include <plib/sg.h>
30
31 #include <Time/fg_time.hxx>
32
33 #include "star.hxx"
34 #include "moon.hxx"
35 #include "mercury.hxx"
36 #include "venus.hxx"
37 #include "mars.hxx"
38 #include "jupiter.hxx"
39 #include "saturn.hxx"
40 #include "uranus.hxx"
41 #include "neptune.hxx"
42 #include "stars.hxx"
43
44
45 class FGEphemeris {
46
47     Star *our_sun;
48     Moon *moon;
49     Mercury *mercury;
50     Venus *venus;
51     Mars *mars;
52     Jupiter *jupiter;
53     Saturn *saturn;
54     Uranus *uranus;
55     Neptune *neptune;
56
57     // 9 planets, minus earth, minus pluto which we don't draw = 7
58     // planets[i][0] = Right Ascension
59     // planets[i][1] = Declination
60     // planets[i][2] = Magnitude
61     int nplanets;
62     sgdVec3 planets[7];
63
64     FGStars *stars;
65
66 public:
67
68     // Constructor
69     FGEphemeris( const string &path );
70
71     // Destructor
72     ~FGEphemeris( void );
73
74     // Update (recalculate) the positions of all objects for the
75     // specified time
76     void update(FGTime *t, double lat);
77
78     // sun
79     inline Star *get_sun() const { return our_sun; }
80     inline double getSunRightAscension() const {
81         return our_sun->getRightAscension();
82     }
83     inline double getSunDeclination() const {
84         return our_sun->getDeclination();
85     }
86
87     // moon
88     inline Moon *get_moon() const { return moon; }
89     inline double getMoonRightAscension() const {
90         return moon->getRightAscension();
91     }
92     inline double getMoonDeclination() const {
93         return moon->getDeclination();
94     }
95
96     // planets
97     inline int getNumPlanets() const { return nplanets; }
98     inline sgdVec3 *getPlanets() { return planets; }
99
100     // planets
101     inline int getNumStars() const { return stars->getNumStars(); }
102     inline sgdVec3 *getStars() { return stars->getStars(); }
103 };
104
105
106 #endif // _EPHEMERIS_HXX
107
108