Isis 3 Programmer Reference
|
//TODO: Remove debug printout & comment // 2016-08-25 Tracie Sucharski - Checking Directory pointer for IPCE code not ideal. More...
#include <MosaicControlNetTool.h>
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. More... | |
void | rebuildPointGraphics () |
Slot used to re-create the graphics items that depict the control points. More... | |
void | displayNewControlPoint (QString pointId) |
void | displayChangedControlPoint (QString pointId) |
void | displayUponControlPointDeletion () |
void | activate (bool) |
Activates the tool. More... | |
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. More... | |
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. More... | |
MovementColorSource | movementArrowColorSource () const |
Get the current setting for the movement arrows. More... | |
int | maxMovementColorMeasureCount () const |
Get the current measure count to become fully colored. More... | |
double | maxMovementColorResidualMagnitude () const |
Get the current max. More... | |
bool | isActive () const |
Returns the activeness of this toool. More... | |
QPixmap | getIcon (QString iconName) const |
returns the path to the icon directory. More... | |
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. More... | |
static MovementColorSource | fromMovementColorSourceString (QString) |
Convert a string back to a MovementColorSource (for serialization purposes). More... | |
Static Public Attributes | |
static const int | NUM_MOVEMENT_COLOR_SOURCE_VALUES = 4 |
This is the count of possible values of MovementColorSource (useful for loops). More... | |
Protected Member Functions | |
QAction * | getPrimaryAction () |
Adds the action to the toolpad. More... | |
QWidget * | getToolBarWidget () |
This method returns a widget that will be put in a tool bar when the tool is activated. More... | |
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) |
MosaicSceneWidget * | getWidget () |
Private Slots | |
void | configMovement () |
Bring up a movement arrow configuration dialog. More... | |
void | updateTool () |
This slot opens and reopens this tool properly. More... | |
void | openControlNet () |
Loads a control net from a file. More... | |
void | displayControlNet () |
The user toggled the cnet visibility - re-sync the graphics item visibility with the action. More... | |
void | displayConnectivity () |
Displays the connectivity of Control Points. More... | |
void | closeNetwork () |
Close the open network, if one is open. More... | |
void | randomizeColors () |
void | objectDestroyed (QObject *) |
An object was destroyed, NULL it out. More... | |
Private Member Functions | |
void | createDialog () |
Image * | takeImage (QString sn, ImageList &images) |
void | enableToolBar () |
Enables entire tool bar. More... | |
void | disableToolBar () |
Disables entire tool bar. More... | |
Private Attributes | |
QPushButton * | m_loadControlNetButton |
QPushButton * | m_displayControlNetButton |
QPushButton * | m_displayConnectivity |
QPushButton * | m_configMovement |
QPushButton * | m_closeNetwork |
QPushButton * | m_randomizeColors |
QAction * | m_connectivity |
ControlNet * | m_controlNet |
ControlNetGraphicsItem * | m_controlNetGraphics |
QLabel * | m_controlNetFileLabel |
QString | m_controlNetFile |
MovementColorSource | m_movementArrowColorSource |
This defines the drawing mode of the apriori to adjusted arrows. More... | |
int | m_measureCount |
This is the measure count at which we start coloring the movement arrows. More... | |
double | m_residualMagnitude |
This is the residual magnitude at which we coloring the movement arrows. More... | |
bool | p_active |
Is the tool active? More... | |
MosaicSceneWidget * | p_widget |
QAction * | p_primaryAction |
QAction * | p_toolBarAction |
//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
Definition at line 74 of file MosaicControlNetTool.h.
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.
Definition at line 86 of file MosaicControlNetTool.h.
Isis::MosaicControlNetTool::MosaicControlNetTool | ( | MosaicSceneWidget * | scene | ) |
MosaicControlNetTool constructor.
parent |
Definition at line 48 of file MosaicControlNetTool.cpp.
References closeNetwork(), configMovement(), displayConnectivity(), displayControlNet(), m_measureCount, m_movementArrowColorSource, m_residualMagnitude, NoMovement, objectDestroyed(), and openControlNet().
|
slotinherited |
Activates the tool.
on |
Definition at line 148 of file MosaicTool.cpp.
References Isis::MosaicTool::disableToolBar(), Isis::MosaicTool::enableToolBar(), and Isis::MosaicTool::p_active.
|
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().
|
privateslot |
Bring up a movement arrow configuration dialog.
Definition at line 381 of file MosaicControlNetTool.cpp.
Referenced by MosaicControlNetTool().
|
privateinherited |
Disables entire tool bar.
Definition at line 174 of file MosaicTool.cpp.
Referenced by Isis::MosaicTool::activate().
|
privateslot |
Displays the connectivity of Control Points.
Definition at line 423 of file MosaicControlNetTool.cpp.
References Isis::ImageDisplayProperties::Color, Isis::Image::displayProperties(), Isis::ControlNet::GetSerialConnections(), Isis::DisplayProperties::getValue(), Isis::ImageDisplayProperties::randomColor(), and Isis::ImageDisplayProperties::setColor().
Referenced by MosaicControlNetTool().
|
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().
|
privateinherited |
Enables entire tool bar.
Definition at line 185 of file MosaicTool.cpp.
Referenced by Isis::MosaicTool::activate().
|
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().
|
inherited |
returns the path to the icon directory.
Definition at line 115 of file MosaicTool.cpp.
References Isis::FileName::expanded().
Referenced by Isis::MosaicAreaTool::getPrimaryAction(), getPrimaryAction(), Isis::MosaicFindTool::getPrimaryAction(), Isis::MosaicGridTool::getPrimaryAction(), Isis::MosaicPanTool::getPrimaryAction(), Isis::MosaicSelectTool::getPrimaryAction(), Isis::MosaicZoomTool::getPrimaryAction(), and Isis::MosaicZoomTool::MosaicZoomTool().
|
protectedvirtual |
Adds the action to the toolpad.
toolpad |
Implements Isis::MosaicTool.
Definition at line 327 of file MosaicControlNetTool.cpp.
References Isis::MosaicTool::getIcon().
|
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.
|
inlineinherited |
Returns the activeness of this toool.
Definition at line 50 of file MosaicTool.h.
References Isis::MosaicTool::p_active.
Referenced by Isis::MosaicZoomTool::rubberBandComplete(), updateTool(), Isis::MosaicFindTool::updateTool(), Isis::MosaicSelectTool::updateTool(), and Isis::MosaicZoomTool::updateTool().
|
slot |
Load m_controlNetFile into memory - this will re-load the network if it's already open.
Definition at line 610 of file MosaicControlNetTool.cpp.
References Isis::Project::activeControl(), closeNetwork(), Isis::Control::controlNet(), m_measureCount, m_movementArrowColorSource, m_residualMagnitude, objectDestroyed(), Isis::Directory::project(), setMovementArrowColorSource(), and Isis::IException::toString().
Referenced by Isis::Footprint2DView::enableControlNetTool(), and openControlNet().
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.
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.
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.
|
privateslot |
An object was destroyed, NULL it out.
Definition at line 544 of file MosaicControlNetTool.cpp.
Referenced by loadNetwork(), and MosaicControlNetTool().
|
privateslot |
Loads a control net from a file.
Definition at line 568 of file MosaicControlNetTool.cpp.
References Isis::Project::activeControl(), Isis::FileName::expanded(), Isis::Control::fileName(), loadNetwork(), and Isis::Directory::project().
Referenced by MosaicControlNetTool(), and updateTool().
|
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().
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.
colorSource | If and how to draw and color the arrows |
maxMeasureCount | The measure count to become fully colored |
maxResidualMagnitude | The 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().
|
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().
|
privateslot |
This slot opens and reopens this tool properly.
Definition at line 392 of file MosaicControlNetTool.cpp.
References Isis::MosaicTool::isActive(), and openControlNet().
|
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().
|
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().
|
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().
|
static |
This is the count of possible values of MovementColorSource (useful for loops).
Definition at line 97 of file MosaicControlNetTool.h.
Referenced by fromMovementColorSourceString().
|
privateinherited |
Is the tool active?
Definition at line 120 of file MosaicTool.h.
Referenced by Isis::MosaicTool::activate(), and Isis::MosaicTool::isActive().