~ubuntu-branches/debian/squeeze/stellarium/squeeze

« back to all changes in this revision

Viewing changes to src/modules/StarWrapper.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Fathi Boudra
  • Date: 2010-04-24 10:44:18 UTC
  • mfrom: (1.2.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20100424104418-oqxpb613s3s1jhtv
Tags: 0.10.4-0.1
* Non-maintainer upload - acked by the maintainer
* New upstream release (Closes: #570005, #577985)
* Switch to dpkg-source 3.0 (quilt) format
* Add 01_fix_pow10_function_check.diff:
  pow10 function check fails as we don't link against math library
* Add 02_remove_unknown_locale_code.diff:
  remove nan locale code, it is unknown
* Bump debian/compat from 5 to 7
* Update debian/control:
  - bump debhelper build dependency to 7.4.15 for dh usage
  - cleanup build dependencies (keep libqt4*-dev and add zlib1g-dev)
  - add versioned build dependencies to cmake (>= 2.6.0)
  - add versioned build dependencies to libqt4-dev (>= 4.6.0)
    (Closes: #578890)
  - bump Standards-Version to 3.8.0 to 3.8.4 (no changes needed)
  - relax dependency relation between stellarium and stellarium-data
    (Closes: #482889)
  - add missing ${misc:Depends} to stellarium-data, lintian warning--
  - remove stellarium (<< 0.6.2-1) Replaces, it's not needed anymore
  - cleanup stellarium-data description, lintian warning--
* Update debian/copyright:
  - cleanup layout
  - update copyright information
* Update debian/rules:
  - convert to dh usage
  - enable parallel build (pass --parallel option to dh)
  - list missing files (pass --list-missing option to dh)
* Update debian/stellarium.desktop (Closes: #530315):
  - remove encoding key, deprecated
  - add missing list separator to categories key
* Add debian/watch file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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.
13
 
 * 
 
13
 *
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.
18
 
 * 
 
18
 *
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)
39
39
{
40
40
        return std::numeric_limits<T>::has_infinity && value == std::numeric_limits<T>::infinity();
41
 
 
41
}
42
42
 
43
43
namespace BigStarCatalogExtension {
44
 
        
 
44
 
45
45
QString StarWrapperBase::getInfoString(const StelCore *core, const InfoStringGroup& flags) const
46
46
{
47
47
        const StelNavigator* nav = core->getNavigator();
50
50
 
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>";
53
 
        
 
53
 
54
54
        oss << getPositionInfoString(core, flags);
55
 
        
 
55
 
56
56
        StelObject::postProcessInfoString(str, flags);
57
57
 
58
58
        return str;
70
70
{
71
71
        QString str;
72
72
        const StelNavigator* nav = core->getNavigator();
73
 
        
 
73
 
74
74
        QTextStream oss(&str);
75
75
        if (s->hip)
76
76
        {
104
104
                if ((flags&Name) || (flags&CatalogNumber))
105
105
                        oss << "</h2>";
106
106
        }
107
 
        
 
107
 
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>";
111
 
        
 
110
                                                                                                                QString::number(s->getBV(), 'f', 2)) << "<br>";
 
111
 
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>";
114
 
        
 
114
 
115
115
        oss << getPositionInfoString(core, flags);
116
 
        
 
116
 
117
117
        if (s->spInt && flags&Extra1)
118
118
        {
119
119
                oss << q_("Spectral Type: %1").arg(StarMgr::convertToSpectralType(s->spInt)) << "<br>";
121
121
 
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>";
124
 
        
 
124
 
125
125
        if (s->plx && flags&Extra2)
126
126
                oss << q_("Parallax: %1\"").arg(0.00001*s->plx, 0, 'f', 5) << "<br>";
127
 
        
 
127
 
128
128
        StelObject::postProcessInfoString(str, flags);
129
129
 
130
130
        return str;
131
131
}
132
132
 
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);
136
136
}
137
137
 
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);
141
141
}
142
142
 
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);
146
146
}
147
147
 
148
148