USGS

Isis 3.0 Object Programmers' Reference

Home

Isis::FeatureNomenclatureTool Class Reference

Display nomenclature on MDI Cube Viewports. More...

#include <FeatureNomenclatureTool.h>

Inheritance diagram for Isis::FeatureNomenclatureTool:
Inheritance graph
Collaboration diagram for Isis::FeatureNomenclatureTool:
Collaboration graph

Classes

class  FeatureDisplayPosition
 A named feature's position in a viewport. More...
 
class  FeaturePosition
 A named feature's position in a cube. More...
 
class  ViewportFeatureDisplay
 The feature display on a single viewport. More...
 

Public Types

enum  VectorType { None, Arrows4, Arrows8, Box }
 Enumeration of extent vector typess. More...
 

Public Slots

void activate (bool)
 Activates the tool.
 
void setCubeViewport (MdiCubeViewport *cvp)
 Sets the current viewport to the given cvp.
 

Signals

void clearWarningSignal ()
 
void toolActivated ()
 
void viewportChanged ()
 

Public Member Functions

 FeatureNomenclatureTool (QWidget *parent)
 This instantiates a FeatureNomenclatureTool.
 
 ~FeatureNomenclatureTool ()
 Cleans up memory allocated by this tool.
 
void addTo (QMenu *menu)
 Add the 'Show Nomenclature' option to the options menu.
 
void paintViewport (MdiCubeViewport *vp, QPainter *painter)
 Paint features on the given viewport.
 
