]> git.mxchange.org Git - flightgear.git/blob - Astro/solarsystem.hxx
Changes contributed by Durk Talsma:
[flightgear.git] / Astro / solarsystem.hxx
1 /**************************************************************************
2  * solarsystem.hxx
3  * Written by Durk Talsma. Originally started October 1997, for distribution  
4  * with the FlightGear project. Version 2 was written in August and 
5  * September 1998. This code is based upon algorithms and data kindly 
6  * provided by Mr. Paul Schlyter. (pausch@saaf.se). 
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  * (Log is kept at end of this file)
24  **************************************************************************/
25 #ifndef _SOLARSYSTEM_H_
26 #define _SOLARSYSTEM_H_
27
28 #include <Time/light.hxx>
29 #include <Time/fg_time.hxx>
30 #include <Main/views.hxx>
31
32 #include "star.hxx"
33 #include "moon.hxx"
34 #include "mercury.hxx"
35 #include "venus.hxx"
36 #include "mars.hxx"
37 #include "jupiter.hxx"
38 #include "saturn.hxx"
39 #include "uranus.hxx"
40 #include "neptune.hxx"
41 #include "pluto.hxx"
42
43
44 class SolarSystem
45 {
46 private:
47   Star*    ourSun;
48   Moon*    earthsMoon;
49   Mercury* mercury;
50   Venus*   venus;
51   Mars*    mars;
52   Jupiter* jupiter;
53   Saturn*  saturn;
54   Uranus*  uranus;
55   Neptune* neptune;
56   //Pluto*   pluto;
57   
58   GLint displayList;
59   double scaleMagnitude(double magn);
60   void addPlanetToList(double ra, double dec, double magn);
61
62
63 public:
64   SolarSystem(fgTIME *t);
65   CelestialBody *getSun();
66   CelestialBody *getMoon();
67   ~SolarSystem();
68
69   static SolarSystem *theSolarSystem;  // thanks to Bernie Bright!
70   void rebuild();
71   friend void solarSystemRebuild();
72   void draw();
73 };
74
75 inline CelestialBody* SolarSystem::getSun()
76 {
77   return ourSun;
78 }
79
80 inline CelestialBody* SolarSystem::getMoon()
81 {
82   return earthsMoon;
83 }
84
85 inline void SolarSystem::draw()
86 {
87   xglCallList(displayList);
88 }
89   
90 extern void solarSystemRebuild();
91
92 #endif // _SOLARSYSTEM_H_