StelObject.hpp   StelObject.hpp 
skipping to change at line 23 skipping to change at line 23
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* 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., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/ */
#ifndef _STELOBJECT_HPP_ #ifndef _STELOBJECT_HPP_
#define _STELOBJECT_HPP_ #define _STELOBJECT_HPP_
#include <QFlags>
#include <QString> #include <QString>
#include "VecMath.hpp" #include "VecMath.hpp"
#include "StelObjectType.hpp" #include "StelObjectType.hpp"
#include "StelRegionObject.hpp" #include "StelRegionObject.hpp"
class StelCore; class StelCore;
//! 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 StelRegionObject 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 //! Use InfoStringGroup instead.
enum InfoStringGroupFlags
{ {
Name = 0x00000001, //!< An object's name Name = 0x00000001, //!< An object's name
CatalogNumber = 0x00000002, //!< Catalog numbers CatalogNumber = 0x00000002, //!< Catalog numbers
Magnitude = 0x00000004, //!< Magnitude related data Magnitude = 0x00000004, //!< Magnitude related data
RaDecJ2000 = 0x00000008, //!< The equatorial position (J2 000 ref) RaDecJ2000 = 0x00000008, //!< The equatorial position (J2 000 ref)
RaDecOfDate = 0x00000010, //!< The equatorial position (of date) RaDecOfDate = 0x00000010, //!< The equatorial position (of date)
AltAzi = 0x00000020, //!< The position (Altitude/Azim uth) AltAzi = 0x00000020, //!< The position (Altitude/Azim uth)
Distance = 0x00000040, //!< Info about an object's dist ance Distance = 0x00000040, //!< Info about an object's dist ance
Size = 0x00000080, //!< Info about an object's size Size = 0x00000080, //!< Info about an object's size
Extra1 = 0x00000100, //!< Derived class-specific extr a fields Extra1 = 0x00000100, //!< Derived class-specific extr a fields
Extra2 = 0x00000200, //!< Derived class-specific extr a fields Extra2 = 0x00000200, //!< Derived class-specific extr a fields
Extra3 = 0x00000400, //!< Derived class-specific extr a fields Extra3 = 0x00000400, //!< Derived class-specific extr a fields
PlainText = 0x00000800, //!< Strip HTML tags from output PlainText = 0x00000800, //!< Strip HTML tags from output
HourAngle = 0x00001000, //!< The hour angle + DE (of da te) HourAngle = 0x00001000, //!< The hour angle + DE (of da te)
AbsoluteMagnitude = 0x00002000 //!< The absolute magnitude AbsoluteMagnitude = 0x00002000 //!< The absolute magnitude
}; };
typedef QFlags<InfoStringGroupFlags> InfoStringGroup;
Q_FLAGS(InfoStringGroup)
//! 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 InfoStringGroupFlags AllInfo = (InfoStringGroupFlags)(N ame|CatalogNumber|Magnitude|RaDecJ2000|RaDecOfDate|AltAzi|Distance|Size|Ext ra1|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 InfoStringGroupFlags ShortInfo = (InfoStringGroupFlags) (Name|CatalogNumber|Magnitude|RaDecJ2000);
virtual ~StelObject() {} virtual ~StelObject() {}
//! Default implementation of the getRegion method. //! Default implementation of the getRegion method.
//! Return the spatial region of the object. //! Return the spatial region of the object.
virtual SphericalRegionP getRegion() const {return SphericalRegionP( new SphericalPoint(getJ2000EquatorialPos(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
skipping to change at line 151 skipping to change at line 155
protected: protected:
//! 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;
}; };
Q_DECLARE_OPERATORS_FOR_FLAGS(StelObject::InfoStringGroup)
#endif // _STELOBJECT_HPP_ #endif // _STELOBJECT_HPP_
 End of changes. 6 change blocks. 
3 lines changed or deleted 9 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/