Isis 3 Programmer Reference
Isis::MatrixSceneWidget Class Reference

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

#include <MatrixSceneWidget.h>

Inheritance diagram for Isis::MatrixSceneWidget:
Inheritance graph
Collaboration diagram for Isis::MatrixSceneWidget:
Collaboration graph

Public Slots

void redrawElements ()
 Redraw matrix when the focus is changed.
 

Signals

void mouseEnter ()
 Emitted when mouse enters widget focus.
 
void mouseMove (QPointF)
 Emitted when mouse moves in widget.
 
void mouseLeave ()
 Emitted when mouse leaves widget focus.
 
void mouseDoubleClick (QPointF)
 Emitted when handling a mouse double-click.
 
void mouseButtonPress (QPointF, Qt::MouseButton s)
 Emitted when mouse is pressed.
 
void mouseButtonRelease (QPointF, Qt::MouseButton s)
 Emitted when mouse button released.
 
void mouseWheel (QPointF, int delta)
 Emitted when mouse wheel is activated Emitted when rubber band selection is complete.
 
void rubberBandComplete (QRectF r, Qt::MouseButton s)
 
void visibleRectChanged (QRectF)
 Emitted when the visible rectangle is changed.
 
void elementsChanged ()
 Emitted when an element of the widget is changed.
 
void queueSelectionChanged ()
 Emitted when selection is changed.
 
void elementClicked (QString)
 Emitted when an element of the widget is clicked.
 

Public Member Functions

 MatrixSceneWidget (QStatusBar *status, bool showTools, bool internalizeToolBarsAndProgress, Directory *directory, QWidget *parent=0)
 Constructor, creates a matrix scene widget.
 
virtual ~MatrixSceneWidget ()
 Default Destructor.
 
MatrixGraphicsViewgetView () const
 Accessor for the QGraphicsView.
 
QGraphicsScenegetScene () const
 Accessor for the QGraphicsScene.
 
bool contextMenuEvent (QGraphicsSceneContextMenuEvent *event)
 This is called by MatrixGraphicsScene::contextMenuEvent.
 
void drawGrid (CorrelationMatrix corrMatrix)
 Draw the lines that will show the columns and blocks for each image.
 
void drawElements (CorrelationMatrix corrMatrix)
 Draw elements.
 
QProgressBargetProgress ()
 Accessor for the widget's progress bar.
 
PvlObject toPvl () const
 
void fromPvl (const PvlObject &)
 
QRectF elementsBoundingRect () const
 Returns the bounding rectangle for the images.
 
Directorydirectory () const
 Accessor for the directory.
 
QList< QAction * > getViewActions ()
 Accessor for the view actions.
 
QList< QAction * > supportedActions (CorrelationMatrix *matrix)
 Get a list of applicable actions for the elements in this scene.
 
void redrawItems ()
 Redraws all the items in the view.
 
void setUpOptions (CorrelationMatrix corrMat)
 Change item colors when options are changed.
 
template<typename DataType >
QList< QAction * > supportedActions (DataType)
 Return an empty list of actions for unknown data types.
 

Protected Member Functions

virtual bool eventFilter (QObject *obj, QEvent *ev)
 Pick the relevant actions given the type of event that occured in the scene.
 

Private Slots

void sendVisibleRectChanged ()
 This method refits the items in the graphics view.
 

Private Member Functions

QList< double > getSelectedElements () const
 

Private Attributes

Directorym_directory
 The directory of the project.
 
QGraphicsScenem_graphicsScene
 The graphics scene holds the scene items.
 
MatrixGraphicsViewm_graphicsView
 The graphics view that displays the scene.
 
QGraphicsRectItemm_outlineRect
 Rectangle outlining the area where the images go.
 
QActionm_quickMapAction
 ??? (always NULL)
 
ProgressBarm_progress
 Progress bar.
 
MatrixOptionsm_matrixOptions
 Options for the correlation matrix.
 

Detailed Description

This widget encompasses the entire matrixDisplay scene.

This widget is a self-contained view of the correlation matrix resulting from a bundle adjust. It uses Qt's graphics scene/view framework. This widget holds the graphics scene, view, and items. It will also hold the options dialog for the matrix.

Author
2014-05-10 Kimberly Oyama
History

2014-07-14 Kimberly Oyama - Original Version

2014-07-21 Kimberly Oyama - Added matrix options dialog. Color options are functional.

2016-06-27 Ian Humphrey - Updated documentation and coding standards. Fixes #4006.

Definition at line 51 of file MatrixSceneWidget.h.

Constructor & Destructor Documentation

◆ MatrixSceneWidget()

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

Constructor, creates a matrix scene widget.

Parameters
statusPointer to an existing status bar
showToolsWhether or not create a matrix scene or matrix world view
internalizeToolBarsAndProgressWhether or not to show progress and status
directoryThe directory of the current project
parentQPointer to the parent widget

Definition at line 52 of file MatrixSceneWidget.cpp.

