From a8db14196ace7a27aa09cda0b4f428ec40103202 Mon Sep 17 00:00:00 2001 From: curt Date: Thu, 2 Mar 2000 12:51:30 +0000 Subject: [PATCH] Working on separating out ephemeris code from the actual rendering code which I am trying to ssg-ify at the same time. --- simgear/ephemeris/Makefile.am | 1 + simgear/ephemeris/celestialBody.hxx | 32 +- simgear/ephemeris/skydome.cxx | 814 ---------------------------- simgear/ephemeris/skydome.hxx | 109 ---- simgear/ephemeris/solarsystem.cxx | 2 +- simgear/ephemeris/star.cxx | 66 +-- simgear/ephemeris/star.hxx | 41 +- simgear/sky/skydome.cxx | 4 - simgear/sky/skydome.hxx | 3 - simgear/sky/skysun.cxx | 211 +++---- simgear/sky/skysun.hxx | 4 +- simgear/sky/sphere.cxx | 4 +- simgear/sky/sphere.hxx | 8 +- 13 files changed, 175 insertions(+), 1124 deletions(-) delete mode 100644 simgear/ephemeris/skydome.cxx delete mode 100644 simgear/ephemeris/skydome.hxx diff --git a/simgear/ephemeris/Makefile.am b/simgear/ephemeris/Makefile.am index 849aa22c..3c67a015 100644 --- a/simgear/ephemeris/Makefile.am +++ b/simgear/ephemeris/Makefile.am @@ -2,6 +2,7 @@ noinst_LIBRARIES = libAstro.a libAstro_a_SOURCES = \ celestialBody.cxx celestialBody.hxx \ + ephemeris.cxx ephemeris.hxx \ jupiter.cxx jupiter.hxx \ mars.cxx mars.hxx \ mercury.cxx mercury.hxx \ diff --git a/simgear/ephemeris/celestialBody.hxx b/simgear/ephemeris/celestialBody.hxx index 410ca01a..59611ef4 100644 --- a/simgear/ephemeris/celestialBody.hxx +++ b/simgear/ephemeris/celestialBody.hxx @@ -39,8 +39,8 @@ class Star; class CelestialBody { -protected: // make the data protected, in order to give the inherited - // classes direct access to the data +protected: // make the data protected, in order to give the + // inherited classes direct access to the data double NFirst; /* longitude of the ascending node first part */ double NSec; /* longitude of the ascending node second part */ double iFirst; /* inclination to the ecliptic first part */ @@ -72,8 +72,17 @@ public: double af, double as, double ef, double es, double Mf, double Ms, FGTime *t); + CelestialBody(double Nf, double Ns, + double If, double Is, + double wf, double ws, + double af, double as, + double ef, double es, + double Mf, double Ms); void getPos(double *ra, double *dec); void getPos(double *ra, double *dec, double *magnitude); + double getRightAscension(); + double getDeclination(); + double getMagnitude(); double getLon(); double getLat(); void updatePosition(FGTime *t, Star *ourSun); @@ -115,6 +124,21 @@ inline CelestialBody::CelestialBody(double Nf, double Ns, updateOrbElements(t); }; +inline CelestialBody::CelestialBody(double Nf, double Ns, + double If, double Is, + double wf, double ws, + double af, double as, + double ef, double es, + double Mf, double Ms) +{ + NFirst = Nf; NSec = Ns; + iFirst = If; iSec = Is; + wFirst = wf; wSec = ws; + aFirst = af; aSec = as; + eFirst = ef; eSec = es; + MFirst = Mf; MSec = Ms; +}; + /**************************************************************************** * inline void CelestialBody::updateOrbElements(FGTime *t) * given the current time, this private member calculates the actual @@ -171,6 +195,10 @@ inline void CelestialBody::getPos(double* ra, double* dec, double* magn) *magn = magnitude; } +inline double CelestialBody::getRightAscension() { return rightAscension; } +inline double CelestialBody::getDeclination() { return declination; } +inline double CelestialBody::getMagnitude() { return magnitude; } + inline double CelestialBody::getLon() { return lonEcl; diff --git a/simgear/ephemeris/skydome.cxx b/simgear/ephemeris/skydome.cxx deleted file mode 100644 index f71f98bd..00000000 --- a/simgear/ephemeris/skydome.cxx +++ /dev/null @@ -1,814 +0,0 @@ -// skydome.cxx -- model sky with an upside down "bowl" -// -// Written by Curtis Olson, started December 1997. -// SSG-ified by Curtis Olson, February 2000. -// -// Copyright (C) 1997-2000 Curtis L. Olson - curt@flightgear.org -// -// 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 - -#include - -#include -#include - -#include -#include -#include - -#include -#include -#include
-#include