Commit 4a8e11d0 authored by Cole Neubauer's avatar Cole Neubauer
Browse files

ImageFileListWidget now a part of the Footprint2DView

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/branches/ipce@7872 41f8697f-d340-4b68-9986-7bafba869bb8
parent 34604724
Loading
Loading
Loading
Loading
+2 −22
Original line number Diff line number Diff line
@@ -142,7 +142,6 @@ namespace Isis {
      createWorkOrder<SensorGetInfoWorkOrder>();
      createWorkOrder<RemoveImagesWorkOrder>();
      createWorkOrder<TargetGetInfoWorkOrder>();
      createWorkOrder<ImageFileListViewWorkOrder>();
      createWorkOrder<BundleObservationViewWorkOrder>();

      //  Main menu actions
@@ -650,24 +649,6 @@ namespace Isis {

    }
    return result;

    /*
    //qDebug()<<"Directory::addFootprint2DView";
    MosaicSceneWidget *result = new MosaicSceneWidget(NULL, true, true, this);

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

    m_footprint2DViewWidgets.append(result);

    result->setWindowTitle( tr("Footprint View %1").arg( m_footprint2DViewWidgets.count() ) );
    result->setObjectName(result->windowTitle());
    result->setObjectName( result->windowTitle() );

    emit newWidgetAvailable(result);

    return result;
    */
  }


