Isis 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>
9#include "TableMainWindow.h"
10#include "IString.h"
11
12
13class QCheckBox;
14class QComboBox;
15class QDialog;
16class QMenu;
17class QLineEdit;
18class QString;
19
20namespace 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();
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 PlanarDistanceIndex,
143 SegmentsSumIndex,
144 SegmentNumberIndex,
145 PathIndex,
146 FileNameIndex
147 };
148
149 double m_startSamp;
150 double m_endSamp;
151 double m_startLine;
152 double m_endLine;
153 double m_startLat;
154 double m_endLat;
155 double m_startLon;
156 double m_endLon;
157 double m_kmDist;
158 double m_mDist;
159 double m_pixDist;
160 double m_radAngle;
161 double m_degAngle;
162 double m_kmArea;
163 double m_mArea;
164 double m_pixArea;
165 double m_kmPlanarDist;
166
167
168 QList<double> m_distanceSegments;
169 QList<double> m_pixDistSegments;
170 QList<double> m_startSampSegments;
171 QList<double> m_endSampSegments;
172 QList<double> m_startLineSegments;
173 QList<double> m_endLineSegments;
174 QList<double> m_startLatSegments;
175 QList<double> m_endLatSegments;
176 QList<double> m_startLonSegments;
177 QList<double> m_endLonSegments;
178
179
180 int m_numLinked;
181 QString m_path;
182 QString m_fname;
183
184 TableMainWindow *m_tableWin;
185 RubberBandComboBox *m_rubberBand;
186 QCheckBox *m_showAllSegments;
187 };
188
189};
190
191#endif
File name manipulation and expansion.
Definition FileName.h:100
Cube display widget for certain Isis MDI applications.
Definition MdiCubeViewport.h:39
Tool for measuring distances.
Definition MeasureTool.h:58
void updateTool()
Updates the measure tool.
Definition MeasureTool.cpp:931
virtual void rubberBandComplete()
Called when the rubberBanding by the user is finished.
Definition MeasureTool.cpp:289
virtual void mouseLeave()
Mouse leave event.
Definition MeasureTool.cpp:316
void enableRubberBandTool()
Enables/resets the rubberband tool.
Definition MeasureTool.cpp:325
QWidget * createToolBarWidget(QStackedWidget *parent)
Creates the widget (button) that goes on the tool bar.
Definition MeasureTool.cpp:112
MeasureTool(QWidget *parent)
MeasureTool constructor.
Definition MeasureTool.cpp:39
void removeConnections(MdiCubeViewport *cvp)
Removes the connection on the given cube viewport.
Definition MeasureTool.cpp:921
QString menuName() const
Returns the menu name.
Definition MeasureTool.h:66
QAction * toolPadAction(ToolPad *pad)
Add the measure tool action to the toolpad.
Definition MeasureTool.cpp:89
virtual void updateMeasure()
Updates the Measure specifications.
Definition MeasureTool.cpp:248
void addTo(QMenu *menu)
Adds the measure action to the given menu.
Definition MeasureTool.cpp:239
Base class for the Qisis tools.
Definition Tool.h:67
Definition ToolPad.h:14
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16