Isis 3 Programmer Reference
Isis::MosaicControlNetTool Class Reference

//TODO: Remove debug printout & comment // 2016-08-25 Tracie Sucharski - Checking Directory pointer for IPCE code not ideal. More...

#include <MosaicControlNetTool.h>

Inheritance diagram for Isis::MosaicControlNetTool:
Inheritance graph
Collaboration diagram for Isis::MosaicControlNetTool:
Collaboration graph

Public Types

enum  MovementColorSource { NoMovement = 0 , NoColor , MeasureCount , ResidualMagnitude }
 This enum defines how to draw the movement arrows (arrows from CP A Priori location to adjusted location). More...
 

Public Slots

void loadNetwork ()
 Load m_controlNetFile into memory - this will re-load the network if it's already open.
 
void rebuildPointGraphics ()
 Slot used to re-create the graphics items that depict the control points.
 
void displayNewControlPoint (QString pointId)
 
void displayChangedControlPoint (QString pointId)
 
void displayUponControlPointDeletion ()
 
void activate (bool)
 Activates the tool.
 

Signals

void modifyControlPoint (ControlPoint *controlPoint)
 
void deleteControlPoint (ControlPoint *controlPoint)
 
void createControlPoint (double latitude, double longitude)
 
void controlPointSelected (ControlPoint *)
 
void deleteControlPoint (QString controlPointId)
 
void activated (bool)
 

Public Member Functions

 MosaicControlNetTool (MosaicSceneWidget *)
 MosaicControlNetTool constructor.
 
void addToMenu (QMenu *menu)
 
PvlObject toPvl () const
 
void fromPvl (const PvlObject &obj)
 
QString projectPvlObjectName () const
 
void setMovementArrowColorSource (MovementColorSource, int, double)
 Define how the movement arrows should be drawn.
 
MovementColorSource movementArrowColorSource () const
 Get the current setting for the movement arrows.
 
int maxMovementColorMeasureCount () const
 Get the current measure count to become fully colored.
 
double maxMovementColorResidualMagnitude () const
 Get the current max.
 
bool isActive () const
 Returns the activeness of this toool.
 
QPixmap getIcon (QString iconName) const
 returns the path to the icon directory.
 
virtual void addTo (QMenu *menu)
 
virtual void addTo (ToolPad *toolPad)
 
virtual void addTo (QToolBar *toolBar)
 
virtual QList< QAction * > getViewActions ()
 

Static Public Member Functions

static QString toString (MovementColorSource)
 Convert a MovementColorSource to a string for serialization purposes.
 
static MovementColorSource fromMovementColorSourceString (QString)
 Convert a string back to a MovementColorSource (for serialization purposes).
 

Static Public Attributes

static const int NUM_MOVEMENT_COLOR_SOURCE_VALUES = 4
 This is the count of possible values of MovementColorSource (useful for loops).
 

Protected Member Functions

QActiongetPrimaryAction ()
 Adds the action to the toolpad.
 
QWidgetgetToolBarWidget ()
 This method returns a widget that will be put in a tool bar when the tool is activated.
 
void mouseButtonRelease (QPointF, Qt::MouseButton s)
 
virtual void mouseEnter ()
 
virtual void mouseMove (QPointF)
 
virtual void mouseLeave ()
 
virtual void mouseDoubleClick (QPointF)
 
virtual void mouseButtonPress (QPointF, Qt::MouseButton s)
 
virtual void mouseWheel (QPointF, int delta)
 
virtual void rubberBandComplete (QRectF r, Qt::MouseButton s)
 
void toolBarDestroyed (QObject *obj)
 
MosaicSceneWidgetgetWidget ()
 

Private Slots

void configMovement ()
 Bring up a movement arrow configuration dialog.
 
void updateTool ()
 This slot opens and reopens this tool properly.
 
void openControlNet ()
 Loads a control net from a file.
 
void displayControlNet ()
 The user toggled the cnet visibility - re-sync the graphics item visibility with the action.
 
