GridLinesMgr.cpp   GridLinesMgr.cpp 
skipping to change at line 41 skipping to change at line 41
#include "StelSkyDrawer.hpp" #include "StelSkyDrawer.hpp"
#include "StelGui.hpp" #include "StelGui.hpp"
#include <set> #include <set>
#include <QSettings> #include <QSettings>
#include <QDebug> #include <QDebug>
#include <QFontMetrics> #include <QFontMetrics>
//! @class SkyGrid //! @class SkyGrid
//! Class which manages a grid to display in the sky. //! Class which manages a grid to display in the sky.
//! TODO needs support for DMS/DMS labelling, not only HMS/DMS
class SkyGrid class SkyGrid
{ {
public: public:
// Create and precompute positions of a SkyGrid // Create and precompute positions of a SkyGrid
SkyGrid(StelCore::FrameType frame); SkyGrid(StelCore::FrameType frame);
virtual ~SkyGrid(); virtual ~SkyGrid();
void draw(const StelCore* prj) const; void draw(const StelCore* prj) const;
void setFontSize(double newFontSize); void setFontSize(double newFontSize);
void setColor(const Vec3f& c) {color = c;} void setColor(const Vec3f& c) {color = c;}
const Vec3f& getColor() {return color;} const Vec3f& getColor() {return color;}
skipping to change at line 278 skipping to change at line 277
const double delta = d->raAngle<M_PI ? M_PI : -M_PI; const double delta = d->raAngle<M_PI ? M_PI : -M_PI;
if (std::fabs(lon-d->raAngle) < 1. || lon==0 . || d->raAngle==M_PI) if (std::fabs(lon-d->raAngle) < 1. || lon==0 . || d->raAngle==M_PI)
textAngle = d->raAngle; textAngle = d->raAngle;
else else
textAngle = d->raAngle+delta; textAngle = d->raAngle+delta;
if (d->raAngle+delta==0.) if (d->raAngle+delta==0.)
textAngle = M_PI; textAngle = M_PI;
if (withDecimalDegree) if (withDecimalDegree)
text = StelUtils::radToDecDegStr(tex tAngle,false,true); text = StelUtils::radToDecDegStr(tex tAngle);
else else
text = StelUtils::radToHmsStrAdapt(t extAngle); text = StelUtils::radToHmsStrAdapt(t extAngle);
} }
} }
} }
else else
text = d->text; text = d->text;
double angleDeg = std::atan2(-direc[1], -direc[0])*180./M_PI; double angleDeg = std::atan2(-direc[1], -direc[0])*180./M_PI;
float xshift=6.f; float xshift=6.f;
skipping to change at line 340 skipping to change at line 339
else else
{ {
const double closetResLon = (frameType==StelCore::FrameAltAz || frameType==StelCore::FrameGalactic) ? getClosestResolutionDMS(prj->getP ixelPerRadAtCenter()*std::cos(lat2)) : getClosestResolutionHMS(prj->getPixe lPerRadAtCenter()*std::cos(lat2)); const double closetResLon = (frameType==StelCore::FrameAltAz || frameType==StelCore::FrameGalactic) ? getClosestResolutionDMS(prj->getP ixelPerRadAtCenter()*std::cos(lat2)) : getClosestResolutionHMS(prj->getPixe lPerRadAtCenter()*std::cos(lat2));
gridStepMeridianRad = M_PI/180.* ((northPoleInViewport || so uthPoleInViewport) ? 15. : closetResLon); gridStepMeridianRad = M_PI/180.* ((northPoleInViewport || so uthPoleInViewport) ? 15. : closetResLon);
} }
// Get the bounding halfspace // Get the bounding halfspace
const SphericalCap& viewPortSphericalCap = prj->getBoundingCap(); const SphericalCap& viewPortSphericalCap = prj->getBoundingCap();
// Compute the first grid starting point. This point is close to the center of the screen // Compute the first grid starting point. This point is close to the center of the screen
// and lays at the intersection of a meridien and a parallel // and lies at the intersection of a meridian and a parallel
lon2 = gridStepMeridianRad*((int)(lon2/gridStepMeridianRad+0.5)); lon2 = gridStepMeridianRad*((int)(lon2/gridStepMeridianRad+0.5));
lat2 = gridStepParallelRad*((int)(lat2/gridStepParallelRad+0.5)); lat2 = gridStepParallelRad*((int)(lat2/gridStepParallelRad+0.5));
Vec3d firstPoint; Vec3d firstPoint;
StelUtils::spheToRect(lon2, lat2, firstPoint); StelUtils::spheToRect(lon2, lat2, firstPoint);
firstPoint.normalize(); firstPoint.normalize();
// Q_ASSERT(viewPortSphericalCap.contains(firstPoint)); // Q_ASSERT(viewPortSphericalCap.contains(firstPoint));
// Initialize a painter and set openGL state // Initialize a painter and set OpenGL state
StelPainter sPainter(prj); StelPainter sPainter(prj);
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
// OpenGL ES 2.0 doesn't have GL_LINE_SMOOTH
#ifdef GL_LINE_SMOOTH
if (QOpenGLContext::currentContext()->format().renderableType()==QSu
rfaceFormat::OpenGL)
glEnable(GL_LINE_SMOOTH);
#endif
Vec4f textColor(color[0], color[1], color[2], 0); Vec4f textColor(color[0], color[1], color[2], 0);
sPainter.setColor(color[0],color[1],color[2], fader.getInterstate()) ; sPainter.setColor(color[0],color[1],color[2], fader.getInterstate()) ;
textColor*=2; textColor*=2;
textColor[3]=fader.getInterstate(); textColor[3]=fader.getInterstate();
sPainter.setFont(font); sPainter.setFont(font);
ViewportEdgeIntersectCallbackData userData(&sPainter); ViewportEdgeIntersectCallbackData userData(&sPainter);
userData.textColor = textColor; userData.textColor = textColor;
userData.frameType = frameType; userData.frameType = frameType;
skipping to change at line 550 skipping to change at line 554
middlePoint*=-1.; middlePoint*=-1.;
middlePoint+=rotCenter; middlePoint+=rotCenter;
} }
sPainter.drawSmallCircleArc(p1, middlePoint, rotCent er, viewportEdgeIntersectCallback, &userData); sPainter.drawSmallCircleArc(p1, middlePoint, rotCent er, viewportEdgeIntersectCallback, &userData);
sPainter.drawSmallCircleArc(p2, middlePoint, rotCent er, viewportEdgeIntersectCallback, &userData); sPainter.drawSmallCircleArc(p2, middlePoint, rotCent er, viewportEdgeIntersectCallback, &userData);
fpt.transfo4d(rotLon); fpt.transfo4d(rotLon);
} }
} }
// OpenGL ES 2.0 doesn't have GL_LINE_SMOOTH
#ifdef GL_LINE_SMOOTH
if (QOpenGLContext::currentContext()->format().renderableType()==QSu
rfaceFormat::OpenGL)
glDisable(GL_LINE_SMOOTH);
#endif
} }
SkyLine::SkyLine(SKY_LINE_TYPE _line_type) : color(0.f, 0.f, 1.f) SkyLine::SkyLine(SKY_LINE_TYPE _line_type) : color(0.f, 0.f, 1.f)
{ {
// Font size is 14 // Font size is 14
font.setPixelSize(StelApp::getInstance().getBaseFontSize()+1); font.setPixelSize(StelApp::getInstance().getBaseFontSize()+1);
line_type = _line_type; line_type = _line_type;
updateLabel(); updateLabel();
} }
 End of changes. 6 change blocks. 
4 lines changed or deleted 15 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/