Isis 3 Programmer Reference
|
View for displaying footprints of images in a QMos like way. More...
#include <Footprint2DView.h>
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... | |
MosaicSceneWidget * | mosaicSceneWidget () |
Accessor for the MosaicSceneWidget. More... | |
ImageFileListWidget * | fileListWidget () |
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 ProjectItemModel * | model () |
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 ProjectItem * | currentItem () |
Returns the current item of the model. More... | |
virtual QList< ProjectItem * > | selectedItems () |
Return the selected items of the model. More... | |
virtual ProjectItemModel * | internalModel () |
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 | |
MosaicSceneWidget * | m_sceneWidget |
The scene widget. More... | |
ImageFileListWidget * | m_fileListWidget |
The file list widget. More... | |
QMainWindow * | m_window |
Main window. More... | |
ImageList | m_images |
QMap< Image *, ProjectItem * > | m_imageItemMap |
Maps images to their items. More... | |
Directory * | m_directory |
The directory. More... | |
QToolBar * | m_permToolBar |
The permanent tool bar. More... | |
QToolBar * | m_activeToolBar |
The active tool bar. More... | |
ToolPad * | m_toolPad |
The tool pad. More... | |
View for displaying footprints of images in a QMos like way.
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.
parent | (QMainWindow *) Pointer to parent QMainWindow |
Definition at line 68 of file Footprint2DView.cpp.
References Isis::AbstractProjectItemView::disableActions(), Isis::AbstractProjectItemView::internalModel(), m_activeToolBar, m_directory, m_fileListWidget, m_permToolBar, m_sceneWidget, m_toolPad, onItemAdded(), onItemRemoved(), onItemsAdded(), onMosItemRemoved(), and onQueueSelectionChanged().
Isis::Footprint2DView::~Footprint2DView | ( | ) |
Destructor.
Definition at line 156 of file Footprint2DView.cpp.
References m_activeToolBar, m_fileListWidget, m_permToolBar, and m_toolPad.
|
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.
[in] | item | (ProjectItem *) The item to add. |
Definition at line 264 of file AbstractProjectItemView.cpp.
References Isis::AbstractProjectItemView::internalModel().
Referenced by Isis::CubeDnView::addItem().
|
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.
[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().
Returns a list of actions appropriate for a context menu.
Definition at line 232 of file AbstractProjectItemView.cpp.
|
virtualinherited |
Returns the current item of the model.
Definition at line 242 of file AbstractProjectItemView.cpp.
References Isis::ProjectItemModel::currentItem(), and Isis::AbstractProjectItemView::model().
|
virtualslotinherited |
Disables toolbars and toolpad actions.
Definition at line 210 of file AbstractProjectItemView.cpp.
Referenced by Isis::CnetEditorView::CnetEditorView(), Isis::CnetEditorView::createMenus(), Footprint2DView(), Isis::CnetEditorView::leaveEvent(), and Isis::AbstractProjectItemView::leaveEvent().
|
virtualinherited |
Accepts the drag enter event if the internal model can accept the mime data.
[in] | event | (QDragEnterEvent *) The drag event |
Definition at line 133 of file AbstractProjectItemView.cpp.
References Isis::AbstractProjectItemView::internalModel().
Referenced by eventFilter().
|
virtualinherited |
Accepts the drag event if the internal model can accept the mime data.
[in] | event | (QDragMoveEvent *) The drag event |
Definition at line 148 of file AbstractProjectItemView.cpp.
References Isis::AbstractProjectItemView::internalModel().
Referenced by eventFilter().
|
virtualinherited |
Drops the data into the internal model if it can accept the data.
[in] | event | (QDropEvent *) The drop event |
Definition at line 162 of file AbstractProjectItemView.cpp.
References Isis::AbstractProjectItemView::internalModel().
Referenced by eventFilter().
|
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().
|
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.
value | The 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.
|
virtualinherited |
Enables actions when cursor enters the view.
event | The enter event |
Definition at line 192 of file AbstractProjectItemView.cpp.
References Isis::AbstractProjectItemView::enableActions().
|
protected |
Event filter to filter out drag and drop events.
[in] | watched | (QObject *) The object being filtered |
[in] | event | (QEvent *) The event |
Definition at line 192 of file Footprint2DView.cpp.
References Isis::AbstractProjectItemView::dragEnterEvent(), Isis::AbstractProjectItemView::dragMoveEvent(), and Isis::AbstractProjectItemView::dropEvent().
ImageFileListWidget * Isis::Footprint2DView::fileListWidget | ( | ) |
Accessor for the FileListWidget.
Definition at line 179 of file Footprint2DView.cpp.
References m_fileListWidget.
|
virtualinherited |
Returns the internal model of the view.
By default it is a proxy model.
Definition at line 122 of file AbstractProjectItemView.cpp.
References Isis::AbstractProjectItemView::m_internalModel.
Referenced by Isis::AbstractProjectItemView::addItem(), Isis::AbstractProjectItemView::addItems(), Isis::CubeDnView::CubeDnView(), Isis::AbstractProjectItemView::dragEnterEvent(), Isis::AbstractProjectItemView::dragMoveEvent(), Isis::AbstractProjectItemView::dropEvent(), Footprint2DView(), Isis::AbstractProjectItemView::model(), Isis::CubeDnView::onCubeViewportActivated(), Isis::CubeDnView::onCubeViewportDeleted(), Isis::CubeDnView::onCurrentChanged(), onQueueSelectionChanged(), Isis::ProjectItemTreeView::ProjectItemTreeView(), Isis::AbstractProjectItemView::removeItem(), Isis::ProjectItemTreeView::setInternalModel(), and Isis::AbstractProjectItemView::setModel().
|
virtualinherited |
Disables actions when cursor leaves the view.
event | The leave event |
Reimplemented in Isis::CubeDnView, and Isis::CnetEditorView.
Definition at line 202 of file AbstractProjectItemView.cpp.
References Isis::AbstractProjectItemView::disableActions().
void Isis::Footprint2DView::load | ( | XmlStackedHandlerReader * | xmlReader | ) |
Loads the Footprint2DView from an XML file.
xmlReader | The reader that takes in and parses the XML file. |
Definition at line 365 of file Footprint2DView.cpp.
References Isis::XmlStackedHandlerReader::pushContentHandler().
|
virtualinherited |
Returns the model used by the view.
If the internal model is a proxy model, it returns the source model.
Definition at line 97 of file AbstractProjectItemView.cpp.
References Isis::AbstractProjectItemView::internalModel().
Referenced by Isis::AbstractProjectItemView::currentItem(), Isis::BundleObservationView::displayCsvFile(), Isis::AbstractProjectItemView::selectedItems(), Isis::ProjectItemTreeView::setInternalModel(), Isis::AbstractProjectItemView::setInternalModel(), and Isis::AbstractProjectItemView::setModel().
MosaicSceneWidget * Isis::Footprint2DView::mosaicSceneWidget | ( | ) |
Accessor for the MosaicSceneWidget.
Definition at line 171 of file Footprint2DView.cpp.
References m_sceneWidget.
Referenced by Isis::Directory::addFootprint2DView().
|
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.
[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().
|
privateslot |
Slot to connect to the itemRemoved signal from the model.
If the item is an image it removes it from the scene.
[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().
|
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().
|
privateslot |
Slot at removes the mosaic item and corresponding image file list item when a cube is closed using the Close Cube context menu.
image | The 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().
|
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().
|
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.
[in] | item | (ProjectItem *) The item to remove. |
Definition at line 292 of file AbstractProjectItemView.cpp.
References Isis::AbstractProjectItemView::internalModel().
Referenced by Isis::AbstractProjectItemView::removeItems().
|
virtualslotinherited |
Removes several items from the view.
The items must be a part of the view's model.
[in] | items | (QList<ProjectItem *>) The items to remove. |
Definition at line 306 of file AbstractProjectItemView.cpp.
References Isis::AbstractProjectItemView::removeItem().
void Isis::Footprint2DView::save | ( | QXmlStreamWriter & | stream, |
Project * | project, | ||
FileName | newProjectRoot | ||
) | const |
Save the footprint view widgets (ImageFileListWidget and MosaicSceneWidget to an XML file.
stream | The XML stream writer |
newProjectRoot | The FileName of the project this Directory is attached to. |
Definition at line 380 of file Footprint2DView.cpp.
References m_fileListWidget, m_sceneWidget, and Isis::ImageFileListWidget::save().
Referenced by Isis::Directory::save().
|
virtualinherited |
Return the selected items of the model.
Definition at line 252 of file AbstractProjectItemView.cpp.
References Isis::AbstractProjectItemView::model(), and Isis::ProjectItemModel::selectedItems().
|
virtualinherited |
Sets the internal model of the view.
[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().
|
virtualinherited |
Sets the model used by the view.
If the internal model is a proxy model, it sets the source model.
[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().
|
virtualinherited |
Returns the suggested size.
Reimplemented in Isis::ProjectItemTreeView, and Isis::ControlHealthMonitorView.
Definition at line 67 of file AbstractProjectItemView.cpp.
|
private |
The active tool bar.
Definition at line 183 of file Footprint2DView.h.
Referenced by Footprint2DView(), and ~Footprint2DView().
|
private |
The directory.
Definition at line 180 of file Footprint2DView.h.
Referenced by enableActions(), and Footprint2DView().
|
private |
The file list widget.
Definition at line 176 of file Footprint2DView.h.
Referenced by fileListWidget(), Footprint2DView(), onItemRemoved(), onItemsAdded(), onMosItemRemoved(), save(), and ~Footprint2DView().
|
private |
Maps images to their items.
Definition at line 179 of file Footprint2DView.h.
Referenced by onItemAdded(), onItemRemoved(), onMosItemRemoved(), and onQueueSelectionChanged().
|
private |
The permanent tool bar.
Definition at line 182 of file Footprint2DView.h.
Referenced by Footprint2DView(), and ~Footprint2DView().
|
private |
The scene widget.
Definition at line 175 of file Footprint2DView.h.
Referenced by Footprint2DView(), mosaicSceneWidget(), onItemRemoved(), onItemsAdded(), onMosItemRemoved(), onQueueSelectionChanged(), and save().
|
private |
The tool pad.
Definition at line 184 of file Footprint2DView.h.
Referenced by enableControlNetTool(), Footprint2DView(), and ~Footprint2DView().
|
private |
Main window.
Definition at line 177 of file Footprint2DView.h.