void displayConnectivity ()
 Displays the connectivity of Control Points.
 
void closeNetwork ()
 Close the open network, if one is open.
 
void randomizeColors ()
 
void objectDestroyed (QObject *)
 An object was destroyed, NULL it out.
 

Private Member Functions

void createDialog ()
 
ImagetakeImage (QString sn, ImageList &images)
 
void enableToolBar ()
 Enables entire tool bar.
 
void disableToolBar ()
 Disables entire tool bar.
 

Private Attributes

QPushButton * m_loadControlNetButton
 
QPushButton * m_displayControlNetButton
 
QPushButton * m_displayConnectivity
 
QPushButton * m_configMovement
 
QPushButton * m_closeNetwork
 
QPushButton * m_randomizeColors
 
QActionm_connectivity
 
ControlNetm_controlNet
 
ControlNetGraphicsItemm_controlNetGraphics
 
QLabel * m_controlNetFileLabel
 
QString m_controlNetFile
 
MovementColorSource m_movementArrowColorSource
 This defines the drawing mode of the apriori to adjusted arrows.
 
int m_measureCount
 This is the measure count at which we start coloring the movement arrows.
 
double m_residualMagnitude
 This is the residual magnitude at which we coloring the movement arrows.
 
bool p_active
 Is the tool active?
 
MosaicSceneWidgetp_widget
 
QActionp_primaryAction
 
QActionp_toolBarAction
 

Detailed Description

//TODO: Remove debug printout & comment // 2016-08-25 Tracie Sucharski - Checking Directory pointer for IPCE code not ideal.

Is there a better design? This might go away if we emit signals, which only IPCE classes would connect to.

Handles Control Net displays

Author
????-??-?? Christopher Austin
History

2010-06-24 Christopher Austin - Added |x| functionality and fixed control net loading

2011-05-07 Steven Lambright - Refactored.

2011-05-10 Steven Lambright - Reduced useless code, open cnet button is now always enabled.

2011-05-10 Steven Lambright - Added label for currently open network.

2011-09-27 Steven Lambright - Improved user documentation. Made the open control network button more obvious.

2013-01-02 Steven Lambright - Implemented movement arrow colorization. This is a quick and dirty implementation designed to get the most basic functionality working with minimal options. Added the enum MovementColorSource and the methods setMovementArrowColorSource(), movementArrowColorSource(), maxMovementColorMeasureCount(), maxMovementColorResidualMagnitude(), toString(), and fromMovementColorSourceString(). Fixes #479.

2013-01-31 Steven Lambright - Removed some debugging statements that were left around from the last change. Fixes #1459.

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

2016-08-25 Tracie Sucharski - Fixed IPCE code which caused qmos to segfault. Added checks for the existence of a Directory pointer in the openControlNet and mouseButtonRelease methods. If Directory point is NULL, IPCE code not executed. Fixes #4063.

2017-01-03 Tracie Sucharski - If IPCE, set m_controlNet to active control net in the loadNetwork method and do not display Load/Close Network button if IPCE.

2017-05-11 Tracie Sucharski - Tools can be created with a Null value for the MosaicSceneWidget, so need to check for Null value getWidget() in Tool constructor. This was causing a segfault when accessing qmos help and a Qt connection error.

2017-07-06 Tracie Sucharski - Added documentation for conditional code necessary for ipce application.

2017-08-02 Tracie Sucharski - Added slot to rebuild the graphics items that depict the control points. This is used to update these items if a control point was added or deleted. Fixes #5007, #5008.

2017-08-15 Tracie Sucharski - Added check in rebuildPointGraphics() to check for existence of graphics items. Fixes #4984.

2018-07-12 Tracie Sucharski - Made the slot loadNetwork public so that ipce can load a new network.

2018-09-19 Tracie Sucharski - For the ipce application, update the control net file name in the toolbar when a new active control is set. Fixes #5518.

