StelObserver.hpp   StelObserver.hpp 
skipping to change at line 26 skipping to change at line 26
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA.
*/ */
#ifndef _STELOBSERVER_HPP_ #ifndef _STELOBSERVER_HPP_
#define _STELOBSERVER_HPP_ #define _STELOBSERVER_HPP_
#include "StelLocation.hpp" #include "StelLocation.hpp"
#include <QObject> #include <QObject>
#include <QString> #include <QString>
#include <QSharedPointer>
#include "VecMath.hpp" #include "VecMath.hpp"
#include "Planet.hpp"
class Planet;
class ArtificialPlanet; class ArtificialPlanet;
class StelObserver; class StelObserver;
//! @class StelObserver //! @class StelObserver
//! Should be renamed as PlanetBasedObserver and derive from a more generic al StelObserver class //! Should be renamed as PlanetBasedObserver and derive from a more generic al StelObserver class
class StelObserver : public QObject class StelObserver : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
skipping to change at line 53 skipping to change at line 54
//! Update StelObserver info if needed. Default implementation does nothing. //! Update StelObserver info if needed. Default implementation does nothing.
virtual void update(double deltaTime) {;} virtual void update(double deltaTime) {;}
//! Get the position of the home planet center in the heliocentric V SOP87 frame in AU //! Get the position of the home planet center in the heliocentric V SOP87 frame in AU
Vec3d getCenterVsop87Pos(void) const; Vec3d getCenterVsop87Pos(void) const;
//! Get the distance between observer and home planet center in AU //! Get the distance between observer and home planet center in AU
double getDistanceFromCenter(void) const; double getDistanceFromCenter(void) const;
Mat4d getRotAltAzToEquatorial(double jd) const; Mat4d getRotAltAzToEquatorial(double jd) const;
Mat4d getRotEquatorialToVsop87(void) const; Mat4d getRotEquatorialToVsop87(void) const;
virtual const Planet* getHomePlanet(void) const {return planet;} virtual const QSharedPointer<Planet> getHomePlanet(void) const;
//! Get the informations on the current location //! Get the informations on the current location
const StelLocation& getCurrentLocation() const {return currentLocati on;} virtual const StelLocation& getCurrentLocation() const {return curre ntLocation;}
//! Get whether the life of this observer is over, and therefore tha t it should be changed to the next one //! Get whether the life of this observer is over, and therefore tha t it should be changed to the next one
//! provided by the getNextObserver() method //! provided by the getNextObserver() method
virtual bool isObserverLifeOver() const {return false;} virtual bool isObserverLifeOver() const {return false;}
//! Get the next observer to use once the life of this one is over //! Get the next observer to use once the life of this one is over
virtual StelObserver* getNextObserver() const {return new StelObserv er(currentLocation);} virtual StelObserver* getNextObserver() const {return new StelObserv er(currentLocation);}
protected: protected:
StelLocation currentLocation; StelLocation currentLocation;
const Planet* planet; QSharedPointer<Planet> planet;
}; };
//! @class SpaceShipObserver //! @class SpaceShipObserver
//! An observer which moves from from one position to another one and/or fr om one planet to another one //! An observer which moves from from one position to another one and/or fr om one planet to another one
class SpaceShipObserver : public StelObserver class SpaceShipObserver : public StelObserver
{ {
public: public:
SpaceShipObserver(const StelLocation& startLoc, const StelLocation& target, double transitSeconds=1.f); SpaceShipObserver(const StelLocation& startLoc, const StelLocation& target, double transitSeconds=1.f);
~SpaceShipObserver(); ~SpaceShipObserver();
//! Update StelObserver info if needed. Default implementation does nothing. //! Update StelObserver info if needed. Default implementation does nothing.
virtual void update(double deltaTime); virtual void update(double deltaTime);
virtual const Planet* getHomePlanet(void) const {return (isObserverL ifeOver() || artificialPlanet==NULL) ? planet : (Planet*)artificialPlanet; } virtual const QSharedPointer<Planet> getHomePlanet() const;
virtual bool isObserverLifeOver() const {return timeToGo <= 0.;} virtual bool isObserverLifeOver() const {return timeToGo <= 0.;}
virtual StelObserver* getNextObserver() const {return new StelObserv er(moveTargetLocation);} virtual StelObserver* getNextObserver() const {return new StelObserv er(moveTargetLocation);}
private: private:
StelLocation moveStartLocation; StelLocation moveStartLocation;
StelLocation moveTargetLocation; StelLocation moveTargetLocation;
ArtificialPlanet* artificialPlanet; QSharedPointer<Planet> artificialPlanet;
double timeToGo; double timeToGo;
double transitSeconds; double transitSeconds;
}; };
#endif // _STELOBSERVER_HPP_ #endif // _STELOBSERVER_HPP_
 End of changes. 8 change blocks. 
6 lines changed or deleted 7 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/