StelObject.hpp   StelObject.hpp 
skipping to change at line 24 skipping to change at line 24
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* 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 _STELOBJECT_HPP_ #ifndef _STELOBJECT_HPP_
#define _STELOBJECT_HPP_ #define _STELOBJECT_HPP_
#include <QString> #include <QString>
#include "vecmath.h" #include "VecMath.hpp"
#include "StelObjectType.hpp" #include "StelObjectType.hpp"
#include "GridObject.hpp" #include "StelGridObject.hpp"
class Navigator; class StelNavigator;
class Projector;
class STexture;
class StelCore; class StelCore;
// Declare the 2 functions needed by boost intrusive pointers // Declare the 2 functions needed by boost intrusive pointers
class StelObject; class StelObject;
void intrusive_ptr_add_ref(StelObject* p); void intrusive_ptr_add_ref(StelObject* p);
void intrusive_ptr_release(StelObject* p); void intrusive_ptr_release(StelObject* p);
//! The base abstract class for sky objects used in Stellarium like Stars, Planets, Constellations etc... //! The base abstract class for sky objects used in Stellarium like Stars, Planets, Constellations etc...
//! Normally you should use StelObjectP instead of StelObject* which have b y default the same behaviour, //! Normally you should use StelObjectP instead of StelObject* which have b y default the same behaviour,
//! but which can be added reference counting if needed. //! but which can be added reference counting if needed.
class StelObject : public GridObject //! @sa StelObjectP
class StelObject : public StelGridObject
{ {
public: public:
//! @enum InfoStringGroup used as named bitfield flags as specifiers to //! @enum InfoStringGroup used as named bitfield flags as specifiers to
//! filter results of getInfoString. The precise definition of these should //! filter results of getInfoString. The precise definition of these should
//! be documented in the getInfoString documentation for the derived classes //! be documented in the getInfoString documentation for the derived classes
//! for all specifiers which are defined in that derivative. //! for all specifiers which are defined in that derivative.
enum InfoStringGroup enum InfoStringGroup
{ {
Name = 0x00000001, //!< An object's name Name = 0x00000001, //!< An object's name
CatalogNumber = 0x00000002, //!< Catalog numbers CatalogNumber = 0x00000002, //!< Catalog numbers
skipping to change at line 73 skipping to change at line 72
AbsoluteMagnitude = 0x00002000 //!< The absolute magnitude AbsoluteMagnitude = 0x00002000 //!< The absolute magnitude
}; };
//! A pre-defined set of specifiers for the getInfoString flags argu ment to getInfoString //! A pre-defined set of specifiers for the getInfoString flags argu ment to getInfoString
static const InfoStringGroup AllInfo = (InfoStringGroup)(Name|Catalo gNumber|Magnitude|RaDecJ2000|RaDecOfDate|AltAzi|Distance|Size|Extra1|Extra2 |Extra3|HourAngle|AbsoluteMagnitude); static const InfoStringGroup AllInfo = (InfoStringGroup)(Name|Catalo gNumber|Magnitude|RaDecJ2000|RaDecOfDate|AltAzi|Distance|Size|Extra1|Extra2 |Extra3|HourAngle|AbsoluteMagnitude);
//! A pre-defined set of specifiers for the getInfoString flags argu ment to getInfoString //! A pre-defined set of specifiers for the getInfoString flags argu ment to getInfoString
static const InfoStringGroup ShortInfo = (InfoStringGroup)(Name|Cata logNumber|Magnitude|RaDecJ2000); static const InfoStringGroup ShortInfo = (InfoStringGroup)(Name|Cata logNumber|Magnitude|RaDecJ2000);
virtual ~StelObject(void) {} virtual ~StelObject(void) {}
//! Default implementation of the GridObject method //! Default implementation of the StelGridObject method
//! Calling this method on some object will cause an error if they n //! Calling this method on some object will cause an error if they n
eed a valid Navigator instance to compute their position eed a valid StelNavigator instance to compute their position
virtual Vec3d getPositionForGrid() const {return getObsJ2000Pos(NULL virtual Vec3d getPositionForGrid() const {return getJ2000EquatorialP
);} os(NULL);}
//! Increment the reference counts if needed.
//! The default behaviour is to do nothing, thus making StelObjectP
behave like normal pointers.
virtual void retain(void) {;}
//! Decrement the reference counts if needed.
//! The default behaviour is to do nothing, thus making StelObjectP
behave like normal pointers.
virtual void release(void) {;}
//! Write I18n information about the object in QString. //! Write I18n information about the object in QString.
//! @param core the StelCore object to use //! @param core the StelCore object to use
//! @param flags a set of InfoStringGroup flags which are used to //! @param flags a set of InfoStringGroup flags which are used to
//! filter the return value - including specified types of informati on //! filter the return value - including specified types of informati on
//! and altering the output format. //! and altering the output format.
//! @return an HTML string containing information about the StelObje ct. //! @return an HTML string containing information about the StelObje ct.
virtual QString getInfoString(const StelCore *core, const InfoString Group& flags=StelObject::AllInfo) const = 0; virtual QString getInfoString(const StelCore *core, const InfoString Group& flags=StelObject::AllInfo) const = 0;
//! Return object's type. It should be the name of the class. //! Return object's type. It should be the name of the class.
virtual QString getType(void) const = 0; virtual QString getType(void) const = 0;
//! Return object's name in english //! Return object's name in english
virtual QString getEnglishName(void) const = 0; virtual QString getEnglishName(void) const = 0;
//! Return translated object's name //! Return translated object's name
virtual QString getNameI18n(void) const = 0; virtual QString getNameI18n(void) const = 0;
//! Get observer centered equatorial coordinate at the current equin //! Get observer-centered equatorial coordinates at equinox J2000
ox virtual Vec3d getJ2000EquatorialPos(const StelNavigator *nav) const
//! The frame has it's Z axis at the observer current rotation axis = 0;
//! Get observer-centered equatorial coordinate at the current equin
ox
//! The frame has it's Z axis at the planet's current rotation axis
//! At time 2000-01-01 this frame is almost the same as J2000, but O NLY if the observer is on earth //! At time 2000-01-01 this frame is almost the same as J2000, but O NLY if the observer is on earth
Vec3d getObsEquatorialPos(const Navigator* nav) const; Vec3d getEquinoxEquatorialPos(const StelNavigator* nav) const;
//! Get observer centered hour angle + declination (at current equin //! Get observer-centered hour angle + declination (at current equin
ox) ox)
//! The frame has its Z axis at the observer current rotation axis //! The frame has its Z axis at the planet's current rotation axis
Vec3d getObsSideralPos(const StelCore* core) const; Vec3d getSideralPos(const StelCore* core) const;
//! Get observer local alt/az coordinate //! Get observer-centered alt/az position
//! The frame has it's Z axis at the zenith //! The frame has it's Z axis at the zenith
Vec3d getAltAzPos(const Navigator* nav) const; Vec3d getAltAzPos(const StelNavigator* nav) const;
//! Get observer centered equatorial coordinates at equinox J2000
virtual Vec3d getObsJ2000Pos(const Navigator *nav) const = 0;
//! Return object's apparent V magnitude as seen from observer //! Return object's apparent V magnitude as seen from observer
virtual float getVMagnitude(const Navigator *nav) const {return 99;} virtual float getVMagnitude(const StelNavigator *nav) const {return 99;}
//! Return a priority value which is used to discriminate objects by priority //! Return a priority value which is used to discriminate objects by priority
//! As for magnitudes, the lower is the higher priority //! As for magnitudes, the lower is the higher priority
virtual float getSelectPriority(const Navigator *nav) const {return 99;} virtual float getSelectPriority(const StelNavigator *nav) const {ret urn 99;}
//! Get a color used to display info about the object //! Get a color used to display info about the object
virtual Vec3f getInfoColor(void) const {return Vec3f(1,1,1);} virtual Vec3f getInfoColor(void) const {return Vec3f(1,1,1);}
//! Return the best FOV in degree to use for a close view of the obj ect //! Return the best FOV in degree to use for a close view of the obj ect
virtual double getCloseViewFov(const Navigator *nav) const {return 1 0.;} virtual double getCloseViewFov(const StelNavigator *nav) const {retu rn 10.;}
//! Return the best FOV in degree to use for a global view of the ob ject satellite system (if there are satellites) //! Return the best FOV in degree to use for a global view of the ob ject satellite system (if there are satellites)
virtual double getSatellitesFov(const Navigator *nav) const {return virtual double getSatellitesFov(const StelNavigator *nav) const {ret
-1.;} urn -1.;}
virtual double getParentSatellitesFov(const Navigator *nav) const {r virtual double getParentSatellitesFov(const StelNavigator *nav) cons
eturn -1.;} t {return -1.;}
//! Return the angular radius of a circle containing the object as s een from the observer //! Return the angular radius of a circle containing the object as s een from the observer
//! with the circle center assumed to be at getObsJ2000Pos(). //! with the circle center assumed to be at getJ2000EquatorialPos().
//! @return radius in degree. This value is the apparent angular siz e of the object, and is independent of the current FOV. //! @return radius in degree. This value is the apparent angular siz e of the object, and is independent of the current FOV.
virtual double getAngularSize(const StelCore* core) const = 0; virtual double getAngularSize(const StelCore* core) const = 0;
//! Return the radius of a circle containing the object on screen
//! @return radius in pixel
float getOnScreenSize(const StelCore* core) const;
protected: protected:
friend void intrusive_ptr_add_ref(StelObject* p);
friend void intrusive_ptr_release(StelObject* p);
//! Format the positional info string contain J2000/of date/altaz/ho ur angle positions for the object //! Format the positional info string contain J2000/of date/altaz/ho ur angle positions for the object
QString getPositionInfoString(const StelCore *core, const InfoString Group& flags) const; QString getPositionInfoString(const StelCore *core, const InfoString Group& flags) const;
//! Apply post processing on the info string //! Apply post processing on the info string
void postProcessInfoString(QString& str, const InfoStringGroup& flag s) const; void postProcessInfoString(QString& str, const InfoStringGroup& flag s) const;
//! Increment the reference counts if needed.
//! The default behaviour is to do nothing, thus making StelObjectP
behave like normal pointers.
virtual void retain(void) {;}
//! Decrement the reference counts if needed.
//! The default behaviour is to do nothing, thus making StelObjectP
behave like normal pointers.
virtual void release(void) {;}
}; };
#endif // _STELOBJECT_HPP_ #endif // _STELOBJECT_HPP_
 End of changes. 18 change blocks. 
46 lines changed or deleted 45 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/