Isis 3 Programmer Reference
Isis::MosaicSceneWidget Class Reference

This widget encompasses the entire mosaic scene. More...

#include <MosaicSceneWidget.h>

Inheritance diagram for Isis::MosaicSceneWidget:
Inheritance graph
Collaboration diagram for Isis::MosaicSceneWidget:
Collaboration graph

Classes

class  XmlHandler
 

Public Slots

void addImages (ImageList)
 
void removeImages (ImageList)
 
void refit ()
 This method refits t:he items in the graphics view. More...
 
void setCubesSelectable (bool)
 
void setProjection (Projection *)
 This method takes ownership of proj. More...
 
void setOutlineRect (QRectF)
 

Signals

void mouseEnter ()
 
void mouseMove (QPointF)
 
void mouseLeave ()
 
void mouseDoubleClick (QPointF)
 
void mouseButtonPress (QPointF, Qt::MouseButton s)
 
void mouseButtonRelease (QPointF, Qt::MouseButton s)
 
void mouseWheel (QPointF, int delta)
 
void projectionChanged (Projection *)
 
void rubberBandComplete (QRectF r, Qt::MouseButton s)
 
void visibleRectChanged (QRectF)
 
void cubesChanged ()
 
void queueSelectionChanged ()
 
void modifyControlPoint (ControlPoint *controlPoint)
 
void deleteControlPoint (ControlPoint *controlPoint)
 
void createControlPoint (double latitude, double longitude)
 
void controlPointSelected (ControlPoint *)
 
void cnetModified ()
 
void controlPointChanged (QString pointId)
 
void controlPointDeleted ()
 
void mosCubeClosed (Image *)
 

Public Member Functions

 MosaicSceneWidget (QStatusBar *status, bool showTools, bool internalizeToolBarsAndProgress, Directory *directory, QWidget *parent=0)
 Create a scene widget. More...
 
MosaicGraphicsViewgetView () const
 
QGraphicsScenegetScene () const
 
ProjectiongetProjection () const
 
QList< MosaicSceneItem * > allMosaicSceneItems ()
 
void addTo (QMenu *menu)
 
void addTo (ToolPad *toolPad)
 
void addToPermanent (QToolBar *toolBar)
 
void addTo (QToolBar *toolBar)
 
bool contextMenuEvent (QGraphicsSceneContextMenuEvent *event)
 This is called by MosaicGraphicsScene::contextMenuEvent. More...
 
MosaicSceneItemcubeToMosaic (Image *)
 
bool cubesSelectable () const
 
void enableRubberBand (bool)
 
bool blockSelectionChange (bool)
 
bool userHasTools () const
 
QProgressBargetProgress ()
 
PvlObject toPvl () const
 
void fromPvl (const PvlObject &)
 Call this method after loading any cubes when loading a project. More...
 
void load (XmlStackedHandlerReader *xmlReader)
 
void save (QXmlStreamWriter &stream, Project *project, FileName newProjectRoot) const
 
QRectF cubesBoundingRect () const
 
QStringList cubeFileNames ()
 
Directorydirectory () const
 
ImageList images ()
 
ImageList selectedImages ()
 Returns a list of all the cubes selected in the scene. More...
 
QList< QAction * > getExportActions ()
 
QList< QAction * > getViewActions ()
 
QList< QAction * > supportedActions (ImageList *)
 Get a list of actions this scene can perform given "images". More...
 
double moveDownOne (MosaicSceneItem *)
 
double moveDownOne (Image *)
 
QList< double > moveDownOne (ImageList *)
 
double moveToBottom (MosaicSceneItem *)
 This doesn't compress the Z values - the original Z values of this scene item is guaranteed to be empty after this operation. More...
 
double moveToBottom (Image *)
 This doesn't compress the Z values - the original Z value of this image is guaranteed to be empty after this operation. More...
 
QList< double > moveToBottom (ImageList *)
 This doesn't compress the Z values - the original Z values of these images are guaranteed to be empty after this operation. More...
 
double moveUpOne (MosaicSceneItem *)
 
double moveUpOne (Image *)
 
QList< double > moveUpOne (ImageList *)
 
double moveToTop (MosaicSceneItem *)
 This doesn't compress the Z values - the original Z values of this scene item is guaranteed to be empty after this operation. More...
 
double moveToTop (Image *)
 This doesn't compress the Z values - the original Z value of this image is guaranteed to be empty after this operation. More...
 
QList< double > moveToTop (ImageList *)
 This doesn't compress the Z values - the original Z values of these images are guaranteed to be empty after this operation. More...
 
double moveZ (MosaicSceneItem *sceneItem, double newZ, bool newZValueMightExist=true)
 This method moves the given scene item to the given Z value. More...
 
double moveZ (Image *image, double newZ, bool newZValueMightExist=true)
 
template<typename DataType >
QList< QAction * > supportedActions (DataType)
 Return an empty list of actions for unknown data types. More...
 
bool isControlNetToolActive ()
 

Static Public Member Functions

static QWidgetgetControlNetHelp (QWidget *cnetToolContainer=NULL)
 
static QWidgetgetGridHelp (QWidget *gridToolContainer=NULL)
 
static QWidgetgetLongHelp (QWidget *mosaicSceneContainer=NULL)
 
static QWidgetgetMapHelp (QWidget *mapContainer=NULL)
 
static QWidgetgetPreviewHelp (QWidget *worldViewContainer=NULL)
 

Protected Member Functions

virtual bool eventFilter (QObject *obj, QEvent *ev)
 

Private Slots

void exportView ()
 Saves the scene as a png, jpg, or tif file. More...
 
void saveList ()
 
void removeMosItem (QObject *)
 
void moveDownOne ()
 
void moveToBottom ()
 
void moveUpOne ()
 
void moveToTop ()
 
void fitInView ()
 
void onSelectionChanged ()
 
void onQueuedSelectionChanged ()
 
void configProjectionParameters ()
 This happens when the user clicks on the map action (the button that is named after the current projection). More...
 
void quickConfigProjectionParameters ()
 
void sendVisibleRectChanged ()
 

Private Member Functions

void setProjection (const PvlGroup &mappingGroup, Pvl label=Pvl())
 
MosaicSceneItemaddImage (Image *image)
 
void reprojectItems ()
 Reprojects all the items in the view. More...
 
double maximumZ ()
 
double minimumZ ()
 
void recalcSceneRect ()
 
MosaicSceneItemgetNextItem (MosaicSceneItem *item, bool up)
 Implemented because we want invisible items too. More...
 
PvlGroup createInitialProjection (Image *cube)
 
MosaicSceneItemcubeToMosaic (DisplayProperties *props)
 

Static Private Member Functions

static bool zOrderGreaterThan (MosaicSceneItem *first, MosaicSceneItem *second)
 

Private Attributes

Directorym_directory
 
bool m_cubesSelectable
 
bool m_customRubberBandEnabled
 
QRubberBand * m_customRubberBand
 
QPoint * m_rubberBandOrigin
 
QGraphicsScenem_graphicsScene
 The graphics scene that makes up this widget. More...
 
MosaicGraphicsViewm_graphicsView
 The graphics view. More...
 
Projectionm_projection
 The current projection type. More...
 
QList< MosaicSceneItem * > * m_mosaicSceneItems
 
QMap< DisplayProperties *, MosaicSceneItem * > m_displayPropsToMosaicSceneItemMap
 
QGraphicsRectItemm_outlineRect
 
QToolButton * m_mapButton
 
QActionm_quickMapAction
 
QList< MosaicTool * > * m_tools
 
ToolPadm_toolpad
 
QToolBarm_permToolbar
 
QToolBarm_activeToolbar
 
ProgressBarm_progress
 
QHash< QString, double > * m_projectImageZOrders
 
bool m_blockingSelectionChanged
 
bool m_userToolControl
 
bool m_ownProjection
 
bool m_queuedSelectionChanged
 
bool m_shouldRequeueSelectionChanged
 
double m_currentMinimumFootprintZ
 
double m_currentMaximumFootprintZ
 
PvlObjectm_projectViewTransform
 

Detailed Description

This widget encompasses the entire mosaic scene.

This widget is a self-contained 2D footprint view using Qt's graphics scene/view framework.

Author
????-??-?? Stacy Alley
History:
2010-05-10 Christopher Austin - Added cnet connectivity functionality and fixed a few design issues
History:
2011-04-01 Steven Lambright - Separated this class from the MosaicWidget class.
History:
2011-05-10 Steven Lambright - Reduced unnecessary code, fixed toolTips to work on everything (not just cubes).
History:
2011-05-17 Steven Lambright - More robust createInitialProj
History:
2011-05-17 Steven Lambright - Target radii recalculated when the user specifies a map file, if they are missing.
History:
2011-05-20 Steven Lambright - Improved error handling when reprojecting.
History:
2011-07-29 Steven Lambright - Z-ordering is now saved and restored in the project files. references #275
History:
2011-08-12 Steven Lambright - Added export options, references #342
History:
2011-08-29 Steven Lambright - Re-worded export file list option, references #342
History:
2011-09-27 Steven Lambright - Improved user documentation
History:
2011-11-04 Steven Lambright - Added the zoom factor and scroll bar position to the project file. References #542.
History:
2011-11-04 Steven Lambright - The mouse wheel events no longer cause panning. The qt code for QAbstractGraphicsView was looking at the event's accepted state. This being fixed means the mouse wheel can be used for zooming! Also added getViewActions in order to allow the zooming key shortcuts from the zoom tool to take effect when the zoom tool wasn't active.
History:
2012-06-20 Debbie A. Cook, Updated Spice members to be more compliant with Isis coding standards. References #972.
History:
2012-07-26 Kimberly Oyama - Updated the help documentation for the grid tool to include tips for the options dialog and the new 'Auto Grid' functionality. References #604.
History:
2012-08-27 Tracie Sucharski - This widget now handles the creation of its own tools to the toolbars. Because this widget is used by qmos to create both the world scene and mosaic scene, the bool showTools was added to the constructor so that toolbars are not shown in the world scene.
History:
2012-09-12 Steven Lambright - Added xml save/load capabilities.
History:
2012-09-17 Steven Lambright - Added very basic right-click on multiple images capabilities. Increased performance.
History:
2012-10-02 Stuart Sides and Steven Lambright - Added supportedActions() and updated fitInView() to work when called by an action with an ImageList for data.
History:
2012-10-03 Steven Lambright - Removed createReferenceFootprint() - this was dead code that the grid tool handles now.
History:
2012-10-11 Debbie A. Cook, Updated to use new Target class. References Mantis tickets #775 and #1114.
History:
2012-10-19 Steven Lambright and Stuart Sides - Added moveUpOne(), moveDownOne(), moveToTop(), and moveToBottom() methods with new, more abstracted arguments. Added moveZ(). Improved fitInView() capabilities. Added supportedActions().
History:
2013-01-31 Steven Lambright - Fixed a problem caused by #1312 - when the minimum longitude wasn't defined in the map file, the one generated by qmos was invalid. Fixes #1406.
History:
2012-12-21 Steven Lambright - Renamed askNewProjection() to configProjectionParameters() and upgraded it's functionality to view and edit the current projection. Fixes #1034.
History:
2013-12-24 Tracie Sucharski - Initialized bool member variables, m_queuedSelectionChanged and m_shouldRequestSelectionChanged. Removed unused private member, m_projectionFootprint. The uninitialized values were causing the qmos selection tool to not work properly. Fixes #1742.
History:
2014-07-18 Kimberly Oyama and Tracie Sucharski - Added selectedCubes() and other control net functionality for IPCE.
History:
2016-04-22 Jeannie Backer - Added label parameter to setProjection(mapGroup, label). The default value for label is an empty Pvl. Also, modified addImage() to pass the label from the cube of the image to be added into setProjection(mapGroup, label). This was done to be able to call TProjection::TargetRadii(label,mapGroup), which will in turn will now call Target::radiiGroup(targetName), if needed. References #3892
History:
2016-08-28 Kelvin Rodriguez - Added using QWidget::contextMenuEvent to avoid hidden virtual function warnings in clang. Part of porting to OS X 10.11.
History:
2016-09-14 Ian Humphrey - Replaced deprecated QPixmap::grabWidget with QWidget::grab. Fixes #4304.
History:
2016-04-22 Jeannie Backer - Added label parameter to setProjection(mapGroup, label). The default value for label is an empty Pvl. Also, modified addImage() to pass the label from the cube of the image to be added into setProjection(mapGroup, label). This was done to be able to call TProjection::TargetRadii(label,mapGroup), which will in turn will now call Target::radiiGroup(targetName), if needed. References #3892
History:
2016-08-02 Tracie Sucharski - Added public method to remove an Image from scene.
History:
2016-09-14 Tracie Sucharski - Added signals for mouse clicks for modifying, deleting and creating control points. These are passed on to Footprint2DView signals, then on to Directory slots.
History:
2016-11-07 Ian Humphrey - Restored the startElement() functionality so footprints can be correctly loaded from an XML storing the MosaicScenWidget's state. Fixes #4486.
History:
2017-07-27 Makayla Shepherd - Fixed a segfault that occurred when closing a cube footprint. Fixes #5050.
History:
2017-08-02 Tracie Sucharski - Added cnetModified signal to indicate that the control point graphics items need to be rebuilt since either a control point was deleted or added to the control net. Renamed deleteControlPoint signal to controlPointDeleted. Removed some unneeded connections. Fixes #5007, #5008.
History:
2018-05-14 Tracie Sucharski - Change the xml tag from footprint2DView to mosaicScene. Reference #5422.
History:
2018-10-04 Tracie Sucharski - When serializing images for ipce project saving, check for shapes in project if image for given id cannot be found. References #5495.

Definition at line 153 of file MosaicSceneWidget.h.

Constructor & Destructor Documentation

◆ MosaicSceneWidget()

Isis::MosaicSceneWidget::MosaicSceneWidget ( QStatusBar *  status,
bool  showTools,
bool  internalizeToolBarsAndProgress,
Directory directory,
QWidget parent = 0 
)

Create a scene widget.

Definition at line 66 of file MosaicSceneWidget.cpp.

References m_graphicsScene, m_graphicsView, and m_projection.

Member Function Documentation

◆ configProjectionParameters

void Isis::MosaicSceneWidget::configProjectionParameters ( )
privateslot

This happens when the user clicks on the map action (the button that is named after the current projection).

This method pops up a modal configuration dialog for the map file.

Definition at line 1515 of file MosaicSceneWidget.cpp.

◆ contextMenuEvent()

bool Isis::MosaicSceneWidget::contextMenuEvent ( QGraphicsSceneContextMenuEvent *  event)

This is called by MosaicGraphicsScene::contextMenuEvent.

Return false if not handled, true if handled.

Definition at line 442 of file MosaicSceneWidget.cpp.

References Isis::ImageList::append(), Isis::Directory::project(), selectedImages(), Isis::Directory::supportedActions(), and Isis::ImageList::supportedActions().

◆ exportView

void Isis::MosaicSceneWidget::exportView ( )
privateslot

Saves the scene as a png, jpg, or tif file.

Definition at line 1427 of file MosaicSceneWidget.cpp.

◆ fromPvl()

void Isis::MosaicSceneWidget::fromPvl ( const PvlObject project)

Call this method after loading any cubes when loading a project.

Parameters
projectThe project Pvl

Definition at line 581 of file MosaicSceneWidget.cpp.

References Isis::PvlObject::findGroup(), Isis::PvlObject::findObject(), Isis::PvlObject::hasObject(), Isis::PvlContainer::keywords(), setProjection(), and Isis::toDouble().

◆ getNextItem()

MosaicSceneItem * Isis::MosaicSceneWidget::getNextItem ( MosaicSceneItem item,
bool  up 
)
private

Implemented because we want invisible items too.

Definition at line 2074 of file MosaicSceneWidget.cpp.

◆ moveToBottom() [1/3]

double Isis::MosaicSceneWidget::moveToBottom ( Image image)

This doesn't compress the Z values - the original Z value of this image is guaranteed to be empty after this operation.

Definition at line 1810 of file MosaicSceneWidget.cpp.

References moveToBottom().

◆ moveToBottom() [2/3]

QList< double > Isis::MosaicSceneWidget::moveToBottom ( ImageList images)

This doesn't compress the Z values - the original Z values of these images are guaranteed to be empty after this operation.

Definition at line 1819 of file MosaicSceneWidget.cpp.

References moveToBottom().

◆ moveToBottom() [3/3]

double Isis::MosaicSceneWidget::moveToBottom ( MosaicSceneItem item)

This doesn't compress the Z values - the original Z values of this scene item is guaranteed to be empty after this operation.

Definition at line 1789 of file MosaicSceneWidget.cpp.

Referenced by moveToBottom().

◆ moveToTop() [1/3]

double Isis::MosaicSceneWidget::moveToTop ( Image image)

This doesn't compress the Z values - the original Z value of this image is guaranteed to be empty after this operation.

Definition at line 1918 of file MosaicSceneWidget.cpp.

References moveToTop().

◆ moveToTop() [2/3]

QList< double > Isis::MosaicSceneWidget::moveToTop ( ImageList images)

This doesn't compress the Z values - the original Z values of these images are guaranteed to be empty after this operation.

Definition at line 1927 of file MosaicSceneWidget.cpp.

References moveToTop().

◆ moveToTop() [3/3]

double Isis::MosaicSceneWidget::moveToTop ( MosaicSceneItem item)

This doesn't compress the Z values - the original Z values of this scene item is guaranteed to be empty after this operation.

Definition at line 1887 of file MosaicSceneWidget.cpp.

Referenced by moveToTop().

◆ moveZ()

double Isis::MosaicSceneWidget::moveZ ( MosaicSceneItem sceneItem,
double  newZ,
bool  newZValueMightExist = true 
)

This method moves the given scene item to the given Z value.

By default, this does not create gaps in the Z-values and makes the necessary room/adjustments for the new item to go to it's spot. If the last operation was moveToTop or moveToBottom, because those methods don't compress/adjust the surrounding Z values, we can avoid any and all adjustments here (significant performance boost) by using newZValueMightExist=false.

N = # items in the scene The time complexity of this method is N if newZValueMightExist. The time complexity of this method is constant if !newZValueMightExist.

Parameters
sceneItemThe item in this scene to change the Z value
newZThe new Z value for the item
newZValueMightExistTrue if an item in the scene might occupy the new Z value

Definition at line 1955 of file MosaicSceneWidget.cpp.

Referenced by Isis::MosaicSceneWorkOrder::restoreZPositions().

◆ refit

void Isis::MosaicSceneWidget::refit ( )
slot

This method refits t:he items in the graphics view.

Definition at line 1485 of file MosaicSceneWidget.cpp.

Referenced by reprojectItems(), and Isis::MosaicZoomTool::zoomFit().

◆ reprojectItems()

void Isis::MosaicSceneWidget::reprojectItems ( )
private

Reprojects all the items in the view.

Also makes sure to resize the view rectangle to fit the newly projected footprints.

Definition at line 1680 of file MosaicSceneWidget.cpp.

References Isis::DisplayProperties::displayName(), Isis::Image::displayProperties(), Isis::IException::print(), Isis::IException::Programmer, refit(), Isis::MosaicSceneItem::reproject(), and Isis::ProgressBar::setText().

Referenced by setProjection().

◆ selectedImages()

ImageList Isis::MosaicSceneWidget::selectedImages ( )

Returns a list of all the cubes selected in the scene.

Returns
QList<Cube *>

Definition at line 742 of file MosaicSceneWidget.cpp.

References Isis::ImageList::append().

Referenced by contextMenuEvent(), and Isis::Footprint2DView::onQueueSelectionChanged().

◆ setProjection

void Isis::MosaicSceneWidget::setProjection ( Projection proj)
slot

This method takes ownership of proj.

Definition at line 290 of file MosaicSceneWidget.cpp.

References Isis::PvlContainer::findKeyword(), m_projection, and reprojectItems().

Referenced by fromPvl().

◆ supportedActions() [1/2]

template<typename DataType >
QList<QAction *> Isis::MosaicSceneWidget::supportedActions ( DataType  )
inline

Return an empty list of actions for unknown data types.

Definition at line 240 of file MosaicSceneWidget.h.

◆ supportedActions() [2/2]

QList< QAction * > Isis::MosaicSceneWidget::supportedActions ( ImageList images)

Get a list of actions this scene can perform given "images".

Definition at line 812 of file MosaicSceneWidget.cpp.

References Isis::Directory::project(), and Isis::WorkOrder::setData().

Member Data Documentation

◆ m_graphicsScene

QGraphicsScene* Isis::MosaicSceneWidget::m_graphicsScene
private

The graphics scene that makes up this widget.

Definition at line 364 of file MosaicSceneWidget.h.

Referenced by MosaicSceneWidget().

◆ m_graphicsView

MosaicGraphicsView* Isis::MosaicSceneWidget::m_graphicsView
private

The graphics view.

Definition at line 365 of file MosaicSceneWidget.h.

Referenced by MosaicSceneWidget().

◆ m_projection

Projection* Isis::MosaicSceneWidget::m_projection
private

The current projection type.

Definition at line 366 of file MosaicSceneWidget.h.

Referenced by MosaicSceneWidget(), and setProjection().


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