Isis 3 Developer Reference
QnetTool.h
Go to the documentation of this file.
1 #ifndef QnetTool_h
2 #define QnetTool_h
3 
4 #include "Tool.h"
5 #include "ControlPoint.h"
6 
7 #include <QCloseEvent>
8 #include <QPalette>
9 #include <QPointer>
10 #include <QStringList>
11 
12 class QAction;
13 class QBoxLayout;
14 class QCheckBox;
15 class QComboBox;
16 class QGroupBox;
17 class QLabel;
18 class QMainWindow;
19 class QObject;
20 class QPainter;
21 class QPoint;
22 class QPushButton;
23 class QSplitter;
24 class QStackedWidget;
25 class QString;
26 class QTableWidget;
27 class QTextEdit;
28 class QWidget;
29 
30 namespace Isis {
31  class ControlMeasure;
32  class ControlNet;
33  class ControlPointEdit;
34  class Cube;
35  class CubeViewport;
36  class MainWindow;
37  class MdiCubeViewport;
38  class QnetHoldPointDialog;
39  class SerialNumberList;
40  class Stretch;
41  class ToolPad;
42  class UniversalGroundMap;
43 
256  class QnetTool : public Tool {
257  Q_OBJECT
258 
259  public:
260  QnetTool (QWidget *parent);
261  virtual ~QnetTool ();
262  void paintViewport (MdiCubeViewport *cvp,QPainter *painter);
263 
264  // measure column values
282  };
283  static const int NUMCOLUMNS = 16;
284 
285  QString measureColumnToString(MeasureColumns column);
286 
288  const ControlNet *controlNet() const;
289 
291  const SerialNumberList *serialNumberList() const;
292 
293  Workspace *workspace() const;
294 
295  signals:
296  void qnetToolSave();
297  void qnetToolSaveAs();
298  void refreshNavList();
299  void editPointChanged(QString pointId);
300  void netChanged();
301  void ignorePointChanged();
302  void ignoreLeftChanged();
303  void ignoreRightChanged();
304  void showNavTool();
307  void measureChanged();
308 
309  public slots:
310  void updateList();
311  void updateNet(QString cNetFileName);
312  void createPoint(double lat,double lon);
313  void createFixedPoint(double lat,double lon);
314  void modifyPoint(ControlPoint *point);
315  void deletePoint(ControlPoint *point);
316  void updatePointInfo(QString pointId);
317  void refresh();
318 
319  protected:
321  bool eventFilter(QObject *o,QEvent *e);
322 
323  protected slots:
324  void mouseButtonRelease(QPoint p, Qt::MouseButton s);
325  QWidget *createToolBarWidget (QStackedWidget *parent);
326 
327  private slots:
328  void enterWhatsThisMode();
329  void paintAllViewports (QString pointId );
330  void saveNet();
331  void saveAsNet();
332  void addMeasure();
333  void setPointType (int pointType);
334  void setLockPoint (bool ignore);
335  void setIgnorePoint (bool ignore);
336  void setLockLeftMeasure (bool ignore);
337  void setIgnoreLeftMeasure (bool ignore);
338  void setLockRightMeasure (bool ignore);
339  void setIgnoreRightMeasure (bool ignore);
340  void showNavWindow (bool checked);
341 
342  void updateSurfacePointInfo ();
343 
344  void nextRightMeasure();
345  void previousRightMeasure();
346  void selectLeftMeasure (int index);
347  void selectRightMeasure (int index);
348  void updateLeftMeasureInfo ();
349  void updateRightMeasureInfo ();
350 
351  void measureSaved();
352  bool checkReference();
353  void updateGroundPosition();
354  void savePoint();
355  void colorizeSaveButton();
356 
357  void openTemplateFile();
358  void viewTemplateFile();
359  void saveChips();
360 
361  void openGround();
362  void groundViewportClosed(CubeViewport *);
363  void openDem();
364  void openReferenceRadius();
365  void showHideTemplateEditor();
366  void saveTemplateFile();
367  void saveTemplateFileAs();
368  void setTemplateModified();
369  void writeTemplateFile(QString);
370 
371  private:
372  void createActions();
373  void createMenus();
374  ControlMeasure *createTemporaryGroundMeasure();
375  void createToolBars();
376  bool findPointLocation();
377  void loadPoint();
378  void loadGroundMeasure();
379  void loadMeasureTable();
380  void drawAllMeasurments (MdiCubeViewport *vp,QPainter *painter);
381  void drawGroundMeasures (MdiCubeViewport *vp,QPainter *painter);
382 // void drawMeasures (MdiCubeViewport *vp,QPainter *painter,ControlPoint &point);
383  void createQnetTool(QWidget *parent);
384  QSplitter * createTopSplitter();
385  QGroupBox * createControlPointGroupBox();
386  QGroupBox * createLeftMeasureGroupBox();
387  QGroupBox * createRightMeasureGroupBox();
388  void createTemplateEditorWidget();
389  void loadTemplateFile(QString);
390  bool okToContinue();
391  void initDem(QString demFile);
392  double demRadius(double latitude, double longitude);
393  void clearGroundSource();
394  bool IsMeasureLocked(QString serialNumber);
395 
396  void readSettings();
397  void writeSettings() const;
398 
399  QPointer<MainWindow> m_qnetTool;
400 
401  QString m_cnetFileName;
402 
403  QStringList findPointFiles(double lat, double lon);
404 
405  QPointer<QAction> m_createPoint;
406  QPointer<QAction> m_modifyPoint;
407  QPointer<QAction> m_deletePoint;
408 
409  QPointer<QAction> m_openGround;
410  QPointer<QAction> m_openDem;
411  QPointer<QAction> m_saveNet;
412  QPointer<QToolBar> toolBar;
413  QPointer<QAction> m_saveAsNet;
414  QPointer<QAction> m_closeQnetTool;
415 
416  QPointer<QAction> m_saveChips;
417  QPointer<QAction> m_showHideTemplateEditor;
418  QPointer<QAction> m_openTemplateFile;
419  QPointer<QAction> m_saveTemplateFile;
420  QPointer<QAction> m_saveTemplateFileAs;
421 
422  QPointer<QAction> m_whatsThis;
423 
424  QPointer<QMainWindow> m_mw;
425  QPointer<ControlPointEdit> m_pointEditor;
426 
427  QPushButton *m_savePoint;
428  QPalette m_saveDefaultPalette;
429 
430  QTextEdit *m_templateEditor;
431  QWidget *m_templateEditorWidget;
432  bool m_templateModified;
433 
434  QPointer<QLabel> m_templateFileNameLabel;
435  QPointer<QLabel> m_groundFileNameLabel;
436  QPointer<QLabel> m_radiusFileNameLabel;
437  QPointer<QLabel> m_ptIdValue;
438  QPointer<QComboBox> m_pointType;
439  QPointer<QLabel> m_numMeasures;
440  QPointer<QLabel> m_pointAprioriLatitude;
441  QPointer<QLabel> m_pointAprioriLongitude;
442  QPointer<QLabel> m_pointAprioriRadius;
443  QPointer<QLabel> m_pointAprioriLatitudeSigma;
444  QPointer<QLabel> m_pointAprioriLongitudeSigma;
445  QPointer<QLabel> m_pointAprioriRadiusSigma;
446  QPointer<QLabel> m_pointLatitude;
447  QPointer<QLabel> m_pointLongitude;
448  QPointer<QLabel> m_pointRadius;
449 
450  QPointer<QCheckBox> m_lockPoint;
451  QPointer<QCheckBox> m_ignorePoint;
452  QPointer<QLabel> m_leftReference;
453  QPointer<QLabel> m_leftMeasureType;
454  QPointer<QLabel> m_leftSampError;
455  QPointer<QLabel> m_leftLineError;
456  QPointer<QLabel> m_leftSampShift;
457  QPointer<QLabel> m_leftLineShift;
458  QPointer<QLabel> m_leftGoodness;
459  QPointer<QLabel> m_rightGoodness;
460  QPointer<QLabel> m_rightReference;
461  QPointer<QLabel> m_rightMeasureType;
462  QPointer<QLabel> m_rightSampError;
463  QPointer<QLabel> m_rightLineError;
464  QPointer<QLabel> m_rightSampShift;
465  QPointer<QLabel> m_rightLineShift;
466  QPointer<QCheckBox> m_lockLeftMeasure;
467  QPointer<QCheckBox> m_ignoreLeftMeasure;
468  QPointer<QCheckBox> m_lockRightMeasure;
469  QPointer<QCheckBox> m_ignoreRightMeasure;
470 
471  QPointer<QComboBox> m_leftCombo;
472  QPointer<QComboBox> m_rightCombo;
473 
474  QPointer<QMainWindow> m_measureWindow;
475  QPointer<QTableWidget> m_measureTable;
476 
477  QPointer<ControlPoint> m_editPoint;
478 
479  QStringList m_pointFiles;
480 
481  QString m_leftFile;
482  QPointer<ControlMeasure> m_leftMeasure;
483  QPointer<ControlMeasure> m_rightMeasure;
484  QScopedPointer<Cube> m_leftCube;
485  QScopedPointer<Cube> m_rightCube;
486 
487  QString m_groundFile;
488  QScopedPointer<Cube> m_groundCube;
489  QString m_groundSN;
490  QScopedPointer<UniversalGroundMap> m_groundGmap;
491  bool m_groundOpen;
492  ControlPoint::SurfacePointSource::Source m_groundSurfacePointSource;
493  ControlPoint::RadiusSource::Source m_groundRadiusSource;
494  // TODO: Combine the following m_groundSourceFile, m_radiusSourceFile
495  // with m_groundFile and m_demFile. Is it just a matter of
496  // full path vs filename only?
497  QString m_groundSourceFile;
498  QString m_radiusSourceFile;
499  QString m_demFile;
500  bool m_demOpen;
501  QScopedPointer<Cube> m_demCube;
502 
503  QString m_lastUsedPointId;
504  QPointer<ControlNet> m_controlNet;
505  SerialNumberList *m_serialNumberList;
506  QPointer<Workspace> m_workspace;
507  };
508 };
509 
510 #endif
Cube display widget for certain Isis MDI applications.
Definition: MdiCubeViewport.h:53
void measureChanged()
Definition: QnetTool.h:270
QString measureColumnToString(MeasureColumns column)
Definition: QnetTool.cpp:2539
Source
Definition: ControlPoint.h:466
void updateNet(QString cNetFileName)
Updates the Control Network displayed in the Qnet Tool title bar.
Definition: QnetTool.cpp:1453
void modifyPoint(ControlPoint *point)
Modify control point.
Definition: QnetTool.cpp:2109
QWidget * createToolBarWidget(QStackedWidget *parent)
This method creates the widgets for the tool bar.
Definition: QnetTool.cpp:3607
void mouseButtonRelease(QPoint p, Qt::MouseButton s)
Handle mouse events on CubeViewport.
Definition: QnetTool.cpp:1519
Definition: QnetTool.h:274
Definition: QnetTool.h:278
void newControlNetwork(ControlNet *)
Source
Definition: ControlPoint.h:455
void qnetToolSave()
void paintViewport(MdiCubeViewport *cvp, QPainter *painter)
Take care of drawing things on a viewPort.
Definition: QnetTool.cpp:3118
Widget to display Isis cubes for qt apps.
Definition: CubeViewport.h:132
void refresh()
Refresh all necessary widgets in QnetTool including the PointEditor and CubeViewports.
Definition: QnetTool.cpp:3555
virtual ~QnetTool()
Definition: QnetTool.cpp:94
void createFixedPoint(double lat, double lon)
Create new Fixed control point.
Definition: QnetTool.cpp:1786
Definition: QnetTool.h:281
void qnetToolSaveAs()
QAction * toolPadAction(ToolPad *pad)
Adds the Tie tool action to the tool pad.
Definition: QnetTool.cpp:1474
a control network
Definition: ControlNet.h:271
void stretchChipViewport(Stretch *, CubeViewport *)
void refreshNavList()
Pixel value mapper.
Definition: Stretch.h:72
QnetTool(QWidget *parent)
Consructs the Qnet Tool window.
Definition: QnetTool.cpp:67
SerialNumberList * serialNumberList()
Definition: QnetTool.cpp:2589
void createPoint(double lat, double lon)
Create new control point.
Definition: QnetTool.cpp:1671
Workspace * workspace() const
Definition: QnetTool.cpp:2599
A single control point.
Definition: ControlPoint.h:369
ControlNet * controlNet()
Definition: QnetTool.cpp:2579
void ignorePointChanged()
bool eventFilter(QObject *o, QEvent *e)
Event filter for QnetTool.
Definition: QnetTool.cpp:3097
Definition: QnetTool.h:272
void deletePoint(ControlPoint *point)
Delete control point.
Definition: QnetTool.cpp:1960
Definition: QnetTool.h:268
Definition: QnetTool.h:271
Definition: QnetTool.h:273
Definition: QnetTool.h:275
Definition: Workspace.h:90
Definition: QnetTool.h:276
Definition: QnetTool.h:279
void ignoreRightChanged()
Definition: QnetTool.h:266
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
void ignoreLeftChanged()
Base class for the Qisis tools.
Definition: Tool.h:81
a control measurement
Definition: ControlMeasure.h:189
Definition: QnetTool.h:280
void editPointChanged(QString pointId)
Qnet tool operations.
Definition: QnetTool.h:256
Definition: QnetTool.h:269
MeasureColumns
Definition: QnetTool.h:265
Serial Number list generator.
Definition: SerialNumberList.h:80
void updatePointInfo(QString pointId)
Update the current editPoint information in the Point Editor labels.
Definition: QnetTool.cpp:3515
void showNavTool()
static const int NUMCOLUMNS
Definition: QnetTool.h:283
void updateList()
Definition: QnetTool.cpp:1430
Definition: QnetTool.h:277
Definition: ToolPad.h:14
Definition: QnetTool.h:267