Commit 2c04b219 authored by Ian Humphrey's avatar Ian Humphrey
Browse files

Updated pens for the grid, controlpoints, and footprint outlines in qmos. Qt5...

Updated pens for the grid, controlpoints, and footprint outlines in qmos. Qt5 changed the defaults for QPen so that they are no longer cosmetic (always 1 pixel wide on screen) by default.

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/branches/v006LibrariesV2@6729 41f8697f-d340-4b68-9986-7bafba869bb8
parent 5dc70dc0
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -44,16 +44,17 @@ namespace Isis {

    m_origPoint = new QPointF(apriori);

    // Providing a width of 0 makes pens cosmetic (i.e. always appear as 1 pixel on screen)
    if(cp->IsIgnored())
      setPen(QPen(Qt::red));
      setPen(QPen(Qt::red, 0.0));
    else if(cp->IsEditLocked())
      setPen(QPen(Qt::magenta));
      setPen(QPen(Qt::magenta, 0.0));
    else if(cp->GetType() == ControlPoint::Fixed)
      setPen(QPen(Qt::green));
      setPen(QPen(Qt::green, 0.0));
    else if(cp->GetType() == ControlPoint::Constrained)
      setPen(QPen(Qt::darkGreen));
      setPen(QPen(Qt::darkGreen, 0.0));
    else // Free
      setPen(QPen(Qt::blue));
      setPen(QPen(Qt::blue, 0.0));

    setBrush(Qt::NoBrush);

+6 −5
Original line number Diff line number Diff line
@@ -19,11 +19,9 @@ namespace Isis {
   * @author 2011-05-07 Steven Lambright
   *
   * @internal
   *   @history 2011-05-09 Steven Lambright - Fixed known issue with paint()
   *                       when zoomed in.
   *   @history 2011-05-10 Steven Lambright - Added arrow capabilities, fixed
   *                       problem with boundingRect() that seemed to cause a
   *                       crash.
   *   @history 2011-05-09 Steven Lambright - Fixed known issue with paint() when zoomed in.
   *   @history 2011-05-10 Steven Lambright - Added arrow capabilities, fixed problem with 
   *                           boundingRect() that seemed to cause a crash.
   *   @history 2011-06-07 Debbie A. Cook and Tracie Sucharski - Modified point types
   *                           Ground ------> Fixed
   *                           Tie----------> Free
@@ -31,6 +29,9 @@ namespace Isis {
   *                           options. The design of this configuration is wrong/needs fixed, but
   *                           I'm leaving it alone due to time constraints. Updated paint() method
   *                           to appropriately apply colors. Fixes #479.
   *   @history 2016-05-18 Ian Humphrey - Updated the control point crosses to be cosmetic so that
   *                           they always appear on screen (Qt4 to Qt5).
   *                   
   */
  class ControlPointGraphicsItem : public QGraphicsRectItem {
    public:
+14 −0
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@

#include <QDebug>
#include <QGraphicsScene>
#include <QPen>

#include "Angle.h"
#include "Distance.h"
@@ -193,7 +194,13 @@ namespace Isis {

                if(havePrevious) {
                  if(previousX != x || previousY != y) {
                    QGraphicsLineItem* latLine = 
                        new QGraphicsLineItem(QLineF(previousX, previousY, x, y), this);
                    // Ensure the line is cosmetic
                    // (i.e. the line width is always 1 pixel wide on screen)
                    QPen pen;
                    pen.setCosmetic(true);
                    latLine->setPen(pen);
                  }
                }
              }
@@ -249,6 +256,7 @@ namespace Isis {
          atMaxLat = false;
          atMaxLon = false;

          // Create the longitude grid lines
          for (Longitude lon = minLon; lon != maxLon + lonInc; lon += lonInc) {

            if (lon > endLon && lon < maxLon) {
@@ -279,7 +287,13 @@ namespace Isis {
                  y = -1 * proj->YCoord();

                  if(previousX != x || previousY != y) {
                    QGraphicsLineItem* lonLine = 
                        new QGraphicsLineItem(QLineF(previousX, previousY, x, y), this);
                    // Ensure the line is cosmetic 
                    // (i.e. the line width is always 1 pixel wide on screen)
                    QPen pen;
                    pen.setCosmetic(true);
                    lonLine->setPen(pen);
                  }
                }
              }
+2 −0
Original line number Diff line number Diff line
@@ -34,6 +34,8 @@ namespace Isis {
   *   @history 2013-03-06 Steven Lambright - Added support for getting target radii from the
   *                           TargetName mapping keyword if the target radii keywords are missing.
   *                           References #1534.
   *   @history 2016-05-18 Ian Humphrey - Made the latitude and longitude lines explicitly cosmetic
   *                           so they always appear as 1 pixel wide on screen (Qt4 to Qt5).
   */
  class GridGraphicsItem : public QGraphicsItem {
    public:
+4 −0
Original line number Diff line number Diff line
@@ -189,6 +189,10 @@ namespace Isis {

              m_box = new QGraphicsPolygonItem(boxPoly);
              m_box->setZValue(DBL_MAX);
              // Ensure lines are cosmetic (i.e. always 1 pixel on screen)
              QPen pen;
              pen.setCosmetic(true);
              m_box->setPen(pen);

              getWidget()->getScene()->addItem(m_box);
              getWidget()->getView()->centerOn(scenePos);
Loading