Commit 1a5b0270 authored by Kristin Berry's avatar Kristin Berry Committed by Makayla Shepherd
Browse files

Updated Control-related classes to switch from using (mostly) std::map and...

Updated Control-related classes to switch from using (mostly) std::map and std::vector to QMap and QVector
parent 2c687f7f
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -36,8 +36,6 @@
#include "ControlNetFileV0002.pb.h"
#include "SpecialPixel.h"

using namespace std;

namespace Isis {
  /**
   * Create a new control measure and initialize it to nulls and zeros.
+3 −3
Original line number Diff line number Diff line
@@ -1226,7 +1226,7 @@ namespace Isis {
   *
   * @author Sharmila Prasad (10/6/2010)
   *
   * @return std::string
   * @return QString
   */
  QString ControlNet::CreatedDate() const {
    return p_created;
@@ -1776,7 +1776,7 @@ namespace Isis {
    }

    p_targetName = target;
    p_targetRadii = radii.toStdVector();
    p_targetRadii = radii;

  }

@@ -1925,7 +1925,7 @@ namespace Isis {
   * @returns the radii of the target body
   */
  std::vector<Distance> ControlNet::GetTargetRadii() {
    return p_targetRadii;
    return p_targetRadii.toStdVector();
  }


+9 −9
Original line number Diff line number Diff line
@@ -28,12 +28,11 @@
#include <QObject> // parent class
#include <QSharedPointer>

#include <map>
#include <vector>

#include "ControlNetFile.h"

#include <QString>
#include <QMap>
#include <QVector>

template< typename A, typename B > class QHash;
template< typename T > class QList;
@@ -42,7 +41,6 @@ template< typename T > class QSet;
class QMutex;
class QString;


namespace Isis {
  class Camera;
  class ControlMeasure;
@@ -206,6 +204,8 @@ namespace Isis {
   *   @history 2017-08-09 Summer Stapleton - Added throw to caught exception for bad control net
   *                           import in constructor. Also removed p_invalid as it was no longer
   *                           being used anywhere. Fixes #5068.
   *   @history 2017-12-12 Kristin Berry - Updated to use QMap and QVector rather than std::map
   *                            and std::vector. 
   */
  class ControlNet : public QObject {
      Q_OBJECT
@@ -434,12 +434,12 @@ namespace Isis {
      QString p_modified;              //!< Date Last Modified
      QString p_description;           //!< Textual Description of network
      QString p_userName;              //!< The user who created the network
      std::map<QString, Isis::Camera *> p_cameraMap; //!< A map from serialnumber to camera
      std::map<QString, int> p_cameraValidMeasuresMap; //!< A map from serialnumber to #measures
      std::map<QString, int> p_cameraRejectedMeasuresMap; //!< A map from serialnumber to
      QMap<QString, Isis::Camera *> p_cameraMap; //!< A map from serialnumber to camera
      QMap<QString, int> p_cameraValidMeasuresMap; //!< A map from serialnumber to #measures
      QMap<QString, int> p_cameraRejectedMeasuresMap; //!< A map from serialnumber to
      //!  #rejected measures
      std::vector<Isis::Camera *> p_cameraList; //!< Vector of image number to camera
      std::vector<Distance> p_targetRadii;        //!< Radii of target body
      QVector<Isis::Camera *> p_cameraList; //!< Vector of image number to camera
      QVector<Distance> p_targetRadii;        //!< Radii of target body

      bool m_ownPoints; //!< Specifies ownership of point list. True if owned by this object. 
  };
+0 −5
Original line number Diff line number Diff line
@@ -18,11 +18,6 @@
#include "PvlKeyword.h"
#include "PvlObject.h"


using std::cerr;
using std::cout;
using std::endl;

namespace Isis {

  /**
+11 −9
Original line number Diff line number Diff line
#include "ControlNetFilter.h"

#include <QVector>

#include "Angle.h"
#include "Camera.h"
#include "CameraFactory.h"
@@ -1018,7 +1020,7 @@ namespace Isis {
   * @param pbLastFilter - Flag to indicate whether this is the last filter to print the stats
   */
  void ControlNetFilter::PointCubeNamesFilter(const PvlGroup &pvlGrp, bool pbLastFilter) {
    std::vector <QString> sCubeNames;
    QVector <QString> sCubeNames;

    // Store the Cubenames from the PvlGroup
    for (int i = 0; i < pvlGrp.keywords(); i++) {
@@ -1079,7 +1081,7 @@ namespace Isis {

          // Image Details
          QString sn = cMeasure->GetCubeSerialNumber();
          vector <double> imgStats = GetImageStatsBySerialNum(sn);
          QVector <double> imgStats = GetImageStatsBySerialNum(sn);
          mOstm << mSerialNumList.fileName(sn)   << ", " << sn << ", "
                << imgStats[imgTotalPoints] << ", " << imgStats[imgIgnoredPoints] << ", "
                << imgStats[imgLockedPoints] << ", " << imgStats[imgFixedPoints] << ", "
@@ -1136,7 +1138,7 @@ namespace Isis {

    for (int sn = (iNumCubes - 1); sn >= 0; sn--) {
      QString sSerialNum = mSerialNumFilter.serialNumber(sn);
      vector<double> imgStats = GetImageStatsBySerialNum(sSerialNum);
      QVector<double> imgStats = GetImageStatsBySerialNum(sSerialNum);
      double convexHullRatio = imgStats[imgConvexHullRatio];
      if (convexHullRatio < dGreater || convexHullRatio > dLesser){
        FilterOutMeasuresBySerialNum(sSerialNum);
@@ -1213,7 +1215,7 @@ namespace Isis {
        QString sSerialNum = mSerialNumFilter.serialNumber(i);

        mOstm << mSerialNumFilter.fileName(i) << ", " << sSerialNum << ", ";
        vector<double> imgStats = GetImageStatsBySerialNum(sSerialNum);
        QVector<double> imgStats = GetImageStatsBySerialNum(sSerialNum);
        mOstm << mSerialNumFilter.fileName(sSerialNum) << ", " << sSerialNum << ", "
              << imgStats[imgTotalPoints]  << ", " << imgStats[imgIgnoredPoints] << ", " << imgStats[imgLockedPoints] << ", "
              << imgStats[imgFixedPoints] << ", " << imgStats[imgConstrainedPoints] << ", " << imgStats[imgFreePoints] << ", "
@@ -1258,7 +1260,7 @@ namespace Isis {

    for (int sn = (iNumCubes - 1); sn >= 0; sn--) {
      QString sSerialNum = mSerialNumFilter.serialNumber(sn);
      vector<double> imgStats = GetImageStatsBySerialNum(sSerialNum);
      QVector<double> imgStats = GetImageStatsBySerialNum(sSerialNum);
      double numPoints = imgStats[imgTotalPoints];
      if (numPoints < iGreaterPoints || numPoints > iLessPoints){
        FilterOutMeasuresBySerialNum(sSerialNum);
@@ -1318,9 +1320,9 @@ namespace Isis {
      double dDist = 0;
      bool bMatchDistance = false;

      std::vector <int> sPointIndex1;
      std::vector <int> sPointIndex2;
      std::vector <double> dPointDistance;
      QVector <int> sPointIndex1;
      QVector <int> sPointIndex2;
      QVector <double> dPointDistance;

      // Point stats
      int iPointsTotal   = 0;
@@ -1449,7 +1451,7 @@ namespace Isis {
        mSerialNumFilter.remove(sSerialNum);
      }
      else if (pbLastFilter) {
        vector <double> imgStats = GetImageStatsBySerialNum((sSerialNum));
        QVector <double> imgStats = GetImageStatsBySerialNum((sSerialNum));
        mOstm << mSerialNumList.fileName(sSerialNum) << ", " << sSerialNum << ", "
              << iPointsTotal << ", " << iPointsIgnored << ", " << iPointsLocked << ", "
              << iPointsFixed << ", " << iPointsConstrained << ", " << iPointsFree << ", "
Loading