Isis 3 Programmer Reference
Isis::Footprint2DView Class Reference

View for displaying footprints of images in a QMos like way. More...

#include <Footprint2DView.h>

Inheritance diagram for Isis::Footprint2DView:
Inheritance graph
Collaboration diagram for Isis::Footprint2DView:
Collaboration graph

Classes

class  XmlHandler
 

Public Slots

void enableControlNetTool (bool value)
 A slot function that is called when directory emits a siganl that an active control network is set. More...
 
virtual void addItem (ProjectItem *item)
 Adds an item to the view. More...
 
virtual void addItems (QList< ProjectItem *> items)
 Adds several items to the view. More...
 
virtual void removeItem (ProjectItem *item)
 Removes an item to the view. More...
 
virtual void removeItems (QList< ProjectItem *> items)
 Removes several items from the view. More...
 
virtual void disableActions ()
 Disables toolbars and toolpad actions. More...
 

Signals

void modifyControlPoint (ControlPoint *controlPoint)
 
void deleteControlPoint (ControlPoint *controlPoint)
 
void createControlPoint (double latitude, double longitude)
 
void redrawMeasures ()
 
void controlPointAdded (QString newPointId)
 
void windowChangeEvent (bool event)
 

Public Member Functions

 Footprint2DView (Directory *directory, QWidget *parent=0)
 Constructor. More...
 
 ~Footprint2DView ()
 Destructor. More...
 
MosaicSceneWidgetmosaicSceneWidget ()
 Accessor for the MosaicSceneWidget. More...
 
ImageFileListWidgetfileListWidget ()
 Accessor for the FileListWidget. More...
 
void load (XmlStackedHandlerReader *xmlReader)
 Loads the Footprint2DView from an XML file. More...
 
