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