Loading isis/src/qisis/objs/AbstractProjectItemView/AbstractProjectItemView.cpp +5 −5 Original line number Original line Diff line number Diff line Loading @@ -262,8 +262,7 @@ namespace Isis { * @param[in] item (ProjectItem *) The item to add. * @param[in] item (ProjectItem *) The item to add. */ */ void AbstractProjectItemView::addItem(ProjectItem *item) { void AbstractProjectItemView::addItem(ProjectItem *item) { if (ProjectItemProxyModel *proxyModel = if (ProjectItemProxyModel *proxyModel = qobject_cast<ProjectItemProxyModel *>( internalModel() )) { qobject_cast<ProjectItemProxyModel *>( internalModel() ) ) { proxyModel->addItem(item); proxyModel->addItem(item); } } } } Loading @@ -271,13 +270,14 @@ namespace Isis { /** /** * Adds several items to the view. The items must be a part of the * Adds several items to the view. The items must be a part of the * view's model. * view's model. This method can be overriden in a subclass to filter out * unneeded items. * * * @param[in] items (QList<ProjectItem *>) The items to add. * @param[in] items (QList<ProjectItem *>) The items to add. */ */ void AbstractProjectItemView::addItems(QList<ProjectItem *> items) { void AbstractProjectItemView::addItems(QList<ProjectItem *> items) { foreach (ProjectItem *item, items) { if (ProjectItemProxyModel *proxyModel = qobject_cast<ProjectItemProxyModel *>( internalModel() )) { addItem(item); proxyModel->addItems(items); } } } } Loading isis/src/qisis/objs/AbstractProjectItemView/AbstractProjectItemView.h +5 −1 Original line number Original line Diff line number Diff line Loading @@ -85,6 +85,10 @@ namespace Isis { * CubeDnViews to be opened at once, since CubeDnView has an internal * CubeDnViews to be opened at once, since CubeDnView has an internal * size policy. References #5433 * size policy. References #5433 * @history 2018-07-26 Tracie Sucharski - Cleaned up some documentation. * @history 2018-07-26 Tracie Sucharski - Cleaned up some documentation. * @history 2018-08-10 Tracie Sucharski - Changed addItems method to call the * ProjectItemProxyModel::addItems rather than this classes addItem. * This speeds things up considerably loading items into the model. * References #5296. */ */ class AbstractProjectItemView : public QMainWindow { class AbstractProjectItemView : public QMainWindow { Loading isis/src/qisis/objs/Footprint2DView/Footprint2DView.cpp +35 −14 Original line number Original line Diff line number Diff line Loading @@ -78,11 +78,13 @@ namespace Isis { connect( internalModel(), SIGNAL( itemAdded(ProjectItem *) ), connect( internalModel(), SIGNAL( itemAdded(ProjectItem *) ), this, SLOT( onItemAdded(ProjectItem *) ) ); this, SLOT( onItemAdded(ProjectItem *) ) ); connect( internalModel(), SIGNAL( itemsAdded() ), this, SLOT( onItemsAdded() ) ); connect( internalModel(), SIGNAL( itemRemoved(ProjectItem *) ), connect( internalModel(), SIGNAL( itemRemoved(ProjectItem *) ), this, SLOT( onItemRemoved(ProjectItem *) ) ); this, SLOT( onItemRemoved(ProjectItem *) ) ); connect(m_sceneWidget, SIGNAL(queueSelectionChanged()), connect(m_sceneWidget, SIGNAL(queueSelectionChanged()), this, SLOT(onQueueSelectionChanged() ) ); this, SLOT(onQueueSelectionChanged()), Qt::QueuedConnection); // Pass on Signals emitted from ControlNetTool, through the MosaicSceneWidget // Pass on Signals emitted from ControlNetTool, through the MosaicSceneWidget // TODO 2016-09-09 TLS Design: Use a proxy model instead of signals? // TODO 2016-09-09 TLS Design: Use a proxy model instead of signals? Loading @@ -99,7 +101,8 @@ namespace Isis { this, SLOT(onMosItemRemoved(Image *))); this, SLOT(onMosItemRemoved(Image *))); // Pass on redrawMeasure signal from Directory, so the control measures are redrawn on all // Pass on redrawMeasure signal from Directory, so the control measures are redrawn on all // the footprints. // the footprints. Connection made in Directory from directory's signal to this signal since // Directory doesn't have access to the scene within the sceneWidget. connect(this, SIGNAL(redrawMeasures()), m_sceneWidget->getScene(), SLOT(update())); connect(this, SIGNAL(redrawMeasures()), m_sceneWidget->getScene(), SLOT(update())); setStatusBar(statusBar); setStatusBar(statusBar); Loading Loading @@ -170,6 +173,14 @@ namespace Isis { } } /** * Accessor for the FileListWidget */ ImageFileListWidget *Footprint2DView::fileListWidget() { return m_fileListWidget; } /** /** * Event filter to filter out drag and drop events. * Event filter to filter out drag and drop events. * * Loading Loading @@ -197,8 +208,10 @@ namespace Isis { /** /** * Slot to connect to the itemAdded signal from the model. If the * Slot to connect to the itemAdded signal from the model. If the item is an image or shape it is * item is an image it adds it to the scene. * added to a list. When everything has been added, then the list is added to the scene through * signal/slot connection from ProjectItemProxyModel signal, itemsAdded which is connected to * this objects onItemsAdded slot. * * * @param[in] item (ProjectItem *) The item * @param[in] item (ProjectItem *) The item */ */ Loading @@ -206,22 +219,16 @@ namespace Isis { if (!item || (!item->isImage() && !item->isShape())) { if (!item || (!item->isImage() && !item->isShape())) { return; return; } } //TODO 2016-09-09 TLS Handle Shapes-Create image from shape since qmos only handles images? // Still don't know if shape should inherit from image or contain an image? // Image *image; Image *image; ImageList images; if (item->isShape()) { if (item->isShape()) { //TEMPORARY UNTIL SHAPE IS FIXED TO HOLD IMAGE, once Shape holds image go back to old code // previous to 10-21-16 image = new Image(item->shape()->cube()); image = new Image(item->shape()->cube()); } } else if (item->isImage()) { else if (item->isImage()) { image = item->image(); image = item->image(); } } images.append(image); m_sceneWidget->addImages(images); m_images.append(image); m_fileListWidget->addImages(&images); if (!m_imageItemMap.value(image)) { if (!m_imageItemMap.value(image)) { m_imageItemMap.insert(image, item); m_imageItemMap.insert(image, item); Loading @@ -229,6 +236,20 @@ namespace Isis { } } /** * Slot called once all selected images have been added to the proxy model. This is much faster * than adding a single image at a time to the MosaicSceneWidget. This is connected from the * ProjectItemProxyModel::itemsAdded signal. * */ void Footprint2DView::onItemsAdded() { // This is called once all selected images have been added to proxy model (internalModel()) // This is much faster than adding a single image at a time to the scene widget m_sceneWidget->addImages(m_images); m_fileListWidget->addImages(&m_images); } /** /** * Slot at removes the mosaic item and corresponding image file list item when a cube is closed * Slot at removes the mosaic item and corresponding image file list item when a cube is closed * using the Close Cube context menu. * using the Close Cube context menu. Loading isis/src/qisis/objs/Footprint2DView/Footprint2DView.h +14 −0 Original line number Original line Diff line number Diff line Loading @@ -28,6 +28,7 @@ #include "AbstractProjectItemView.h" #include "AbstractProjectItemView.h" #include "FileName.h" #include "FileName.h" #include "ImageList.h" #include "XmlStackedHandler.h" #include "XmlStackedHandler.h" class QAction; class QAction; Loading Loading @@ -97,6 +98,13 @@ namespace Isis { * @history 2018-07-12 Tracie Sucharski - Renamed m_controlNetTool to m_controlNetToolAction * @history 2018-07-12 Tracie Sucharski - Renamed m_controlNetTool to m_controlNetToolAction * to be clear it is not a pointer to the tool. Add a call to * to be clear it is not a pointer to the tool. Add a call to * the MosaicControlNetTool::loadNetwork in enableControlNetTool. * the MosaicControlNetTool::loadNetwork in enableControlNetTool. * @history 2018-07-31 Tracie Sucharski - Add accessor method for ImageFileListWidget. * @history 2018-08-10 Tracie Sucharski - Added new slot connected from ProjectItemProxyModel's * itemsAdded signal which is emitted after all selected items have * been added to the proxy model. This allows the FootprintView to put * all selected items into the scene widget at once rather than * individually which speeds the display of footprints. Fixes #5296. * */ */ class Footprint2DView : public AbstractProjectItemView { class Footprint2DView : public AbstractProjectItemView { Loading @@ -107,6 +115,7 @@ namespace Isis { ~Footprint2DView(); ~Footprint2DView(); MosaicSceneWidget *mosaicSceneWidget(); MosaicSceneWidget *mosaicSceneWidget(); ImageFileListWidget *fileListWidget(); void load(XmlStackedHandlerReader *xmlReader); void load(XmlStackedHandlerReader *xmlReader); void save(QXmlStreamWriter &stream, Project *project, FileName newProjectRoot) const; void save(QXmlStreamWriter &stream, Project *project, FileName newProjectRoot) const; Loading @@ -125,8 +134,12 @@ namespace Isis { protected: protected: bool eventFilter(QObject *watched, QEvent *event); bool eventFilter(QObject *watched, QEvent *event); protected slots: //void rowsInserted(const QModelIndex &parent, int first, int last); private slots: private slots: void onItemAdded(ProjectItem *item); void onItemAdded(ProjectItem *item); void onItemsAdded(); void onItemRemoved(ProjectItem *item); void onItemRemoved(ProjectItem *item); void onQueueSelectionChanged(); void onQueueSelectionChanged(); void onMosItemRemoved(Image *image); void onMosItemRemoved(Image *image); Loading Loading @@ -159,6 +172,7 @@ namespace Isis { MosaicSceneWidget *m_sceneWidget; //!< The scene widget MosaicSceneWidget *m_sceneWidget; //!< The scene widget ImageFileListWidget *m_fileListWidget; //!< The file list widget ImageFileListWidget *m_fileListWidget; //!< The file list widget QMainWindow *m_window; //!< Main window QMainWindow *m_window; //!< Main window ImageList m_images; QMap<Image *, ProjectItem *> m_imageItemMap; //!< Maps images to their items QMap<Image *, ProjectItem *> m_imageItemMap; //!< Maps images to their items Directory *m_directory; //!< The directory Directory *m_directory; //!< The directory Loading isis/src/qisis/objs/ProjectItemProxyModel/ProjectItemProxyModel.cpp +1 −2 Original line number Original line Diff line number Diff line Loading @@ -179,7 +179,6 @@ namespace Isis { * @return @b ProjectItem* The item in the proxy model. * @return @b ProjectItem* The item in the proxy model. */ */ ProjectItem *ProjectItemProxyModel::addItem(ProjectItem *sourceItem) { ProjectItem *ProjectItemProxyModel::addItem(ProjectItem *sourceItem) { // qDebug()<<"ProjectItemProxyModel::addItem"; if (!sourceItem) { if (!sourceItem) { return 0; return 0; } } Loading Loading @@ -208,10 +207,10 @@ namespace Isis { * source model. * source model. */ */ void ProjectItemProxyModel::addItems(QList<ProjectItem *> sourceItems) { void ProjectItemProxyModel::addItems(QList<ProjectItem *> sourceItems) { // qDebug()<<"ProjectItemProxyModel::addItem"; foreach (ProjectItem *item, sourceItems) { foreach (ProjectItem *item, sourceItems) { addItem(item); addItem(item); } } emit itemsAdded(); } } Loading Loading
isis/src/qisis/objs/AbstractProjectItemView/AbstractProjectItemView.cpp +5 −5 Original line number Original line Diff line number Diff line Loading @@ -262,8 +262,7 @@ namespace Isis { * @param[in] item (ProjectItem *) The item to add. * @param[in] item (ProjectItem *) The item to add. */ */ void AbstractProjectItemView::addItem(ProjectItem *item) { void AbstractProjectItemView::addItem(ProjectItem *item) { if (ProjectItemProxyModel *proxyModel = if (ProjectItemProxyModel *proxyModel = qobject_cast<ProjectItemProxyModel *>( internalModel() )) { qobject_cast<ProjectItemProxyModel *>( internalModel() ) ) { proxyModel->addItem(item); proxyModel->addItem(item); } } } } Loading @@ -271,13 +270,14 @@ namespace Isis { /** /** * Adds several items to the view. The items must be a part of the * Adds several items to the view. The items must be a part of the * view's model. * view's model. This method can be overriden in a subclass to filter out * unneeded items. * * * @param[in] items (QList<ProjectItem *>) The items to add. * @param[in] items (QList<ProjectItem *>) The items to add. */ */ void AbstractProjectItemView::addItems(QList<ProjectItem *> items) { void AbstractProjectItemView::addItems(QList<ProjectItem *> items) { foreach (ProjectItem *item, items) { if (ProjectItemProxyModel *proxyModel = qobject_cast<ProjectItemProxyModel *>( internalModel() )) { addItem(item); proxyModel->addItems(items); } } } } Loading
isis/src/qisis/objs/AbstractProjectItemView/AbstractProjectItemView.h +5 −1 Original line number Original line Diff line number Diff line Loading @@ -85,6 +85,10 @@ namespace Isis { * CubeDnViews to be opened at once, since CubeDnView has an internal * CubeDnViews to be opened at once, since CubeDnView has an internal * size policy. References #5433 * size policy. References #5433 * @history 2018-07-26 Tracie Sucharski - Cleaned up some documentation. * @history 2018-07-26 Tracie Sucharski - Cleaned up some documentation. * @history 2018-08-10 Tracie Sucharski - Changed addItems method to call the * ProjectItemProxyModel::addItems rather than this classes addItem. * This speeds things up considerably loading items into the model. * References #5296. */ */ class AbstractProjectItemView : public QMainWindow { class AbstractProjectItemView : public QMainWindow { Loading
isis/src/qisis/objs/Footprint2DView/Footprint2DView.cpp +35 −14 Original line number Original line Diff line number Diff line Loading @@ -78,11 +78,13 @@ namespace Isis { connect( internalModel(), SIGNAL( itemAdded(ProjectItem *) ), connect( internalModel(), SIGNAL( itemAdded(ProjectItem *) ), this, SLOT( onItemAdded(ProjectItem *) ) ); this, SLOT( onItemAdded(ProjectItem *) ) ); connect( internalModel(), SIGNAL( itemsAdded() ), this, SLOT( onItemsAdded() ) ); connect( internalModel(), SIGNAL( itemRemoved(ProjectItem *) ), connect( internalModel(), SIGNAL( itemRemoved(ProjectItem *) ), this, SLOT( onItemRemoved(ProjectItem *) ) ); this, SLOT( onItemRemoved(ProjectItem *) ) ); connect(m_sceneWidget, SIGNAL(queueSelectionChanged()), connect(m_sceneWidget, SIGNAL(queueSelectionChanged()), this, SLOT(onQueueSelectionChanged() ) ); this, SLOT(onQueueSelectionChanged()), Qt::QueuedConnection); // Pass on Signals emitted from ControlNetTool, through the MosaicSceneWidget // Pass on Signals emitted from ControlNetTool, through the MosaicSceneWidget // TODO 2016-09-09 TLS Design: Use a proxy model instead of signals? // TODO 2016-09-09 TLS Design: Use a proxy model instead of signals? Loading @@ -99,7 +101,8 @@ namespace Isis { this, SLOT(onMosItemRemoved(Image *))); this, SLOT(onMosItemRemoved(Image *))); // Pass on redrawMeasure signal from Directory, so the control measures are redrawn on all // Pass on redrawMeasure signal from Directory, so the control measures are redrawn on all // the footprints. // the footprints. Connection made in Directory from directory's signal to this signal since // Directory doesn't have access to the scene within the sceneWidget. connect(this, SIGNAL(redrawMeasures()), m_sceneWidget->getScene(), SLOT(update())); connect(this, SIGNAL(redrawMeasures()), m_sceneWidget->getScene(), SLOT(update())); setStatusBar(statusBar); setStatusBar(statusBar); Loading Loading @@ -170,6 +173,14 @@ namespace Isis { } } /** * Accessor for the FileListWidget */ ImageFileListWidget *Footprint2DView::fileListWidget() { return m_fileListWidget; } /** /** * Event filter to filter out drag and drop events. * Event filter to filter out drag and drop events. * * Loading Loading @@ -197,8 +208,10 @@ namespace Isis { /** /** * Slot to connect to the itemAdded signal from the model. If the * Slot to connect to the itemAdded signal from the model. If the item is an image or shape it is * item is an image it adds it to the scene. * added to a list. When everything has been added, then the list is added to the scene through * signal/slot connection from ProjectItemProxyModel signal, itemsAdded which is connected to * this objects onItemsAdded slot. * * * @param[in] item (ProjectItem *) The item * @param[in] item (ProjectItem *) The item */ */ Loading @@ -206,22 +219,16 @@ namespace Isis { if (!item || (!item->isImage() && !item->isShape())) { if (!item || (!item->isImage() && !item->isShape())) { return; return; } } //TODO 2016-09-09 TLS Handle Shapes-Create image from shape since qmos only handles images? // Still don't know if shape should inherit from image or contain an image? // Image *image; Image *image; ImageList images; if (item->isShape()) { if (item->isShape()) { //TEMPORARY UNTIL SHAPE IS FIXED TO HOLD IMAGE, once Shape holds image go back to old code // previous to 10-21-16 image = new Image(item->shape()->cube()); image = new Image(item->shape()->cube()); } } else if (item->isImage()) { else if (item->isImage()) { image = item->image(); image = item->image(); } } images.append(image); m_sceneWidget->addImages(images); m_images.append(image); m_fileListWidget->addImages(&images); if (!m_imageItemMap.value(image)) { if (!m_imageItemMap.value(image)) { m_imageItemMap.insert(image, item); m_imageItemMap.insert(image, item); Loading @@ -229,6 +236,20 @@ namespace Isis { } } /** * Slot called once all selected images have been added to the proxy model. This is much faster * than adding a single image at a time to the MosaicSceneWidget. This is connected from the * ProjectItemProxyModel::itemsAdded signal. * */ void Footprint2DView::onItemsAdded() { // This is called once all selected images have been added to proxy model (internalModel()) // This is much faster than adding a single image at a time to the scene widget m_sceneWidget->addImages(m_images); m_fileListWidget->addImages(&m_images); } /** /** * Slot at removes the mosaic item and corresponding image file list item when a cube is closed * Slot at removes the mosaic item and corresponding image file list item when a cube is closed * using the Close Cube context menu. * using the Close Cube context menu. Loading
isis/src/qisis/objs/Footprint2DView/Footprint2DView.h +14 −0 Original line number Original line Diff line number Diff line Loading @@ -28,6 +28,7 @@ #include "AbstractProjectItemView.h" #include "AbstractProjectItemView.h" #include "FileName.h" #include "FileName.h" #include "ImageList.h" #include "XmlStackedHandler.h" #include "XmlStackedHandler.h" class QAction; class QAction; Loading Loading @@ -97,6 +98,13 @@ namespace Isis { * @history 2018-07-12 Tracie Sucharski - Renamed m_controlNetTool to m_controlNetToolAction * @history 2018-07-12 Tracie Sucharski - Renamed m_controlNetTool to m_controlNetToolAction * to be clear it is not a pointer to the tool. Add a call to * to be clear it is not a pointer to the tool. Add a call to * the MosaicControlNetTool::loadNetwork in enableControlNetTool. * the MosaicControlNetTool::loadNetwork in enableControlNetTool. * @history 2018-07-31 Tracie Sucharski - Add accessor method for ImageFileListWidget. * @history 2018-08-10 Tracie Sucharski - Added new slot connected from ProjectItemProxyModel's * itemsAdded signal which is emitted after all selected items have * been added to the proxy model. This allows the FootprintView to put * all selected items into the scene widget at once rather than * individually which speeds the display of footprints. Fixes #5296. * */ */ class Footprint2DView : public AbstractProjectItemView { class Footprint2DView : public AbstractProjectItemView { Loading @@ -107,6 +115,7 @@ namespace Isis { ~Footprint2DView(); ~Footprint2DView(); MosaicSceneWidget *mosaicSceneWidget(); MosaicSceneWidget *mosaicSceneWidget(); ImageFileListWidget *fileListWidget(); void load(XmlStackedHandlerReader *xmlReader); void load(XmlStackedHandlerReader *xmlReader); void save(QXmlStreamWriter &stream, Project *project, FileName newProjectRoot) const; void save(QXmlStreamWriter &stream, Project *project, FileName newProjectRoot) const; Loading @@ -125,8 +134,12 @@ namespace Isis { protected: protected: bool eventFilter(QObject *watched, QEvent *event); bool eventFilter(QObject *watched, QEvent *event); protected slots: //void rowsInserted(const QModelIndex &parent, int first, int last); private slots: private slots: void onItemAdded(ProjectItem *item); void onItemAdded(ProjectItem *item); void onItemsAdded(); void onItemRemoved(ProjectItem *item); void onItemRemoved(ProjectItem *item); void onQueueSelectionChanged(); void onQueueSelectionChanged(); void onMosItemRemoved(Image *image); void onMosItemRemoved(Image *image); Loading Loading @@ -159,6 +172,7 @@ namespace Isis { MosaicSceneWidget *m_sceneWidget; //!< The scene widget MosaicSceneWidget *m_sceneWidget; //!< The scene widget ImageFileListWidget *m_fileListWidget; //!< The file list widget ImageFileListWidget *m_fileListWidget; //!< The file list widget QMainWindow *m_window; //!< Main window QMainWindow *m_window; //!< Main window ImageList m_images; QMap<Image *, ProjectItem *> m_imageItemMap; //!< Maps images to their items QMap<Image *, ProjectItem *> m_imageItemMap; //!< Maps images to their items Directory *m_directory; //!< The directory Directory *m_directory; //!< The directory Loading
isis/src/qisis/objs/ProjectItemProxyModel/ProjectItemProxyModel.cpp +1 −2 Original line number Original line Diff line number Diff line Loading @@ -179,7 +179,6 @@ namespace Isis { * @return @b ProjectItem* The item in the proxy model. * @return @b ProjectItem* The item in the proxy model. */ */ ProjectItem *ProjectItemProxyModel::addItem(ProjectItem *sourceItem) { ProjectItem *ProjectItemProxyModel::addItem(ProjectItem *sourceItem) { // qDebug()<<"ProjectItemProxyModel::addItem"; if (!sourceItem) { if (!sourceItem) { return 0; return 0; } } Loading Loading @@ -208,10 +207,10 @@ namespace Isis { * source model. * source model. */ */ void ProjectItemProxyModel::addItems(QList<ProjectItem *> sourceItems) { void ProjectItemProxyModel::addItems(QList<ProjectItem *> sourceItems) { // qDebug()<<"ProjectItemProxyModel::addItem"; foreach (ProjectItem *item, sourceItems) { foreach (ProjectItem *item, sourceItems) { addItem(item); addItem(item); } } emit itemsAdded(); } } Loading