10
10
* modify it under the terms of the GNU General Public License
11
11
* as published by the Free Software Foundation; either version 2
12
12
* of the License, or (at your option) any later version.
14
14
* This program is distributed in the hope that it will be useful,
15
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
17
* GNU General Public License for more details.
19
19
* You should have received a copy of the GNU General Public License
20
20
* along with this program; if not, write to the Free Software
21
21
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
38
38
template<typename T> inline bool isInf(T value)
40
40
return std::numeric_limits<T>::has_infinity && value == std::numeric_limits<T>::infinity();
43
43
namespace BigStarCatalogExtension {
45
45
QString StarWrapperBase::getInfoString(const StelCore *core, const InfoStringGroup& flags) const
47
47
const StelNavigator* nav = core->getNavigator();
51
51
if (flags&Magnitude)
52
52
oss << q_("Magnitude: <b>%1</b> (B-V: %2)").arg(QString::number(getVMagnitude(nav), 'f', 2), QString::number(getBV(), 'f', 2)) << "<br>";
54
54
oss << getPositionInfoString(core, flags);
56
56
StelObject::postProcessInfoString(str, flags);
104
104
if ((flags&Name) || (flags&CatalogNumber))
108
108
if (flags&Magnitude)
109
109
oss << q_("Magnitude: <b>%1</b> (B-V: %2)").arg(QString::number(getVMagnitude(nav), 'f', 2),
110
QString::number(s->getBV(), 'f', 2)) << "<br>";
110
QString::number(s->getBV(), 'f', 2)) << "<br>";
112
112
if ((flags&AbsoluteMagnitude) && s->plx && !isNan(s->plx) && !isInf(s->plx))
113
113
oss << q_("Absolute Magnitude: %1").arg(getVMagnitude(nav)+5.*(1.+std::log10(0.00001*s->plx)), 0, 'f', 2) << "<br>";
115
115
oss << getPositionInfoString(core, flags);
117
117
if (s->spInt && flags&Extra1)
119
119
oss << q_("Spectral Type: %1").arg(StarMgr::convertToSpectralType(s->spInt)) << "<br>";
122
122
if ((flags&Distance) && s->plx && !isNan(s->plx) && !isInf(s->plx))
123
123
oss << q_("Distance: %1 Light Years").arg((AU/(SPEED_OF_LIGHT*86400*365.25)) / (s->plx*((0.00001/3600)*(M_PI/180))), 0, 'f', 2) << "<br>";
125
125
if (s->plx && flags&Extra2)
126
126
oss << q_("Parallax: %1\"").arg(0.00001*s->plx, 0, 'f', 5) << "<br>";
128
128
StelObject::postProcessInfoString(str, flags);
133
133
StelObjectP Star1::createStelObject(const SpecialZoneArray<Star1> *a,
134
const SpecialZoneData<Star1> *z) const {
135
return StelObjectP(new StarWrapper1(a,z,this));
134
const SpecialZoneData<Star1> *z) const {
135
return StelObjectP(new StarWrapper1(a,z,this), true);
138
138
StelObjectP Star2::createStelObject(const SpecialZoneArray<Star2> *a,
139
const SpecialZoneData<Star2> *z) const {
140
return StelObjectP(new StarWrapper2(a,z,this));
139
const SpecialZoneData<Star2> *z) const {
140
return StelObjectP(new StarWrapper2(a,z,this), true);
143
143
StelObjectP Star3::createStelObject(const SpecialZoneArray<Star3> *a,
144
const SpecialZoneData<Star3> *z) const {
145
return StelObjectP(new StarWrapper3(a,z,this));
144
const SpecialZoneData<Star3> *z) const {
145
return StelObjectP(new StarWrapper3(a,z,this), true);