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

Double cliking on the matrix view will fit the matrix to the view

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/branches/ipce@5951 41f8697f-d340-4b68-9986-7bafba869bb8
parent 86b34f8c
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -412,8 +412,8 @@ namespace Isis {
  MatrixSceneWidget *Directory::addMatrixView() {
    MatrixSceneWidget *result = new MatrixSceneWidget(NULL, true, true, this);

//     connect( result, SIGNAL( destroyed(QObject *) ),
//              this, SLOT( cleanupMatrixViewWidgets() ) );
    connect( result, SIGNAL( destroyed(QObject *) ),
             this, SLOT( cleanupMatrixViewWidgets() ) );

    m_matrixViewWidgets.append(result);

@@ -479,6 +479,11 @@ namespace Isis {
  }


  void Directory::cleanupMatrixViewWidgets() {
    m_matrixViewWidgets.removeAll(NULL);
  }


  void Directory::imagesAddedToProject(ImageList *imageList) {
    m_projectTreeWidget->addImageGroup(imageList);
  }
@@ -523,7 +528,6 @@ namespace Isis {



///////////////////////////////////////////////////////////////////////////////////////////////////
  /**
   * Accessor for the list of MatrixSceneWidgets currently available.
   *
@@ -538,7 +542,7 @@ namespace Isis {

    return results;
  }
///////////////////////////////////////////////////////////////////////////////////////////////////

  

  /**
+1 −0
Original line number Diff line number Diff line
@@ -156,6 +156,7 @@ namespace Isis {
      void cleanupCubeDnViewWidgets();
      void cleanupFileListWidgets();
      void cleanupFootprint2DViewWidgets();
      void cleanupMatrixViewWidgets();
      void imagesAddedToProject(ImageList *images);
      void updateRecentProjects(Project *);

+7 −41
Original line number Diff line number Diff line
@@ -278,46 +278,6 @@ namespace Isis {
  QList<QAction *> MatrixSceneWidget::supportedActions(CorrelationMatrix *matrix) {
    QList<QAction *> results;

//     bool allMatrixElementsInView = !matrix->visibleElements().isEmpty();

    // Add visible elements to scene
    
//     foreach (MatrixElement *element, *elements) {
//       allMatrixElementsInView = allMatrixElementsInView && (elementToMatrix(element) != NULL);
//     }

    // Add actions to return list
//     if (allMatrixElementsInView) {
//       MoveToTopSceneWorkOrder *moveToTopAct =
//           new MoveToTopSceneWorkOrder( this, m_directory->project() );
//       moveToTopAct->setData(elements);
//       results.append(moveToTopAct);
// 
//       MoveUpOneSceneWorkOrder *moveUpOneAct =
//           new MoveUpOneSceneWorkOrder( this, m_directory->project() );
//       moveUpOneAct->setData(elements);
//       results.append(moveUpOneAct);
// 
//       MoveToBottomSceneWorkOrder *moveToBottomAct =
//           new MoveToBottomSceneWorkOrder( this, m_directory->project() );
//       moveToBottomAct->setData(elements);
//       results.append(moveToBottomAct);
// 
//       MoveDownOneSceneWorkOrder *moveDownOneAct =
//           new MoveDownOneSceneWorkOrder( this, m_directory->project() );
//       moveDownOneAct->setData(elements);
//       results.append(moveDownOneAct);

      // Add separator to contect menu
//       results.append(NULL);
/*
      QAction *zoomFitAct = new QAction(tr("Zoom Fit"), this);
      zoomFitAct->setData( qVariantFromValue( matrix->visibleElements() ) );
      connect( zoomFitAct, SIGNAL( triggered() ),
               this, SLOT( fitInView() ) );
      results.append(zoomFitAct);*/
//     }

    return results;
  }

@@ -372,7 +332,6 @@ namespace Isis {
   */
  bool MatrixSceneWidget::eventFilter(QObject *obj, QEvent *event) {
    bool stopProcessingEvent = true;
    qDebug() << "event type:" << event->type();

    switch( event->type() ) {
      case QMouseEvent::GraphicsSceneMousePress: {
@@ -384,6 +343,13 @@ namespace Isis {
        break;
      }

      case QMouseEvent::GraphicsSceneMouseDoubleClick:
        emit mouseDoubleClick(
              ((QGraphicsSceneMouseEvent *)event)->scenePos());
        m_graphicsView->fitInView(m_graphicsScene->itemsBoundingRect(), Qt::KeepAspectRatio);
        stopProcessingEvent = false;
        break;
      
      default:
        stopProcessingEvent = false;
        break;