USGS

Isis 3.0 Object Programmers' Reference

Home

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 
10 class QCheckBox;
11 class QComboBox;
12 class QDialog;
13 class QLabel;
14 class QLineEdit;
15 class QMenu;
16 class QProgressBar;
17 class QPushButton;
18 class QString;
19 
20 template <typename A, typename B> class QMap;
21 template <typename A, typename B> class QPair;
22 
23 namespace Isis {
24  class MdiCubeViewport;
25  class UniversalGroundMap;
26 
55  class FeatureNomenclatureTool : public Tool {
56  Q_OBJECT
57 
58  public:
59 
61  enum VectorType {
110  };
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 
156  void rebuildFeaturesCombo();
160  void toolStateChanged();
161  void viewportDone(MdiCubeViewport *vp);
162  ViewportFeatureDisplay *viewportFeatureDisplay(MdiCubeViewport *vp);
163  const ViewportFeatureDisplay *
165  bool viewportFeaturesFound(MdiCubeViewport *vp) const;
167 
168  void readSettings();
169  void writeSettings();
170 
171  private:
188  public:
189  FeaturePosition();
191  FeaturePosition(const FeaturePosition &other);
193 
194  bool isValid() const;
195 
196  QPair<double, double> center() const;
199  const FeatureNomenclature::Feature &feature() const;
200  void applyExtentType(VectorType vectorType);
201 
202  void swap(FeaturePosition &other);
204 
205  private:
207  double m_centerLine;
210 
213 
221  };
222 
223 
236  public:
238  FeatureDisplayPosition(QRect textRect, QRect fullDisplayRect,
242 
243  QRect textArea() const;
244  QRect displayArea() const;
245  QList<QPoint> edgePoints() const;
246 
247  void swap(FeatureDisplayPosition &other);
249  private:
250 
251  private:
253  QRect *m_textRect;
258  };
259 
260 
275  public:
283 
284  void applyExtentType(VectorType vectorType);
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);
295 
296  void swap(ViewportFeatureDisplay &other);
298  const ViewportFeatureDisplay &rhs);
299 
300  private:
301  QPair<QPointF, QPointF> viewportCubeRange() const;
302 
303  private:
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 
357 
364 
367 
371  QColor *m_fontColor;
380  };
381 }
382 
383 #endif