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