Definition at line 74 of file MosaicControlNetTool.h.

Member Enumeration Documentation

◆ MovementColorSource

This enum defines how to draw the movement arrows (arrows from CP A Priori location to adjusted location).

These settings include whether the arrows are shown and how to color them.

NOTE: It's important to start at zero. Also, if you add to this enumeration, be sure to update NUM_MOVEMENT_COLOR_SOURCE_VALUES.

Enumerator
NoMovement 

Do not show movement arrows.

NoColor 

Show black movement arrows.

MeasureCount 

Show movement arrows colored by measure count.

ResidualMagnitude 

Show movement arrows colored by residual magnitude.

Definition at line 86 of file MosaicControlNetTool.h.

Constructor & Destructor Documentation

◆ MosaicControlNetTool()

Isis::MosaicControlNetTool::MosaicControlNetTool ( MosaicSceneWidget * scene)

◆ ~MosaicControlNetTool()

Isis::MosaicControlNetTool::~MosaicControlNetTool ( )

Definition at line 129 of file MosaicControlNetTool.cpp.

Member Function Documentation

◆ activate

void Isis::MosaicTool::activate ( bool on)
slotinherited

Activates the tool.

Parameters
on

Definition at line 148 of file MosaicTool.cpp.

◆ addTo() [1/3]

virtual void Isis::MosaicTool::addTo ( QMenu * menu)
inlinevirtualinherited

Definition at line 63 of file MosaicTool.h.

◆ addTo() [2/3]

void Isis::MosaicTool::addTo ( QToolBar * toolBar)
virtualinherited

Definition at line 70 of file MosaicTool.cpp.

◆ addTo() [3/3]

void Isis::MosaicTool::addTo ( ToolPad * toolPad)
virtualinherited

Definition at line 52 of file MosaicTool.cpp.

◆ closeNetwork

void Isis::MosaicControlNetTool::closeNetwork ( )
privateslot

Close the open network, if one is open.

m_controlNetFile is set to an empty string.

Definition at line 503 of file MosaicControlNetTool.cpp.

Referenced by loadNetwork(), and MosaicControlNetTool().

◆ configMovement

void Isis::MosaicControlNetTool::configMovement ( )
privateslot

Bring up a movement arrow configuration dialog.

Definition at line 381 of file MosaicControlNetTool.cpp.

Referenced by MosaicControlNetTool().

◆ disableToolBar()

void Isis::MosaicTool::disableToolBar ( )
privateinherited

Disables entire tool bar.

Definition at line 174 of file MosaicTool.cpp.

◆ displayChangedControlPoint

void Isis::MosaicControlNetTool::displayChangedControlPoint ( QString pointId)
slot

Definition at line 478 of file MosaicControlNetTool.cpp.

◆ displayConnectivity

◆ displayControlNet

void Isis::MosaicControlNetTool::displayControlNet ( )
privateslot

The user toggled the cnet visibility - re-sync the graphics item visibility with the action.

Definition at line 413 of file MosaicControlNetTool.cpp.

Referenced by MosaicControlNetTool().

◆ displayNewControlPoint

void Isis::MosaicControlNetTool::displayNewControlPoint ( QString pointId)
slot

Definition at line 484 of file MosaicControlNetTool.cpp.

◆ displayUponControlPointDeletion

void Isis::MosaicControlNetTool::displayUponControlPointDeletion ( )
slot

Definition at line 493 of file MosaicControlNetTool.cpp.

◆ enableToolBar()

void Isis::MosaicTool::enableToolBar ( )
privateinherited

Enables entire tool bar.

Definition at line 185 of file MosaicTool.cpp.

◆ fromMovementColorSourceString()

MosaicControlNetTool::MovementColorSource Isis::MosaicControlNetTool::fromMovementColorSourceString ( QString string)
static

Convert a string back to a MovementColorSource (for serialization purposes).

Definition at line 306 of file MosaicControlNetTool.cpp.

