Commit c5251090 authored by Kim Oyama's avatar Kim Oyama
Browse files

Added CorrelationMatrix item under BundleStatistics on the project tree. Right...

Added CorrelationMatrix item under BundleStatistics on the project tree. Right clicking on this new item will bring up the context menu instead of right clicking on the BundleResults tree item. At this time the CorrelationMatrix is still hard coded, it does not come from BundleStatistics yet. Removed the m_visibleImagesAndParameters variable from CorrelationMatrix, it is not necessary.

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/branches/ipce@5933 41f8697f-d340-4b68-9986-7bafba869bb8
parent 1ec17848
Loading
Loading
Loading
Loading
+1 −17
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@ namespace Isis {
   */
  CorrelationMatrix::CorrelationMatrix() {
    m_imagesAndParameters = NULL;
    m_visibleImagesAndParameters = NULL; // TODO: unused variable ???
    m_covarianceFileName = NULL; // new FileName("/work/users/koyama/testData/covarianceMatrix2.dat");
    m_correlationFileName = NULL; // new FileName("/work/users/koyama/testData/correlationMatrix.dat");
    m_diagonals = NULL;
@@ -72,7 +71,6 @@ namespace Isis {
   */
  CorrelationMatrix::CorrelationMatrix(PvlObject storedMatrixData) {
    m_imagesAndParameters = NULL;
    m_visibleImagesAndParameters = NULL; // TODO: unused variable ???
    m_covarianceFileName = NULL;
    m_correlationFileName = NULL;
    m_diagonals = NULL;
@@ -129,8 +127,6 @@ namespace Isis {
   */
  CorrelationMatrix::CorrelationMatrix(const CorrelationMatrix &other) {
    m_imagesAndParameters = new QMap<QString, QStringList>(*other.m_imagesAndParameters);
    m_visibleImagesAndParameters
        = new QMap<QString, QStringList>(*other.m_visibleImagesAndParameters); // TODO: unused variable ???
    m_covarianceFileName = new FileName(*other.m_covarianceFileName);
    m_correlationFileName = new FileName(*other.m_correlationFileName);
    m_diagonals = new QList<double>(*other.m_diagonals);
@@ -164,9 +160,6 @@ namespace Isis {
//   delete m_imagesAndParameters;
//   m_imagesAndParameters = NULL;

    delete m_visibleImagesAndParameters; // TODO: unused variable ???
    m_visibleImagesAndParameters = NULL; // TODO: unused variable ???

    delete m_covarianceFileName;
    m_covarianceFileName = NULL;

@@ -198,10 +191,6 @@ namespace Isis {
      delete m_imagesAndParameters;
      m_imagesAndParameters = new QMap<QString, QStringList>(*other.m_imagesAndParameters);
  
      delete m_visibleImagesAndParameters; // TODO: unused variable ???
      m_visibleImagesAndParameters
          = new QMap<QString, QStringList>(*other.m_visibleImagesAndParameters); // TODO: unused variable ???
  
      delete m_covarianceFileName;
      m_covarianceFileName = new FileName(*other.m_covarianceFileName);
  
@@ -500,7 +489,7 @@ namespace Isis {

  QDataStream &CorrelationMatrix::write(QDataStream &stream) const {
    // QMaps
    stream << *m_imagesAndParameters << *m_visibleImagesAndParameters;
    stream << *m_imagesAndParameters;
    // FileNames
    stream << m_covarianceFileName->expanded() << m_correlationFileName->expanded();
    // QLists
@@ -517,11 +506,6 @@ namespace Isis {
    delete m_imagesAndParameters;
    m_imagesAndParameters = new QMap<QString, QStringList>(imagesAndParameters);

    QMap<QString, QStringList> visibleImagesAndParameters;
    stream >> visibleImagesAndParameters;
    delete m_visibleImagesAndParameters;
    m_visibleImagesAndParameters = new QMap<QString, QStringList>(visibleImagesAndParameters);

    // FileNames
    QString covarianceFileName;
    stream >> covarianceFileName;
+0 −3
Original line number Diff line number Diff line
@@ -97,9 +97,6 @@ namespace Isis {
      //! This map holds the images used to create this matrix and their associated parameters.
      QMap<QString, QStringList> *m_imagesAndParameters;

      //! This map holds the images and parameters associated with the block in focus.
      QMap<QString, QStringList> *m_visibleImagesAndParameters;

      //! FileName of the covariance matrix calculated when the bundle was run.
      FileName *m_covarianceFileName;

+0 −5
Original line number Diff line number Diff line
@@ -66,7 +66,6 @@ namespace Isis {
   *         is of type CorrelationMatrix.
   */
  bool MatrixViewWorkOrder::isExecutable(CorrelationMatrix *matrix) {
    // qDebug() << "MatrixViewWorkOrder::isExecutable";
    return matrix->isValid();
  }

@@ -77,7 +76,6 @@ namespace Isis {
   *
   */
  bool MatrixViewWorkOrder::execute() {
    // qDebug() << "MatrixViewWorkOrder::execute";
    bool success = WorkOrder::execute();

    if (success) {
@@ -115,11 +113,8 @@ namespace Isis {
      else if (viewToUse != -1) {
        MatrixSceneWidget *matrixView = existingViews[viewToUse];


        matrixView->drawGrid( project()->correlationMatrix() );
        matrixView->drawElements( project()->correlationMatrix() );


      }

      QStringList internalData;
+45 −0
Original line number Diff line number Diff line
#include "CorrMatTreeWidgetItem.h"

#include <QDebug>

#include "CorrelationMatrix.h"


namespace Isis {

  /**
   * CorrMatTreeWidgetItem constructor.
   * CorrMatTreeWidgetItem is derived from QTreeWidgetItem
   *
   *
   * @param parent
   */
  CorrMatTreeWidgetItem::CorrMatTreeWidgetItem(CorrelationMatrix *correlationMatrix,
                                               QTreeWidget *parent) :
      QTreeWidgetItem(parent, UserType) {

    m_correlationMatrix = correlationMatrix;

    setText( 0, "Correlation Matrix");
    setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable);
    setIcon( 0, QIcon(":pointReg") );

//     connect( m_correlationMatrix, SIGNAL( destroyed(QObject *) ),
//              this, SLOT( deleteLater() ) );
  }


  CorrMatTreeWidgetItem::~CorrMatTreeWidgetItem() {
    m_correlationMatrix = NULL;
  }


  CorrelationMatrix CorrMatTreeWidgetItem::correlationMatrix() {
    return *m_correlationMatrix;
  }


  void CorrMatTreeWidgetItem::selectionChanged() {
//     m_correlationMatrix->displayProperties()->setSelected( isSelected() );
  }
}
+34 −0
Original line number Diff line number Diff line
#ifndef CorrMatTreeWidgetItem_H
#define CorrMatTreeWidgetItem_H

#include <QObject>
#include <QTreeWidgetItem>

namespace Isis {
  class CorrelationMatrix;

  /**
   * @brief A correlation matrix in the project tree widget
   *
   * This class visualizes a CorrelationMatrix * from the project in the project tree widget.
   *
   * @author 2012-09-26 Tracie Sucharski
   *
   * @internal
   */
  class CorrMatTreeWidgetItem : public QObject, public QTreeWidgetItem {
    Q_OBJECT
    public:
      CorrMatTreeWidgetItem(CorrelationMatrix *correlationMatrix, QTreeWidget *parent = 0);
      virtual ~CorrMatTreeWidgetItem();

      CorrelationMatrix correlationMatrix();
      void selectionChanged();

    private:
      CorrelationMatrix *m_correlationMatrix;
  };
}

#endif
Loading