~ubuntu-branches/debian/sid/stellarium/sid

« back to all changes in this revision

Viewing changes to src/core/modules/GridLinesMgr.cpp

  • Committer: Package Import Robot
  • Author(s): Tomasz Buchert
  • Date: 2015-01-20 19:20:13 UTC
  • mfrom: (1.2.17)
  • Revision ID: package-import@ubuntu.com-20150120192013-n9d3rxliaam647ay
Tags: 0.13.2-1
ImportedĀ UpstreamĀ versionĀ 0.13.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
 
39
39
//! @class SkyGrid
40
40
//! Class which manages a grid to display in the sky.
41
 
//! TODO needs support for DMS/DMS labelling, not only HMS/DMS
42
41
class SkyGrid
43
42
{
44
43
public:
276
275
                                        textAngle = M_PI;
277
276
 
278
277
                                if (withDecimalDegree)
279
 
                                        text = StelUtils::radToDecDegStr(textAngle,false,true);
 
278
                                        text = StelUtils::radToDecDegStr(textAngle);
280
279
                                else
281
280
                                        text = StelUtils::radToHmsStrAdapt(textAngle);
282
281
                        }
338
337
        const SphericalCap& viewPortSphericalCap = prj->getBoundingCap();
339
338
 
340
339
        // Compute the first grid starting point. This point is close to the center of the screen
341
 
        // and lays at the intersection of a meridien and a parallel
 
340
        // and lies at the intersection of a meridian and a parallel
342
341
        lon2 = gridStepMeridianRad*((int)(lon2/gridStepMeridianRad+0.5));
343
342
        lat2 = gridStepParallelRad*((int)(lat2/gridStepParallelRad+0.5));
344
343
        Vec3d firstPoint;
347
346
 
348
347
        // Q_ASSERT(viewPortSphericalCap.contains(firstPoint));
349
348
 
350
 
        // Initialize a painter and set openGL state
 
349
        // Initialize a painter and set OpenGL state
351
350
        StelPainter sPainter(prj);
352
351
        glEnable(GL_BLEND);
353
352
        glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // Normal transparency mode
 
353
        // OpenGL ES 2.0 doesn't have GL_LINE_SMOOTH
 
354
        #ifdef GL_LINE_SMOOTH
 
355
        if (QOpenGLContext::currentContext()->format().renderableType()==QSurfaceFormat::OpenGL)
 
356
                glEnable(GL_LINE_SMOOTH);
 
357
        #endif
354
358
        Vec4f textColor(color[0], color[1], color[2], 0);
355
359
        sPainter.setColor(color[0],color[1],color[2], fader.getInterstate());
356
360
 
548
552
                        fpt.transfo4d(rotLon);
549
553
                }
550
554
        }
 
555
        // OpenGL ES 2.0 doesn't have GL_LINE_SMOOTH
 
556
        #ifdef GL_LINE_SMOOTH
 
557
        if (QOpenGLContext::currentContext()->format().renderableType()==QSurfaceFormat::OpenGL)
 
558
                glDisable(GL_LINE_SMOOTH);
 
559
        #endif
551
560
}
552
561
 
553
562