References NoMovement, NUM_MOVEMENT_COLOR_SOURCE_VALUES, and toString().

◆ fromPvl()

void Isis::MosaicControlNetTool::fromPvl ( const PvlObject & obj)
virtual

Reimplemented from Isis::MosaicTool.

Definition at line 183 of file MosaicControlNetTool.cpp.

◆ getIcon()

◆ getPrimaryAction()

QAction * Isis::MosaicControlNetTool::getPrimaryAction ( )
protectedvirtual

Adds the action to the toolpad.

Parameters
toolpad
Returns
QAction*

Implements Isis::MosaicTool.

Definition at line 327 of file MosaicControlNetTool.cpp.

References Isis::MosaicTool::getIcon().

◆ getToolBarWidget()

QWidget * Isis::MosaicControlNetTool::getToolBarWidget ( )
protectedvirtual

This method returns a widget that will be put in a tool bar when the tool is activated.

This method will only be called once so it can new the widget without a problem.

Reimplemented from Isis::MosaicTool.

Definition at line 344 of file MosaicControlNetTool.cpp.

◆ getViewActions()

QList< QAction * > Isis::MosaicTool::getViewActions ( )
virtualinherited

Definition at line 84 of file MosaicTool.cpp.

◆ getWidget()

MosaicSceneWidget * Isis::MosaicTool::getWidget ( )
inlineprotectedinherited

Definition at line 96 of file MosaicTool.h.

◆ isActive()

bool Isis::MosaicTool::isActive ( ) const
inlineinherited

◆ loadNetwork

void Isis::MosaicControlNetTool::loadNetwork ( )
slot

◆ maxMovementColorMeasureCount()

int Isis::MosaicControlNetTool::maxMovementColorMeasureCount ( ) const

Get the current measure count to become fully colored.

This will return -1 if it's undefined.

Definition at line 251 of file MosaicControlNetTool.cpp.

References m_measureCount.

◆ maxMovementColorResidualMagnitude()

double Isis::MosaicControlNetTool::maxMovementColorResidualMagnitude ( ) const

Get the current max.

residual magnitude to become fully colored. This will return Null if it's undefined.

Definition at line 265 of file MosaicControlNetTool.cpp.

References Isis::IsSpecial(), m_residualMagnitude, and Isis::Null.

◆ mouseButtonPress()

void Isis::MosaicTool::mouseButtonPress ( QPointF ,
Qt::MouseButton s )
protectedvirtualinherited

Definition at line 130 of file MosaicTool.cpp.

◆ mouseButtonRelease()

void Isis::MosaicControlNetTool::mouseButtonRelease ( QPointF point,
Qt::MouseButton s )
protectedvirtual

Reimplemented from Isis::MosaicTool.

Definition at line 673 of file MosaicControlNetTool.cpp.

◆ mouseDoubleClick()

void Isis::MosaicTool::mouseDoubleClick ( QPointF )
protectedvirtualinherited

Definition at line 126 of file MosaicTool.cpp.

◆ mouseEnter()

virtual void Isis::MosaicTool::mouseEnter ( )
inlineprotectedvirtualinherited

Definition at line 81 of file MosaicTool.h.

◆ mouseLeave()

virtual void Isis::MosaicTool::mouseLeave ( )
inlineprotectedvirtualinherited

Definition at line 83 of file MosaicTool.h.

◆ mouseMove()

void Isis::MosaicTool::mouseMove ( QPointF )
protectedvirtualinherited

Definition at line 122 of file MosaicTool.cpp.

◆ mouseWheel()

void Isis::MosaicTool::mouseWheel ( QPointF ,
int delta )
protectedvirtualinherited

Definition at line 139 of file MosaicTool.cpp.

◆ movementArrowColorSource()

MosaicControlNetTool::MovementColorSource Isis::MosaicControlNetTool::movementArrowColorSource ( ) const

Get the current setting for the movement arrows.

Definition at line 243 of file MosaicControlNetTool.cpp.