void save (QXmlStreamWriter &stream, Project *project, FileName newProjectRoot) const
 Save the footprint view widgets (ImageFileListWidget and MosaicSceneWidget to an XML file. More...
 
virtual QSize sizeHint () const
 Returns the suggested size. More...
 
virtual void setModel (ProjectItemModel *model)
 Sets the model used by the view. More...
 
virtual ProjectItemModelmodel ()
 Returns the model used by the view. More...
 
virtual void dragEnterEvent (QDragEnterEvent *event)
 Accepts the drag enter event if the internal model can accept the mime data. More...
 
virtual void dragMoveEvent (QDragMoveEvent *event)
 Accepts the drag event if the internal model can accept the mime data. More...
 
virtual void dropEvent (QDropEvent *event)
 Drops the data into the internal model if it can accept the data. More...
 
virtual void moveEvent (QMoveEvent *event)
 
virtual void resizeEvent (QResizeEvent *event)
 
virtual void enterEvent (QEvent *event)
 Enables actions when cursor enters the view. More...
 
virtual void leaveEvent (QEvent *event)
 Disables actions when cursor leaves the view. More...
 
virtual QList< QAction * > contextMenuActions ()
 Returns a list of actions appropriate for a context menu. More...
 
virtual ProjectItemcurrentItem ()
 Returns the current item of the model. More...
 
virtual QList< ProjectItem * > selectedItems ()
 Return the selected items of the model. More...
 
virtual ProjectItemModelinternalModel ()
 Returns the internal model of the view. More...
 
virtual void setInternalModel (ProjectItemModel *model)
 Sets the internal model of the view. More...
 

Protected Member Functions

bool eventFilter (QObject *watched, QEvent *event)
 Event filter to filter out drag and drop events. More...
 

Private Slots

void onItemAdded (ProjectItem *item)
 Slot to connect to the itemAdded signal from the model. More...
 
void onItemsAdded ()
 Slot called once all selected images have been added to the proxy model. More...
 
void onItemRemoved (ProjectItem *item)
 Slot to connect to the itemRemoved signal from the model. More...
 
void onQueueSelectionChanged ()
 Slot to connect to the queueSelectionChanged signal from a MosiacSceneWidget. More...
 
void onMosItemRemoved (Image *image)
 Slot at removes the mosaic item and corresponding image file list item when a cube is closed using the Close Cube context menu. More...
 

Private Member Functions

void enableActions ()
 Enables toolbars and toolpad actions. More...
 

Private Attributes

MosaicSceneWidgetm_sceneWidget
 The scene widget. More...
 
ImageFileListWidgetm_fileListWidget
 The file list widget. More...
 
QMainWindowm_window
 Main window. More...
 
ImageList m_images
 
QMap< Image *, ProjectItem * > m_imageItemMap
 Maps images to their items. More...
 
Directorym_directory
 The directory. More...
 
QToolBarm_permToolBar
 The permanent tool bar. More...
 
QToolBarm_activeToolBar
 The active tool bar. More...
 
ToolPadm_toolPad
 The tool pad. More...
 

Detailed Description

View for displaying footprints of images in a QMos like way.

Author
2016-01-13 Jeffrey Covington
History:

2016-01-13 Jeffrey Covington - Original version.

2016-06-27 Ian Humphrey - Minor updates to documentation, checked coding standards. Fixes #4004.

2016-08-25 Adam Paquette - Updated documentation. Fixes #4299.

2016-09-14 Tracie Sucharski - Added signals for mouse clicks for modifying, deleting and creating control points. These are passed on to Directory slots.

2016-10-20 Tracie Sucharski - Added back the capability for choosing either a new view or using an existing view.

2017-02-06 Tracie Sucharski - Added status bar for the track tool. Fixes #4475.

2017-07-18 Cole Neubauer - Moved creation of the ImageFileListWidget into Footprint2DView to more mirror the Qmos window. Fixes #4996.

2017-07-27 Makayla Shepherd - Fixed a segfault that occurred when closing a cube footprint. Fixes #5050.

2017-08-02 Tracie Sucharski - Fixed connections between views for control point editing. Fixes #5007, #5008.

2018-05-14 Tracie Sucharski - Serialize Footprint2DView rather than MosaicSceneWidget. This will allow all parts of Footprint2DView to be saved/restored including the ImageFileListWidget. Fixes #5422.

2018-05-30 Summer Stapleton - updated the view to remove QMainWindow constructor, include a central widget and to remove layout capacity. This change was made to adjust to parent class now inheriting from QMainWindow instead of QWidget. References #5433.

2018-06-08 Tracie Sucharski - Remove deletion of m_window from destructor. This member variable no longer exists.

2018-06-13 Kaitlyn Lee - Since views now inherit from QMainWindow, each individual view has its own toolbar, so having getters that return toolbar actions to fill the toolbar of the IpceMainWindow are unnecessary. Removed methods that returned menu and toolbar actions. Added enableControlNetTool(bool) so when an active control net is set, the tool becomes enabled.

2018-06-25 Kaitlyn Lee - When multiple views are open, there is a possibility of getting ambiguous shortcut errors. To counter this, we enable/disable actions. On default, actions are disabled until a user moves the cursor over the view. When a user moves the cursor outside of the view, the actions are disabled.

2018-07-09 Tracie Sucharski - Serialize the objectName for this view so that the view can be re-created with the same objectName for restoring the project state. Qt's save/restoreState use the objectName. Remove sizeHint method which is now taken care of in the parent class, AbstractProjectItemView.

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 the MosaicControlNetTool::loadNetwork in enableControlNetTool.

2018-07-31 Tracie Sucharski - Add accessor method for ImageFileListWidget.

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. The images are added to a new private member as each item is added to the model through the slot, onItemAdded. 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.

2018-10-04 Tracie Sucharski - If adding Shape to footprint view, call Image new Image constructor which takes a footprint and id, so that the MosaicSceneWidget can properly serialize Shapes that have been added. Fixes #5495.

Definition at line 115 of file Footprint2DView.h.

Constructor & Destructor Documentation

◆ Footprint2DView()

◆ ~Footprint2DView()

Isis::Footprint2DView::~Footprint2DView ( )

Destructor.

Definition at line 156 of file Footprint2DView.cpp.

References m_activeToolBar, m_fileListWidget, m_permToolBar, and m_toolPad.

Member Function Documentation

◆ addItem

void Isis::AbstractProjectItemView::addItem ( ProjectItem item)
virtualslotinherited

Adds an item to the view.

The item must be part of the view's model. This method can be overridden in a subclass to filter out unneeded items.

Parameters
[in]item(ProjectItem *) The item to add.

Definition at line 264 of file AbstractProjectItemView.cpp.

References Isis::AbstractProjectItemView::internalModel().

Referenced by Isis::CubeDnView::addItem().

◆ addItems

void Isis::AbstractProjectItemView::addItems ( QList< ProjectItem *>  items)
virtualslotinherited

Adds several items to the view.

The items must be a part of the view's model. This method can be overridden in a subclass to filter out unneeded items.

Parameters
[in]items(QList<ProjectItem *>) The items to add.

Definition at line 278 of file AbstractProjectItemView.cpp.

References Isis::AbstractProjectItemView::internalModel().

Referenced by Isis::CubeDnViewWorkOrder::execute(), and Isis::Footprint2DViewWorkOrder::execute().

◆ contextMenuActions()

QList< QAction * > Isis::AbstractProjectItemView::contextMenuActions ( )
virtualinherited

Returns a list of actions appropriate for a context menu.

Returns
QList<QAction *> The actions

Definition at line 232 of file AbstractProjectItemView.cpp.

◆ currentItem()

ProjectItem * Isis::AbstractProjectItemView::currentItem ( )
virtualinherited

Returns the current item of the model.

Returns
ProjectItem * The item

Definition at line 242 of file AbstractProjectItemView.cpp.

References Isis::ProjectItemModel::currentItem(), and Isis::AbstractProjectItemView::model().

◆ disableActions

void Isis::AbstractProjectItemView::disableActions ( )
virtualslotinherited

◆ dragEnterEvent()

void Isis::AbstractProjectItemView::dragEnterEvent ( QDragEnterEvent *  event)
virtualinherited

Accepts the drag enter event if the internal model can accept the mime data.

Parameters
[in]event(QDragEnterEvent *) The drag event

Definition at line 133 of file AbstractProjectItemView.cpp.

References Isis::AbstractProjectItemView::internalModel().

Referenced by eventFilter().

◆ dragMoveEvent()

void Isis::AbstractProjectItemView::dragMoveEvent ( QDragMoveEvent *  event)
virtualinherited

Accepts the drag event if the internal model can accept the mime data.

Parameters
[in]event(QDragMoveEvent *) The drag event

Definition at line 148 of file AbstractProjectItemView.cpp.

References Isis::AbstractProjectItemView::internalModel().

Referenced by eventFilter().

◆ dropEvent()

void Isis::AbstractProjectItemView::dropEvent ( QDropEvent *  event)
virtualinherited

Drops the data into the internal model if it can accept the data.

Parameters
[in]event(QDropEvent *) The drop event

Definition at line 162 of file AbstractProjectItemView.cpp.

References Isis::AbstractProjectItemView::internalModel().

Referenced by eventFilter().

◆ enableActions()

void Isis::Footprint2DView::enableActions ( )
privatevirtual

Enables toolbars and toolpad actions.

Overriden method. If an active control network has not been set, do not enable the cnet tool.

Reimplemented from Isis::AbstractProjectItemView.

Definition at line 351 of file Footprint2DView.cpp.

References Isis::Project::activeControl(), m_directory, and Isis::Directory::project().

◆ enableControlNetTool

void Isis::Footprint2DView::enableControlNetTool ( bool  value)
slot

A slot function that is called when directory emits a siganl that an active control network is set.

It enables the control network editor tool in the toolpad.

Parameters
valueThe boolean that holds if a control network has been set.

Definition at line 334 of file Footprint2DView.cpp.

References Isis::MosaicControlNetTool::loadNetwork(), and m_toolPad.

◆ enterEvent()

void Isis::AbstractProjectItemView::enterEvent ( QEvent *  event)
virtualinherited

Enables actions when cursor enters the view.

Parameters
eventThe enter event

Definition at line 192 of file AbstractProjectItemView.cpp.

References Isis::AbstractProjectItemView::enableActions().

◆ eventFilter()

bool Isis::Footprint2DView::eventFilter ( QObject watched,
QEvent *  event 
)
protected

Event filter to filter out drag and drop events.

Parameters
[in]watched(QObject *) The object being filtered
[in]event(QEvent *) The event
Returns
bool True if the event was intercepted

Definition at line 192 of file Footprint2DView.cpp.

References Isis::AbstractProjectItemView::dragEnterEvent(), Isis::AbstractProjectItemView::dragMoveEvent(), and Isis::AbstractProjectItemView::dropEvent().

◆ fileListWidget()

ImageFileListWidget * Isis::Footprint2DView::fileListWidget ( )

Accessor for the FileListWidget.

Definition at line 179 of file Footprint2DView.cpp.

References m_fileListWidget.

◆ internalModel()

◆ leaveEvent()

void Isis::AbstractProjectItemView::leaveEvent ( QEvent *  event)
virtualinherited

Disables actions when cursor leaves the view.

Parameters
eventThe leave event

Reimplemented in Isis::CubeDnView, and Isis::CnetEditorView.

Definition at line 202 of file AbstractProjectItemView.cpp.

References Isis::AbstractProjectItemView::disableActions().

◆ load()

void Isis::Footprint2DView::load ( XmlStackedHandlerReader xmlReader)

Loads the Footprint2DView from an XML file.

Parameters
xmlReaderThe reader that takes in and parses the XML file.

Definition at line 365 of file Footprint2DView.cpp.

References Isis::XmlStackedHandlerReader::pushContentHandler().

◆ model()

ProjectItemModel * Isis::AbstractProjectItemView::model ( )
virtualinherited

◆ mosaicSceneWidget()

MosaicSceneWidget * Isis::Footprint2DView::mosaicSceneWidget ( )

Accessor for the MosaicSceneWidget.

Definition at line 171 of file Footprint2DView.cpp.

References m_sceneWidget.

Referenced by Isis::Directory::addFootprint2DView().

◆ onItemAdded

void Isis::Footprint2DView::onItemAdded ( ProjectItem item)
privateslot

Slot to connect to the itemAdded signal from the model.

If the item is an image or shape it is 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.

Parameters
[in]item(ProjectItem *) The item

Definition at line 218 of file Footprint2DView.cpp.

References Isis::ImageList::append(), Isis::Shape::cube(), Isis::Shape::footprint(), Isis::Shape::id(), Isis::ProjectItem::image(), Isis::ProjectItem::isImage(), Isis::ProjectItem::isShape(), m_imageItemMap, and Isis::ProjectItem::shape().

Referenced by Footprint2DView().

◆ onItemRemoved

void Isis::Footprint2DView::onItemRemoved ( ProjectItem item)
privateslot

Slot to connect to the itemRemoved signal from the model.

If the item is an image it removes it from the scene.

Parameters
[in]item(ProjectItem *) The item to be removed

Definition at line 280 of file Footprint2DView.cpp.

References Isis::ImageList::append(), Isis::ProjectItem::image(), Isis::ProjectItem::isImage(), m_fileListWidget, m_imageItemMap, m_sceneWidget, and Isis::ImageFileListWidget::removeImages().

Referenced by Footprint2DView().

◆ onItemsAdded

void Isis::Footprint2DView::onItemsAdded ( )
privateslot

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.

Definition at line 245 of file Footprint2DView.cpp.

References Isis::ImageFileListWidget::addImages(), m_fileListWidget, and m_sceneWidget.

Referenced by Footprint2DView().

◆ onMosItemRemoved

void Isis::Footprint2DView::onMosItemRemoved ( Image image)
privateslot

Slot at removes the mosaic item and corresponding image file list item when a cube is closed using the Close Cube context menu.

Parameters
imageThe image that was closed and needs to be removed

Definition at line 259 of file Footprint2DView.cpp.

References Isis::ImageList::append(), m_fileListWidget, m_imageItemMap, m_sceneWidget, and Isis::ImageFileListWidget::removeImages().

Referenced by Footprint2DView().

◆ onQueueSelectionChanged

void Isis::Footprint2DView::onQueueSelectionChanged ( )
privateslot

Slot to connect to the queueSelectionChanged signal from a MosiacSceneWidget.

Updates the selection in the model.

Definition at line 305 of file Footprint2DView.cpp.

References Isis::AbstractProjectItemView::internalModel(), m_imageItemMap, m_sceneWidget, Isis::MosaicSceneWidget::selectedImages(), and Isis::ProjectItemModel::selectionModel().

Referenced by Footprint2DView().

◆ removeItem

void Isis::AbstractProjectItemView::removeItem ( ProjectItem item)
virtualslotinherited

Removes an item to the view.

The item must be part of the view's model. This method can be overriden in a subclass to filter out unneeded items.

Parameters
[in]item(ProjectItem *) The item to remove.

Definition at line 292 of file AbstractProjectItemView.cpp.

References Isis::AbstractProjectItemView::internalModel().

Referenced by Isis::AbstractProjectItemView::removeItems().

◆ removeItems

void Isis::AbstractProjectItemView::removeItems ( QList< ProjectItem *>  items)
virtualslotinherited

Removes several items from the view.

The items must be a part of the view's model.

Parameters
[in]items(QList<ProjectItem *>) The items to remove.

Definition at line 306 of file AbstractProjectItemView.cpp.

References Isis::AbstractProjectItemView::removeItem().

◆ save()

void Isis::Footprint2DView::save ( QXmlStreamWriter &  stream,
Project project,
FileName  newProjectRoot 
) const

Save the footprint view widgets (ImageFileListWidget and MosaicSceneWidget to an XML file.

Parameters
streamThe XML stream writer
newProjectRootThe FileName of the project this Directory is attached to.
History:
2016-11-07 Ian Humphrey - Restored saving of footprints (footprint2view). References #4486.

Definition at line 380 of file Footprint2DView.cpp.

References m_fileListWidget, m_sceneWidget, and Isis::ImageFileListWidget::save().

Referenced by Isis::Directory::save().

◆ selectedItems()

QList< ProjectItem * > Isis::AbstractProjectItemView::selectedItems ( )
virtualinherited

Return the selected items of the model.

Returns
QList<ProjectItem *> The items

Definition at line 252 of file AbstractProjectItemView.cpp.

References Isis::AbstractProjectItemView::model(), and Isis::ProjectItemModel::selectedItems().

◆ setInternalModel()

void Isis::AbstractProjectItemView::setInternalModel ( ProjectItemModel model)
virtualinherited

Sets the internal model of the view.

Parameters
[in]model(ProjectItemModel *) The new internal model

Reimplemented in Isis::ProjectItemTreeView.

Definition at line 111 of file AbstractProjectItemView.cpp.

References Isis::AbstractProjectItemView::m_internalModel, and Isis::AbstractProjectItemView::model().

Referenced by Isis::ProjectItemTreeView::setInternalModel().

◆ setModel()

void Isis::AbstractProjectItemView::setModel ( ProjectItemModel model)
virtualinherited

Sets the model used by the view.

If the internal model is a proxy model, it sets the source model.

Parameters
[in]model(ProjectItemModel *) The new model

Definition at line 83 of file AbstractProjectItemView.cpp.

References Isis::AbstractProjectItemView::internalModel(), and Isis::AbstractProjectItemView::model().

Referenced by Isis::Directory::addCubeDnView(), Isis::Directory::addFootprint2DView(), and Isis::Directory::addProjectItemTreeView().

◆ sizeHint()

QSize Isis::AbstractProjectItemView::sizeHint ( ) const
virtualinherited

Returns the suggested size.

Returns
QSize The size hint

Reimplemented in Isis::ProjectItemTreeView, and Isis::ControlHealthMonitorView.

Definition at line 67 of file AbstractProjectItemView.cpp.

Member Data Documentation

◆ m_activeToolBar

QToolBar* Isis::Footprint2DView::m_activeToolBar
private

The active tool bar.

Definition at line 183 of file Footprint2DView.h.

Referenced by Footprint2DView(), and ~Footprint2DView().

◆ m_directory

Directory* Isis::Footprint2DView::m_directory
private

The directory.

Definition at line 180 of file Footprint2DView.h.

Referenced by enableActions(), and Footprint2DView().

◆ m_fileListWidget

ImageFileListWidget* Isis::Footprint2DView::m_fileListWidget
private

The file list widget.

Definition at line 176 of file Footprint2DView.h.

Referenced by fileListWidget(), Footprint2DView(), onItemRemoved(), onItemsAdded(), onMosItemRemoved(), save(), and ~Footprint2DView().

◆ m_imageItemMap

QMap<Image *, ProjectItem *> Isis::Footprint2DView::m_imageItemMap
private

Maps images to their items.

Definition at line 179 of file Footprint2DView.h.

Referenced by onItemAdded(), onItemRemoved(), onMosItemRemoved(), and onQueueSelectionChanged().

◆ m_permToolBar

QToolBar* Isis::Footprint2DView::m_permToolBar
private

The permanent tool bar.

Definition at line 182 of file Footprint2DView.h.

Referenced by Footprint2DView(), and ~Footprint2DView().

◆ m_sceneWidget

MosaicSceneWidget* Isis::Footprint2DView::m_sceneWidget
private

◆ m_toolPad

ToolPad* Isis::Footprint2DView::m_toolPad
private

The tool pad.

Definition at line 184 of file Footprint2DView.h.

Referenced by enableControlNetTool(), Footprint2DView(), and ~Footprint2DView().

◆ m_window

QMainWindow* Isis::Footprint2DView::m_window
private

Main window.

Definition at line 177 of file Footprint2DView.h.


The documentation for this class was generated from the following files: