StarWrapper.hpp   StarWrapper.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 _STARWRAPPER_HPP_ #ifndef _STARWRAPPER_HPP_
#define _STARWRAPPER_HPP_ #define _STARWRAPPER_HPP_
#include <QString> #include <QString>
#include "StelObject.hpp" #include "StelObject.hpp"
#include "StelApp.hpp" #include "StelApp.hpp"
#include "Navigator.hpp" #include "StelNavigator.hpp"
#include "StarMgr.hpp" #include "StarMgr.hpp"
#include "Star.hpp" #include "Star.hpp"
#include "SkyDrawer.hpp" #include "StelSkyDrawer.hpp"
namespace BigStarCatalogExtension { namespace BigStarCatalogExtension {
template <class Star> struct SpecialZoneArray; template <class Star> struct SpecialZoneArray;
template <class Star> struct SpecialZoneData; template <class Star> struct SpecialZoneData;
// A Star (Star1,Star2,Star3,...) cannot be a StelObject. The additional // A Star (Star1,Star2,Star3,...) cannot be a StelObject. The additional
// overhead of having a dynamic type would simply be too much. // overhead of having a dynamic type would simply be too much.
// Therefore the StarWrapper is needed when returning Stars as StelObjects, // Therefore the StarWrapper is needed when returning Stars as StelObjects,
// e.g. for searching, and for constellations. // e.g. for searching, and for constellations.
skipping to change at line 70 skipping to change at line 70
//! - AltAzi //! - AltAzi
//! - PlainText //! - PlainText
//! @param core the StelCore object //! @param core the StelCore object
//! @param flags a set of InfoStringGroup items to include in the return value. //! @param flags a set of InfoStringGroup items to include in the return value.
//! @return a QString containing an HMTL encoded description of the StarW rapperBase. //! @return a QString containing an HMTL encoded description of the StarW rapperBase.
//! is included in the return value. //! is included in the return value.
QString getInfoString(const StelCore *core, const InfoStringGroup& flags) const; QString getInfoString(const StelCore *core, const InfoStringGroup& flags) const;
virtual float getBV(void) const = 0; virtual float getBV(void) const = 0;
private: private:
int ref_count; int ref_count;
void retain(void) {assert(ref_count>=0);ref_count++;} void retain(void) {Q_ASSERT(ref_count>=0);ref_count++;}
void release(void) {assert(ref_count>0);if (--ref_count==0) delete this;} void release(void) {Q_ASSERT(ref_count>0);if (--ref_count==0) delete this
;}
}; };
template <class Star> template <class Star>
class StarWrapper : public StarWrapperBase { class StarWrapper : public StarWrapperBase {
protected: protected:
StarWrapper(const SpecialZoneArray<Star> *a, StarWrapper(const SpecialZoneArray<Star> *a,
const SpecialZoneData<Star> *z, const SpecialZoneData<Star> *z,
const Star *s) : a(a),z(z),s(s) {} const Star *s) : a(a),z(z),s(s) {}
Vec3d getObsJ2000Pos(const Navigator*) const { Vec3d getJ2000EquatorialPos(const StelNavigator*) const {
const double d2000 = 2451545.0; const double d2000 = 2451545.0;
return s->getJ2000Pos(z, return s->getJ2000Pos(z,
(M_PI/180)*(0.0001/3600) (M_PI/180)*(0.0001/3600)
* ((StarMgr::getCurrentJDay()-d2000)/365.25) * ((StarMgr::getCurrentJDay()-d2000)/365.25)
/ a->star_position_scale / a->star_position_scale
); );
} }
Vec3f getInfoColor(void) const {return StelApp::getInstance().getVisionMo Vec3f getInfoColor(void) const {return StelApp::getInstance().getVisionMo
deNight() ? Vec3f(0.8, 0.2, 0.2) : SkyDrawer::indexToColor(s->bV);} deNight() ? Vec3f(0.8, 0.2, 0.2) : StelSkyDrawer::indexToColor(s->bV);}
float getVMagnitude(const Navigator *nav) const float getVMagnitude(const StelNavigator *nav) const
{return 0.001f*a->mag_min + s->mag*(0.001f*a->mag_range)/a->mag_steps;} {return 0.001f*a->mag_min + s->mag*(0.001f*a->mag_range)/a->mag_steps;}
float getSelectPriority(const Navigator *nav) const float getSelectPriority(const StelNavigator *nav) const
{ {
return getVMagnitude(nav); return getVMagnitude(nav);
} }
float getBV(void) const {return s->getBV();} float getBV(void) const {return s->getBV();}
QString getEnglishName(void) const { QString getEnglishName(void) const {
return ""; return "";
} }
QString getNameI18n(void) const { QString getNameI18n(void) const {
return s->getNameI18n(); return s->getNameI18n();
} }
 End of changes. 6 change blocks. 
9 lines changed or deleted 10 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/