References m_movementArrowColorSource.

◆ objectDestroyed

void Isis::MosaicControlNetTool::objectDestroyed ( QObject * obj)
privateslot

An object was destroyed, NULL it out.

Definition at line 544 of file MosaicControlNetTool.cpp.

Referenced by loadNetwork(), and MosaicControlNetTool().

◆ openControlNet

void Isis::MosaicControlNetTool::openControlNet ( )
privateslot

Loads a control net from a file.

Definition at line 568 of file MosaicControlNetTool.cpp.

References Isis::Project::activeControl(), Isis::Control::fileName(), loadNetwork(), and Isis::Directory::project().

Referenced by MosaicControlNetTool(), and updateTool().

◆ projectPvlObjectName()

QString Isis::MosaicControlNetTool::projectPvlObjectName ( ) const
virtual

Reimplemented from Isis::MosaicTool.

Definition at line 209 of file MosaicControlNetTool.cpp.

◆ randomizeColors

void Isis::MosaicControlNetTool::randomizeColors ( )
privateslot

Definition at line 665 of file MosaicControlNetTool.cpp.

◆ rebuildPointGraphics

void Isis::MosaicControlNetTool::rebuildPointGraphics ( )
slot

Slot used to re-create the graphics items that depict the control points.

Definition at line 471 of file MosaicControlNetTool.cpp.

References Isis::ControlNetGraphicsItem::buildChildren().

◆ rubberBandComplete()

virtual void Isis::MosaicTool::rubberBandComplete ( QRectF r,
Qt::MouseButton s )
inlineprotectedvirtualinherited

Reimplemented in Isis::MosaicZoomTool.

Definition at line 88 of file MosaicTool.h.

◆ setMovementArrowColorSource()

void Isis::MosaicControlNetTool::setMovementArrowColorSource ( MovementColorSource colorSource,
int maxMeasureCount,
double maxResidualMagnitude )

Define how the movement arrows should be drawn.

This includes if movement arrows should be drawn, what criteria should be used, and how to stretch (where to transition colors) the arrows.

NOTE: This is just a quick implementation and is probably not designed correctly. This is subject to change.

Parameters
colorSourceIf and how to draw and color the arrows
maxMeasureCountThe measure count to become fully colored
maxResidualMagnitudeThe max residual magnitude to become fully colored

Definition at line 226 of file MosaicControlNetTool.cpp.

References m_measureCount, m_movementArrowColorSource, m_residualMagnitude, MeasureCount, NoMovement, ResidualMagnitude, and Isis::ControlNetGraphicsItem::setArrowsVisible().

Referenced by loadNetwork().

◆ takeImage()

Image * Isis::MosaicControlNetTool::takeImage ( QString sn,
ImageList & images )
private

Definition at line 144 of file MosaicControlNetTool.cpp.

◆ toolBarDestroyed()

void Isis::MosaicTool::toolBarDestroyed ( QObject * obj)
protectedinherited

Definition at line 165 of file MosaicTool.cpp.

◆ toPvl()

PvlObject Isis::MosaicControlNetTool::toPvl ( ) const
virtual

Reimplemented from Isis::MosaicTool.

Definition at line 162 of file MosaicControlNetTool.cpp.

◆ toString()

QString Isis::MosaicControlNetTool::toString ( MovementColorSource source)
static

Convert a MovementColorSource to a string for serialization purposes.

Definition at line 278 of file MosaicControlNetTool.cpp.

References MeasureCount, NoColor, NoMovement, and ResidualMagnitude.

Referenced by fromMovementColorSourceString().

◆ updateTool

void Isis::MosaicControlNetTool::updateTool ( )
privateslot

This slot opens and reopens this tool properly.

Definition at line 392 of file MosaicControlNetTool.cpp.

References Isis::MosaicTool::isActive(), and openControlNet().

Member Data Documentation

◆ m_closeNetwork

QPushButton* Isis::MosaicControlNetTool::m_closeNetwork
private

