Commit 873f35b3 authored by Tracie Sucharski's avatar Tracie Sucharski
Browse files

PROG: Recovering from bad git merge (accidently merged ipceDocks into ipce).

parent 5be7bf82
Loading
Loading
Loading
Loading
+52 −15
Original line number Diff line number Diff line
@@ -20,9 +20,15 @@

namespace Isis {
  /**
   * NewControlPointDialog constructor
   * @param parent The parent widget for the
   *               cube points filter
   * @description Create dialog for creating a new Control Point
   *  
   * @param controlNet               The control net the new control point will be contained in 
   * @param serialNumberList         The serial number list corresponding to the controlNet 
   * @param defaultPointId           The default pointID, usually empty string 
   * @param parent                   Parent widget 
   * @param pointType                Show the Point Type combo box, default = false 
   * @param groundSource             Show the Ground Source list, default = false 
   * @param subpixelRegisterMeasures Show the check box for sub-pixel registration option, default = false
   *
   * @internal
   *   @history 2008-11-26 Jeannie Walldren - Set lastPointIdValue
@@ -68,11 +74,12 @@ namespace Isis {
        m_pointTypeCombo->insertItem(i, ControlPoint::PointTypeToString(
                                     (ControlPoint::PointType) i));
      }
      m_pointTypeCombo->setCurrentIndex(2);
      m_pointTypeCombo->setCurrentText("Free");
      QLabel *pointTypeLabel = new QLabel("Point Type:");
      pointTypeLayout->addWidget(pointTypeLabel);
      pointTypeLayout->addWidget(m_pointTypeCombo);
      connect(m_pointTypeCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(pointTypeChanged(int)));
      connect(m_pointTypeCombo, SIGNAL(currentIndexChanged(QString)),
              this, SLOT(pointTypeChanged(QString)));
    }


@@ -99,6 +106,7 @@ namespace Isis {

    //  Create OK & Cancel buttons
    m_okButton = new QPushButton("OK");

    //  If the last point id used was never saved to network, do not set ok
    //  button to faslse
    enableOkButton("");
@@ -147,7 +155,14 @@ namespace Isis {


  int NewControlPointDialog::pointType() const {
    return m_pointTypeCombo->currentIndex();
    int result = ControlPoint::Free;
    if (m_pointTypeCombo->currentText() == "Constrained") {
      result = ControlPoint::Constrained;
    }
    if (m_pointTypeCombo->currentText() == "Fixed") {
      result = ControlPoint::Fixed;
    }
    return result;
  }


@@ -172,20 +187,34 @@ namespace Isis {
  }


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


  void NewControlPointDialog::setGroundSource(QStringList groundFiles, int numberShapesWithPoint) {
    //  If groundFiles not empty, add to the list widget for selection
    if (groundFiles.count() != 0) {
      m_groundSourceCombo->addItems(groundFiles); 
      for (int i = 0; i < numberShapesWithPoint; i++) {
        m_groundSourceCombo->setItemData(i, QColor(Qt::red), Qt::ForegroundRole);
      }
      m_groundSourceCombo->insertSeparator(numberShapesWithPoint);
    }
    // If groundFiles is empty, remove option to change point type to Constrained or Fixed, add a
    // tooltip to give user hint as to why they don't have option to change point type and set
    // default point type back to "Free".
    else {
      m_pointTypeCombo->setToolTip("The Point Type cannot be changed to \"Fixed\" or "
                                   "\"Constrained\", because there are no shapes imported into "
                                   "your project.");
      m_pointTypeCombo->removeItem(m_pointTypeCombo->findText("Constrained"));
      m_pointTypeCombo->removeItem(m_pointTypeCombo->findText("Fixed"));
      m_pointTypeCombo->setCurrentText("Free");
    }
  }


  /**
@@ -227,7 +256,15 @@ namespace Isis {
   *            to the ptIdValue
   */
  void NewControlPointDialog::enableOkButton(const QString &) {
    m_okButton->setEnabled(!m_ptIdEdit->text().isEmpty() &&
                           !m_controlNet->ContainsPoint(m_ptIdEdit->text()));
    bool enable = !m_ptIdEdit->text().isEmpty() &&
                  !m_controlNet->ContainsPoint(m_ptIdEdit->text());
    m_okButton->setEnabled(enable);
    if (enable) {
      m_okButton->setToolTip("");
    }
    else {
      m_okButton->setToolTip("Cannot create point because Point Id is either empty or the active "
                             "control net already contains a control point with this point Id.");
    }
  }
}
+11 −3
Original line number Diff line number Diff line
@@ -33,8 +33,16 @@ namespace Isis {
   *   @history 2016-10-18 Tracie Sucharski - Added method to return value of the
   *                          subpixelRegister radio button.  If set, all measures in the control
   *                          point created will be subpixel registered.
   *   @history 2017-07-04 Christopher Combs - Added bools to toggle on specific elements of the
   *                          dialog to remove similar classes like QnetNewPointDialog. Fixes #4383.
   *   @history 2017-07-04 Christopher Combs - Combined functionality of dialogs from qnet,
   *                          qview and ipce applications by adding bools to toggle on specific
   *                          elements of the dialog to remove similar classes like
   *                          QnetNewPointDialog. Fixes #4383.
   *   @history 2018-05-02 Tracie Sucharski - If no shapes available remove option to change point
   *                          type to "Constrained" or "Fixed". Because pointType combo dependent on
   *                          having all 3 types to use ControlPoint's enum, change comparisons to
   *                          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.
   */
  class NewControlPointDialog : public QDialog {

@@ -58,7 +66,7 @@ namespace Isis {
      bool subpixelRegisterPoint();

    private slots:
      void pointTypeChanged(int pointType);
      void pointTypeChanged(QString pointType);
      void enableOkButton(const QString &text);

    private: