USGS

Isis 3.0 Object Programmers' Reference

Home

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 refit ()
 This method refits t:he items in the graphics view.
 
void setCubesSelectable (bool)
 
void setProjection (Projection *)
 This method takes ownership of proj.
 
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 ()
 

Public Member Functions

 MosaicSceneWidget (QStatusBar *status, bool showTools, bool internalizeToolBarsAndProgress, Directory *directory, QWidget *parent=0)
 Create a scene widget.
 
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.
 
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.
 
void load (XmlStackedHandlerReader *xmlReader)
 
void save (QXmlStreamWriter &stream, Project *project, FileName newProjectRoot) const
 
QRectF cubesBoundingRect () const
 
QStringList cubeFileNames ()
 
Directorydirectory () const
 
ImageList images ()
 
QList< QAction * > getExportActions ()
 
QList< QAction * > getViewActions ()
 
QList< QAction * > supportedActions (ImageList *)
 Get a list of actions this scene can perform given "images".
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
double moveUpOne (MosaicSceneItem *)
 
double moveUpOne (Image *)
 
QList< double > moveUpOne (ImageList *)
 
double moveZ (MosaicSceneItem *sceneItem, double newZ, bool newZValueMightExist=true)
 This method moves the given scene item to the given Z value.
 
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.
 

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.
 
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).
 
void quickConfigProjectionParameters ()
 
void sendVisibleRectChanged ()
 

Private Member Functions

void setProjection (const PvlGroup &)
 
MosaicSceneItemaddImage (Image *)
 
void reprojectItems ()
 Reprojects all the items in the view.
 
double maximumZ ()
 
double minimumZ ()
 
void recalcSceneRect ()
 
MosaicSceneItemgetNextItem (MosaicSceneItem *item, bool up)
 Implemented because we want invisible items too.
 
PvlGroup createInitialProjection (Image *cube)
 
MosaicSceneItemcubeToMosaic (DisplayProperties *props)
 
ImageList getSelectedCubes () const
 Returns a list of all the cubes selected in the scene.
 

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.
 
MosaicGraphicsViewm_graphicsView
 The graphics view.
 
Projectionm_projection
 The current projection type.
 
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

2011-04-01 Steven Lambright - Separated this class from the MosaicWidget class.

2011-05-10 Steven Lambright - Reduced unnecessary code, fixed toolTips to work on everything (not just cubes).

2011-05-17 Steven Lambright - More robust createInitialProj

2011-05-17 Steven Lambright - Target radii recalculated when the user specifies a map file, if they are missing.

2011-05-20 Steven Lambright - Improved error handling when reprojecting.

2011-07-29 Steven Lambright - Z-ordering is now saved and restored in the project files. references #275

2011-08-12 Steven Lambright - Added export options, references #342

2011-08-29 Steven Lambright - Re-worded export file list option, references #342

2011-09-27 Steven Lambright - Improved user documentation

2011-11-04 Steven Lambright - Added the zoom factor and scroll bar position to the project file. References #542.

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.

2012-06-20 Debbie A. Cook, Updated Spice members to be more compliant with Isis coding standards. References #972.

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.

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.

2012-09-12 Steven Lambright - Added xml save/load capabilities.

2012-09-17 Steven Lambright - Added very basic right-click on multiple images capabilities. Increased performance.

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.

2012-10-03 Steven Lambright - Removed createReferenceFootprint() - this was dead code that the grid tool handles now.

2012-10-11 Debbie A. Cook, Updated to use new Target class. References Mantis tickets #775 and #1114.

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().

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.

2012-12-21 Steven Lambright - Renamed askNewProjection() to configProjectionParameters() and upgraded it's functionality to view and edit the current projection. Fixes #1034.

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.

Definition at line 110 of file MosaicSceneWidget.h.

Constructor & Destructor Documentation

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

Create a scene widget.

Definition at line 53 of file MosaicSceneWidget.cpp.

References m_graphicsScene, m_graphicsView, and m_projection.

Member Function Documentation

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 1436 of file MosaicSceneWidget.cpp.

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

This is called by MosaicGraphicsScene::contextMenuEvent.

Return false if not handled, true if handled.

Definition at line 431 of file MosaicSceneWidget.cpp.

References Isis::ImageList::append(), and Isis::ImageList::supportedActions().

void Isis::MosaicSceneWidget::exportView ( )
privateslot

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

Definition at line 1348 of file MosaicSceneWidget.cpp.

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 570 of file MosaicSceneWidget.cpp.

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

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

Implemented because we want invisible items too.

Definition at line 1999 of file MosaicSceneWidget.cpp.

ImageList Isis::MosaicSceneWidget::getSelectedCubes ( ) const
private

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

Returns
QList<Cube *>

Definition at line 354 of file MosaicSceneWidget.cpp.

References Isis::ImageList::append().

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 1730 of file MosaicSceneWidget.cpp.

Referenced by moveToBottom().

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 1751 of file MosaicSceneWidget.cpp.

References moveToBottom().

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 1760 of file MosaicSceneWidget.cpp.

References moveToBottom().

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 1775 of file MosaicSceneWidget.cpp.

Referenced by moveToTop().

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 1806 of file MosaicSceneWidget.cpp.

References moveToTop().

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 1815 of file MosaicSceneWidget.cpp.

References moveToTop().

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 1880 of file MosaicSceneWidget.cpp.

void Isis::MosaicSceneWidget::refit ( )
slot

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

Definition at line 1406 of file MosaicSceneWidget.cpp.

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

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 1602 of file MosaicSceneWidget.cpp.

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

Referenced by setProjection().

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

This method takes ownership of proj.

Definition at line 260 of file MosaicSceneWidget.cpp.

References m_projection, and reprojectItems().

Referenced by fromPvl().

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

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

Definition at line 759 of file MosaicSceneWidget.cpp.

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

Return an empty list of actions for unknown data types.

Definition at line 189 of file MosaicSceneWidget.h.

Member Data Documentation

QGraphicsScene* Isis::MosaicSceneWidget::m_graphicsScene
private

The graphics scene that makes up this widget.

Definition at line 300 of file MosaicSceneWidget.h.

Referenced by MosaicSceneWidget().

MosaicGraphicsView* Isis::MosaicSceneWidget::m_graphicsView
private

The graphics view.

Definition at line 301 of file MosaicSceneWidget.h.

Referenced by MosaicSceneWidget().

Projection* Isis::MosaicSceneWidget::m_projection
private

The current projection type.

Definition at line 302 of file MosaicSceneWidget.h.

Referenced by MosaicSceneWidget(), and setProjection().


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