Isis 3 Programmer Reference
MeasureTool.h
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:
89  QLineEdit *m_distLineEdit;
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 
120  };
121 
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 
178  QString m_path;
179  QString m_fname;
180 
183  QCheckBox *m_showAllSegments;
184  };
185 
186 };
187 
188 #endif
Cube display widget for certain Isis MDI applications.
void updateRow(int row)
This method updates the row in the table window with the current measure information.
Area in meters.
Definition: MeasureTool.h:114
double m_startLine
starting line
Definition: MeasureTool.h:150
virtual void mouseLeave()
Mouse leave event.
Angle in radians index.
Definition: MeasureTool.h:138
double m_pixDist
distance in pixels
Definition: MeasureTool.h:158
TableColumnsMap
Enum for all possible table columns.
Definition: MeasureTool.h:103
double m_endSamp
ending sample
Definition: MeasureTool.h:149
QLineEdit * m_distLineEdit
Distance line edit.
Definition: MeasureTool.h:89
double m_startLat
starting latitude
Definition: MeasureTool.h:152
TableColumnIndex
Enum for storing all the indexes.
Definition: MeasureTool.h:125
double m_startLon
starting longitude
Definition: MeasureTool.h:154
int m_numLinked
number of linked viewports
Definition: MeasureTool.h:177
Combo box for choosing a rubber band type.
Distance in meters index.
Definition: MeasureTool.h:135
double m_degAngle
angle in degrees
Definition: MeasureTool.h:160
void initData(void)
Initialize Class data.
QAction * m_action
Measure tool&#39;s action.
Definition: MeasureTool.h:88
double m_kmArea
area in kilometers
Definition: MeasureTool.h:161
double m_endLon
ending longitude
Definition: MeasureTool.h:155
void enableRubberBandTool()
Enables/resets the rubberband tool.
Segment lengths in kilometers.
Definition: MeasureTool.h:142
QString m_path
filename path
Definition: MeasureTool.h:178
Ending latitude index.
Definition: MeasureTool.h:128
virtual void rubberBandComplete()
Called when the rubberBanding by the user is finished.
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.
void updateDistEdit()
Change the value in the distance edit to match the units.
Distance in pixels index.
Definition: MeasureTool.h:136
Angle in degrees index.
Definition: MeasureTool.h:137
QWidget * createToolBarWidget(QStackedWidget *parent)
Creates the widget (button) that goes on the tool bar.
Distance in meters.
Definition: MeasureTool.h:109
Distance in kilometers.
Definition: MeasureTool.h:108
Area in kilometers.
Definition: MeasureTool.h:113
RubberBandComboBox * m_rubberBand
rubberband combo box
Definition: MeasureTool.h:182
double m_startSamp
starting sample
Definition: MeasureTool.h:148
FileName path.
Definition: MeasureTool.h:117
void updateTool()
Updates the measure tool.
Ending sample index.
Definition: MeasureTool.h:132
Tool for measuring distances.
Definition: MeasureTool.h:58
QAction * toolPadAction(ToolPad *pad)
Add the measure tool action to the toolpad.
Definition: MeasureTool.cpp:88
double m_endLat
ending latitude
Definition: MeasureTool.h:153
Angle in degrees.
Definition: MeasureTool.h:111
void updateUnitsCombo()
Updates the units combo box.
Angle in radians.
Definition: MeasureTool.h:112
QString m_fname
filename
Definition: MeasureTool.h:179
TableMainWindow * m_tableWin
table window
Definition: MeasureTool.h:181
double m_endLine
ending line
Definition: MeasureTool.h:151
double m_kmDist
distance in kilometers
Definition: MeasureTool.h:156
Starting sample index.
Definition: MeasureTool.h:130
Segment lengths in kilometers.
Definition: MeasureTool.h:116
void updateDist(MdiCubeViewport *cvp, int row)
This method updates the distance variables.
FileName path index.
Definition: MeasureTool.h:144
double m_pixArea
area in pixels
Definition: MeasureTool.h:163
Area in pixels index.
Definition: MeasureTool.h:141
a subclass of the qisis mainwindow, tablemainwindow handles all of the table tasks.
Area in meters index.
Definition: MeasureTool.h:140
Starting longitude index.
Definition: MeasureTool.h:127
Distance in pixels.
Definition: MeasureTool.h:110
Area in kilometers index.
Definition: MeasureTool.h:139
Distance in kilometers index.
Definition: MeasureTool.h:134
QComboBox * m_unitsComboBox
Units selection.
Definition: MeasureTool.h:90
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.
void updateRows(int row)
This method is called instead of updateRows if the &#39;Show All Segment&#39; checkbox is checked...
double m_mDist
distance in meters
Definition: MeasureTool.h:157
double m_radAngle
angle in radians
Definition: MeasureTool.h:159
Ending longitude index.
Definition: MeasureTool.h:129
double m_mArea
area in meters
Definition: MeasureTool.h:162
Starting latitude index.
Definition: MeasureTool.h:126
virtual void updateMeasure()
Updates the Measure specifications.