StelObject.hpp   StelObject.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 _STELOBJECT_HPP_ #ifndef _STELOBJECT_HPP_
#define _STELOBJECT_HPP_ #define _STELOBJECT_HPP_
#include <QString> #include <QString>
#include "VecMath.hpp" #include "VecMath.hpp"
#include "StelObjectType.hpp" #include "StelObjectType.hpp"
#include "StelGridObject.hpp" #include "StelRegionObject.hpp"
class StelNavigator; class StelNavigator;
class StelCore; class StelCore;
// Declare the 2 functions needed by boost intrusive pointers
class StelObject;
void intrusive_ptr_add_ref(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.
//! @sa StelObjectP //! @sa StelObjectP
class StelObject : public StelGridObject class StelObject : public StelRegionObject
{ {
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 72 skipping to change at line 67
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 StelGridObject method //! Default implementation of the getRegion 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 StelNavigator instance to compute their position eed a valid StelNavigator instance to compute their position.
virtual Vec3d getPositionForGrid() const {return getJ2000EquatorialP //! Return the spatial region of the object.
os(NULL);} virtual SphericalRegionP getRegion() const {return SphericalRegionP(
new SphericalPoint(getJ2000EquatorialPos(NULL)));}
//! 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.
skipping to change at line 132 skipping to change at line 128
//! 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 StelNavigator *nav) const {ret urn -1.;} virtual double getSatellitesFov(const StelNavigator *nav) const {ret urn -1.;}
virtual double getParentSatellitesFov(const StelNavigator *nav) cons t {return -1.;} virtual double getParentSatellitesFov(const StelNavigator *nav) cons 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 getJ2000EquatorialPos(). //! 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;
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. 6 change blocks. 
24 lines changed or deleted 8 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/