bool defaultEnabled () const
 Is this tool enabled by default? (i.e.
 
QColor fontColor () const
 What is the font color to use?
 
int fontSize () const
 Retrieve the font size of the features in this tool.
 
bool showApprovedOnly () const
 Show approved features only?
 
VectorType vectorType () const
 Draw vectors to the extents of features?
 
void setDefaultEnabled (bool defaultEnabled)
 Set whether this tool is enabled by default.
 
void setFontColor (QColor color)
 Set the color to use for drawing on the viewport.
 
void setFontSize (int newFontSize)
 Set the font point size to use for drawing text on the viewport.
 
void setShowApprovedOnly (bool approvedOnly)
 Set whether to show approved features and exclude unapproved features.
 
void setVectorType (VectorType show)
 Set whether to draw vectors from the feature center to the feature extents on the viewport.
 
QString menuName () const
 This is the name of the menu that should be passed into "addTo()".
 
void addTo (ViewportMainWindow *mw)
 Adds the tool to the application.
 
void addTo (ToolPad *toolpad)
 Adds the tool to the toolpad.
 
virtual void addTo (Workspace *ws)
 Adds the given workspace to the cubeviewport list.
 
virtual void addToPermanent (QToolBar *toolbar)
 
void addToActive (QToolBar *toolbar)
 
QString toolIconDir () const
 returns the path to the icon directory.
 
RubberBandToolrubberBandTool ()
 
void setList (ToolList *currentList)
 

Protected Types

typedef QVector
< MdiCubeViewport * > 
CubeViewportList
 A list of cubeviewports.
 

Protected Slots

virtual void rubberBandComplete ()
 
virtual void screenPixelsChanged ()
 This is called when actions change which pixels from the cube are displayed.
 
virtual void mouseEnter ()
 
virtual void mouseMove (QPoint p)
 
virtual void mouseMove (QPoint p, Qt::MouseButton)
 
virtual void mouseLeave ()
 
virtual void mouseDoubleClick (QPoint p)
 
virtual void mouseButtonPress (QPoint p, Qt::MouseButton s)
 
virtual void updateMeasure ()
 
virtual void scaleChanged ()
 
virtual void stretchRequested (MdiCubeViewport *, int)
 
void registerTool (MdiCubeViewport *viewport)
 Registers the tool to the viewport.
 

Protected Member Functions

QWidgetcreateToolBarWidget (QStackedWidget *parent)
 Creates the widget that goes on the tool bar when this tool is active.
 
QActiontoolPadAction (ToolPad *pad)
 Add this tool's action to the toolpad.
 
void mouseButtonRelease (QPoint p, Qt::MouseButton s)
 This handles a mouse release on one of the cube viewports when this tool is active.
 
void updateTool ()
 Updates the state of the current tool.
 
MdiCubeViewportcubeViewport () const
 Return the current cubeviewport.
 
CubeViewportListcubeViewportList () const
 Return the list of cubeviewports.
 
virtual void addConnections (MdiCubeViewport *cvp)
 Anytime a tool is created, you must add the connections for it.
 
virtual void removeConnections (MdiCubeViewport *cvp)
 Anytime a tool is created, you must be able to remove it's connections.
 
virtual void enableRubberBandTool ()
 Anytime a tool is created, you may use the rubber band tool.
 
Workspaceworkspace ()
 

Private Slots

void centerOnSelectedFeature ()
 Center the relevent viewport (and any viewports linked to it) on the feature selected in the feature selection combo box.
 
void configure ()
 Give a configuration dialog for the options available in this tool.
 
void featureSelected ()
 This handles a feature being selected in the feature list combo box.
 
void featuresIdentified (FeatureNomenclature *)
 A feature nomenclature has finished querying...
 
void findNomenclatureStateChanged (int)
 The 'Name Features' check box has changed state.
 
void nomenclaturePositionsOutdated ()
 Update the screen coordinates of the named features because the viewport has changed it's mappings.
 
void onToolActivated ()
 When this tool is activated (clicked on in the tool bar), turn ourselves on immediately.
 
void showDisclaimer ()
 Show the user our nomenclature disclaimer and make note that we have shown the disclaimer.
 

Private Member Functions

void centerOnFeature (MdiCubeViewport *vp, FeatureNomenclature::Feature)
 Center the given and any linked viewports (which contain the same feature) on the given feature.
 
void featuresForViewportFound (MdiCubeViewport *vp)
 Move the features from a searching state to a found state for the given viewport.
 
void findMissingNomenclature ()
 Update this tool's nomenclature data based on this tool's enabled state and the current viewport list.
 
void findMissingNomenclature (MdiCubeViewport *vp)
 Query for nomenclature on the given viewport.
 
void rebuildFeaturesCombo ()
 Rebuild m_foundFeaturesCombo's data from scratch.
 
void removeFeatureDisplay (MdiCubeViewport *vp)
 Remove knowledge of features on the given viewport.
 
void showFeatureDetails (FeatureNomenclature::Feature)
 Show a dialog with full feature details of a given feature.
 
void showFeatureWebsite (FeatureNomenclature::Feature)
 Show a web view pointed to the feature's web page.
 
void toolStateChanged ()
 This should be called any time this tool's enabled or searching state could have changed.
 
void viewportDone (MdiCubeViewport *vp)
 Finalize the search results for the given viewport.
 
ViewportFeatureDisplayviewportFeatureDisplay (MdiCubeViewport *vp)
 Map from viewport to feature display.
 
const ViewportFeatureDisplayviewportFeatureDisplay (MdiCubeViewport *vp) const
 Map from viewport to feature display.
 
bool viewportFeaturesFound (MdiCubeViewport *vp) const
 Test if features have already been found for a given viewport.
 
QList< MdiCubeViewport * > viewportsWithFoundNomenclature ()
 Get a list of viewports with found nomenclature.
 
void readSettings ()
 Read this tool's preserved state.
 
void writeSettings ()
 Write out this tool's preserved state between runs.
 

Private Attributes

QPointer< QActionm_action
 This is the 'Show Nomenclature' toggleable action in the options menu.
 
QPointer< QCheckBox > m_findNomenclatureCheckBox
 This is the 'Name Features' check box when this tool is active.
 
QPointer< QComboBoxm_foundFeaturesCombo
 This combo box lists all of the found features and their viewports.
 
QPointer< QPushButton > m_nomenclatureCenterBtn
 This is the 'Center' button in this tool's tool bar.
 
QPointer< QPushButton > m_nomenclatureOptionsBtn
 This is the 'Tool Options' button in this tool's tool bar.
 
QPointer< QPushButton > m_disclaimerBtn
 This is the 'Disclaimer' button in this tool's tool bar.
 
QPointer< QProgressBarm_queryingProgress
 This is a busy indicator that is visible when queries are out to the nomenclature database.
 
QList< ViewportFeatureDisplay > * m_foundNomenclature
 The nomenclature that has been identified, one for each viewport.
 
QMap< MdiCubeViewport
*, FeatureNomenclature * > * 
m_nomenclatureSearchers
 The nomenclature being queried currently, one for each viewport that has no found nomenclature.
 
bool m_nomenclatureEnabled
 Do we find and display nomenclature? This corresponds to the 'Name Features' check box and the 'Show Nomenclature' action in the options menu.
 
QString m_disclaimerText
 The (HTML) contents of the disclaimer to show the user.
 
int m_fontSize
 The font size to use when naming features.
 
QColor * m_fontColor
 The color to use when drawing on the viewport.
 
bool m_defaultEnabled
 Do we turn ourselves on immediately?
 
bool m_disclaimedAlready
 Have we ever shown the user our disclaimer?
 
VectorType m_extentType
 How we need to draw extents (if at all)
 
bool m_showApprovedOnly
 Only show IAU approved features.
 

Detailed Description

Display nomenclature on MDI Cube Viewports.

This tool is designed to paint named features onto the viewports' displays. The nomenclature and it's positioning comes from the FeatureNomenclature class. Options such as auto-enabling from program start, showing vectors, font configurations, showing detailed feature information and linking back to the nomenclature website are built-in.

Author
2012-03-22 Steven Lambright and Jai Rideout
History:

2012-06-12 Steven Lambright and Kimberly Oyama - Implemented multiple extent types (Box, 4 Arrows, 8 Arrows). Added ability to hide unapproved or dropped features. Added appropriate mutators and accessors (showApprovedOnly(), vectorType(), setShowApprovedOnly(), setVectorType()). Added an enumerator for the vector types. Fixes #852. Fixes #892.

2012-06-26 Kimberly Oyama - Minor refactoring in the findMissingNomenclature() method. References #958.

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

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

Definition at line 55 of file FeatureNomenclatureTool.h.

Member Typedef Documentation

typedef QVector< MdiCubeViewport * > Isis::Tool::CubeViewportList
protectedinherited

A list of cubeviewports.

Definition at line 219 of file Tool.h.

Member Enumeration Documentation

Enumeration of extent vector typess.

Enumerator
None 

When using this vector (extent) type, no extents will be drawn.

Arrows4 

When using this vector (extent) type, 4 arrows will be drawn out from the text of the feature.

If an arrow doesn't extend past the text then it will not be drawn. The extents should look something like this:


^ | | | | |<-— Feature Name ---—>| | | v


Arrows8 

When using this vector (extent) type, 8 arrows will be drawn out from the text of the feature.

If an arrow doesn't extend past the text then it will not be drawn. The extents would look similar to the 4 arrow version shown above. There would be 8 arrows extending to the marked points:

*

  • Feature Name *

    • *

Box 

When using this vector (extent) type, 4 arrows will be drawn out from the text of the feature.

If the arrow doesn't extend past the text then it will not be drawn. The extents should look something like this:


|Feature Name | |_____________|

Definition at line 61 of file FeatureNomenclatureTool.h.

Constructor & Destructor Documentation

Isis::FeatureNomenclatureTool::FeatureNomenclatureTool ( QWidget parent)
Isis::FeatureNomenclatureTool::~FeatureNomenclatureTool ( )

Cleans up memory allocated by this tool.

Definition at line 97 of file FeatureNomenclatureTool.cpp.

References m_foundNomenclature, and m_nomenclatureSearchers.

Member Function Documentation

virtual void Isis::Tool::addConnections ( MdiCubeViewport cvp)
inlineprotectedvirtualinherited

Anytime a tool is created, you must add the connections for it.

Parameters
cvp

Reimplemented in Isis::TrackTool, and Isis::WindowTool.

Definition at line 253 of file Tool.h.

Referenced by Isis::Tool::addViewportConnections().

void Isis::Tool::addTo ( ToolPad toolpad)
inherited

Adds the tool to the toolpad.

Parameters
toolpad

Definition at line 97 of file Tool.cpp.

References Isis::Tool::activate(), Isis::ToolPad::addAction(), Isis::Tool::m_toolPadAction, and Isis::Tool::toolPadAction().

void Isis::FeatureNomenclatureTool::addTo ( QMenu *  menu)
virtual

Add the 'Show Nomenclature' option to the options menu.

Parameters
menuMenu to add 'Show Nomenclature' to.

Reimplemented from Isis::Tool.

Definition at line 115 of file FeatureNomenclatureTool.cpp.

References m_action, m_findNomenclatureCheckBox, and m_nomenclatureEnabled.

void Isis::Tool::addTo ( Workspace ws)
virtualinherited

Adds the given workspace to the cubeviewport list.

Parameters
ws

Reimplemented in Isis::EditTool, Isis::FileTool, Isis::SpecialPixelTool, and Isis::WindowTool.

Definition at line 44 of file Tool.cpp.

References Isis::Tool::registerTool(), and Isis::Tool::setCubeViewport().

void Isis::Tool::addToActive ( QToolBar toolbar)
inherited
virtual void Isis::Tool::addToPermanent ( QToolBar toolbar)
inlinevirtualinherited
void Isis::FeatureNomenclatureTool::centerOnFeature ( MdiCubeViewport vp,
FeatureNomenclature::Feature  feature 
)
private

Center the given and any linked viewports (which contain the same feature) on the given feature.

This also prioritizes the feature to display on top of the other features in the viewport(s) which center on the feature.

Parameters
vpThe viewport to center (and to use for finding linked viewports)
featureThe feature to center on the viewport

Definition at line 549 of file FeatureNomenclatureTool.cpp.

References Isis::FeatureNomenclatureTool::ViewportFeatureDisplay::centerFeature(), Isis::MdiCubeViewport::isLinked(), viewportFeatureDisplay(), and viewportsWithFoundNomenclature().

Referenced by centerOnSelectedFeature(), and Isis::FeatureNomenclatureTool::ViewportFeatureDisplay::handleMouseClicked().

void Isis::FeatureNomenclatureTool::centerOnSelectedFeature ( )
privateslot

Center the relevent viewport (and any viewports linked to it) on the feature selected in the feature selection combo box.

Definition at line 412 of file FeatureNomenclatureTool.cpp.

References centerOnFeature(), and m_foundFeaturesCombo.

Referenced by createToolBarWidget().

void Isis::FeatureNomenclatureTool::configure ( )
privateslot

Give a configuration dialog for the options available in this tool.

Definition at line 431 of file FeatureNomenclatureTool.cpp.

Referenced by createToolBarWidget().

QWidget * Isis::FeatureNomenclatureTool::createToolBarWidget ( QStackedWidget *  parent)
protectedvirtual

Creates the widget that goes on the tool bar when this tool is active.

Parameters
parent
Returns
QWidget*

Reimplemented from Isis::Tool.

Definition at line 302 of file FeatureNomenclatureTool.cpp.

References centerOnSelectedFeature(), configure(), featureSelected(), findNomenclatureStateChanged(), m_disclaimerBtn, m_findNomenclatureCheckBox, m_foundFeaturesCombo, m_nomenclatureCenterBtn, m_nomenclatureEnabled, m_nomenclatureOptionsBtn, m_queryingProgress, and showDisclaimer().

MdiCubeViewport* Isis::Tool::cubeViewport ( ) const
inlineprotectedinherited

Return the current cubeviewport.

Returns
CubeViewport*

Definition at line 211 of file Tool.h.

References Isis::Tool::m_cvp.

Referenced by Isis::WindowTool::addConnections(), Isis::TrackTool::addConnections(), Isis::StretchTool::advancedStretchChanged(), Isis::FindTool::centerLinkedViewports(), Isis::StretchTool::changeStretch(), Isis::BandTool::changeView(), Isis::BandTool::copyLinkedViewports(), Isis::FileTool::discard(), Isis::Tool::enableToolBar(), Isis::FileTool::exportView(), Isis::StatisticsTool::getStatistics(), Isis::FindTool::handleRecordClicked(), Isis::EditTool::LineToPoints(), Isis::TrackTool::locateCursor(), Isis::SunShadowTool::mouseButtonPress(), Isis::RubberBandTool::mouseButtonRelease(), Isis::EditTool::mouseButtonRelease(), mouseButtonRelease(), Isis::FindTool::mouseButtonRelease(), Isis::StretchTool::mouseButtonRelease(), Isis::MatchTool::mouseButtonRelease(), Isis::QnetTool::mouseButtonRelease(), Isis::AdvancedTrackTool::mouseLeave(), Isis::ScatterPlotTool::mouseMove(), Isis::SunShadowTool::mouseMove(), Isis::TrackTool::mouseMove(), Isis::RubberBandTool::mouseMove(), Isis::SunShadowTool::paintViewport(), Isis::RubberBandTool::paintViewport(), Isis::FindTool::paintViewport(), Isis::FileTool::print(), Isis::SunShadowTool::recalculateShadowHeight(), Isis::EditTool::redoEdit(), Isis::FindTool::refresh(), Isis::HistogramTool::refreshPlot(), Isis::SpatialPlotTool::refreshPlot(), Isis::SpectralPlotTool::refreshPlot(), Isis::WindowTool::removeConnections(), Isis::TrackTool::removeConnections(), Isis::RubberBandTool::repaint(), Isis::WindowTool::resizeWindows(), Isis::HistogramTool::rubberBandComplete(), Isis::MeasureTool::rubberBandComplete(), Isis::ZoomTool::rubberBandComplete(), Isis::EditTool::rubberBandComplete(), Isis::StretchTool::rubberBandComplete(), Isis::FileTool::save(), Isis::FileTool::saveAs(), Isis::FileTool::saveAsCubeByOption(), Isis::FileTool::saveAsReducedCube(), Isis::FileTool::saveInfo(), Isis::BandTool::setBandBin(), Isis::BandTool::setList(), Isis::StretchTool::setStretchAcrossBands(), Isis::StretchTool::setStretchAllViewports(), Isis::StretchTool::showAdvancedDialog(), Isis::ScatterPlotTool::showNewScatterPlotConfig(), Isis::StretchTool::stretchChanged(), Isis::StretchTool::stretchGlobal(), Isis::StretchTool::stretchGlobalAllBands(), Isis::StretchTool::stretchRegional(), Isis::EditTool::undoEdit(), Isis::StretchTool::updateAdvStretchDialogforAll(), Isis::StretchTool::updateHistograms(), Isis::TrackTool::updateLabels(), Isis::MeasureTool::updateMeasure(), Isis::AdvancedTrackTool::updateRow(), Isis::WindowTool::updateTool(), Isis::BlinkTool::updateTool(), Isis::SpecialPixelTool::updateTool(), Isis::SunShadowTool::updateTool(), Isis::BandTool::updateTool(), Isis::AbstractPlotTool::updateTool(), Isis::ZoomTool::updateTool(), Isis::FileTool::updateTool(), Isis::EditTool::updateTool(), Isis::FindTool::updateTool(), Isis::StretchTool::updateTool(), Isis::AbstractPlotTool::viewportsToPlot(), Isis::EditTool::writeToCube(), Isis::ZoomTool::zoomBy(), Isis::ZoomTool::zoomFit(), Isis::ZoomTool::zoomFitHeight(), Isis::ZoomTool::zoomFitWidth(), and Isis::ZoomTool::zoomManual().

Tool::CubeViewportList * Isis::Tool::cubeViewportList ( ) const
protectedinherited

Return the list of cubeviewports.

Returns
CubeViewportList*

Definition at line 389 of file Tool.cpp.

References Isis::Workspace::cubeViewportList().

Referenced by Isis::BlinkTool::advance(), Isis::SpecialPixelTool::apply(), Isis::FindTool::centerLinkedViewports(), Isis::WindowTool::changeCursor(), Isis::FileTool::closeAll(), Isis::BandTool::copyAllViewports(), Isis::BandTool::copyLinkedViewports(), Isis::MatchTool::createPoint(), Isis::BlinkTool::eventFilter(), featuresIdentified(), findMissingNomenclature(), findNomenclatureStateChanged(), Isis::FindTool::handleLinkClicked(), Isis::WindowTool::linkWindows(), Isis::RubberBandTool::mouseButtonRelease(), Isis::RubberBandTool::mouseMove(), Isis::QnetTool::openGround(), Isis::StereoTool::paintAllViewports(), Isis::MatchTool::paintAllViewports(), Isis::QnetTool::paintAllViewports(), Isis::FindTool::refresh(), Isis::ScatterPlotTool::repaintViewports(), Isis::AbstractPlotTool::repaintViewports(), Isis::WindowTool::resizeWindows(), Isis::BlinkTool::reverse(), Isis::ZoomTool::rubberBandComplete(), Isis::MatchTool::serialNumberList(), setFontColor(), setFontSize(), setShowApprovedOnly(), Isis::StretchTool::setStretchAllViewports(), setVectorType(), Isis::StretchTool::stretchGlobalAllViewports(), Isis::BlinkTool::toggleLink(), Isis::WindowTool::unlinkWindows(), Isis::MeasureTool::updateMeasure(), Isis::AdvancedTrackTool::updateRow(), Isis::WindowTool::updateTool(), Isis::BlinkTool::updateTool(), Isis::FindTool::updateTool(), Isis::AbstractPlotTool::viewportsToPlot(), Isis::ZoomTool::zoomBy(), Isis::ZoomTool::zoomFit(), Isis::ZoomTool::zoomFitHeight(), Isis::ZoomTool::zoomFitWidth(), and Isis::ZoomTool::zoomManual().

bool Isis::FeatureNomenclatureTool::defaultEnabled ( ) const

Is this tool enabled by default? (i.e.

on program start)

Returns
True if this tool is automatically enabled

Definition at line 150 of file FeatureNomenclatureTool.cpp.

References m_defaultEnabled.

Referenced by Isis::NomenclatureToolConfigDialog::readSettings(), and setDefaultEnabled().

void Isis::Tool::enableRubberBandTool ( )
protectedvirtualinherited

Anytime a tool is created, you may use the rubber band tool.

Enable the use of the rubberband tool.

Reimplemented in Isis::RubberBandTool, Isis::ZoomTool, Isis::MeasureTool, Isis::StereoTool, Isis::SpatialPlotTool, Isis::SpectralPlotTool, and Isis::HistogramTool.

Definition at line 338 of file Tool.cpp.

References Isis::RubberBandTool::disable().

Referenced by Isis::Tool::addViewportConnections().

void Isis::FeatureNomenclatureTool::featureSelected ( )
privateslot

This handles a feature being selected in the feature list combo box.

The 'Center' button's enabled state is set to reflect if a feature is selected and the tool is enabled.

Definition at line 446 of file FeatureNomenclatureTool.cpp.

References m_foundFeaturesCombo, m_nomenclatureCenterBtn, and m_nomenclatureEnabled.

Referenced by createToolBarWidget(), and toolStateChanged().

void Isis::FeatureNomenclatureTool::featuresForViewportFound ( MdiCubeViewport vp)
private
void Isis::FeatureNomenclatureTool::featuresIdentified ( FeatureNomenclature searcher)
privateslot

A feature nomenclature has finished querying...

we need to translate the features into visible names.

Definition at line 462 of file FeatureNomenclatureTool.cpp.

References Isis::Tool::cubeViewportList(), featuresForViewportFound(), m_nomenclatureEnabled, m_nomenclatureSearchers, and viewportDone().

Referenced by findMissingNomenclature().

void Isis::FeatureNomenclatureTool::findMissingNomenclature ( )
private

Update this tool's nomenclature data based on this tool's enabled state and the current viewport list.

This will always remove results of viewports that no longer exist. If displaying nomenclature is enabled, then this will also look for features on any viewports that don't have results and aren't currently querying.

Definition at line 694 of file FeatureNomenclatureTool.cpp.

References Isis::Tool::cubeViewportList(), m_nomenclatureEnabled, m_nomenclatureSearchers, rebuildFeaturesCombo(), removeFeatureDisplay(), viewportFeaturesFound(), and viewportsWithFoundNomenclature().

Referenced by findNomenclatureStateChanged(), and updateTool().

void Isis::FeatureNomenclatureTool::findMissingNomenclature ( MdiCubeViewport vp)
private

Query for nomenclature on the given viewport.

Parameters
vpA viewport that both has no results and is not currently querying the nomenclature database.

Definition at line 733 of file FeatureNomenclatureTool.cpp.

References Isis::CubeViewport::camera(), Isis::CubeViewport::cube(), featuresIdentified(), Isis::UniversalGroundMap::GroundRange(), Isis::PvlContainer::hasKeyword(), Isis::Target::name(), Isis::CubeViewport::projection(), Isis::Spice::target(), toolStateChanged(), Isis::CubeViewport::universalGroundMap(), and viewportDone().

void Isis::FeatureNomenclatureTool::findNomenclatureStateChanged ( int  newState)
privateslot

The 'Name Features' check box has changed state.

Handle identifying any missing features and naming any already-found features if enabling, hide all names if disabling.

Definition at line 486 of file FeatureNomenclatureTool.cpp.

References Isis::Tool::cubeViewportList(), findMissingNomenclature(), m_nomenclatureEnabled, and toolStateChanged().

Referenced by createToolBarWidget().

QColor Isis::FeatureNomenclatureTool::fontColor ( ) const

What is the font color to use?

Returns
Color that is used for painting features

Definition at line 160 of file FeatureNomenclatureTool.cpp.

References m_fontColor.

Referenced by Isis::NomenclatureToolConfigDialog::readSettings().

int Isis::FeatureNomenclatureTool::fontSize ( ) const

Retrieve the font size of the features in this tool.

Returns
Font point size used to render feature names

Definition at line 170 of file FeatureNomenclatureTool.cpp.

References m_fontSize.

Referenced by Isis::FeatureNomenclatureTool::ViewportFeatureDisplay::handleViewChanged(), and Isis::NomenclatureToolConfigDialog::readSettings().

QString Isis::FeatureNomenclatureTool::menuName ( ) const
virtual

This is the name of the menu that should be passed into "addTo()".

Returns
The options menu's name

Reimplemented from Isis::Tool.

Definition at line 290 of file FeatureNomenclatureTool.cpp.

void Isis::Tool::mouseButtonPress ( QPoint  p,
Qt::MouseButton  s 
)
protectedvirtualslotinherited
Parameters
p
s

Definition at line 366 of file Tool.cpp.

Referenced by Isis::Tool::addViewportConnections(), and Isis::Tool::removeViewportConnections().

void Isis::FeatureNomenclatureTool::mouseButtonRelease ( QPoint  p,
Qt::MouseButton  s 
)
protectedvirtual

This handles a mouse release on one of the cube viewports when this tool is active.

The responsibilities are forwarde to ViewportFeatureDisplay::handleMouseClicked().

Parameters
pThe point in the viewport where the mouse was released
sThe mouse buttons that were released

Reimplemented from Isis::Tool.

Definition at line 390 of file FeatureNomenclatureTool.cpp.

References Isis::Tool::cubeViewport(), Isis::FeatureNomenclatureTool::ViewportFeatureDisplay::handleMouseClicked(), m_nomenclatureEnabled, and viewportFeatureDisplay().

void Isis::Tool::mouseDoubleClick ( QPoint  p)
protectedvirtualslotinherited
Parameters
p

Definition at line 357 of file Tool.cpp.

Referenced by Isis::Tool::addViewportConnections(), and Isis::Tool::removeViewportConnections().

void Isis::Tool::mouseMove ( QPoint  p)
protectedvirtualslotinherited
Parameters
p

Definition at line 351 of file Tool.cpp.

Referenced by Isis::Tool::addViewportConnections(), and Isis::Tool::removeViewportConnections().

void Isis::FeatureNomenclatureTool::nomenclaturePositionsOutdated ( )
privateslot

Update the screen coordinates of the named features because the viewport has changed it's mappings.

This uses the already found cube sample, line positions... it just needs to do the appropriate transformations from cube to viewport. This method does not cause a repaint.

Definition at line 509 of file FeatureNomenclatureTool.cpp.

References m_foundNomenclature, and m_nomenclatureEnabled.

Referenced by setFontSize(), setShowApprovedOnly(), setVectorType(), and viewportDone().

void Isis::FeatureNomenclatureTool::onToolActivated ( )
privateslot

When this tool is activated (clicked on in the tool bar), turn ourselves on immediately.

Definition at line 523 of file FeatureNomenclatureTool.cpp.

References m_findNomenclatureCheckBox.

Referenced by FeatureNomenclatureTool().

void Isis::FeatureNomenclatureTool::paintViewport ( MdiCubeViewport vp,
QPainter *  painter 
)
virtual

Paint features on the given viewport.

Parameters
vpThe viewport that needs painted
painterThe painter to use for painting

Reimplemented from Isis::Tool.

Definition at line 131 of file FeatureNomenclatureTool.cpp.

References m_extentType, m_fontColor, m_fontSize, m_nomenclatureEnabled, m_showApprovedOnly, None, Isis::FeatureNomenclatureTool::ViewportFeatureDisplay::paint(), viewportFeatureDisplay(), and viewportFeaturesFound().

void Isis::FeatureNomenclatureTool::readSettings ( )
private

Read this tool's preserved state.

This uses the current state as defaults, so please make sure your variables are initialized before calling this method.

Definition at line 989 of file FeatureNomenclatureTool.cpp.

References m_defaultEnabled, m_disclaimedAlready, m_extentType, m_fontColor, m_fontSize, and m_showApprovedOnly.

Referenced by FeatureNomenclatureTool().

void Isis::FeatureNomenclatureTool::rebuildFeaturesCombo ( )
private

Rebuild m_foundFeaturesCombo's data from scratch.

This should only be necessary when viewports are lost.

Definition at line 782 of file FeatureNomenclatureTool.cpp.

References featuresForViewportFound(), m_foundFeaturesCombo, and viewportsWithFoundNomenclature().

Referenced by findMissingNomenclature(), and setShowApprovedOnly().

void Isis::Tool::registerTool ( MdiCubeViewport viewport)
protectedslotinherited

Registers the tool to the viewport.

Parameters
viewport

Definition at line 326 of file Tool.cpp.

References Isis::Tool::m_cvp, and Isis::MdiCubeViewport::registerTool().

Referenced by Isis::Tool::addTo().

virtual void Isis::Tool::removeConnections ( MdiCubeViewport cvp)
inlineprotectedvirtualinherited

Anytime a tool is created, you must be able to remove it's connections.

Parameters
cvp

Reimplemented in Isis::MeasureTool, Isis::TrackTool, and Isis::WindowTool.

Definition at line 261 of file Tool.h.

Referenced by Isis::Tool::removeViewportConnections().

void Isis::FeatureNomenclatureTool::removeFeatureDisplay ( MdiCubeViewport vp)
private

Remove knowledge of features on the given viewport.

The viewport does not have to be a valid (allocated) pointer.

Parameters
vpThe viewport to forget.

Definition at line 800 of file FeatureNomenclatureTool.cpp.

References m_foundNomenclature.

Referenced by findMissingNomenclature().

virtual void Isis::Tool::screenPixelsChanged ( )
inlineprotectedvirtualslotinherited

This is called when actions change which pixels from the cube are displayed.

Definition at line 162 of file Tool.h.

Referenced by Isis::Tool::addViewportConnections(), Isis::Tool::removeViewportConnections(), and viewportDone().

void Isis::Tool::setCubeViewport ( MdiCubeViewport cvp)
slotinherited
void Isis::FeatureNomenclatureTool::setDefaultEnabled ( bool  defaultEnabled)

Set whether this tool is enabled by default.

Parameters
defaultEnabledTrue to enable by default

Definition at line 200 of file FeatureNomenclatureTool.cpp.

References defaultEnabled(), m_defaultEnabled, and writeSettings().

Referenced by Isis::NomenclatureToolConfigDialog::applySettings().

void Isis::FeatureNomenclatureTool::setFontColor ( QColor  color)

Set the color to use for drawing on the viewport.

This takes effect immediately.

Parameters
colorThe color to use for drawing

Definition at line 214 of file FeatureNomenclatureTool.cpp.

References Isis::Tool::cubeViewportList(), m_fontColor, and writeSettings().

Referenced by Isis::NomenclatureToolConfigDialog::applySettings().

void Isis::FeatureNomenclatureTool::setFontSize ( int  newFontSize)

Set the font point size to use for drawing text on the viewport.

This takes effect immediately.

Parameters
newFontSizeThe font point size to use for rendering text

Definition at line 231 of file FeatureNomenclatureTool.cpp.

References Isis::Tool::cubeViewportList(), m_fontSize, nomenclaturePositionsOutdated(), and writeSettings().

Referenced by Isis::NomenclatureToolConfigDialog::applySettings().

void Isis::FeatureNomenclatureTool::setShowApprovedOnly ( bool  approvedOnly)

Set whether to show approved features and exclude unapproved features.

Parameters
approvedOnlyTrue to show only appproved features

Definition at line 249 of file FeatureNomenclatureTool.cpp.

References Isis::Tool::cubeViewportList(), m_showApprovedOnly, nomenclaturePositionsOutdated(), rebuildFeaturesCombo(), and writeSettings().

Referenced by Isis::NomenclatureToolConfigDialog::applySettings().

void Isis::FeatureNomenclatureTool::setVectorType ( VectorType  show)

Set whether to draw vectors from the feature center to the feature extents on the viewport.

This takes effect immediately.

Parameters
showTrue to show the vectors

Definition at line 268 of file FeatureNomenclatureTool.cpp.

References Isis::Tool::cubeViewportList(), m_extentType, m_foundNomenclature, nomenclaturePositionsOutdated(), and writeSettings().

Referenced by Isis::NomenclatureToolConfigDialog::applySettings().

bool Isis::FeatureNomenclatureTool::showApprovedOnly ( ) const

Show approved features only?

Returns
True if we're showing only approved features.

Definition at line 180 of file FeatureNomenclatureTool.cpp.

References m_showApprovedOnly.

Referenced by Isis::NomenclatureToolConfigDialog::readSettings().

void Isis::FeatureNomenclatureTool::showDisclaimer ( )
privateslot

Show the user our nomenclature disclaimer and make note that we have shown the disclaimer.

Definition at line 533 of file FeatureNomenclatureTool.cpp.

References m_disclaimedAlready, m_disclaimerText, and writeSettings().

Referenced by createToolBarWidget(), and toolStateChanged().

void Isis::FeatureNomenclatureTool::showFeatureDetails ( FeatureNomenclature::Feature  feature)
private

Show a dialog with full feature details of a given feature.

Parameters
featureThe feature to describe

Definition at line 813 of file FeatureNomenclatureTool.cpp.

References Isis::FeatureNomenclature::Feature::toWidget().

Referenced by Isis::FeatureNomenclatureTool::ViewportFeatureDisplay::handleMouseClicked().

void Isis::FeatureNomenclatureTool::showFeatureWebsite ( FeatureNomenclature::Feature  feature)
private

Show a web view pointed to the feature's web page.

Parameters
featureThe feature to bring up in the web view

Definition at line 846 of file FeatureNomenclatureTool.cpp.

References Isis::FeatureNomenclature::Feature::referenceUrl().

Referenced by Isis::FeatureNomenclatureTool::ViewportFeatureDisplay::handleMouseClicked().

QAction * Isis::FeatureNomenclatureTool::toolPadAction ( ToolPad toolpad)
protectedvirtual

Add this tool's action to the toolpad.

This defines the name and hotkey of this tool.

Parameters
toolpad
Returns
QAction*

Reimplemented from Isis::Tool.

Definition at line 363 of file FeatureNomenclatureTool.cpp.

References Isis::Tool::toolIconDir().

void Isis::FeatureNomenclatureTool::toolStateChanged ( )
private

This should be called any time this tool's enabled or searching state could have changed.

This enabled/disables and shows/hides widgets appropriately to match the current state.

Definition at line 857 of file FeatureNomenclatureTool.cpp.

References featureSelected(), m_action, m_disclaimedAlready, m_findNomenclatureCheckBox, m_nomenclatureCenterBtn, m_nomenclatureEnabled, m_nomenclatureSearchers, m_queryingProgress, and showDisclaimer().

Referenced by findMissingNomenclature(), findNomenclatureStateChanged(), and viewportDone().

void Isis::FeatureNomenclatureTool::updateTool ( )
protectedvirtual

Updates the state of the current tool.

This will find any missing nomenclature if appropriate.

Reimplemented from Isis::Tool.

Definition at line 403 of file FeatureNomenclatureTool.cpp.

References findMissingNomenclature().

FeatureNomenclatureTool::VectorType Isis::FeatureNomenclatureTool::vectorType ( ) const

Draw vectors to the extents of features?

Returns
True if we're drawing vectors to the extents of features.

Definition at line 190 of file FeatureNomenclatureTool.cpp.

References m_extentType.

Referenced by Isis::FeatureNomenclatureTool::ViewportFeatureDisplay::handleViewChanged(), and Isis::NomenclatureToolConfigDialog::readSettings().

void Isis::FeatureNomenclatureTool::viewportDone ( MdiCubeViewport vp)
private

Finalize the search results for the given viewport.

The viewport doesn't have to be a valid (allocated) pointer. This will destroy any searchers with the given viewport, and if there are no found results for the viewport this will create a blank one as a place holder. This prevents searching for features on the viewport again.

Parameters
vpThe viewport to finalize the search results for

Definition at line 891 of file FeatureNomenclatureTool.cpp.

References m_extentType, m_foundNomenclature, m_nomenclatureSearchers, nomenclaturePositionsOutdated(), Isis::Tool::screenPixelsChanged(), toolStateChanged(), and viewportFeatureDisplay().

Referenced by featuresIdentified(), and findMissingNomenclature().

FeatureNomenclatureTool::ViewportFeatureDisplay * Isis::FeatureNomenclatureTool::viewportFeatureDisplay ( MdiCubeViewport vp)
private

Map from viewport to feature display.

Parameters
vpThe viewport to map
Returns
NULL if there is no found nomenclature for the viewport, otherwise the appropriate feature display.

Definition at line 922 of file FeatureNomenclatureTool.cpp.

References m_foundNomenclature.

Referenced by centerOnFeature(), featuresForViewportFound(), mouseButtonRelease(), paintViewport(), viewportDone(), and viewportFeaturesFound().

const FeatureNomenclatureTool::ViewportFeatureDisplay * Isis::FeatureNomenclatureTool::viewportFeatureDisplay ( MdiCubeViewport vp) const
private

Map from viewport to feature display.

Parameters
vpThe viewport to map
Returns
NULL if there is no found nomenclature for the viewport, otherwise the appropriate feature display.

Definition at line 940 of file FeatureNomenclatureTool.cpp.

References m_foundNomenclature.

bool Isis::FeatureNomenclatureTool::viewportFeaturesFound ( MdiCubeViewport vp) const
private

Test if features have already been found for a given viewport.

Parameters
vpThe viewport to test
Returns
True if features have been found, false if we're either still searching for features or haven't started searching for features on the viewport.

Definition at line 959 of file FeatureNomenclatureTool.cpp.

References viewportFeatureDisplay().

Referenced by findMissingNomenclature(), and paintViewport().

QList< MdiCubeViewport * > Isis::FeatureNomenclatureTool::viewportsWithFoundNomenclature ( )
private

Get a list of viewports with found nomenclature.

This may include viewports that no longer exist but haven't been cleaned up already.

Returns
A list of viewports with a feature display.

Definition at line 972 of file FeatureNomenclatureTool.cpp.

References m_foundNomenclature.

Referenced by centerOnFeature(), findMissingNomenclature(), and rebuildFeaturesCombo().

void Isis::FeatureNomenclatureTool::writeSettings ( )
private

Write out this tool's preserved state between runs.

This is NOT called on close, so you should call this any time you change the preserved state.

Definition at line 1011 of file FeatureNomenclatureTool.cpp.

References m_defaultEnabled, m_disclaimedAlready, m_extentType, m_fontColor, m_fontSize, and m_showApprovedOnly.

Referenced by setDefaultEnabled(), setFontColor(), setFontSize(), setShowApprovedOnly(), setVectorType(), and showDisclaimer().

Member Data Documentation

QPointer<QAction> Isis::FeatureNomenclatureTool::m_action
private

This is the 'Show Nomenclature' toggleable action in the options menu.

Definition at line 323 of file FeatureNomenclatureTool.h.

Referenced by addTo(), and toolStateChanged().

bool Isis::FeatureNomenclatureTool::m_defaultEnabled
private

Do we turn ourselves on immediately?

Definition at line 373 of file FeatureNomenclatureTool.h.

Referenced by defaultEnabled(), FeatureNomenclatureTool(), readSettings(), setDefaultEnabled(), and writeSettings().

bool Isis::FeatureNomenclatureTool::m_disclaimedAlready
private

Have we ever shown the user our disclaimer?

Definition at line 375 of file FeatureNomenclatureTool.h.

Referenced by FeatureNomenclatureTool(), readSettings(), showDisclaimer(), toolStateChanged(), and writeSettings().

QPointer<QPushButton> Isis::FeatureNomenclatureTool::m_disclaimerBtn
private

This is the 'Disclaimer' button in this tool's tool bar.

Definition at line 342 of file FeatureNomenclatureTool.h.

Referenced by createToolBarWidget(), and FeatureNomenclatureTool().

QString Isis::FeatureNomenclatureTool::m_disclaimerText
private

The (HTML) contents of the disclaimer to show the user.

Definition at line 366 of file FeatureNomenclatureTool.h.

Referenced by FeatureNomenclatureTool(), and showDisclaimer().

VectorType Isis::FeatureNomenclatureTool::m_extentType
private
QPointer<QCheckBox> Isis::FeatureNomenclatureTool::m_findNomenclatureCheckBox
private

This is the 'Name Features' check box when this tool is active.

Definition at line 326 of file FeatureNomenclatureTool.h.

Referenced by addTo(), createToolBarWidget(), FeatureNomenclatureTool(), featuresForViewportFound(), onToolActivated(), and toolStateChanged().

QColor* Isis::FeatureNomenclatureTool::m_fontColor
private

The color to use when drawing on the viewport.

Definition at line 371 of file FeatureNomenclatureTool.h.

Referenced by FeatureNomenclatureTool(), fontColor(), paintViewport(), readSettings(), setFontColor(), and writeSettings().

int Isis::FeatureNomenclatureTool::m_fontSize
private

The font size to use when naming features.

Definition at line 369 of file FeatureNomenclatureTool.h.

Referenced by FeatureNomenclatureTool(), fontSize(), paintViewport(), readSettings(), setFontSize(), and writeSettings().

QPointer<QComboBox> Isis::FeatureNomenclatureTool::m_foundFeaturesCombo
private

This combo box lists all of the found features and their viewports.

The data stored in this combo box is of format:

Map<QString, QVariant>: "Viewport" -> MdiCubeViewport* "Feature" -> FeatureNomenclature::Feature "Target" -> QString(target name, all upper case)

Definition at line 336 of file FeatureNomenclatureTool.h.

Referenced by centerOnSelectedFeature(), createToolBarWidget(), FeatureNomenclatureTool(), featureSelected(), featuresForViewportFound(), and rebuildFeaturesCombo().

QList<ViewportFeatureDisplay>* Isis::FeatureNomenclatureTool::m_foundNomenclature
private
QPointer<QPushButton> Isis::FeatureNomenclatureTool::m_nomenclatureCenterBtn
private

This is the 'Center' button in this tool's tool bar.

Definition at line 338 of file FeatureNomenclatureTool.h.

Referenced by createToolBarWidget(), FeatureNomenclatureTool(), featureSelected(), and toolStateChanged().

bool Isis::FeatureNomenclatureTool::m_nomenclatureEnabled
private

Do we find and display nomenclature? This corresponds to the 'Name Features' check box and the 'Show Nomenclature' action in the options menu.

Definition at line 363 of file FeatureNomenclatureTool.h.

Referenced by addTo(), createToolBarWidget(), FeatureNomenclatureTool(), featureSelected(), featuresIdentified(), findMissingNomenclature(), findNomenclatureStateChanged(), mouseButtonRelease(), nomenclaturePositionsOutdated(), paintViewport(), and toolStateChanged().

QPointer<QPushButton> Isis::FeatureNomenclatureTool::m_nomenclatureOptionsBtn
private

This is the 'Tool Options' button in this tool's tool bar.

Definition at line 340 of file FeatureNomenclatureTool.h.

Referenced by createToolBarWidget(), and FeatureNomenclatureTool().

QMap< MdiCubeViewport *, FeatureNomenclature *>* Isis::FeatureNomenclatureTool::m_nomenclatureSearchers
private

The nomenclature being queried currently, one for each viewport that has no found nomenclature.

Definition at line 356 of file FeatureNomenclatureTool.h.

Referenced by FeatureNomenclatureTool(), featuresForViewportFound(), featuresIdentified(), findMissingNomenclature(), toolStateChanged(), viewportDone(), and ~FeatureNomenclatureTool().

QPointer<QProgressBar> Isis::FeatureNomenclatureTool::m_queryingProgress
private

This is a busy indicator that is visible when queries are out to the nomenclature database.

Definition at line 347 of file FeatureNomenclatureTool.h.

Referenced by createToolBarWidget(), FeatureNomenclatureTool(), and toolStateChanged().

bool Isis::FeatureNomenclatureTool::m_showApprovedOnly
private

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