]> git.mxchange.org Git - simgear.git/blob - simgear/ephemeris/ephemeris.hxx
7340d5e1c83e80bd0ffee1808dc50e696b5dce0c
[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 #ifdef HAVE_CONFIG_H
30 #  include <config.h>
31 #endif
32
33 #include <plib/sg.h>
34
35 #include <simgear/timing/sg_time.hxx>
36
37 #include "star.hxx"
38 #include "moon.hxx"
39 #include "mercury.hxx"
40 #include "venus.hxx"
41 #include "mars.hxx"
42 #include "jupiter.hxx"
43 #include "saturn.hxx"
44 #include "uranus.hxx"
45 #include "neptune.hxx"
46 #include "stars.hxx"
47
48
49 class FGEphemeris {
50
51     Star *our_sun;
52     Moon *moon;
53     Mercury *mercury;
54     Venus *venus;
55     Mars *mars;
56     Jupiter *jupiter;
57     Saturn *saturn;
58     Uranus *uranus;
59     Neptune *neptune;
60
61     // 9 planets, minus earth, minus pluto which we don't draw = 7
62     // planets[i][0] = Right Ascension
63     // planets[i][1] = Declination
64     // planets[i][2] = Magnitude
65     int nplanets;
66     sgdVec3 planets[7];
67
68     FGStars *stars;
69
70 public:
71
72     // Constructor
73     FGEphemeris( const string &path );
74
75     // Destructor
76     ~FGEphemeris( void );
77
78     // Update (recalculate) the positions of all objects for the
79     // specified time
80     void update(SGTime *t, double lat);
81
82     // sun
83     inline Star *get_sun() const { return our_sun; }
84     inline double getSunRightAscension() const {
85         return our_sun->getRightAscension();
86     }
87     inline double getSunDeclination() const {
88         return our_sun->getDeclination();
89     }
90
91     // moon
92     inline Moon *get_moon() const { return moon; }
93     inline double getMoonRightAscension() const {
94         return moon->getRightAscension();
95     }
96     inline double getMoonDeclination() const {
97         return moon->getDeclination();
98     }
99
100     // planets
101     inline int getNumPlanets() const { return nplanets; }
102     inline sgdVec3 *getPlanets() { return planets; }
103
104     // planets
105     inline int getNumStars() const { return stars->getNumStars(); }
106     inline sgdVec3 *getStars() { return stars->getStars(); }
107 };
108
109
110 #endif // _EPHEMERIS_HXX
111
112