Isis 3 Developer Reference
ControlPointEditWidget.h
Go to the documentation of this file.
1 #ifndef ControlPointEditWidget_h
2 #define ControlPointEditWidget_h
3 
4 
5 #include "ControlPoint.h"
6 #include "FileName.h"
7 #include "SpecialPixel.h"
8 #include "TemplateList.h"
9 
10 #include <QCloseEvent>
11 #include <QDir>
12 #include <QHideEvent>
13 #include <QPalette>
14 #include <QPointer>
15 #include <QStatusBar>
16 #include <QString>
17 #include <QStringList>
18 #include <QWidget>
19 
20 class QAction;
21 class QBoxLayout;
22 class QCheckBox;
23 class QComboBox;
24 class QGroupBox;
25 class QLabel;
26 class QMainWindow;
27 class QObject;
28 class QPainter;
29 class QPoint;
30 class QPushButton;
31 class QSplitter;
32 class QStackedWidget;
33 class QStandardItemModel;
34 class QString;
35 class QTableWidget;
36 class QTextEdit;
37 class QWidget;
38 
39 namespace Isis {
40  class Control;
41  class ControlMeasureEditWidget;
42  class ControlMeasure;
43  class ControlNet;
44  class Cube;
45  class CubeViewport;
46  class Directory;
47  class MdiCubeViewport;
48  class SerialNumberList;
49  class Stretch;
50  class ToolPad;
51  class UniversalGroundMap;
52 
114  Q_OBJECT
115 
116  public:
117  ControlPointEditWidget(Directory *directory, QWidget *parent, bool addMeasures = false);
118  virtual ~ControlPointEditWidget();
119 
120  QString editPointId();
122 
123  signals:
124  void controlPointChanged(QString pointId);
125  void controlPointAdded(QString pointId);
126  void ignorePointChanged();
127  void ignoreLeftChanged();
128  void ignoreRightChanged();
129  void cnetModified();
132  void measureChanged();
133  // temporary signal for quick & dirty autosave in Ipce
134  void saveControlNet();
135 
136  public slots:
138  void setControl(Control *control);
139  void setControlFromActive();
140  void setEditPoint(ControlPoint *controlPoint, QString serialNumber = "");
141  void deletePoint(ControlPoint *controlPoint);
142 
143  void createControlPoint(double latitude, double longitude, Cube *cube = 0,
144  bool isGroundSource = false);
145 
146  // Changed colorizeSaveNetButton to public slot so it could be called from
147  // Directory::saveActiveControl(). This should be temporary until the modify/save functionality
148  // of active control is re-factored. Also added reset parameter, defaulting to false so button
149  // is red. This default was used so that current calls did not need to be changed.
150  void colorizeSaveNetButton(bool reset = false);
151 
152  void addTemplates(TemplateList *templateList);
153 
154  protected:
155  bool eventFilter(QObject *o,QEvent *e);
156 
157  private slots:
158 // void enterWhatsThisMode();
159  void reloadPoint();
160  void saveNet();
161 // void addMeasure();
162  void setPointType (int pointType);
163  void setLockPoint (bool ignore);
164  void setIgnorePoint (bool ignore);
165  void setLockLeftMeasure (bool ignore);
166  void setIgnoreLeftMeasure (bool ignore);
167  void setLockRightMeasure (bool ignore);
168  void setIgnoreRightMeasure (bool ignore);
169 
170  void selectLeftMeasure (int index);
171  void selectRightMeasure (int index);
172  void nextRightMeasure();
173  void previousRightMeasure();
174  void updateLeftMeasureInfo ();
175  void updateRightMeasureInfo ();
176 
177  void measureSaved();
178  void checkReference();
179 
180  void updateGroundPosition();
181  void updateSurfacePointInfo ();
182  void openReferenceRadius();
183  void groundSourceFileSelectionChanged(int index);
184 
185  void savePoint();
186 
187  void colorizeAllSaveButtons(QString color);
188  void colorizeSavePointButton();
189 
190  void openTemplateFile();
191  void viewTemplateFile();
192  void saveChips();
193  void showHideTemplateEditor();
194  void saveTemplateFile();
195  void saveTemplateFileAs();
196  void setTemplateFile(QString);
197  void setTemplateModified();
198  void writeTemplateFile(QString);
199  void resetTemplateComboBox(QString fileName);
200  void clearEditPoint();
201 
202  private:
203  void createActions();
204 
205  void loadPoint(QString serialNumber = "");
206  void loadGroundMeasure();
207  void createPointEditor(QWidget *parent, bool addMeasures);
208  QSplitter * createTopSplitter();
209  QGroupBox * createControlPointGroupBox();
210  QGroupBox * createLeftMeasureGroupBox();
211  QGroupBox * createRightMeasureGroupBox();
212  void createTemplateEditorWidget();
213  void loadTemplateFile(QString);
214  bool okToContinue();
215  bool IsMeasureLocked(QString serialNumber);
216  bool validateMeasureChange(ControlMeasure *m);
217 
218  void setShapesForPoint(double latitude=Null, double longitude=Null);
219  ControlMeasure *createTemporaryGroundMeasure();
220  bool setGroundSourceInfo();
221  FileName checkGroundFileLocation(FileName groundFile);
222  void changeGroundLocationsInNet();
223  void clearGroundSource();
224 
225  void initDem(QString demFile);
226  double demRadius(double latitude, double longitude);
227 
228  private:
229 
230  QPointer<QWidget> m_parent;
231  Directory *m_directory;
232  bool m_addMeasuresButton;
233 
234  QString m_cnetFileName;
235  QPointer<QLabel> m_cnetFileNameLabel;
236  bool m_cnetModified;
237 
238  QPointer<QAction> m_closePointEditor;
239 
240  QPointer<QAction> m_saveChips;
241  QPointer<QAction> m_showHideTemplateEditor;
243  QPointer<QAction> m_openTemplateFile;
244  QPointer<QAction> m_saveTemplateFile;
245  QPointer<QAction> m_saveTemplateFileAs;
246 
247 
249  QPointer<ControlMeasureEditWidget> m_measureEditor;
250 
251  QPointer<QPushButton> m_reloadPoint;
252  QPointer<QPushButton> m_savePoint;
253  QPalette m_saveDefaultPalette;
254 
255  QPointer<QPushButton> m_saveNet;
256 
257  QPointer<QTextEdit> m_templateEditor;
258  QPointer<QWidget> m_templateEditorWidget;
259  bool m_templateModified;
260 
261  QPointer<QComboBox> m_templateComboBox;
262  QPointer<QComboBox> m_groundSourceCombo;
263  QPointer<QComboBox> m_radiusSourceCombo;
264  QPointer<QLabel> m_ptIdValue;
265  QPointer<QComboBox> m_pointTypeCombo;
266  QPointer<QLabel> m_numMeasures;
267  QPointer<QLabel> m_aprioriLatitude;
268  QPointer<QLabel> m_aprioriLongitude;
269  QPointer<QLabel> m_aprioriRadius;
270 
271  QPointer<QCheckBox> m_lockPoint;
272  QPointer<QCheckBox> m_ignorePoint;
273  QPointer<QLabel> m_leftReference;
274  QPointer<QLabel> m_leftMeasureType;
275  QPointer<QLabel> m_rightReference;
276  QPointer<QLabel> m_rightMeasureType;
277  QPointer<QCheckBox> m_lockLeftMeasure;
278  QPointer<QCheckBox> m_ignoreLeftMeasure;
279  QPointer<QCheckBox> m_lockRightMeasure;
280  QPointer<QCheckBox> m_ignoreRightMeasure;
281 
282  QPointer<QComboBox> m_leftCombo;
283  QPointer<QComboBox> m_rightCombo;
284  QPointer<QStandardItemModel> m_model;
285 
286  QPointer<QMainWindow> m_measureWindow;
287  QPointer<QTableWidget> m_measureTable;
288 
289  QPointer<ControlPoint> m_editPoint;
290  SerialNumberList *m_serialNumberList;
291  QPointer<ControlNet> m_controlNet;
292  QPointer<Control> m_control;
293 
294  QPointer<ControlPoint> m_newPoint;
295  QString m_lastUsedPointId;
296 
297  QStringList m_pointFiles;
298 
299  QString m_leftFile;
300  QPointer<ControlMeasure> m_leftMeasure;
301  QPointer<ControlMeasure> m_rightMeasure;
302  QScopedPointer<Cube> m_leftCube;
303  QScopedPointer<Cube> m_rightCube;
304 
305  QStringList m_projectShapeNames;
306  int m_numberProjectShapesWithPoint;
307  QMap<QString, Shape *> m_nameToShapeMap;
308 
309  QString m_groundFilename;
310  QString m_groundSN;
311  ControlPoint::SurfacePointSource::Source m_groundSourceType;
312  QScopedPointer<UniversalGroundMap> m_groundGmap;
313 
314  bool m_changeAllGroundLocation;
315  bool m_changeGroundLocationInNet;
317  QString m_newGroundDir;
318 
319  // TODO: Combine the following m_groundSourceFile, m_radiusSourceFile
320  // with m_groundFile and m_demFile. Is it just a matter of
321  // full path vs filename only?
322  QString m_radiusFilename;
323  ControlPoint::RadiusSource::Source m_radiusSourceType;
324  bool m_demOpen;
325  QString m_demFile;
326  QScopedPointer<Cube> m_demCube;
327  };
328 };
329 #endif
This represents an ISIS control net in a project-based GUI interface.
Definition: Control.h:79
const double Null
Value for an Isis Null pixel.
Definition: SpecialPixel.h:110
Source
Definition: ControlPoint.h:466
File name manipulation and expansion.
Definition: FileName.h:116
bool eventFilter(QObject *o, QEvent *e)
Event filter for ControlPointEditWidget.
Definition: ControlPointEditWidget.cpp:2727
Source
Definition: ControlPoint.h:455
Definition: TemplateList.h:49
QString editPointId()
Definition: ControlPointEditWidget.cpp:103
virtual ~ControlPointEditWidget()
Definition: ControlPointEditWidget.cpp:98
Widget to display Isis cubes for qt apps.
Definition: CubeViewport.h:132
Gui for editing ControlPoints in ipce application.
Definition: ControlPointEditWidget.h:113
void newControlNetwork(ControlNet *)
void deletePoint(ControlPoint *controlPoint)
Gives user options for deleting a control point from the control network.
Definition: ControlPointEditWidget.cpp:1560
void createControlPoint(double latitude, double longitude, Cube *cube=0, bool isGroundSource=false)
Create a new control point at the given latitude, longitude.
Definition: ControlPointEditWidget.cpp:1447
void colorizeSaveNetButton(bool reset=false)
Turn "Save Net" button text to red.
Definition: ControlPointEditWidget.cpp:3114
a control network
Definition: ControlNet.h:271
Pixel value mapper.
Definition: Stretch.h:72
void setControl(Control *control)
New control network being edited.
Definition: ControlPointEditWidget.cpp:666
A single control point.
Definition: ControlPoint.h:369
void controlPointAdded(QString pointId)
void setSerialNumberList(SerialNumberList *snList)
Set the serial number list.
Definition: ControlPointEditWidget.cpp:645
ControlPointEditWidget(Directory *directory, QWidget *parent, bool addMeasures=false)
Consructs the ControlPointEditWidget widget.
Definition: ControlPointEditWidget.cpp:72
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
a control measurement
Definition: ControlMeasure.h:189
void addTemplates(TemplateList *templateList)
Add registration TemplateList to combobox when imported to project.
Definition: ControlPointEditWidget.cpp:2963
void controlPointChanged(QString pointId)
void setControlFromActive()
New active control was set from ipce.
Definition: ControlPointEditWidget.cpp:689
Serial Number list generator.
Definition: SerialNumberList.h:80
void stretchChipViewport(Stretch *, CubeViewport *)
Definition: Directory.h:285
void setEditPoint(ControlPoint *controlPoint, QString serialNumber="")
Slot called by Directory to set the control point for editing.
Definition: ControlPointEditWidget.cpp:1161
Definition: CubeIoHandler.h:38
ControlPoint * editPoint()
Definition: ControlPointEditWidget.cpp:113
IO Handler for Isis Cubes.
Definition: Cube.h:170