Merge lp:~alexwolf/stellarium/star-labels into lp:stellarium

Proposed by Alexander Wolf
Status: Merged
Merged at revision: 4906
Proposed branch: lp:~alexwolf/stellarium/star-labels
Merge into: lp:stellarium
Diff against target: 66 lines (+11/-2)
3 files modified
src/core/modules/Star.cpp (+6/-0)
src/core/modules/Star.hpp (+3/-0)
src/core/modules/ZoneArray.cpp (+2/-2)
To merge this branch: bzr merge lp:~alexwolf/stellarium/star-labels
Reviewer Review Type Date Requested Status
treaves Approve
Review via email: mp+65641@code.launchpad.net

Description of the change

Fix bug #515311 - displays name only for first component of multiple stars

To post a comment you must log in.
Revision history for this message
Alexander Wolf (alexwolf) wrote :

display only on the sky

Revision history for this message
treaves (treaves) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/core/modules/Star.cpp'
--- src/core/modules/Star.cpp 2010-04-15 12:28:34 +0000
+++ src/core/modules/Star.cpp 2011-06-23 11:31:50 +0000
@@ -41,6 +41,12 @@
41 return QString();41 return QString();
42}42}
4343
44int Star1::hasComponentID(void) const {
45 if (componentIds) {
46 return componentIds;
47 }
48 return 0;
49}
4450
45static51static
46int UnpackBits(bool fromBe,const char *addr,int bits_begin,52int UnpackBits(bool fromBe,const char *addr,int bits_begin,
4753
=== modified file 'src/core/modules/Star.hpp'
--- src/core/modules/Star.hpp 2010-04-15 12:28:34 +0000
+++ src/core/modules/Star.hpp 2011-06-23 11:31:50 +0000
@@ -75,6 +75,7 @@
75 float getBV(void) const {return IndexToBV(bV);}75 float getBV(void) const {return IndexToBV(bV);}
76 bool hasName() const {return hip;}76 bool hasName() const {return hip;}
77 QString getNameI18n(void) const;77 QString getNameI18n(void) const;
78 int hasComponentID(void) const;
78 void repack(bool fromBe);79 void repack(bool fromBe);
79 void print(void);80 void print(void);
80}81}
@@ -108,6 +109,7 @@
108 }109 }
109 float getBV(void) const {return IndexToBV(bV);}110 float getBV(void) const {return IndexToBV(bV);}
110 QString getNameI18n(void) const {return QString();}111 QString getNameI18n(void) const {return QString();}
112 int hasComponentID(void) const {return 0;}
111 bool hasName() const {return false;}113 bool hasName() const {return false;}
112 void repack(bool fromBe);114 void repack(bool fromBe);
113 void print(void);115 void print(void);
@@ -140,6 +142,7 @@
140 }142 }
141 float getBV(void) const {return IndexToBV(bV);}143 float getBV(void) const {return IndexToBV(bV);}
142 QString getNameI18n(void) const {return QString();}144 QString getNameI18n(void) const {return QString();}
145 int hasComponentID(void) const {return 0;}
143 bool hasName() const {return false;}146 bool hasName() const {return false;}
144 void repack(bool fromBe);147 void repack(bool fromBe);
145 void print(void);148 void print(void);
146149
=== modified file 'src/core/modules/ZoneArray.cpp'
--- src/core/modules/ZoneArray.cpp 2011-05-31 20:35:59 +0000
+++ src/core/modules/ZoneArray.cpp 2011-06-23 11:31:50 +0000
@@ -478,7 +478,7 @@
478{478{
479 StelSkyDrawer* drawer = core->getSkyDrawer();479 StelSkyDrawer* drawer = core->getSkyDrawer();
480 SpecialZoneData<Star> *const z = getZones() + index;480 SpecialZoneData<Star> *const z = getZones() + index;
481 Vec3f vf;481 Vec3f vf;
482 const Star *const end = z->getStars() + z->size;482 const Star *const end = z->getStars() + z->size;
483 static const double d2000 = 2451545.0;483 static const double d2000 = 2451545.0;
484 const double movementFactor = (M_PI/180)*(0.0001/3600) * ((core->getJDay()-d2000)/365.25) / star_position_scale;484 const double movementFactor = (M_PI/180)*(0.0001/3600) * ((core->getJDay()-d2000)/365.25) / star_position_scale;
@@ -489,7 +489,7 @@
489 if (*tmpRcmag<=0.f)489 if (*tmpRcmag<=0.f)
490 break;490 break;
491 s->getJ2000Pos(z,movementFactor, vf);491 s->getJ2000Pos(z,movementFactor, vf);
492 if (drawer->drawPointSource(sPainter, vf, tmpRcmag, s->bV, !is_inside) && s->hasName() && s->mag < maxMagStarName)492 if (drawer->drawPointSource(sPainter, vf, tmpRcmag, s->bV, !is_inside) && s->hasName() && s->mag < maxMagStarName && s->hasComponentID()<=1)
493 {493 {
494 const float offset = *tmpRcmag*0.7f;494 const float offset = *tmpRcmag*0.7f;
495 const Vec3f& colorr = (StelApp::getInstance().getVisionModeNight() ? Vec3f(0.8f, 0.2f, 0.2f) : StelSkyDrawer::indexToColor(s->bV))*0.75f;495 const Vec3f& colorr = (StelApp::getInstance().getVisionModeNight() ? Vec3f(0.8f, 0.2f, 0.2f) : StelSkyDrawer::indexToColor(s->bV))*0.75f;