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 Developer Reference
FeatureNomenclatureTool.h
Go to the documentation of this file.
1#ifndef FeatureNomenclatureTool_h
2#define FeatureNomenclatureTool_h
3
4#include "Tool.h"
5
6#include <QPointer>
7#include <QProgressDialog>
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:
139 void centerOnSelectedFeature();
140 void configure();
141 void featureSelected();
142 void featuresIdentified(FeatureNomenclature *);
143 void findNomenclatureStateChanged(int);
144 void nomenclaturePositionsOutdated();
145 void onToolActivated();
146 void showDisclaimer();
147
148 private:
149 // This is an inner class defined below.
150 class ViewportFeatureDisplay;
151
152 void centerOnFeature(MdiCubeViewport *vp, FeatureNomenclature::Feature);
153 void featuresForViewportFound(MdiCubeViewport *vp);
154 void findMissingNomenclature();
155 void findMissingNomenclature(MdiCubeViewport *vp);
156 void rebuildFeaturesCombo();
157 void removeFeatureDisplay(MdiCubeViewport *vp);
158 void showFeatureDetails(FeatureNomenclature::Feature);
159 void showFeatureWebsite(FeatureNomenclature::Feature);
160 void toolStateChanged();
161 void viewportDone(MdiCubeViewport *vp);
162 ViewportFeatureDisplay *viewportFeatureDisplay(MdiCubeViewport *vp);
163 const ViewportFeatureDisplay *
164 viewportFeatureDisplay(MdiCubeViewport *vp) const;
165 bool viewportFeaturesFound(MdiCubeViewport *vp) const;
166 QList<MdiCubeViewport *> viewportsWithFoundNomenclature();
167
168 void readSettings();
169 void writeSettings();
170
171 private:
187 class FeaturePosition {
188 public:
189 FeaturePosition();
190 FeaturePosition(MdiCubeViewport *, FeatureNomenclature::Feature, VectorType vectorType);
191 FeaturePosition(const FeaturePosition &other);
192 ~FeaturePosition();
193
194 bool isValid() const;
195
196 QPair<double, double> center() const;
197 QList< QPair<double, double> > edges() const;
199 const FeatureNomenclature::Feature &feature() const;
200 void applyExtentType(VectorType vectorType);
201
202 void swap(FeaturePosition &other);
203 FeaturePosition &operator=(const FeaturePosition &rhs);
204
205 private:
207 double m_centerLine;
209 double m_centerSample;
210
212 UniversalGroundMap *m_gmap;
213
218 QList< QPair<double, double> > *m_featureEdgeLineSamples;
221 };
222
223
235 class FeatureDisplayPosition {
236 public:
237 FeatureDisplayPosition();
238 FeatureDisplayPosition(QRect textRect, QRect fullDisplayRect,
239 QList<QPoint> edgePoints);
240 FeatureDisplayPosition(const FeatureDisplayPosition &other);
241 ~FeatureDisplayPosition();
242
243 QRect textArea() const;
244 QRect displayArea() const;
245 QList<QPoint> edgePoints() const;
246
247 void swap(FeatureDisplayPosition &other);
248 FeatureDisplayPosition &operator=(const FeatureDisplayPosition &rhs);
249 private:
250
251 private:
253 QRect *m_textRect;
255 QRect *m_fullDisplayRect;
257 QList<QPoint> *m_edgePoints;
258 };
259
260
274 class ViewportFeatureDisplay {
275 public:
276 ViewportFeatureDisplay();
277 ViewportFeatureDisplay(FeatureNomenclatureTool *tool,
278 MdiCubeViewport *sourceViewport,
279 QList<FeatureNomenclature::Feature> features,
281 ViewportFeatureDisplay(const ViewportFeatureDisplay &other);
282 ~ViewportFeatureDisplay();
283
284 void applyExtentType(VectorType vectorType);
285 void centerFeature(FeatureNomenclature::Feature);
286 QList<FeatureNomenclature::Feature> features();
287 QList<FeaturePosition> featurePositions();
288 MdiCubeViewport *sourceViewport() const;
289 void paint(QPainter *painter, bool showVectors,
290 VectorType vectorType, bool approvedOnly)const;
291
292 void handleMouseClicked(FeatureNomenclatureTool *tool, QPoint p,
293 Qt::MouseButton s);
294 void handleViewChanged(FeatureNomenclatureTool *tool);
295
296 void swap(ViewportFeatureDisplay &other);
297 ViewportFeatureDisplay &operator=(
298 const ViewportFeatureDisplay &rhs);
299
300 private:
301 QPair<QPointF, QPointF> viewportCubeRange() const;
302
303 private:
308 MdiCubeViewport *m_sourceViewport;
310 QList<FeaturePosition> *m_features;
312 QList<FeatureDisplayPosition> *m_featureScreenAreas;
318 QPair<QPointF, QPointF> *m_viewportCubeRange;
319 };
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
350 QList<ViewportFeatureDisplay> * m_foundNomenclature;
355 QMap< MdiCubeViewport *,
356 FeatureNomenclature *> * m_nomenclatureSearchers;
357
363 bool m_nomenclatureEnabled;
364
366 QString m_disclaimerText;
367
369 int m_fontSize;
371 QColor *m_fontColor;
373 bool m_defaultEnabled;
375 bool m_disclaimedAlready;
377 VectorType m_extentType;
379 bool m_showApprovedOnly;
380 };
381}
382
383#endif
A named feature on a target.
Definition FeatureNomenclature.h:117
Feature nomenclature database querier.
Definition FeatureNomenclature.h:51
void setVectorType(VectorType show)
Set whether to draw vectors from the feature center to the feature extents on the viewport.
Definition FeatureNomenclatureTool.cpp:269
~FeatureNomenclatureTool()
Cleans up memory allocated by this tool.
Definition FeatureNomenclatureTool.cpp:98
void addTo(QMenu *menu)
Add the 'Show Nomenclature' option to the options menu.
Definition FeatureNomenclatureTool.cpp:116
void setShowApprovedOnly(bool approvedOnly)
Set whether to show approved features and exclude unapproved features.
Definition FeatureNomenclatureTool.cpp:250
void setFontSize(int newFontSize)
Set the font point size to use for drawing text on the viewport.
Definition FeatureNomenclatureTool.cpp:232
VectorType vectorType() const
Draw vectors to the extents of features?
Definition FeatureNomenclatureTool.cpp:191
void updateTool()
Updates the state of the current tool.
Definition FeatureNomenclatureTool.cpp:404
void paintViewport(MdiCubeViewport *vp, QPainter *painter)
Paint features on the given viewport.
Definition FeatureNomenclatureTool.cpp:132
void setDefaultEnabled(bool defaultEnabled)
Set whether this tool is enabled by default.
Definition FeatureNomenclatureTool.cpp:201
FeatureNomenclatureTool(QWidget *parent)
This instantiates a FeatureNomenclatureTool.
Definition FeatureNomenclatureTool.cpp:46
QWidget * createToolBarWidget(QStackedWidget *parent)
Creates the widget that goes on the tool bar when this tool is active.
Definition FeatureNomenclatureTool.cpp:303
void mouseButtonRelease(QPoint p, Qt::MouseButton s)
This handles a mouse release on one of the cube viewports when this tool is active.
Definition FeatureNomenclatureTool.cpp:391
int fontSize() const
Retrieve the font size of the features in this tool.
Definition FeatureNomenclatureTool.cpp:171
VectorType
Enumeration of extent vector typess.
Definition FeatureNomenclatureTool.h:61
@ Arrows8
When using this vector (extent) type, 8 arrows will be drawn out from the text of the feature.
Definition FeatureNomenclatureTool.h:100
@ Box
When using this vector (extent) type, 4 arrows will be drawn out from the text of the feature.
Definition FeatureNomenclatureTool.h:109
@ None
When using this vector (extent) type, no extents will be drawn.
Definition FeatureNomenclatureTool.h:65
@ Arrows4
When using this vector (extent) type, 4 arrows will be drawn out from the text of the feature.
Definition FeatureNomenclatureTool.h:82
void setFontColor(QColor color)
Set the color to use for drawing on the viewport.
Definition FeatureNomenclatureTool.cpp:215
bool showApprovedOnly() const
Show approved features only?
Definition FeatureNomenclatureTool.cpp:181
QString menuName() const
This is the name of the menu that should be passed into "addTo()".
Definition FeatureNomenclatureTool.cpp:291
QColor fontColor() const
What is the font color to use?
Definition FeatureNomenclatureTool.cpp:161
bool defaultEnabled() const
Is this tool enabled by default?
Definition FeatureNomenclatureTool.cpp:151
QAction * toolPadAction(ToolPad *pad)
Add this tool's action to the toolpad.
Definition FeatureNomenclatureTool.cpp:364
Cube display widget for certain Isis MDI applications.
Definition MdiCubeViewport.h:39
Tool(QWidget *parent)
Tool constructor.
Definition Tool.cpp:27
Definition ToolPad.h:14
Universal Ground Map.
Definition UniversalGroundMap.h:69
This is free and unencumbered software released into the public domain.
Definition BoxcarCachingAlgorithm.h:13
This is free and unencumbered software released into the public domain.
Definition CubeIoHandler.h:23
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16