References directory(), getView(), m_directory, m_graphicsScene, m_graphicsView, m_outlineRect, m_progress, m_quickMapAction, and sendVisibleRectChanged().

◆ ~MatrixSceneWidget()

Isis::MatrixSceneWidget::~MatrixSceneWidget ( )
virtual

Default Destructor.

Definition at line 152 of file MatrixSceneWidget.cpp.

References m_outlineRect.

Member Function Documentation

◆ contextMenuEvent()

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

This is called by MatrixGraphicsScene::contextMenuEvent.

Parameters
eventThe context menu event
Returns
bool false if not handled, true if handled.

Definition at line 184 of file MatrixSceneWidget.cpp.

References getScene().

◆ directory()

Directory * Isis::MatrixSceneWidget::directory ( ) const

Accessor for the directory.

Returns
Directory* The directory

Definition at line 275 of file MatrixSceneWidget.cpp.

References m_directory.

Referenced by MatrixSceneWidget().

◆ drawElements()

void Isis::MatrixSceneWidget::drawElements ( CorrelationMatrix corrMatrix)

Draw elements.

If element is drawn in black, something is wrong. The correlation value is out of range.

Need separate redraw method because we will already have the list of MatrixSceneItems.

Parameters
corrMatrixThe matrix that belongs to the project.

Definition at line 413 of file MatrixSceneWidget.cpp.

References Isis::MatrixOptions::badCorrelationColor(), Isis::MatrixOptions::colorScheme(), Isis::MatrixOptions::colorTolerance(), Isis::MatrixOptions::goodCorrelationColor(), m_graphicsScene, and m_matrixOptions.

Referenced by redrawElements().

◆ drawGrid()

void Isis::MatrixSceneWidget::drawGrid ( CorrelationMatrix corrMatrix)

Draw the lines that will show the columns and blocks for each image.

Parameters
corrMatrixThe matrix that belongs to the project

Definition at line 548 of file MatrixSceneWidget.cpp.

References m_graphicsScene.

◆ elementClicked

void Isis::MatrixSceneWidget::elementClicked ( QString )
signal

Emitted when an element of the widget is clicked.

Referenced by eventFilter().

◆ elementsBoundingRect()

QRectF Isis::MatrixSceneWidget::elementsBoundingRect ( ) const

Returns the bounding rectangle for the images.

Returns
QRectF Bounding rectangle for image elements

Definition at line 260 of file MatrixSceneWidget.cpp.

References m_outlineRect.

◆ elementsChanged

void Isis::MatrixSceneWidget::elementsChanged ( )
signal

Emitted when an element of the widget is changed.

◆ eventFilter()

bool Isis::MatrixSceneWidget::eventFilter ( QObject * obj,
QEvent * event )
protectedvirtual

Pick the relevant actions given the type of event that occured in the scene.

Mouse Events:

Press - Emit elementClicked signal to update the options dialog Release - nolowerColorValue? Double-Click - same as press Move - nolowerColorValue Enter - change label to match current item. Leave - clear label

Parameters
objPointer to the target QObject to watch events on
eventThe event to inspect
Returns
bool True if the event is filter (stopping all future processing of the event)

Definition at line 358 of file MatrixSceneWidget.cpp.

References elementClicked(), m_graphicsScene, m_graphicsView, and mouseDoubleClick().

◆ getProgress()

QProgressBar * Isis::MatrixSceneWidget::getProgress ( )

Accessor for the widget's progress bar.

Returns
QProgressBar* The progress bar

Definition at line 244 of file MatrixSceneWidget.cpp.

References m_progress.

◆ getScene()

QGraphicsScene * Isis::MatrixSceneWidget::getScene ( ) const

Accessor for the QGraphicsScene.

Returns
MatrixGraphicsScene* The matrix scene.

Definition at line 172 of file MatrixSceneWidget.cpp.

References m_graphicsScene.

Referenced by contextMenuEvent().

◆ getView()

MatrixGraphicsView * Isis::MatrixSceneWidget::getView ( ) const

Accessor for the QGraphicsView.

Returns
MatrixGraphicsView* The matrix view.

Definition at line 162 of file MatrixSceneWidget.cpp.

References m_graphicsView.

Referenced by MatrixSceneWidget(), and sendVisibleRectChanged().

◆ getViewActions()

QList< QAction * > Isis::MatrixSceneWidget::getViewActions ( )

Accessor for the view actions.

Returns
QList<QAction*> List of view actions

Definition at line 285 of file MatrixSceneWidget.cpp.

◆ mouseButtonPress

void Isis::MatrixSceneWidget::mouseButtonPress ( QPointF ,
Qt::MouseButton s )
signal

Emitted when mouse is pressed.

◆ mouseButtonRelease

void Isis::MatrixSceneWidget::mouseButtonRelease ( QPointF ,
Qt::MouseButton s )
signal

Emitted when mouse button released.

◆ mouseDoubleClick

void Isis::MatrixSceneWidget::mouseDoubleClick ( QPointF )
signal

