Isis 3 Developer Reference
MeasureTool.h
Go to the documentation of this file.
1 #ifndef Qisis_MeasureTool_h
2 #define Qisis_MeasureTool_h
3 
4 #include "Tool.h"
5 
6 // FIXME: remove these includes
7 #include <QAction>
8 #include "RubberBandComboBox.h"
9 #include "TableMainWindow.h"
10 #include "IString.h"
11 
12 
13 class QCheckBox;
14 class QComboBox;
15 class QDialog;
16 class QMenu;
17 class QLineEdit;
18 class QString;
19 
20 namespace Isis {
21  class MdiCubeViewport;
22 
58  class MeasureTool : public Tool {
59  Q_OBJECT
60 
61  public:
62  MeasureTool(QWidget *parent);
63  void addTo(QMenu *menu);
64 
66  QString menuName() const {
67  return "&Options";
68  }
69 
70  protected slots:
71  virtual void rubberBandComplete();
72  virtual void updateMeasure();
73  virtual void mouseLeave();
74 
75  protected:
76  QWidget *createToolBarWidget(QStackedWidget *parent);
78  void updateTool();
80  void enableRubberBandTool();
81 
82  private slots:
83 
84  void updateUnitsCombo();
85  void updateDistEdit();
86 
87  private:
88  QAction *m_action;
89  QLineEdit *m_distLineEdit;
90  QComboBox *m_unitsComboBox;
91  int miComboUnit; // Store the previous unit chosen
92 
93  void addRow();
94  void updateDist(MdiCubeViewport *cvp, int row);
95  void setDistances(MdiCubeViewport *cvp, QPoint lineStart, QPoint lineEnd);
96  void updateRow(int row);
97  void updateRows(int row);
98  void initData(void);
99 
103  enum TableColumnsMap {
104  FeatureName,
105  FeatureType,
106  LatitudeLongitude,
107  SampleLine,
108  DistanceKm,
109  DistanceM,
110  DistancePix,
111  AngleDeg,
112  AngleRad,
113  AreaKm,
114  AreaM,
115  AreaPix,
116  Segments,
117  Path,
118  FileName,
119  Notes
120  };
121 
125  enum TableColumnIndex {
126  StartLatIndex = 2,
127  StartLonIndex,
128  EndLatIndex,
129  EndLonIndex,
130  StartSampIndex,
131  StartLineIndex,
132  EndSampIndex,
133  EndLineIndex,
134  DistanceKmIndex,
135  DistanceMIndex,
136  DistancePixIndex,
137  AngleDegIndex,
138  AngleRadIndex,
139  AreaKmIndex,
140  AreaMIndex,
141  AreaPixIndex,
142  SegmentsSumIndex,
143  SegmentNumberIndex,
144  PathIndex,
145  FileNameIndex
146  };
147 
148  double m_startSamp;
149  double m_endSamp;
150  double m_startLine;
151  double m_endLine;
152  double m_startLat;
153  double m_endLat;
154  double m_startLon;
155  double m_endLon;
156  double m_kmDist;
157  double m_mDist;
158  double m_pixDist;
159  double m_radAngle;
160  double m_degAngle;
161  double m_kmArea;
162  double m_mArea;
163  double m_pixArea;
164 
165  QList<double> m_distanceSegments;
166  QList<double> m_pixDistSegments;
167  QList<double> m_startSampSegments;
168  QList<double> m_endSampSegments;
169  QList<double> m_startLineSegments;
170  QList<double> m_endLineSegments;
171  QList<double> m_startLatSegments;
172  QList<double> m_endLatSegments;
173  QList<double> m_startLonSegments;
174  QList<double> m_endLonSegments;
175 
176 
177  int m_numLinked;
178  QString m_path;
179  QString m_fname;
180 
181  TableMainWindow *m_tableWin;
182  RubberBandComboBox *m_rubberBand;
183  QCheckBox *m_showAllSegments;
184  };
185 
186 };
187 
188 #endif
Cube display widget for certain Isis MDI applications.
Definition: MdiCubeViewport.h:53
virtual void mouseLeave()
Mouse leave event.
Definition: MeasureTool.cpp:305
File name manipulation and expansion.
Definition: FileName.h:116
void enableRubberBandTool()
Enables/resets the rubberband tool.
Definition: MeasureTool.cpp:314
virtual void rubberBandComplete()
Called when the rubberBanding by the user is finished.
Definition: MeasureTool.cpp:278
QString menuName() const
Returns the menu name.
Definition: MeasureTool.h:66
MeasureTool(QWidget *parent)
MeasureTool constructor.
Definition: MeasureTool.cpp:39
void addTo(QMenu *menu)
Adds the measure action to the given menu.
Definition: MeasureTool.cpp:228
QWidget * createToolBarWidget(QStackedWidget *parent)
Creates the widget (button) that goes on the tool bar.
Definition: MeasureTool.cpp:111
void updateTool()
Updates the measure tool.
Definition: MeasureTool.cpp:869
Tool for measuring distances.
Definition: MeasureTool.h:58
QAction * toolPadAction(ToolPad *pad)
Add the measure tool action to the toolpad.
Definition: MeasureTool.cpp:88
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
Base class for the Qisis tools.
Definition: Tool.h:81
void removeConnections(MdiCubeViewport *cvp)
Removes the connection on the given cube viewport.
Definition: MeasureTool.cpp:859
Definition: ToolPad.h:14
virtual void updateMeasure()
Updates the Measure specifications.
Definition: MeasureTool.cpp:237