USGS

Isis 3.0 Developer's Reference (API)

Home

MeasureTool.h

Go to the documentation of this file.
00001 #ifndef Qisis_MeasureTool_h
00002 #define Qisis_MeasureTool_h
00003 
00004 #include "Tool.h"
00005 
00006 // FIXME: remove these includes
00007 #include <QAction>
00008 #include "RubberBandComboBox.h"
00009 #include "TableMainWindow.h"
00010 #include "iString.h"
00011 
00012 
00013 class QDialog;
00014 class QMenu;
00015 class QLineEdit;
00016 class QComboBox;
00017 
00018 namespace Isis {
00019   class iString;
00020 }
00021 
00022 namespace Isis {
00023   class MdiCubeViewport;
00024 
00056   class MeasureTool : public Tool {
00057       Q_OBJECT
00058 
00059     public:
00060       MeasureTool(QWidget *parent);
00061       void addTo(QMenu *menu);
00062 
00063     protected slots:
00064       virtual void rubberBandComplete();
00065       virtual void updateMeasure();
00066       virtual void mouseLeave();
00067 
00068     protected:
00070       QString menuName() const {
00071         return "&Options";
00072       };
00073       QWidget *createToolBarWidget(QStackedWidget *parent);
00074       QAction *toolPadAction(ToolPad *pad);
00075       void updateTool();
00076       void removeConnections(MdiCubeViewport *cvp);
00077       void enableRubberBandTool();
00078 
00079     private slots:
00080 
00081       void updateUnitsCombo();
00082       void updateDistEdit();
00083 
00084     private:
00085       QAction *m_action;          
00086       QLineEdit *m_distLineEdit;  
00087       QComboBox *m_unitsComboBox; 
00088       int miComboUnit;            // Store the previous unit chosen
00089 
00090       void addRow();
00091       void updateDist(MdiCubeViewport *cvp, int row);
00092       void setDistances(MdiCubeViewport *cvp, QPoint lineStart, QPoint lineEnd);
00093       void updateRow(int row);
00094       void updateRows(int row);
00095       void initData(void);
00096 
00100       enum TableColumnsMap {
00101         FeatureName, 
00102         FeatureType, 
00103         LatitudeLongitude, 
00104         SampleLine, 
00105         DistanceKm, 
00106         DistanceM, 
00107         DistancePix, 
00108         AngleDeg, 
00109         AngleRad, 
00110         AreaKm, 
00111         AreaM, 
00112         AreaPix, 
00113         Segments, 
00114         Path, 
00115         Filename, 
00116         Notes 
00117       };
00118 
00122       enum TableColumnIndex {
00123         StartLatIndex = 2,
00124         StartLonIndex,
00125         EndLatIndex,
00126         EndLonIndex,
00127         StartSampIndex,
00128         StartLineIndex,
00129         EndSampIndex,
00130         EndLineIndex,
00131         DistanceKmIndex,
00132         DistanceMIndex,
00133         DistancePixIndex,
00134         AngleDegIndex,
00135         AngleRadIndex,
00136         AreaKmIndex,
00137         AreaMIndex,
00138         AreaPixIndex,
00139         SegmentsSumIndex,
00140         SegmentNumberIndex, 
00141         PathIndex,
00142         FilenameIndex
00143       };
00144 
00145       double m_startSamp;
00146       double m_endSamp;
00147       double m_startLine;
00148       double m_endLine;
00149       double m_startLat;
00150       double m_endLat;
00151       double m_startLon;
00152       double m_endLon;
00153       double m_kmDist;
00154       double m_mDist;
00155       double m_pixDist;
00156       double m_radAngle;
00157       double m_degAngle;
00158       double m_kmArea;
00159       double m_mArea;
00160       double m_pixArea;
00161 
00162       QList<double> m_distanceSegments;
00163       QList<double> m_pixDistSegments;
00164       QList<double> m_startSampSegments;
00165       QList<double> m_endSampSegments;
00166       QList<double> m_startLineSegments;
00167       QList<double> m_endLineSegments;
00168       QList<double> m_startLatSegments;
00169       QList<double> m_endLatSegments;
00170       QList<double> m_startLonSegments;
00171       QList<double> m_endLonSegments;
00172 
00173 
00174       int m_numLinked;
00175       iString m_path;
00176       iString m_fname;
00177 
00178       TableMainWindow *m_tableWin;
00179       RubberBandComboBox *m_rubberBand;
00180       QCheckBox *m_showAllSegments;
00181   };
00182 
00183 };
00184 
00185 #endif