@@ -818,6 +799,7 @@ namespace Isis {
   * @brief Add an imageFileList widget to the window.
   * @return @b (ImageFileListWidget *) A pointer to the widget to add to the window.
   */

  ImageFileListWidget *Directory::addImageFileListView() {
    //qDebug()<<"Directory::addImageFileListView";
    ImageFileListWidget *result = new ImageFileListWidget(this);
@@ -830,8 +812,6 @@ namespace Isis {
    result->setWindowTitle( tr("File List %1").arg( m_fileListWidgets.count() ) );
    result->setObjectName( result->windowTitle() );

    emit newWidgetAvailable(result);

    return result;
  }

@@ -927,7 +907,7 @@ namespace Isis {


  /**
   * @brief Reomoves pointers to deleted ImageFileListWidget objects.
   * @brief Removes pointers to deleted ImageFileListWidget objects.
   */
  void Directory::cleanupFileListWidgets(QObject *obj) {

+3 −0
Original line number Diff line number Diff line
@@ -146,6 +146,9 @@ namespace Isis {
   *                           control net is not active and slotted it to reenable when Project
   *                           emits activeControlSet(bool).
   *                           Fixes #5046
   *   @history 2017-07-18 Cole Neubauer - Because the ImageFileListWidget now exists only inside
   *                           the Footprint2DView the ImageFileListWidgetWorkOrder was removed
   *                           from the context menu Fixes #4996
   */
  class Directory : public QObject {
    Q_OBJECT
+51 −26
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@
#include "Footprint2DView.h"

#include <QAction>
#include <QDockWidget>
#include <QDragEnterEvent>
#include <QDragMoveEvent>
#include <QDropEvent>
@@ -34,6 +35,9 @@
#include <QSizePolicy>
#include <QStatusBar>
#include <QToolBar>
#include <QBoxLayout>
#include <QHBoxLayout>
#include <QMainWindow>
#include <QVBoxLayout>
#include <QWidget>
#include <QWidgetAction>
@@ -41,6 +45,7 @@
#include "ControlPoint.h"
#include "Cube.h"
#include "Image.h"
#include "ImageFileListWidget.h"
#include "MosaicGraphicsView.h"
#include "MosaicSceneWidget.h"
#include "ProjectItem.h"
@@ -64,7 +69,7 @@ namespace Isis {
    MosaicGraphicsView *graphicsView = m_sceneWidget->getView();
    graphicsView->installEventFilter(this);
    graphicsView->setAcceptDrops(false);
//  qDebug()<<"Footprint2DView::Footprint2DView  internalModel() = "<<internalModel();

    connect( internalModel(), SIGNAL( itemAdded(ProjectItem *) ),
             this, SLOT( onItemAdded(ProjectItem *) ) );
    connect( internalModel(), SIGNAL( itemRemoved(ProjectItem *) ),
@@ -89,12 +94,33 @@ namespace Isis {
    connect(this, SIGNAL(controlPointAdded(QString)),
            m_sceneWidget, SIGNAL(controlPointAdded(QString)));

    QVBoxLayout *layout = new QVBoxLayout;
    setLayout(layout);
    QBoxLayout *layout = new QBoxLayout(QBoxLayout::TopToBottom);
    QHBoxLayout *viewlayout = new QHBoxLayout();

    layout->addWidget(m_sceneWidget);
    layout->addWidget(statusBar);

    m_fileListWidget = new ImageFileListWidget(directory);

    m_fileListWidget->setWindowTitle( tr("File List")  );
    m_fileListWidget->setObjectName( m_fileListWidget->windowTitle() );

    QDockWidget *imageFileListdock = new QDockWidget( m_fileListWidget->windowTitle() );
    imageFileListdock->setObjectName(imageFileListdock->windowTitle());
    imageFileListdock->setFeatures( QDockWidget::DockWidgetFloatable |
                                    QDockWidget::DockWidgetMovable);

    imageFileListdock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);

    imageFileListdock->setWidget(m_fileListWidget);

    m_window = new QMainWindow();
    m_window->addDockWidget(Qt::LeftDockWidgetArea, imageFileListdock, Qt::Vertical);
    m_window->setCentralWidget(m_sceneWidget);
    viewlayout->addWidget(m_window);
    layout->addLayout(viewlayout);

    setLayout(layout);

    m_permToolBar = new QToolBar("Standard Tools", 0);
    m_permToolBar->setObjectName("permToolBar");
    m_permToolBar->setIconSize(QSize(22, 22));
@@ -123,7 +149,6 @@ namespace Isis {
    policy.setHorizontalPolicy(QSizePolicy::Expanding);
    policy.setVerticalPolicy(QSizePolicy::Expanding);
    setSizePolicy(policy);

  }


@@ -131,6 +156,8 @@ namespace Isis {
   * Destructor
   */
  Footprint2DView::~Footprint2DView() {
    delete m_fileListWidget;
    delete m_window;
    delete m_permToolBar;
    delete m_activeToolBar;
    delete m_toolPad;
@@ -150,7 +177,9 @@ namespace Isis {
    return QSize(800, 600);
  }


  /**
   * Accessor for the MosaicSceneWidget
   */
  MosaicSceneWidget *Footprint2DView::mosaicSceneWidget() {
    return m_sceneWidget;
  }
@@ -207,6 +236,7 @@ namespace Isis {
    }
    images.append(image);
    m_sceneWidget->addImages(images);
    m_fileListWidget->addImages(&images);

    if (!m_imageItemMap.value(image)) {
      m_imageItemMap.insert(image, item);
@@ -221,9 +251,7 @@ namespace Isis {
   * @param[in] item (ProjectItem *) The item to be removed
   */
  void Footprint2DView::onItemRemoved(ProjectItem *item) {
//  qDebug()<<"Footprint2DView::onItemRemoved item= "<<item;
//  qDebug()<<"                               source model: "<<internalModel()->sourceModel()<<"  rows = "<<internalModel()->sourceModel()->rowCount();
//  qDebug()<<"                               proxy model: "<<internalModel()<<"  rows = "<<internalModel()->rowCount();

    if (!item) {
      return;
    }
@@ -232,9 +260,9 @@ namespace Isis {

      ImageList images;
      images.append(item->image());
//    qDebug()<<"       image count = "<<images.size();

      m_sceneWidget->removeImages(images);
      m_fileListWidget->removeImages(&(images));

      if ( m_imageItemMap.value( item->image() ) ) {
        m_imageItemMap.remove( item->image());
@@ -262,7 +290,6 @@ namespace Isis {
      internalModel()->selectionModel()->setCurrentIndex(item->index(), QItemSelectionModel::Select);
    }


    foreach (Image *image, selectedImages) {
      if ( ProjectItem *item = m_imageItemMap.value(image) ) {
        internalModel()->selectionModel()->select(item->index(), QItemSelectionModel::Select);
@@ -301,6 +328,4 @@ namespace Isis {
  QList<QAction *> Footprint2DView::toolPadActions() {
    return m_toolPad->actions();
  }


}
+10 −4
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@

class QAction;
class QEvent;
class QMainWindow;
class QToolBar;
class QWidgetAction;

@@ -38,6 +39,7 @@ namespace Isis {
  class ControlPoint;
  class Directory;
  class Image;
  class ImageFileListWidget;
  class MosaicSceneWidget;
  class ToolPad;

@@ -56,6 +58,8 @@ namespace Isis {
   *   @history 2016-10-20 Tracie Sucharski -  Added back the capability for choosing either a new
   *                           view or using an existing view.
   *   @history 2017-02-06 Tracie Sucharski - Added status bar for the track tool.  Fixes #4475.
   *   @history 2017-07-18 Cole Neubauer - Moved creation of the ImageFileListWidget into
   *                           Footprint2DView to more mirror the Qmos window.  Fixes #4996.
   */
  class Footprint2DView : public AbstractProjectItemView {

@@ -89,6 +93,8 @@ namespace Isis {

    private:
      MosaicSceneWidget *m_sceneWidget; //!< The scene widget
      ImageFileListWidget *m_fileListWidget; //!< The file list widget
      QMainWindow *m_window; //!< Main window
      QMap<Image *, ProjectItem *> m_imageItemMap; //!< Maps images to their items

      QToolBar *m_permToolBar; //!< The permanent tool bar
+60 −32
Original line number Diff line number Diff line
@@ -415,6 +415,34 @@ namespace Isis {
    m_progress->setVisible(false);
  }

  /**
  * Removes an imagelist from the FileListWidget. This would normally be handled elsewhere
  * but for IPCE it needs a method to hide images and update the tree.
  *
  * @param ImageList containing the images to remove from the tree
  */
  void ImageFileListWidget::removeImages(ImageList* images){
    foreach (Image* image, *images) {

      for (int i = 0; i < m_tree->topLevelItemCount(); i++) {
        QTreeWidgetItem *group = m_tree->topLevelItem(i);

        for (int j = 0; j < group->childCount(); j++) {
          QTreeWidgetItem *item = group->child(j);

          if (item->type() == QTreeWidgetItem::UserType && !item->isHidden()) {
            ImageTreeWidgetItem *cubeItem = (ImageTreeWidgetItem *)item;
            if (cubeItem->image() == image){
              item->setHidden(true);
            }
          }
        }
      }
    }
    m_tree->repaint();
  }

  
  /**
   * This method takes an event and gets all of the FootprintColumns, adds them to
   * the menu, then it pops up the menu at the location of event.
Loading