Isis 3 Programmer Reference
StereoTool.h
1 #ifndef StereoTool_h
2 #define StereoTool_h
3 
4 #include "Tool.h"
5 
6 #include <QFile>
7 #include <QPointer>
8 #include <QString>
9 
10 #include "AbstractPlotTool.h"
11 #include "Distance.h"
12 
13 class QAction;
14 class QCheckBox;
15 class QComboBox;
16 class QLabel;
17 class QLineEdit;
18 class QMainWindow;
19 
20 class ProfileDialog;
21 
22 namespace Isis {
23  class ControlMeasure;
24  class ControlNet;
25  class ControlPoint;
26  class ControlPointEdit;
27  class Cube;
28  class CubeViewport;
29  class MdiCubeViewport;
30  class SerialNumberList;
31  class Stretch;
32  class UniversalGroundMap;
33 
59  class StereoTool : public AbstractPlotTool {
60  Q_OBJECT
61 
62  public:
63  StereoTool(QWidget *parent);
64  void paintViewport(MdiCubeViewport *cvp, QPainter *painter);
65  static QString lastPtIdValue;
66 
67  signals:
68  void tieToolSave();
69  void editPointChanged();
70  void stretchChipViewport(Stretch *, CubeViewport *);
71 
72  public slots:
73  void createPoint(double lat, double lon);
74  void modifyPoint(ControlPoint *point);
75  void deletePoint(ControlPoint *point);
76 
77  protected:
78  QWidget *createToolBarWidget(QStackedWidget *parent);
80  void enableRubberBandTool();
82  void detachCurves();
83 
84  protected slots:
85  void rubberBandComplete();
86  void activateTool();
87 
88  private slots:
89  void showHelp();
90  void paintAllViewports();
91  void calculateElevation();
92  void profile();
93  void saveElevations();
94  void saveAsElevations();
95 
96  void userBaseRadius();
97  void updateRadiusLineEdit();
98 
99  void measureSaved();
100 
101  void setTemplateFile();
102  void viewTemplateFile();
103 
104  void clearProfile();
105  void createStartPoint();
106  void createEndPoint();
107 
108  private:
109  void createStereoTool(QWidget *parent);
110  void setupFiles();
111  void clearNetData();
112  void setFiles(Cube *leftCube, Cube *rightCube);
113  void clearFiles();
114  void paintProfile(MdiCubeViewport *vp, QPainter *painter,
115  QString serialNumber);
116  void calculateElevation(ControlPoint *point);
117 
118  void createMenus();
119 
120  void loadPoint();
121  void updateLabels();
122 
123  void warningDialog();
124  void readSettings();
125  void writeSettings();
126 
127  QMainWindow *m_stereoTool;
128  QComboBox *m_radiusBox;
129  QLineEdit *m_radiusLineEdit;
130  ControlPointEdit *m_pointEditor;
131  QLabel *m_ptIdValue;
132  QLabel *m_leftCubeLabel;
133  QLabel *m_rightCubeLabel;
134  QLabel *m_elevationLabel;
135  QLabel *m_elevationErrorLabel;
136  QLabel *m_baseRadiiLabel;
137  QLabel *m_leftDemRadiiLabel;
138  QLabel *m_rightDemRadiiLabel;
139 
140  bool m_showWarning;
141 
142  ControlPoint *m_startPoint;
143  ControlPoint *m_endPoint;
144 
145  enum CubeIndex {
146  Left,
147  Right
148  };
149 
150  SerialNumberList *m_serialNumberList;
151  QPointer<ControlNet> m_controlNet;
152  Distance m_targetRadius;
153  Distance m_baseRadius;
154  ControlPoint *m_editPoint;
155  int m_ptIdIndex;
156 
157  QList<CubeViewport *> m_linkedViewports;
158 
159  Cube *m_leftCube;
160  Cube *m_rightCube;
161  QString m_leftSN;
162  QString m_rightSN;
163  UniversalGroundMap *m_leftGM;
164  UniversalGroundMap *m_rightGM;
165 
166  QFile m_currentFile;
167  QAction *m_save;
168 
169 
170  ProfileDialog *m_profileDialog;
171 
172  };
173 };
174 
175 #endif
Cube display widget for certain Isis MDI applications.
void measureSaved()
Save control measures under crosshairs of ChipViewports.
Definition: StereoTool.cpp:850
void setFiles(Cube *leftCube, Cube *rightCube)
Setup the stereo cubes.
Definition: StereoTool.cpp:783
PlotWindow * createWindow()
This needs to be implemented by children to instantiate a plot window of the appropriate child class ...
Definition: StereoTool.cpp:348
Universal Ground Map.
void createPoint(double lat, double lon)
Create control point at given lat,lon.
QWidget * createToolBarWidget(QStackedWidget *parent)
Attaches this tool to the toolbar.
Definition: StereoTool.cpp:280
void paintAllViewports()
This method will repaint the control measures in each viewport.
void createStereoTool(QWidget *parent)
Design the StereoTool widget.
Definition: StereoTool.cpp:103
Widget to display Isis cubes for qt apps.
Definition: CubeViewport.h:132
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
Distance measurement, usually in meters.
Definition: Distance.h:47
void clearFiles()
New files selected, clean up old file info.
Definition: StereoTool.cpp:760
void viewTemplateFile()
Allows the user to view the template file that is currently set.
void modifyPoint(ControlPoint *point)
Modify given control point.
Pixel value mapper.
Definition: Stretch.h:72
A single control point.
Definition: ControlPoint.h:369
StereoTool(QWidget *parent)
Construct the StereoTool.
Definition: StereoTool.cpp:74
void paintViewport(MdiCubeViewport *cvp, QPainter *painter)
Repaint the given CubeViewport.
void loadPoint()
Load control point into the ControlPointEdit widget.
void setTemplateFile()
Allows user to set a new template file.
void deletePoint(ControlPoint *point)
Delete given control point.
void createMenus()
Create the menus for StereoTool.
Definition: StereoTool.cpp:178
void saveAsElevations()
Save the elevation information to file.
void detachCurves()
This will be called when the selected plot window changes.
Definition: StereoTool.cpp:357
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
QAction * toolPadAction(ToolPad *pad)
Put the StereoTool icon on the main window Toolpad.
Definition: StereoTool.cpp:250
Point Editor Widget.
Parent class for plotting tools which provides common functionality.
Serial Number list generator.
void enableRubberBandTool()
This methods enables the RubberBandTool, it also sets the RubberBandTool to allow points and to allow...
Definition: StereoTool.cpp:886
Tool for computing parallax.
Definition: StereoTool.h:59
IO Handler for Isis Cubes.
Definition: Cube.h:170