Constellation.cpp   Constellation.cpp 
skipping to change at line 29 skipping to change at line 29
*/ */
#include "StelProjector.hpp" #include "StelProjector.hpp"
#include "Constellation.hpp" #include "Constellation.hpp"
#include "StarMgr.hpp" #include "StarMgr.hpp"
#include "StelTexture.hpp" #include "StelTexture.hpp"
#include "StelPainter.hpp" #include "StelPainter.hpp"
#include "StelApp.hpp" #include "StelApp.hpp"
#include "StelCore.hpp" #include "StelCore.hpp"
#include "StelModuleMgr.hpp"
#include "ConstellationMgr.hpp"
#include <algorithm> #include <algorithm>
#include <QString> #include <QString>
#include <QTextStream> #include <QTextStream>
#include <QDebug> #include <QDebug>
#include <QFontMetrics> #include <QFontMetrics>
Vec3f Constellation::lineColor = Vec3f(0.4,0.4,0.8); Vec3f Constellation::lineColor = Vec3f(0.4,0.4,0.8);
Vec3f Constellation::labelColor = Vec3f(0.4,0.4,0.8); Vec3f Constellation::labelColor = Vec3f(0.4,0.4,0.8);
Vec3f Constellation::boundaryColor = Vec3f(0.8,0.3,0.3); Vec3f Constellation::boundaryColor = Vec3f(0.8,0.3,0.3);
skipping to change at line 68 skipping to change at line 70
abbreviation.clear(); abbreviation.clear();
numberOfSegments = 0; numberOfSegments = 0;
QString buf(record); QString buf(record);
QTextStream istr(&buf, QIODevice::ReadOnly); QTextStream istr(&buf, QIODevice::ReadOnly);
QString abb; QString abb;
istr >> abb >> numberOfSegments; istr >> abb >> numberOfSegments;
if (istr.status()!=QTextStream::Ok) if (istr.status()!=QTextStream::Ok)
return false; return false;
abbreviation = abb.toUpper(); // It's better to allow mixed-case abbreviations now that they can b
e displayed on screen. We then need toUpper() in comparisons.
//abbreviation = abb.toUpper();
abbreviation=abb;
asterism = new StelObjectP[numberOfSegments*2]; asterism = new StelObjectP[numberOfSegments*2];
for (unsigned int i=0;i<numberOfSegments*2;++i) for (unsigned int i=0;i<numberOfSegments*2;++i)
{ {
HP = 0; HP = 0;
istr >> HP; istr >> HP;
if(HP == 0) if(HP == 0)
{ {
// TODO: why is this delete commented? // TODO: why is this delete commented?
// delete[] asterism; // delete[] asterism;
skipping to change at line 124 skipping to change at line 128
{ {
star1=asterism[2*i]->getJ2000EquatorialPos(core); star1=asterism[2*i]->getJ2000EquatorialPos(core);
star2=asterism[2*i+1]->getJ2000EquatorialPos(core); star2=asterism[2*i+1]->getJ2000EquatorialPos(core);
star1.normalize(); star1.normalize();
star2.normalize(); star2.normalize();
sPainter.drawGreatCircleArc(star1, star2, &viewportH alfspace); sPainter.drawGreatCircleArc(star1, star2, &viewportH alfspace);
} }
} }
} }
void Constellation::drawName(StelPainter& sPainter) const void Constellation::drawName(StelPainter& sPainter, ConstellationMgr::Const ellationDisplayStyle style) const
{ {
if (!nameFader.getInterstate()) if (!nameFader.getInterstate())
return; return;
if (checkVisibility()) if (checkVisibility())
{ {
QString name;
switch (style)
{
case ConstellationMgr::constellationsTranslated:
name=nameI18;
break;
case ConstellationMgr::constellationsNative:
name=nativeName;
break;
case ConstellationMgr::constellationsEnglish:
name=englishName;
break;
case ConstellationMgr::constellationsAbbreviated:
name=(abbreviation.startsWith('.') ? "" : ab
breviation);
break;
Q_ASSERT(0);
}
sPainter.setColor(labelColor[0], labelColor[1], labelColor[2 ], nameFader.getInterstate()); sPainter.setColor(labelColor[0], labelColor[1], labelColor[2 ], nameFader.getInterstate());
sPainter.drawText(XYname[0], XYname[1], nameI18, 0., -sPaint er.getFontMetrics().width(nameI18)/2, 0, false); sPainter.drawText(XYname[0], XYname[1], name, 0., -sPainter. getFontMetrics().width(name)/2, 0, false);
} }
} }
void Constellation::drawArtOptim(StelPainter& sPainter, const SphericalRegi on& region) const void Constellation::drawArtOptim(StelPainter& sPainter, const SphericalRegi on& region) const
{ {
if (checkVisibility()) if (checkVisibility())
{ {
const float intensity = artFader.getInterstate(); const float intensity = artFader.getInterstate();
if (artTexture && intensity && region.intersects(boundingCap )) if (artTexture && intensity && region.intersects(boundingCap ))
{ {
 End of changes. 5 change blocks. 
3 lines changed or deleted 27 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/