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>
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  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
Isis::Angle::Degrees
@ Degrees
Degrees are generally considered more human readable, 0-360 is one circle, however most math does not...
Definition: Angle.h:56
FileName.h
Isis::MdiCubeViewport
Cube display widget for certain Isis MDI applications.
Definition: MdiCubeViewport.h:39
QWidget
Isis::RubberBandComboBox
Combo box for choosing a rubber band type.
Definition: RubberBandComboBox.h:26
Isis::MeasureTool::removeConnections
void removeConnections(MdiCubeViewport *cvp)
Removes the connection on the given cube viewport.
Definition: MeasureTool.cpp:923
MdiCubeViewport.h
Isis::TableMainWindow::table
QTableWidget * table() const
Returns the table.
Definition: TableMainWindow.h:70
Isis::RubberBandTool::setDrawActiveViewportOnly
void setDrawActiveViewportOnly(bool activeOnly=false)
This called to set whether rubber band is drawn on active viewport only rather than all linked viewpo...
Definition: RubberBandTool.cpp:333
Isis::RubberBandTool::RectangleMode
@ RectangleMode
Definition: RubberBandTool.h:62
QList< double >
Isis::MeasureTool::enableRubberBandTool
void enableRubberBandTool()
Enables/resets the rubberband tool.
Definition: MeasureTool.cpp:326
Isis::Distance::Pixels
@ Pixels
The distance is being specified in pixels.
Definition: Distance.h:47
Isis::RubberBandComboBox::SegmentedLine
@ SegmentedLine
Segmented Line.
Definition: RubberBandComboBox.h:43
Isis::Tool::cubeViewportList
CubeViewportList * cubeViewportList() const
Return the list of cubeviewports.
Definition: Tool.cpp:390
Isis::RubberBandComboBox::Circle
@ Circle
Circle.
Definition: RubberBandComboBox.h:37
Isis::FileName::name
QString name() const
Returns the name of the file excluding the path and the attributes in the file name.
Definition: FileName.cpp:162
Isis::MeasureTool
Tool for measuring distances.
Definition: MeasureTool.h:58
Isis::Tool
Base class for the Qisis tools.
Definition: Tool.h:67
Isis::FileName
File name manipulation and expansion.
Definition: FileName.h:100
Isis::DEG2RAD
const double DEG2RAD
Multiplier for converting from degrees to radians.
Definition: Constants.h:43
QMenu
Isis::Tool::toolIconDir
QString toolIconDir() const
returns the path to the icon directory.
Definition: Tool.h:113
Isis::RubberBandComboBox::Polygon
@ Polygon
Polygon.
Definition: RubberBandComboBox.h:41
Isis::Tool::rubberBandTool
RubberBandTool * rubberBandTool()
Definition: Tool.cpp:57
Longitude.h
Isis::RubberBandTool::currentMode
RubberBandMode currentMode()
Definition: RubberBandTool.cpp:1161
Isis::RubberBandComboBox::Line
@ Line
Line.
Definition: RubberBandComboBox.h:42
Tool.h
Isis::RubberBandComboBox::Rectangle
@ Rectangle
Rectangle.
Definition: RubberBandComboBox.h:39
ToolPad.h
IString.h
Isis::RubberBandComboBox::Angle
@ Angle
Angle.
Definition: RubberBandComboBox.h:44
QComboBox
Isis::TableMainWindow::addToTable
void addToTable(bool setOn, const QString &heading, const QString &menuText="", int insertAt=-1, Qt::Orientation o=Qt::Horizontal, QString toolTip="")
Adds a new column to the table when a new curve is added to the plot.
Definition: TableMainWindow.cpp:208
Isis::RubberBandTool::SegmentedLineMode
@ SegmentedLineMode
Definition: RubberBandTool.h:65
Isis::TableMainWindow::setTrackListItems
void setTrackListItems(bool track=false)
If this property is true, the class will keep track of the checked/unchecked items in the dock area w...
Definition: TableMainWindow.cpp:875
Isis::RubberBandTool::AngleMode
@ AngleMode
Definition: RubberBandTool.h:58
Isis::Distance::Kilometers
@ Kilometers
The distance is being specified in kilometers.
Definition: Distance.h:45
Isis::TableMainWindow::clearRow
void clearRow(int row)
This method clears the text of the given row.
Definition: TableMainWindow.cpp:452
Isis::MeasureTool::rubberBandComplete
virtual void rubberBandComplete()
Called when the rubberBanding by the user is finished.
Definition: MeasureTool.cpp:290
Isis::Distance::Meters
@ Meters
The distance is being specified in meters.
Definition: Distance.h:43
Isis::MeasureTool::addTo
void addTo(QMenu *menu)
Adds the measure action to the given menu.
Definition: MeasureTool.cpp:240
Isis::FileName::expanded
QString expanded() const
Returns a QString of the full file name including the file path, excluding the attributes.
Definition: FileName.cpp:196
Latitude.h
Isis::MeasureTool::MeasureTool
MeasureTool(QWidget *parent)
MeasureTool constructor.
Definition: MeasureTool.cpp:40
Isis::MeasureTool::createToolBarWidget
QWidget * createToolBarWidget(QStackedWidget *parent)
Creates the widget (button) that goes on the tool bar.
Definition: MeasureTool.cpp:113
Isis::RubberBandComboBox::Ellipse
@ Ellipse
Ellipse.
Definition: RubberBandComboBox.h:38
Isis::MeasureTool::menuName
QString menuName() const
Returns the menu name.
Definition: MeasureTool.h:66
MeasureTool.h
Isis::MeasureTool::updateTool
void updateTool()
Updates the measure tool.
Definition: MeasureTool.cpp:933
SurfacePoint.h
Isis::MdiCubeViewport::isLinked
bool isLinked() const
Is the viewport linked with other viewports.
Definition: MdiCubeViewport.h:50
Isis::TableMainWindow::setCurrentRow
void setCurrentRow(int row)
Sets the current row to row.
Definition: TableMainWindow.cpp:896
Isis::Projection::RingPlane
@ RingPlane
These projections are used to map ring planes.
Definition: Projection.h:168
Isis::TableMainWindow
a subclass of the qisis mainwindow, tablemainwindow handles all of the table tasks.
Definition: TableMainWindow.h:57
TableMainWindow.h
ASSERT
#define ASSERT(x)
Definition: IsisDebug.h:134
TProjection.h
Camera.h
Isis::Null
const double Null
Value for an Isis Null pixel.
Definition: SpecialPixel.h:95
Isis::RubberBandTool::angle
Angle angle()
Definition: RubberBandTool.cpp:760
Isis::ToolPad
Definition: ToolPad.h:14
Isis::RubberBandComboBox::reset
void reset()
Resets the selection.
Definition: RubberBandComboBox.cpp:226
Isis::MeasureTool::toolPadAction
QAction * toolPadAction(ToolPad *pad)
Add the measure tool action to the toolpad.
Definition: MeasureTool.cpp:90
Isis::RubberBandTool::geometry
geos::geom::Geometry * geometry()
Definition: RubberBandTool.cpp:823
Isis::TableMainWindow::setStatusMessage
void setStatusMessage(QString message)
sets the status message in the lower lefthand corner of the window.
Definition: TableMainWindow.cpp:191
RingPlaneProjection.h
Isis::Angle::degrees
double degrees() const
Get the angle in units of Degrees.
Definition: Angle.h:232
Projection.h
Isis::TableMainWindow::currentRow
int currentRow() const
Returns the current row.
Definition: TableMainWindow.h:114
Isis::Projection::Triaxial
@ Triaxial
These projections are used to map triaxial and irregular-shaped bodies.
Definition: Projection.h:166
Isis::RubberBandComboBox::RotatedRectangle
@ RotatedRectangle
RotatedRectangle.
Definition: RubberBandComboBox.h:40
QDialog
Isis::MeasureTool::mouseLeave
virtual void mouseLeave()
Mouse leave event.
Definition: MeasureTool.cpp:317
Isis::RubberBandTool::LineMode
@ LineMode
Definition: RubberBandTool.h:61
Constants.h
Distance.h
IsisDebug.h
QAction
Isis::MeasureTool::updateMeasure
virtual void updateMeasure()
Updates the Measure specifications.
Definition: MeasureTool.cpp:249
Isis::Projection::ProjectionType
ProjectionType
This enum defines the subclasses of Projection supported in Isis.
Definition: Projection.h:166
Isis::Tool::cubeViewport
MdiCubeViewport * cubeViewport() const
Return the current cubeviewport.
Definition: Tool.h:197
Isis::FileName::path
QString path() const
Returns the path of the file name.
Definition: FileName.cpp:103
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
RubberBandComboBox.h
Isis::Angle::radians
double radians() const
Convert an angle to a double.
Definition: Angle.h:226
Isis::RubberBandTool::vertices
QList< QPoint > vertices()
This method returns the vertices.
Definition: RubberBandTool.cpp:672