Definition at line 157 of file MosaicControlNetTool.h.

◆ m_configMovement

QPushButton* Isis::MosaicControlNetTool::m_configMovement
private

Definition at line 156 of file MosaicControlNetTool.h.

◆ m_connectivity

QAction* Isis::MosaicControlNetTool::m_connectivity
private

Definition at line 159 of file MosaicControlNetTool.h.

◆ m_controlNet

ControlNet* Isis::MosaicControlNetTool::m_controlNet
private

Definition at line 160 of file MosaicControlNetTool.h.

◆ m_controlNetFile

QString Isis::MosaicControlNetTool::m_controlNetFile
private

Definition at line 163 of file MosaicControlNetTool.h.

◆ m_controlNetFileLabel

QLabel* Isis::MosaicControlNetTool::m_controlNetFileLabel
private

Definition at line 162 of file MosaicControlNetTool.h.

◆ m_controlNetGraphics

ControlNetGraphicsItem* Isis::MosaicControlNetTool::m_controlNetGraphics
private

Definition at line 161 of file MosaicControlNetTool.h.

◆ m_displayConnectivity

QPushButton* Isis::MosaicControlNetTool::m_displayConnectivity
private

Definition at line 155 of file MosaicControlNetTool.h.

◆ m_displayControlNetButton

QPushButton* Isis::MosaicControlNetTool::m_displayControlNetButton
private

Definition at line 154 of file MosaicControlNetTool.h.

◆ m_loadControlNetButton

QPushButton* Isis::MosaicControlNetTool::m_loadControlNetButton
private

Definition at line 153 of file MosaicControlNetTool.h.

◆ m_measureCount

int Isis::MosaicControlNetTool::m_measureCount
private

This is the measure count at which we start coloring the movement arrows.

Definition at line 169 of file MosaicControlNetTool.h.

Referenced by loadNetwork(), maxMovementColorMeasureCount(), MosaicControlNetTool(), and setMovementArrowColorSource().

◆ m_movementArrowColorSource

MovementColorSource Isis::MosaicControlNetTool::m_movementArrowColorSource
private

This defines the drawing mode of the apriori to adjusted arrows.

Definition at line 167 of file MosaicControlNetTool.h.

Referenced by loadNetwork(), MosaicControlNetTool(), movementArrowColorSource(), and setMovementArrowColorSource().

◆ m_randomizeColors

QPushButton* Isis::MosaicControlNetTool::m_randomizeColors
private

Definition at line 158 of file MosaicControlNetTool.h.

◆ m_residualMagnitude

double Isis::MosaicControlNetTool::m_residualMagnitude
private

This is the residual magnitude at which we coloring the movement arrows.

Definition at line 171 of file MosaicControlNetTool.h.

Referenced by loadNetwork(), maxMovementColorResidualMagnitude(), MosaicControlNetTool(), and setMovementArrowColorSource().

◆ NUM_MOVEMENT_COLOR_SOURCE_VALUES

const int Isis::MosaicControlNetTool::NUM_MOVEMENT_COLOR_SOURCE_VALUES = 4
static

This is the count of possible values of MovementColorSource (useful for loops).

Definition at line 97 of file MosaicControlNetTool.h.

Referenced by fromMovementColorSourceString().

◆ p_active

bool Isis::MosaicTool::p_active
privateinherited

Is the tool active?

Definition at line 120 of file MosaicTool.h.

Referenced by Isis::MosaicTool::isActive().

◆ p_primaryAction

QAction* Isis::MosaicTool::p_primaryAction
privateinherited

Definition at line 124 of file MosaicTool.h.

◆ p_toolBarAction

QAction* Isis::MosaicTool::p_toolBarAction
privateinherited

Definition at line 125 of file MosaicTool.h.

◆ p_widget

MosaicSceneWidget* Isis::MosaicTool::p_widget
privateinherited

Definition at line 122 of file MosaicTool.h.


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