StarWrapper.hpp   StarWrapper.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 _STARWRAPPER_HPP_ #ifndef _STARWRAPPER_HPP_
#define _STARWRAPPER_HPP_ #define _STARWRAPPER_HPP_
#include <QString>
#include "StelObject.hpp" #include "StelObject.hpp"
#include "StelApp.hpp" #include "StelApp.hpp"
#include "StelCore.hpp" #include "StelCore.hpp"
#include "StarMgr.hpp" #include "StarMgr.hpp"
#include "Star.hpp" #include "Star.hpp"
#include "StelSkyDrawer.hpp" #include "StelSkyDrawer.hpp"
namespace BigStarCatalogExtension { #include <QString>
template <class Star> class SpecialZoneArray; template <class Star> class SpecialZoneArray;
template <class Star> struct SpecialZoneData; template <class Star> struct SpecialZoneData;
//! @class StarWrapperBase //! @class StarWrapperBase
//! 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 , e.g. for searching, and for constellations. //! Therefore the StarWrapper is needed when returning Stars as StelObjects , e.g. for searching, and for constellations.
//! The StarWrapper is destroyed when it is not needed anymore, by utilizin g reference counting. //! The StarWrapper is destroyed when it is not needed anymore, by utilizin g reference counting.
//! So there is no chance that more than a few hundreds of StarWrappers are alive simultanousely. //! So there is no chance that more than a few hundreds of StarWrappers are alive simultanousely.
skipping to change at line 85 skipping to change at line 84
const Star *s) : a(a), z(z), s(s) {;} const Star *s) : a(a), z(z), s(s) {;}
Vec3d getJ2000EquatorialPos(const StelCore* core) const Vec3d getJ2000EquatorialPos(const StelCore* core) const
{ {
static const double d2000 = 2451545.0; static const double d2000 = 2451545.0;
Vec3f v; Vec3f v;
s->getJ2000Pos(z, (M_PI/180.)*(0.0001/3600.) * ((core->getJD ay()-d2000)/365.25) / a->star_position_scale, v); s->getJ2000Pos(z, (M_PI/180.)*(0.0001/3600.) * ((core->getJD ay()-d2000)/365.25) / a->star_position_scale, v);
return Vec3d(v[0], v[1], v[2]); return Vec3d(v[0], v[1], v[2]);
} }
Vec3f getInfoColor(void) const Vec3f getInfoColor(void) const
{ {
return StelApp::getInstance().getVisionModeNight() ? Vec3f(0 .8, 0.0, 0.0) : StelSkyDrawer::indexToColor(s->bV); return StelSkyDrawer::indexToColor(s->bV);
} }
float getVMagnitude(const StelCore* core, bool withExtinction=false) const float getVMagnitude(const StelCore* core) const
{ {
float extinctionMag=0.0; // track magnitude loss Q_UNUSED(core);
if (withExtinction && core->getSkyDrawer()->getFlagHasAtmosphere return 0.001f*a->mag_min + s->mag*(0.001f*a->mag_range)/a->m
()) ag_steps;
{
double alt=getAltAzPosApparent(core)[2];
core->getSkyDrawer()->getExtinction().forward(&alt, &extinct
ionMag);
}
return 0.001f*a->mag_min + s->mag*(0.001f*a->mag_range)/a->m
ag_steps + extinctionMag;
} }
float getSelectPriority(const StelCore* core) const {return getVMagn itude(core, false);}
float getBV(void) const {return s->getBV();} float getBV(void) const {return s->getBV();}
QString getEnglishName(void) const {return QString();} QString getEnglishName(void) const {return QString();}
QString getNameI18n(void) const {return s->getNameI18n();} QString getNameI18n(void) const {return s->getNameI18n();}
virtual double getAngularSize(const StelCore*) const {return 0.;} virtual double getAngularSize(const StelCore*) const {return 0.;}
protected: protected:
const SpecialZoneArray<Star> *const a; const SpecialZoneArray<Star> *const a;
const SpecialZoneData<Star> *const z; const SpecialZoneData<Star> *const z;
const Star *const s; const Star *const s;
}; };
skipping to change at line 123 skipping to change at line 115
const SpecialZoneData<Star1> *z, const SpecialZoneData<Star1> *z,
const Star1 *s) : StarWrapper<Star1>(a,z,s) {;} const Star1 *s) : StarWrapper<Star1>(a,z,s) {;}
//! StarWrapper1 supports the following InfoStringGroup flags: <ul> //! StarWrapper1 supports the following InfoStringGroup flags: <ul>
//! <li> Name //! <li> Name
//! <li> CatalogNumber //! <li> CatalogNumber
//! <li> Magnitude //! <li> Magnitude
//! <li> RaDecJ2000 //! <li> RaDecJ2000
//! <li> RaDec //! <li> RaDec
//! <li> AltAzi //! <li> AltAzi
//! <li> Extra1 (spectral type) //! <li> Extra (spectral type, parallax)
//! <li> Distance //! <li> Distance
//! <li> Extra2 (parallax)
//! <li> PlainText </ul> //! <li> PlainText </ul>
//! @param core the StelCore object. //! @param core the StelCore object.
//! @param flags a set of InfoStringGroup items to include in the re turn value. //! @param flags a set of InfoStringGroup items to include in the re turn value.
//! @return a QString containing an HMTL encoded description of the StarWrapper1. //! @return a QString containing an HMTL encoded description of the StarWrapper1.
QString getInfoString(const StelCore *core, const InfoStringGroup& f lags) const; QString getInfoString(const StelCore *core, const InfoStringGroup& f lags) const;
QString getEnglishName(void) const; QString getEnglishName(void) const;
}; };
class StarWrapper2 : public StarWrapper<Star2> class StarWrapper2 : public StarWrapper<Star2>
{ {
skipping to change at line 150 skipping to change at line 141
}; };
class StarWrapper3 : public StarWrapper<Star3> class StarWrapper3 : public StarWrapper<Star3>
{ {
public: public:
StarWrapper3(const SpecialZoneArray<Star3> *a, StarWrapper3(const SpecialZoneArray<Star3> *a,
const SpecialZoneData<Star3> *z, const SpecialZoneData<Star3> *z,
const Star3 *s) : StarWrapper<Star3>(a,z,s) {;} const Star3 *s) : StarWrapper<Star3>(a,z,s) {;}
}; };
} // namespace BigStarCatalogExtension
#endif // _STARWRAPPER_HPP_ #endif // _STARWRAPPER_HPP_
 End of changes. 9 change blocks. 
20 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/