Constellation.cpp   Constellation.cpp 
skipping to change at line 31 skipping to change at line 31
#include <QString> #include <QString>
#include <QTextStream> #include <QTextStream>
#include <QDebug> #include <QDebug>
#include "StelProjector.hpp" #include "StelProjector.hpp"
#include "Constellation.hpp" #include "Constellation.hpp"
#include "StarMgr.hpp" #include "StarMgr.hpp"
#include "StelNavigator.hpp" #include "StelNavigator.hpp"
#include "StelTexture.hpp" #include "StelTexture.hpp"
#include "StelFont.hpp" #include "StelFont.hpp"
#include "StelPainter.hpp" #include "StelPainter.hpp"
#include "StelApp.hpp"
#include "StelCore.hpp"
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;
Constellation::Constellation() : asterism(NULL) Constellation::Constellation() : asterism(NULL)
{ {
} }
skipping to change at line 88 skipping to change at line 90
qWarning() << "Error in Constellation " << abbreviat ion << " asterism : can't find star HP= " << HP; qWarning() << "Error in Constellation " << abbreviat ion << " asterism : can't find star HP= " << HP;
// TODO: why is this delete commented? // TODO: why is this delete commented?
// delete[] asterism; // delete[] asterism;
return false; return false;
} }
} }
XYZname.set(0.,0.,0.); XYZname.set(0.,0.,0.);
for(unsigned int ii=0;ii<numberOfSegments*2;++ii) for(unsigned int ii=0;ii<numberOfSegments*2;++ii)
{ {
XYZname+= asterism[ii]->getJ2000EquatorialPos(0); XYZname+= asterism[ii]->getJ2000EquatorialPos(StelApp::getIn stance().getCore()->getNavigator());
} }
XYZname*=1./(numberOfSegments*2); XYZname*=1./(numberOfSegments*2);
return true; return true;
} }
void Constellation::drawOptim(const StelProjectorP& prj) const void Constellation::drawOptim(const StelPainter& sPainter, const StelNaviga tor* nav) const
{ {
if(!lineFader.getInterstate()) return; if(!lineFader.getInterstate()) return;
glDisable(GL_TEXTURE_2D); glDisable(GL_TEXTURE_2D);
glEnable(GL_BLEND); glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // Normal transpa rency mode glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // Normal transpa rency mode
glColor4f(lineColor[0], lineColor[1], lineColor[2], lineFader.getInt erstate()); glColor4f(lineColor[0], lineColor[1], lineColor[2], lineFader.getInt erstate());
Vec3d star1; Vec3d star1;
Vec3d star2; Vec3d star2;
Vec3d dummy;
Vec3d v;
const StelGeom::HalfSpace viewportHalfspace = sPainter.getProjector(
)->getBoundingHalfSpace();
for (unsigned int i=0;i<numberOfSegments;++i) for (unsigned int i=0;i<numberOfSegments;++i)
{ {
if (prj->projectLineCheck(asterism[2*i]->getJ2000EquatorialP star1=asterism[2*i]->getJ2000EquatorialPos(nav);
os(0),star1,asterism[2*i+1]->getJ2000EquatorialPos(0),star2)) star2=asterism[2*i+1]->getJ2000EquatorialPos(nav);
{ v = star1^star2;
glBegin(GL_LINES); v.normalize();
glVertex2f(star1[0],star1[1]); if (viewportHalfspace.d<0. || StelGeom::planeIntersect2(view
glVertex2f(star2[0],star2[1]); portHalfspace, StelGeom::HalfSpace(v), dummy, dummy)!=false)
glEnd(); if (viewportHalfspace.contains(star1) || viewportHal
} fspace.contains(star2))
sPainter.drawSmallCircleArc(star1, star2, Ve
c3d(0));
} }
} }
void Constellation::drawName(StelFont *constfont, const StelPainter& sPaint er) const void Constellation::drawName(StelFont *constfont, const StelPainter& sPaint er) const
{ {
if(!nameFader.getInterstate()) if(!nameFader.getInterstate())
return; return;
glColor4f(labelColor[0], labelColor[1], labelColor[2], nameFader.get Interstate()); glColor4f(labelColor[0], labelColor[1], labelColor[2], nameFader.get Interstate());
sPainter.drawText(constfont, XYname[0], XYname[1], nameI18, 0., -con stfont->getStrLen(nameI18)/2, 0, false); sPainter.drawText(constfont, XYname[0], XYname[1], nameI18, 0., -con stfont->getStrLen(nameI18)/2, 0, false);
} }
 End of changes. 5 change blocks. 
10 lines changed or deleted 18 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/