From 1984ae1583d160c46e026806352d45dad3d41df6 Mon Sep 17 00:00:00 2001 From: curt Date: Thu, 16 Mar 2000 22:00:53 +0000 Subject: [PATCH] Removed solarsystem.* replaced mostly with ephemeris.* which is similar but not rendering oriented. Added star database management class. --- simgear/ephemeris/Makefile.am | 1 - simgear/ephemeris/ephemeris.cxx | 4 +- simgear/ephemeris/ephemeris.hxx | 11 +- simgear/ephemeris/solarsystem.cxx | 221 ------------------------ simgear/ephemeris/solarsystem.hxx | 91 ---------- simgear/ephemeris/stars.cxx | 274 +++++++----------------------- simgear/ephemeris/stars.hxx | 42 +++-- 7 files changed, 101 insertions(+), 543 deletions(-) delete mode 100644 simgear/ephemeris/solarsystem.cxx delete mode 100644 simgear/ephemeris/solarsystem.hxx diff --git a/simgear/ephemeris/Makefile.am b/simgear/ephemeris/Makefile.am index 3c67a015..1ef7ce24 100644 --- a/simgear/ephemeris/Makefile.am +++ b/simgear/ephemeris/Makefile.am @@ -10,7 +10,6 @@ libAstro_a_SOURCES = \ neptune.cxx neptune.hxx \ pluto.hxx \ saturn.cxx saturn.hxx \ - solarsystem.cxx solarsystem.hxx \ star.cxx star.hxx \ stars.cxx stars.hxx \ uranus.cxx uranus.hxx \ diff --git a/simgear/ephemeris/ephemeris.cxx b/simgear/ephemeris/ephemeris.cxx index 2f96b9bc..957556f9 100644 --- a/simgear/ephemeris/ephemeris.cxx +++ b/simgear/ephemeris/ephemeris.cxx @@ -26,7 +26,7 @@ // Constructor -FGEphemeris::FGEphemeris( void ) { +FGEphemeris::FGEphemeris( const string &path ) { our_sun = new Star; moon = new Moon; mercury = new Mercury; @@ -36,6 +36,7 @@ FGEphemeris::FGEphemeris( void ) { saturn = new Saturn; uranus = new Uranus; neptune = new Neptune; + stars = new FGStars( FGPath(path) ); } @@ -50,6 +51,7 @@ FGEphemeris::~FGEphemeris( void ) { delete saturn; delete uranus; delete neptune; + delete stars; } diff --git a/simgear/ephemeris/ephemeris.hxx b/simgear/ephemeris/ephemeris.hxx index 7b9a7c42..74594e3b 100644 --- a/simgear/ephemeris/ephemeris.hxx +++ b/simgear/ephemeris/ephemeris.hxx @@ -39,6 +39,7 @@ #include "saturn.hxx" #include "uranus.hxx" #include "neptune.hxx" +#include "stars.hxx" class FGEphemeris { @@ -59,11 +60,13 @@ class FGEphemeris { // planets[i][2] = Magnitude int nplanets; sgdVec3 planets[7]; - + + FGStars *stars; + public: // Constructor - FGEphemeris( void ); + FGEphemeris( const string &path ); // Destructor ~FGEphemeris( void ); @@ -93,6 +96,10 @@ public: // planets inline int getNumPlanets() const { return nplanets; } inline sgdVec3 *getPlanets() { return planets; } + + // planets + inline int getNumStars() const { return stars->getNumStars(); } + inline sgdVec3 *getStars() { return stars->getStars(); } }; diff --git a/simgear/ephemeris/solarsystem.cxx b/simgear/ephemeris/solarsystem.cxx deleted file mode 100644 index 001f7958..00000000 --- a/simgear/ephemeris/solarsystem.cxx +++ /dev/null @@ -1,221 +0,0 @@ -/************************************************************************** - * solarsystem.cxx - * Written by Durk Talsma. Originally started October 1997, for distribution - * with the FlightGear project. Version 2 was written in August and - * September 1998. This code is based upon algorithms and data kindly - * provided by Mr. Paul Schlyter. (pausch@saaf.se). - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * $Id$ - **************************************************************************/ - -#ifdef HAVE_CONFIG_H -# include -#endif - -#ifdef HAVE_WINDOWS_H -# include -#endif - -#ifdef __BORLANDC__ -# define exception c_exception -#endif -#include - -#include -#include - -#include - -#include