Home · All Namespaces · All Classes · Functions · Coding Style · Scripting · Plugins · File Structure

core/StelObserver.hpp

00001 /*
00002  * Stellarium
00003  * Copyright (C) 2002 Fabien Chereau
00004  *
00005  * This program is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License
00007  * as published by the Free Software Foundation; either version 2
00008  * of the License, or (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00018  */
00019 
00020 #ifndef _STELOBSERVER_HPP_
00021 #define _STELOBSERVER_HPP_
00022 
00023 #include "StelLocation.hpp"
00024 #include <QObject>
00025 #include <QString>
00026 #include <QSharedPointer>
00027 #include "VecMath.hpp"
00028 #include "Planet.hpp"
00029 
00030 class ArtificialPlanet;
00031 class StelObserver;
00032 
00035 class StelObserver : public QObject
00036 {
00037     Q_OBJECT
00038 
00039 public:
00041     StelObserver(const StelLocation& loc);
00042     ~StelObserver();
00043 
00045     virtual void update(double deltaTime) {;}
00046 
00048     Vec3d getCenterVsop87Pos(void) const;
00050     double getDistanceFromCenter(void) const;
00051     Mat4d getRotAltAzToEquatorial(double jd) const;
00052     Mat4d getRotEquatorialToVsop87(void) const;
00053 
00054     virtual const QSharedPointer<Planet> getHomePlanet(void) const;
00055 
00057     virtual const StelLocation& getCurrentLocation() const {return currentLocation;}
00058 
00061     virtual bool isObserverLifeOver() const {return false;}
00062 
00064     virtual StelObserver* getNextObserver() const {return new StelObserver(currentLocation);}
00065 
00066 protected:
00067     StelLocation currentLocation;
00068     QSharedPointer<Planet> planet;
00069 };
00070 
00073 class SpaceShipObserver : public StelObserver
00074 {
00075 public:
00076     SpaceShipObserver(const StelLocation& startLoc, const StelLocation& target, double transitSeconds=1.f);
00077     ~SpaceShipObserver();
00078 
00080     virtual void update(double deltaTime);
00081     virtual const QSharedPointer<Planet> getHomePlanet() const;
00082     virtual bool isObserverLifeOver() const {return timeToGo <= 0.;}
00083     virtual StelObserver* getNextObserver() const {return new StelObserver(moveTargetLocation);}
00084     
00085 private:
00086     StelLocation moveStartLocation;
00087     StelLocation moveTargetLocation;
00088     QSharedPointer<Planet> artificialPlanet;
00089     double timeToGo;
00090     double transitSeconds;
00091 };
00092 
00093 #endif // _STELOBSERVER_HPP_
00094 

Generated on Mon Mar 22 09:55:38 2010 for Stellarium by  doxygen 1.5.5