Emitted when handling a mouse double-click.

Referenced by eventFilter().

◆ mouseEnter

void Isis::MatrixSceneWidget::mouseEnter ( )
signal

Emitted when mouse enters widget focus.

◆ mouseLeave

void Isis::MatrixSceneWidget::mouseLeave ( )
signal

Emitted when mouse leaves widget focus.

◆ mouseMove

void Isis::MatrixSceneWidget::mouseMove ( QPointF )
signal

Emitted when mouse moves in widget.

◆ mouseWheel

void Isis::MatrixSceneWidget::mouseWheel ( QPointF ,
int delta )
signal

Emitted when mouse wheel is activated Emitted when rubber band selection is complete.

◆ queueSelectionChanged

void Isis::MatrixSceneWidget::queueSelectionChanged ( )
signal

Emitted when selection is changed.

◆ redrawElements

void Isis::MatrixSceneWidget::redrawElements ( )
slot

Redraw matrix when the focus is changed.

Definition at line 616 of file MatrixSceneWidget.cpp.

References drawElements(), and m_matrixOptions.

Referenced by setUpOptions().

◆ redrawItems()

void Isis::MatrixSceneWidget::redrawItems ( )

Redraws all the items in the view.

Also makes sure to resize the view rectangle to fit the newly drawn items.

Definition at line 393 of file MatrixSceneWidget.cpp.

◆ sendVisibleRectChanged

void Isis::MatrixSceneWidget::sendVisibleRectChanged ( )
privateslot

This method refits the items in the graphics view.

Update the visible bounding rectangle

Definition at line 331 of file MatrixSceneWidget.cpp.

References getView(), and visibleRectChanged().

Referenced by MatrixSceneWidget().

◆ setUpOptions()

void Isis::MatrixSceneWidget::setUpOptions ( CorrelationMatrix corrMat)

Change item colors when options are changed.

Parameters
colorSchemeTrue if using tolerance. False if using gradient. Allows for changing the options on a CorrelationMatrix
corrMatThe matrix to set up options for

Definition at line 649 of file MatrixSceneWidget.cpp.

References m_matrixOptions, and redrawElements().

◆ supportedActions() [1/2]

QList< QAction * > Isis::MatrixSceneWidget::supportedActions ( CorrelationMatrix * matrix)

Get a list of applicable actions for the elements in this scene.

Parameters
matrixPointer to the CorrelationMatrix that belongs to the project
Returns
QList<QAction*> List of supported actions for the CorrelationMatrix elements

Definition at line 303 of file MatrixSceneWidget.cpp.

◆ supportedActions() [2/2]

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

Return an empty list of actions for unknown data types.

Parameters
DataTypeThe type of data we want to get actions for
Returns
QList<QAction*> Empty list of actions (currently)

Definition at line 93 of file MatrixSceneWidget.h.

◆ visibleRectChanged

void Isis::MatrixSceneWidget::visibleRectChanged ( QRectF )
signal

Emitted when the visible rectangle is changed.

Referenced by sendVisibleRectChanged().

Member Data Documentation

◆ m_directory

Directory* Isis::MatrixSceneWidget::m_directory
private

The directory of the project.

Definition at line 132 of file MatrixSceneWidget.h.

Referenced by directory(), and MatrixSceneWidget().

◆ m_graphicsScene

QGraphicsScene* Isis::MatrixSceneWidget::m_graphicsScene
private

The graphics scene holds the scene items.

Definition at line 134 of file MatrixSceneWidget.h.

Referenced by drawElements(), drawGrid(), eventFilter(), getScene(), and MatrixSceneWidget().

◆ m_graphicsView

MatrixGraphicsView* Isis::MatrixSceneWidget::m_graphicsView
private

The graphics view that displays the scene.

Definition at line 135 of file MatrixSceneWidget.h.

Referenced by eventFilter(), getView(), and MatrixSceneWidget().

◆ m_matrixOptions

MatrixOptions* Isis::MatrixSceneWidget::m_matrixOptions
private

Options for the correlation matrix.

Definition at line 143 of file MatrixSceneWidget.h.

Referenced by drawElements(), redrawElements(), and setUpOptions().

◆ m_outlineRect

QGraphicsRectItem* Isis::MatrixSceneWidget::m_outlineRect
private

Rectangle outlining the area where the images go.

Definition at line 137 of file MatrixSceneWidget.h.

Referenced by elementsBoundingRect(), MatrixSceneWidget(), and ~MatrixSceneWidget().

◆ m_progress

ProgressBar* Isis::MatrixSceneWidget::m_progress
private

Progress bar.

Definition at line 141 of file MatrixSceneWidget.h.

Referenced by getProgress(), and MatrixSceneWidget().

◆ m_quickMapAction

QAction* Isis::MatrixSceneWidget::m_quickMapAction
private

??? (always NULL)

Definition at line 139 of file MatrixSceneWidget.h.

Referenced by MatrixSceneWidget().


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