Official websites use .gov
A .gov website belongs to an official government organization in the United States.

Secure .gov websites use HTTPS
A lock ( ) or https:// means you’ve safely connected to the .gov website. Share sensitive information only on official, secure websites.

Isis 3 Programmer Reference
FeatureNomenclatureTool.h
1#ifndef FeatureNomenclatureTool_h
2#define FeatureNomenclatureTool_h
3
4#include "Tool.h"
5
6#include <QPointer>
7#include <QProgressDialog>
8#include "FeatureNomenclature.h"
9
10class QCheckBox;
11class QComboBox;
12class QDialog;
13class QLabel;
14class QLineEdit;
15class QMenu;
16class QProgressBar;
17class QPushButton;
18class QString;
19
20template <typename A, typename B> class QMap;
21
22namespace Isis {
23 class MdiCubeViewport;
25
56 Q_OBJECT
57
58 public:
59
111
114
115 void addTo(QMenu *menu);
116 void paintViewport(MdiCubeViewport *vp, QPainter *painter);
117
118 bool defaultEnabled() const;
119 QColor fontColor() const;
120 int fontSize() const;
121 bool showApprovedOnly() const;
122 VectorType vectorType() const;
123
125 void setFontColor(QColor color);
126 void setFontSize(int newFontSize);
127 void setShowApprovedOnly(bool approvedOnly);
128 void setVectorType(VectorType show);
129
130 QString menuName() const;
131
132 protected:
133 QWidget *createToolBarWidget(QStackedWidget *parent);
135 void mouseButtonRelease(QPoint p, Qt::MouseButton s);
136 void updateTool();
137
138 private slots:
140 void configure();
141 void featureSelected();
145 void onToolActivated();
146 void showDisclaimer();
147
148 private:
149 // This is an inner class defined below.
150 class ViewportFeatureDisplay;
151
160 void toolStateChanged();
162 ViewportFeatureDisplay *viewportFeatureDisplay(MdiCubeViewport *vp);
163 const ViewportFeatureDisplay *
167
168 void readSettings();
169 void writeSettings();
170
171 private:
222
223
236 public:
238 FeatureDisplayPosition(QRect textRect, QRect fullDisplayRect,
242
243 QRect textArea() const;
244 QRect displayArea() const;
246
247 void swap(FeatureDisplayPosition &other);
249 private:
250
251 private:
258 };
259
260
320
321 private:
323 QPointer<QAction> m_action;
324
326 QPointer<QCheckBox> m_findNomenclatureCheckBox;
336 QPointer<QComboBox> m_foundFeaturesCombo;
338 QPointer<QPushButton> m_nomenclatureCenterBtn;
340 QPointer<QPushButton> m_nomenclatureOptionsBtn;
342 QPointer<QPushButton> m_disclaimerBtn;
347 QPointer<QProgressBar> m_queryingProgress;
348
357
364
367
371 QColor *m_fontColor;
380 };
381}
382
383#endif
Feature nomenclature database querier.
QList< QPoint > * m_edgePoints
The viewport screen pixel points which the edges are at.
QList< QPoint > edgePoints() const
Get the edge screen pixel points in viewport screen coordinates that circle the feature.
QRect * m_textRect
The viewport screen pixel rect which the text will consume.
FeatureDisplayPosition & operator=(const FeatureDisplayPosition &rhs)
Assign the state of rhs to this.This is exception-safe.
QRect * m_fullDisplayRect
The viewport screen pixel rect which the entire display will use.
FeatureDisplayPosition()
Instantiate a blank feature display position.
QRect displayArea() const
Get the screen pixel rect in viewport screen coordinates that encapsulates the entire feature.
void swap(FeatureDisplayPosition &other)
Swap member data with another instance of this class.
QRect textArea() const
Get the screen pixel rect in viewport screen coordinates that ought to be filled with the textual nam...
FeatureNomenclature::Feature & feature()
Get the feature associated with this feature position.
double m_centerSample
The cube sample position of the feature center, Null if !isValid()
UniversalGroundMap * m_gmap
The map used to determine the sample, line pair from a lat, lon pair.
QList< QPair< double, double > > * m_featureEdgeLineSamples
The pair is cube sample, line (first and second) respectively.
QPair< double, double > center() const
Get the center sample/line position of the feature.
FeaturePosition()
Instiantiates a feature position with no data.
bool isValid() const
Test if sample/line coordinates could be found for this feature.
void applyExtentType(VectorType vectorType)
Applies the type of extents to the feature.
FeaturePosition & operator=(const FeaturePosition &rhs)
Assign rhs to this.
void swap(FeaturePosition &other)
Trade member data with other.
QList< QPair< double, double > > edges() const
Get the edge sample/line positions of the feature.
FeatureNomenclature::Feature m_feature
The feature for which we're encapsulating a viewport position.
double m_centerLine
The cube line position of the feature center, Null if !isValid()
void paint(QPainter *painter, bool showVectors, VectorType vectorType, bool approvedOnly) const
Paint features onto the viewport.
QPair< QPointF, QPointF > viewportCubeRange() const
Get the min/max cube line/sample positions of the viewport.
QList< FeatureNomenclature::Feature > features()
Get a list of features available on this viewport.
QPair< QPointF, QPointF > * m_viewportCubeRange
A check to make sure the cube viewport is in the correct state for painting.
void swap(ViewportFeatureDisplay &other)
Swap *this and other's member data in an exception-free way.
~ViewportFeatureDisplay()
Cleans up memory allocated by this feature display.
QList< FeaturePosition > * m_features
The features on the image in m_sourceViewport.
void centerFeature(FeatureNomenclature::Feature)
Center the viewport on this feature.
MdiCubeViewport * m_sourceViewport
The viewport this display is working with; we paint onto this viewport and react to events on this vi...
QList< FeatureDisplayPosition > * m_featureScreenAreas
The visible features on the image in m_sourceViewport.
void handleViewChanged(FeatureNomenclatureTool *tool)
The display options or area on the viewport has changed.
QList< FeaturePosition > featurePositions()
Get the list of feature positions for a given display.
ViewportFeatureDisplay & operator=(const ViewportFeatureDisplay &rhs)
Copy the data of rhs into *this.
void applyExtentType(VectorType vectorType)
Apply the extent type to all of the features for the source viewport.
void handleMouseClicked(FeatureNomenclatureTool *tool, QPoint p, Qt::MouseButton s)
Handle a mouse click event on the viewport.
MdiCubeViewport * sourceViewport() const
Get the viewport associated with this feature display.
void setVectorType(VectorType show)
Set whether to draw vectors from the feature center to the feature extents on the viewport.
void onToolActivated()
When this tool is activated (clicked on in the tool bar), turn ourselves on immediately.
QPointer< QProgressBar > m_queryingProgress
This is a busy indicator that is visible when queries are out to the nomenclature database.
~FeatureNomenclatureTool()
Cleans up memory allocated by this tool.
void featureSelected()
This handles a feature being selected in the feature list combo box.
void addTo(QMenu *menu)
Add the 'Show Nomenclature' option to the options menu.
bool viewportFeaturesFound(MdiCubeViewport *vp) const
Test if features have already been found for a given viewport.
void setShowApprovedOnly(bool approvedOnly)
Set whether to show approved features and exclude unapproved features.
QList< MdiCubeViewport * > viewportsWithFoundNomenclature()
Get a list of viewports with found nomenclature.
VectorType m_extentType
How we need to draw extents (if at all)
void featuresIdentified(FeatureNomenclature *)
A feature nomenclature has finished querying... we need to translate the features into visible names.
void nomenclaturePositionsOutdated()
Update the screen coordinates of the named features because the viewport has changed it's mappings.
QPointer< QCheckBox > m_findNomenclatureCheckBox
This is the 'Name Features' check box when this tool is active.
void writeSettings()
Write out this tool's preserved state between runs.
void setFontSize(int newFontSize)
Set the font point size to use for drawing text on the viewport.
void showFeatureWebsite(FeatureNomenclature::Feature)
Show a web view pointed to the feature's web page.
QList< ViewportFeatureDisplay > * m_foundNomenclature
The nomenclature that has been identified, one for each viewport.
void viewportDone(MdiCubeViewport *vp)
Finalize the search results for the given viewport.
VectorType vectorType() const
Draw vectors to the extents of features?
QString m_disclaimerText
The (HTML) contents of the disclaimer to show the user.
void updateTool()
Updates the state of the current tool.
void paintViewport(MdiCubeViewport *vp, QPainter *painter)
Paint features on the given viewport.
void setDefaultEnabled(bool defaultEnabled)
Set whether this tool is enabled by default.
bool m_defaultEnabled
Do we turn ourselves on immediately?
bool m_disclaimedAlready
Have we ever shown the user our disclaimer?
FeatureNomenclatureTool(QWidget *parent)
This instantiates a FeatureNomenclatureTool.
QMap< MdiCubeViewport *, FeatureNomenclature * > * m_nomenclatureSearchers
The nomenclature being queried currently, one for each viewport that has no found nomenclature.
QPointer< QComboBox > m_foundFeaturesCombo
This combo box lists all of the found features and their viewports.
void configure()
Give a configuration dialog for the options available in this tool.
QPointer< QAction > m_action
This is the 'Show Nomenclature' toggleable action in the options menu.
void findMissingNomenclature()
Update this tool's nomenclature data based on this tool's enabled state and the current viewport list...
ViewportFeatureDisplay * viewportFeatureDisplay(MdiCubeViewport *vp)
Map from viewport to feature display.
bool m_nomenclatureEnabled
Do we find and display nomenclature?
void centerOnSelectedFeature()
Center the relevent viewport (and any viewports linked to it) on the feature selected in the feature ...
void readSettings()
Read this tool's preserved state.
QWidget * createToolBarWidget(QStackedWidget *parent)
Creates the widget that goes on the tool bar when this tool is active.
void featuresForViewportFound(MdiCubeViewport *vp)
Move the features from a searching state to a found state for the given viewport.
void findNomenclatureStateChanged(int)
The 'Name Features' check box has changed state.
void mouseButtonRelease(QPoint p, Qt::MouseButton s)
This handles a mouse release on one of the cube viewports when this tool is active.
QPointer< QPushButton > m_nomenclatureOptionsBtn
This is the 'Tool Options' button in this tool's tool bar.
void toolStateChanged()
This should be called any time this tool's enabled or searching state could have changed.
QColor * m_fontColor
The color to use when drawing on the viewport.
void showDisclaimer()
Show the user our nomenclature disclaimer and make note that we have shown the disclaimer.
int fontSize() const
Retrieve the font size of the features in this tool.
VectorType
Enumeration of extent vector typess.
@ Arrows8
When using this vector (extent) type, 8 arrows will be drawn out from the text of the feature.
@ Box
When using this vector (extent) type, 4 arrows will be drawn out from the text of the feature.
@ 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.
void rebuildFeaturesCombo()
Rebuild m_foundFeaturesCombo's data from scratch.
void setFontColor(QColor color)
Set the color to use for drawing on the viewport.
bool m_showApprovedOnly
Only show IAU approved features.
bool showApprovedOnly() const
Show approved features only?
void showFeatureDetails(FeatureNomenclature::Feature)
Show a dialog with full feature details of a given feature.
QPointer< QPushButton > m_disclaimerBtn
This is the 'Disclaimer' button in this tool's tool bar.
QString menuName() const
This is the name of the menu that should be passed into "addTo()".
QColor fontColor() const
What is the font color to use?
void removeFeatureDisplay(MdiCubeViewport *vp)
Remove knowledge of features on the given viewport.
QPointer< QPushButton > m_nomenclatureCenterBtn
This is the 'Center' button in this tool's tool bar.
void centerOnFeature(MdiCubeViewport *vp, FeatureNomenclature::Feature)
Center the given and any linked viewports (which contain the same feature) on the given feature.
bool defaultEnabled() const
Is this tool enabled by default?
int m_fontSize
The font size to use when naming features.
QAction * toolPadAction(ToolPad *pad)
Add this tool's action to the toolpad.
Cube display widget for certain Isis MDI applications.
Tool(QWidget *parent)
Tool constructor.
Definition Tool.cpp:27
Universal Ground Map.
This is free and unencumbered software released into the public domain.
This is free and unencumbered software released into the public domain.
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16