Commit bb870273 authored by Tracie Sucharski's avatar Tracie Sucharski
Browse files

Added radius source combo to the NewControlPointDialog. References #5504.

parent 95907819
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -415,7 +415,7 @@ namespace Isis {
          painter->drawLine(x, y - 5, x, y + 5);
        }
        // If this point is the current edit point in ControlPointEditView
        else if (currentEditPoint != NULL && &p == currentEditPoint) {
        else if (currentEditPoint != NULL && p.GetId() == currentEditPoint->GetId()) {
          //  Draw circle, then crosshair inside circle
          QPainterPath path;
          path.addEllipse(QPointF(x,y), 5., 5.);
+15 −0
Original line number Diff line number Diff line
@@ -1459,6 +1459,21 @@ namespace Isis {
        m_serialNumberList, m_lastUsedPointId, this, true, true, true);
    newPointDialog->setFiles(pointFiles);
    newPointDialog->setGroundSource(m_projectShapeNames, m_numberProjectShapesWithPoint);

    //  Load imported project shapes that are Dems and contain point location into the radius combo.
    if (m_projectShapeNames.count() > 0) {
      QStringList radiusSourceFiles;
      for (int i=0; i<m_numberProjectShapesWithPoint; i++) {
        Shape *shape = m_nameToShapeMap[m_projectShapeNames.at(i)];
        if (shape->radiusSource() == ControlPoint::RadiusSource::DEM) {
          radiusSourceFiles<<shape->fileName();
        }
      }
      newPointDialog->setRadiusSource(radiusSourceFiles);
    }



    if (newPointDialog->exec() == QDialog::Accepted) {
      m_lastUsedPointId = newPointDialog->pointId();
      ControlPoint *newPoint =
+2 −0
Original line number Diff line number Diff line
@@ -107,6 +107,8 @@ namespace Isis {
   *                           choices on constrained and fixed points.  Fixes #5504.
   *   @history 2018-10-04 Tracie Sucharski - Removed calls to ControlNet::GetTargetRadii because of
   *                           changes to ControlNet.
   *   @history 2018-10-05 Tracie Sucharski - Added radius source combo to the NewControlPoint
   *                           dialog.
   */
  class ControlPointEditWidget : public QWidget {
    Q_OBJECT
+30 −5
Original line number Diff line number Diff line
@@ -82,14 +82,22 @@ namespace Isis {
              this, SLOT(pointTypeChanged(QString)));
    }


    QHBoxLayout *groundSourceLayout = NULL;
    QHBoxLayout *radiusSourceLayout = NULL;
    if (groundSource) {
      m_groundSourceLayout = new QHBoxLayout();
      groundSourceLayout = new QHBoxLayout();
      m_groundSourceCombo = new QComboBox;
      QLabel *groundSourceLabel = new QLabel("Ground Source:");
      m_groundSourceLayout->addWidget(groundSourceLabel);
      m_groundSourceLayout->addWidget(m_groundSourceCombo);
      groundSourceLayout->addWidget(groundSourceLabel);
      groundSourceLayout->addWidget(m_groundSourceCombo);
      m_groundSourceCombo->setVisible(false);

      radiusSourceLayout = new QHBoxLayout();
      m_radiusSourceCombo = new QComboBox;
      QLabel *radiusSourceLabel = new QLabel("Radius Source:");
      radiusSourceLayout->addWidget(radiusSourceLabel);
      radiusSourceLayout->addWidget(m_radiusSourceCombo);
      m_radiusSourceCombo->setVisible(false);
    }

    if (subpixelRegisterMeasures) {
@@ -132,7 +140,8 @@ namespace Isis {
    }

    if (groundSource) {
      vLayout->addLayout(m_groundSourceLayout);
      vLayout->addLayout(groundSourceLayout);
      vLayout->addLayout(radiusSourceLayout);
    }

    if (subpixelRegisterMeasures) {
@@ -187,9 +196,15 @@ namespace Isis {
  }


  QString NewControlPointDialog::radiusSource() const {
    return m_radiusSourceCombo->currentText();
  }


  void NewControlPointDialog::pointTypeChanged(QString pointType) {
    if (pointType == "Fixed" || pointType == "Constrained") {
      m_groundSourceCombo->setVisible(true);
      m_radiusSourceCombo->setVisible(true);
    }
  }

@@ -217,6 +232,16 @@ namespace Isis {
  }


  void NewControlPointDialog::setRadiusSource(QStringList radiusFiles) {
    //  If radiusFiles not empty, add to the radius source combo, first adding "None" as option.
    m_radiusSourceCombo->addItem("None");
    m_radiusSourceCombo->setCurrentText("None");
    if (radiusFiles.count() != 0) {
      m_radiusSourceCombo->addItems(radiusFiles);
    }
  }


  /**
   * @internal
   *   @history 2010-06-03 Jeannie Walldren - Removed "std::"
+5 −1
Original line number Diff line number Diff line
@@ -43,6 +43,8 @@ namespace Isis {
   *                          check text instead of int values. Add tool tip explaining why point
   *                          type cannot be changed.  Set tool tip on Ok button explaining why it
   *                          is not enabled. Fixes #5087.
   *   @history 2018-10-05 Tracie Sucharski - Add radius source combo for choosing the radius
   *                          source. References #5504.
   */
  class NewControlPointDialog : public QDialog {

@@ -60,7 +62,9 @@ namespace Isis {
      QString pointId() const;
      int pointType() const;
      void setGroundSource(QStringList groundFiles, int numberShapesWithPoint);
      void setRadiusSource(QStringList radiusFiles);
      QString groundSource() const;
      QString radiusSource() const;
      QStringList selectedFiles() const;
      void setFiles(QStringList pointFiles);
      bool subpixelRegisterPoint();
@@ -76,7 +80,7 @@ namespace Isis {
      QLabel *m_ptIdLabel;
      QComboBox *m_pointTypeCombo;
      QComboBox *m_groundSourceCombo;
      QHBoxLayout *m_groundSourceLayout;
      QComboBox *m_radiusSourceCombo;
      QRadioButton *m_subpixelRegisterButton;
      QPushButton *m_okButton;
      QLineEdit *m_ptIdEdit;