Isis 3 Programmer Reference
QnetTool.h
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
265  enum MeasureColumns {
266  FILENAME,
267  CUBESN,
268  SAMPLE,
269  LINE,
270  APRIORISAMPLE,
271  APRIORILINE,
272  SAMPLERESIDUAL,
273  LINERESIDUAL,
274  RESIDUALMAGNITUDE,
275  SAMPLESHIFT,
276  LINESHIFT,
277  PIXELSHIFT,
278  GOODNESSOFFIT,
279  IGNORED,
280  EDITLOCK,
281  TYPE
282  };
283  static const int NUMCOLUMNS = 16;
284 
285  QString measureColumnToString(MeasureColumns column);
286 
287  ControlNet *controlNet();
288  const ControlNet *controlNet() const;
289 
290  SerialNumberList *serialNumberList();
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();
305  void newControlNetwork(ControlNet *);
306  void stretchChipViewport(Stretch *, CubeViewport *);
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();
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();
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();
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.
void loadGroundMeasure()
Load ground measure into right side and add to file combo boxes.
Definition: QnetTool.cpp:1185
void setIgnorePoint(bool ignore)
Set point&#39;s "Ignore" keyword to the value of the input parameter.
Definition: QnetTool.cpp:1239
bool checkReference()
Change which measure is the reference.
Definition: QnetTool.cpp:864
void setLockLeftMeasure(bool ignore)
Set the "EditLock" keyword of the measure shown in the left viewport to the value of the input parame...
Definition: QnetTool.cpp:1272
void updateSurfacePointInfo()
Update the Surface Point Information in the QnetTool window.
Definition: QnetTool.cpp:2615
QGroupBox * createControlPointGroupBox()
Definition: QnetTool.cpp:265
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
void saveChips()
Slot which calls ControlPointEditor slot to save chips.
Definition: QnetTool.cpp:3488
void openReferenceRadius()
Open a radius source using the shape model of the reference measure of m_editPoint.
Definition: QnetTool.cpp:3858
void drawGroundMeasures(MdiCubeViewport *vp, QPainter *painter)
Draw all Fixed or Constrained points on the ground source viewport.
Definition: QnetTool.cpp:3249
bool findPointLocation()
Attempt to find the control point&#39;s location on the ground source.
Definition: QnetTool.cpp:2161
void nextRightMeasure()
Selects the next right measure when activated by key shortcut.
Definition: QnetTool.cpp:2724
void openTemplateFile()
prompt user for a registration template file to open.
Definition: QnetTool.cpp:3325
void paintViewport(MdiCubeViewport *cvp, QPainter *painter)
Take care of drawing things on a viewPort.
Definition: QnetTool.cpp:3118
void setPointType(int pointType)
Set the point type.
Definition: QnetTool.cpp:1119
void saveNet()
Signal to save control net.
Definition: QnetTool.cpp:1404
void setTemplateModified()
called when the template file is modified by the template editor
Definition: QnetTool.cpp:3371
Widget to display Isis cubes for qt apps.
Definition: CubeViewport.h:132
void selectLeftMeasure(int index)
Select left measure.
Definition: QnetTool.cpp:2765
void refresh()
Refresh all necessary widgets in QnetTool including the PointEditor and CubeViewports.
Definition: QnetTool.cpp:3555
void createFixedPoint(double lat, double lon)
Create new Fixed control point.
Definition: QnetTool.cpp:1786
QGroupBox * createLeftMeasureGroupBox()
Definition: QnetTool.cpp:331
void savePoint()
Save edit point to the Control Network.
Definition: QnetTool.cpp:1060
void paintAllViewports(QString pointId)
This method will repaint the given Point ID in each viewport Note: The pointId parameter is here even...
Definition: QnetTool.cpp:3137
bool okToContinue()
Allows user to set a new template file.
Definition: QnetTool.cpp:3301
void updateLeftMeasureInfo()
Definition: QnetTool.cpp:2843
QAction * toolPadAction(ToolPad *pad)
Adds the Tie tool action to the tool pad.
Definition: QnetTool.cpp:1474
void createQnetTool(QWidget *parent)
create the main window for editing control points
Definition: QnetTool.cpp:131
void addMeasure()
Add measure to point.
Definition: QnetTool.cpp:3015
void loadTemplateFile(QString)
Updates the current template file being used.
Definition: QnetTool.cpp:3348
a control network
Definition: ControlNet.h:271
Pixel value mapper.
Definition: Stretch.h:72
QnetTool(QWidget *parent)
Consructs the Qnet Tool window.
Definition: QnetTool.cpp:67
void saveTemplateFileAs()
save the contents of template editor to a file chosen by the user
Definition: QnetTool.cpp:3390
void createPoint(double lat, double lon)
Create new control point.
Definition: QnetTool.cpp:1671
ControlMeasure * createTemporaryGroundMeasure()
Create a temporary measure to hold the ground point info for ground source.
Definition: QnetTool.cpp:2207
void readSettings()
This method is called from the constructor so that when the Main window is created, it know&#39;s it&#39;s size and location.
Definition: QnetTool.cpp:4112
void colorizeSaveButton()
Turn "Save Point" button text to red.
Definition: QnetTool.cpp:4066
A single control point.
Definition: ControlPoint.h:369
void createMenus()
Customize dropdown menus below title bar.
Definition: QnetTool.cpp:626
void setLockRightMeasure(bool ignore)
Set the "EditLock" keyword of the measure shown in the right viewport to the value of the input param...
Definition: QnetTool.cpp:1343
void previousRightMeasure()
Selects the previous right measure when activated by key shortcut.
Definition: QnetTool.cpp:2743
void loadPoint()
Load point into QnetTool.
Definition: QnetTool.cpp:2244
bool eventFilter(QObject *o, QEvent *e)
Event filter for QnetTool.
Definition: QnetTool.cpp:3097
void setIgnoreRightMeasure(bool ignore)
Set the "Ignore" keyword of the measure shown in the right viewport to the value of the input paramet...
Definition: QnetTool.cpp:1383
void createTemplateEditorWidget()
Creates the Widget which contains the template editor and its toolbar.
Definition: QnetTool.cpp:475
void saveAsNet()
Signal to save the control net.
Definition: QnetTool.cpp:1420
void writeTemplateFile(QString)
write the contents of the template editor to the file provided.
Definition: QnetTool.cpp:3408
void deletePoint(ControlPoint *point)
Delete control point.
Definition: QnetTool.cpp:1960
void loadMeasureTable()
Load measure information into the measure table.
Definition: QnetTool.cpp:2378
void measureSaved()
This method is connected with the measureSaved() signal from ControlPointEdit.
Definition: QnetTool.cpp:724
void drawAllMeasurments(MdiCubeViewport *vp, QPainter *painter)
Draw all measurments which are on this viewPort.
Definition: QnetTool.cpp:3171
void setIgnoreLeftMeasure(bool ignore)
Set the "Ignore" keyword of the measure shown in the left viewport to the value of the input paramete...
Definition: QnetTool.cpp:1313
void setLockPoint(bool ignore)
Set point&#39;s "EditLock" keyword to the value of the input parameter.
Definition: QnetTool.cpp:1220
void viewTemplateFile()
Allows the user to view the template file that is currently set.
Definition: QnetTool.cpp:3462
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
void showNavWindow(bool checked)
Emits a signal to displays the Navigation window.
Definition: QnetTool.cpp:3590
Base class for the Qisis tools.
Definition: Tool.h:81
a control measurement
void openGround()
Open a ground source for selecting fixed points.
Definition: QnetTool.cpp:3648
void updateRightMeasureInfo()
Definition: QnetTool.cpp:2931
Qnet tool operations.
Definition: QnetTool.h:256
void createActions()
Creates the menu actions for Qnet Tool.
Definition: QnetTool.cpp:505
void groundViewportClosed(CubeViewport *)
Slot called when the ground source cube viewport is closed.
Definition: QnetTool.cpp:3955
void saveTemplateFile()
save the file opened in the template editor
Definition: QnetTool.cpp:3378
void writeSettings() const
This method is called when the Main window is closed or hidden to write the size and location setting...
Definition: QnetTool.cpp:4128
Serial Number list generator.
double demRadius(double latitude, double longitude)
Return a radius values from the dem using bilinear interpolation.
Definition: QnetTool.cpp:4023
QSplitter * createTopSplitter()
creates everything above the ControlPointEdit
Definition: QnetTool.cpp:236
QGroupBox * createRightMeasureGroupBox()
Creates the right measure group box.
Definition: QnetTool.cpp:403
void selectRightMeasure(int index)
Select right measure.
Definition: QnetTool.cpp:2800
void updatePointInfo(QString pointId)
Update the current editPoint information in the Point Editor labels.
Definition: QnetTool.cpp:3515
bool IsMeasureLocked(QString serialNumber)
Check for implicitly locked measure in m_editPoint.
Definition: QnetTool.cpp:4089
void openDem()
Open a DEM for ground source radii.
Definition: QnetTool.cpp:3830