Constellation.cpp   Constellation.cpp 
skipping to change at line 30 skipping to change at line 30
#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 "StelModuleMgr.hpp"
#include "StelTranslator.hpp"
#include "ConstellationMgr.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);
bool Constellation::singleSelected = false; bool Constellation::singleSelected = false;
bool Constellation::seasonalRuleEnabled = false; bool Constellation::seasonalRuleEnabled = false;
float Constellation::artIntensityFovScale = 1.0f;
Constellation::Constellation() Constellation::Constellation()
: numberOfSegments(0) : numberOfSegments(0)
, beginSeason(0) , beginSeason(0)
, endSeason(0) , endSeason(0)
, asterism(NULL) , asterism(NULL)
{ {
} }
Constellation::~Constellation() Constellation::~Constellation()
skipping to change at line 152 skipping to change at line 154
break; break;
case ConstellationMgr::constellationsNative: case ConstellationMgr::constellationsNative:
name=nativeName; name=nativeName;
break; break;
case ConstellationMgr::constellationsEnglish: case ConstellationMgr::constellationsEnglish:
name=englishName; name=englishName;
break; break;
case ConstellationMgr::constellationsAbbreviated: case ConstellationMgr::constellationsAbbreviated:
name=(abbreviation.startsWith('.') ? "" : ab breviation); name=(abbreviation.startsWith('.') ? "" : ab breviation);
break; 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], name, 0., -sPainter. getFontMetrics().width(name)/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() * artIntens
if (artTexture && intensity && region.intersects(boundingCap ityFovScale;
)) if (artTexture && intensity > 0.0f && region.intersects(boun
dingCap))
{ {
sPainter.setColor(intensity,intensity,intensity); sPainter.setColor(intensity,intensity,intensity);
// The texture is not fully loaded // The texture is not fully loaded
if (artTexture->bind()==false) if (artTexture->bind()==false)
return; return;
sPainter.drawStelVertexArray(artPolygon); sPainter.drawStelVertexArray(artPolygon);
} }
} }
skipping to change at line 280 skipping to change at line 281
else else
{ {
// ...oops, it's a "inverted" season rule // ...oops, it's a "inverted" season rule
if (((month>=1) && (month<=endSeason)) || ((month>=beginSeas on) && (month<=12))) if (((month>=1) && (month<=endSeason)) || ((month>=beginSeas on) && (month<=12)))
visible = true; visible = true;
} }
return visible; return visible;
} }
QString Constellation::getInfoString(const StelCore *core, const InfoString
Group &flags) const
{
Q_UNUSED(core);
QString str;
QTextStream oss(&str);
if (flags&Name)
{
oss << "<h2>" << getNameI18n();
if (!getShortName().isEmpty())
oss << " (" << getShortName() << ")";
oss << "</h2>";
}
if (flags&ObjectType)
oss << q_("Type: <b>%1</b>").arg(q_("constellation")) << "<b
r />";
postProcessInfoString(str, flags);
return str;
}
StelObjectP Constellation::getBrightestStarInConstellation(void) const StelObjectP Constellation::getBrightestStarInConstellation(void) const
{ {
float maxMag = 99.f; float maxMag = 99.f;
StelObjectP brightest; StelObjectP brightest;
// maybe the brightest star has always odd index, // maybe the brightest star has always odd index,
// so check all segment endpoints: // so check all segment endpoints:
for (int i=2*numberOfSegments-1;i>=0;i--) for (int i=2*numberOfSegments-1;i>=0;i--)
{ {
const float Mag = asterism[i]->getVMagnitude(0); const float Mag = asterism[i]->getVMagnitude(0);
if (Mag < maxMag) if (Mag < maxMag)
 End of changes. 5 change blocks. 
4 lines changed or deleted 30 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/