Isis 3.0 Programmer Reference
Back | Home
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 
251  class QnetTool : public Tool {
252  Q_OBJECT
253 
254  public:
255  QnetTool (QWidget *parent);
256  virtual ~QnetTool ();
257  void paintViewport (MdiCubeViewport *cvp,QPainter *painter);
258 
259  // measure column values
260  enum MeasureColumns {
261  FILENAME,
262  CUBESN,
263  SAMPLE,
264  LINE,
265  APRIORISAMPLE,
266  APRIORILINE,
267  SAMPLERESIDUAL,
268  LINERESIDUAL,
269  RESIDUALMAGNITUDE,
270  SAMPLESHIFT,
271  LINESHIFT,
272  PIXELSHIFT,
273  GOODNESSOFFIT,
274  IGNORED,
275  EDITLOCK,
276  TYPE
277  };
278  static const int NUMCOLUMNS = 16;
279 
280  QString measureColumnToString(MeasureColumns column);
281 
282  ControlNet *controlNet();
283  const ControlNet *controlNet() const;
284 
285  SerialNumberList *serialNumberList();
286  const SerialNumberList *serialNumberList() const;
287 
288  Workspace *workspace() const;
289 
290  signals:
291  void qnetToolSave();
292  void qnetToolSaveAs();
293  void refreshNavList();
294  void editPointChanged(QString pointId);
295  void netChanged();
296  void ignorePointChanged();
297  void ignoreLeftChanged();
298  void ignoreRightChanged();
299  void showNavTool();
300  void newControlNetwork(ControlNet *);
301  void stretchChipViewport(Stretch *, CubeViewport *);
302  void measureChanged();
303 
304  public slots:
305  void updateList();
306  void updateNet(QString cNetFileName);
307  void createPoint(double lat,double lon);
308  void createFixedPoint(double lat,double lon);
309  void modifyPoint(ControlPoint *point);
310  void deletePoint(ControlPoint *point);
311  void updatePointInfo(QString pointId);
312  void refresh();
313 
314  protected:
316  bool eventFilter(QObject *o,QEvent *e);
317 
318  protected slots:
319  void mouseButtonRelease(QPoint p, Qt::MouseButton s);
320  QWidget *createToolBarWidget (QStackedWidget *parent);
321 
322  private slots:
323  void enterWhatsThisMode();
324  void paintAllViewports (QString pointId );
325  void saveNet();
326  void saveAsNet();
327  void addMeasure();
328  void setPointType (int pointType);
329  void setLockPoint (bool ignore);
330  void setIgnorePoint (bool ignore);
331  void setLockLeftMeasure (bool ignore);
332  void setIgnoreLeftMeasure (bool ignore);
333  void setLockRightMeasure (bool ignore);
334  void setIgnoreRightMeasure (bool ignore);
335  void showNavWindow (bool checked);
336 
337  void updateSurfacePointInfo ();
338 
339  void nextRightMeasure();
340  void previousRightMeasure();
341  void selectLeftMeasure (int index);
342  void selectRightMeasure (int index);
343  void updateLeftMeasureInfo ();
344  void updateRightMeasureInfo ();
345 
346  void measureSaved();
347  bool checkReference();
348  void updateGroundPosition();
349  void savePoint();
350  void colorizeSaveButton();
351 
352  void openTemplateFile();
353  void viewTemplateFile();
354  void saveChips();
355 
356  void openGround();
358  void openDem();
359  void openReferenceRadius();
360  void showHideTemplateEditor();
361  void saveTemplateFile();
362  void saveTemplateFileAs();
363  void setTemplateModified();
364  void writeTemplateFile(QString);
365 
366  private:
367  void createActions();
368  void createMenus();
370  void createToolBars();
371  bool findPointLocation();
372  void loadPoint();
373  void loadGroundMeasure();
374  void loadMeasureTable();
375  void drawAllMeasurments (MdiCubeViewport *vp,QPainter *painter);
376  void drawGroundMeasures (MdiCubeViewport *vp,QPainter *painter);
377 // void drawMeasures (MdiCubeViewport *vp,QPainter *painter,ControlPoint &point);
378  void createQnetTool(QWidget *parent);
379  QSplitter * createTopSplitter();
380  QGroupBox * createControlPointGroupBox();
381  QGroupBox * createLeftMeasureGroupBox();
382  QGroupBox * createRightMeasureGroupBox();
384  void loadTemplateFile(QString);
385  bool okToContinue();
386  void initDem(QString demFile);
387  double demRadius(double latitude, double longitude);
388  void clearGroundSource();
389  bool IsMeasureLocked(QString serialNumber);
390 
391  void readSettings();
392  void writeSettings() const;
393 
394  QPointer<MainWindow> m_qnetTool;
395 
396  QString m_cnetFileName;
397 
398  QStringList findPointFiles(double lat, double lon);
399 
400  QPointer<QAction> m_createPoint;
401  QPointer<QAction> m_modifyPoint;
402  QPointer<QAction> m_deletePoint;
403 
404  QPointer<QAction> m_openGround;
405  QPointer<QAction> m_openDem;
406  QPointer<QAction> m_saveNet;
407  QPointer<QToolBar> toolBar;
408  QPointer<QAction> m_saveAsNet;
409  QPointer<QAction> m_closeQnetTool;
410 
411  QPointer<QAction> m_saveChips;
412  QPointer<QAction> m_showHideTemplateEditor;
413  QPointer<QAction> m_openTemplateFile;
414  QPointer<QAction> m_saveTemplateFile;
415  QPointer<QAction> m_saveTemplateFileAs;
416 
417  QPointer<QAction> m_whatsThis;
418 
419  QPointer<QMainWindow> m_mw;
420  QPointer<ControlPointEdit> m_pointEditor;
421 
422  QPushButton *m_savePoint;
423  QPalette m_saveDefaultPalette;
424 
425  QTextEdit *m_templateEditor;
426  QWidget *m_templateEditorWidget;
427  bool m_templateModified;
428 
429  QPointer<QLabel> m_templateFileNameLabel;
430  QPointer<QLabel> m_groundFileNameLabel;
431  QPointer<QLabel> m_radiusFileNameLabel;
432  QPointer<QLabel> m_ptIdValue;
433  QPointer<QComboBox> m_pointType;
434  QPointer<QLabel> m_numMeasures;
435  QPointer<QLabel> m_pointAprioriLatitude;
436  QPointer<QLabel> m_pointAprioriLongitude;
437  QPointer<QLabel> m_pointAprioriRadius;
438  QPointer<QLabel> m_pointAprioriLatitudeSigma;
439  QPointer<QLabel> m_pointAprioriLongitudeSigma;
440  QPointer<QLabel> m_pointAprioriRadiusSigma;
441  QPointer<QLabel> m_pointLatitude;
442  QPointer<QLabel> m_pointLongitude;
443  QPointer<QLabel> m_pointRadius;
444 
445  QPointer<QCheckBox> m_lockPoint;
446  QPointer<QCheckBox> m_ignorePoint;
447  QPointer<QLabel> m_leftReference;
448  QPointer<QLabel> m_leftMeasureType;
449  QPointer<QLabel> m_leftSampError;
450  QPointer<QLabel> m_leftLineError;
451  QPointer<QLabel> m_leftSampShift;
452  QPointer<QLabel> m_leftLineShift;
453  QPointer<QLabel> m_leftGoodness;
454  QPointer<QLabel> m_rightGoodness;
455  QPointer<QLabel> m_rightReference;
456  QPointer<QLabel> m_rightMeasureType;
457  QPointer<QLabel> m_rightSampError;
458  QPointer<QLabel> m_rightLineError;
459  QPointer<QLabel> m_rightSampShift;
460  QPointer<QLabel> m_rightLineShift;
461  QPointer<QCheckBox> m_lockLeftMeasure;
462  QPointer<QCheckBox> m_ignoreLeftMeasure;
463  QPointer<QCheckBox> m_lockRightMeasure;
464  QPointer<QCheckBox> m_ignoreRightMeasure;
465 
466  QPointer<QComboBox> m_leftCombo;
467  QPointer<QComboBox> m_rightCombo;
468 
469  QPointer<QMainWindow> m_measureWindow;
470  QPointer<QTableWidget> m_measureTable;
471 
472  QPointer<ControlPoint> m_editPoint;
473 
474  QStringList m_pointFiles;
475 
476  QString m_leftFile;
477  QPointer<ControlMeasure> m_leftMeasure;
478  QPointer<ControlMeasure> m_rightMeasure;
479  QScopedPointer<Cube> m_leftCube;
480  QScopedPointer<Cube> m_rightCube;
481 
482  QString m_groundFile;
483  QScopedPointer<Cube> m_groundCube;
484  QString m_groundSN;
485  QScopedPointer<UniversalGroundMap> m_groundGmap;
486  bool m_groundOpen;
487  ControlPoint::SurfacePointSource::Source m_groundSurfacePointSource;
488  ControlPoint::RadiusSource::Source m_groundRadiusSource;
489  // TODO: Combine the following m_groundSourceFile, m_radiusSourceFile
490  // with m_groundFile and m_demFile. Is it just a matter of
491  // full path vs filename only?
492  QString m_groundSourceFile;
493  QString m_radiusSourceFile;
494  QString m_demFile;
495  bool m_demOpen;
496  QScopedPointer<Cube> m_demCube;
497 
498  QString m_lastUsedPointId;
499  QPointer<ControlNet> m_controlNet;
500  SerialNumberList *m_serialNumberList;
501  QPointer<Workspace> m_workspace;
502  };
503 };
504 
505 #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:1189
void setIgnorePoint(bool ignore)
Set point&#39;s &quot;Ignore&quot; keyword to the value of the input parameter.
Definition: QnetTool.cpp:1243
bool checkReference()
Change which measure is the reference.
Definition: QnetTool.cpp:864
void setLockLeftMeasure(bool ignore)
Set the &quot;EditLock&quot; keyword of the measure shown in the left viewport to the value of the input parame...
Definition: QnetTool.cpp:1276
void updateSurfacePointInfo()
Update the Surface Point Information in the QnetTool window.
Definition: QnetTool.cpp:2617
QGroupBox * createControlPointGroupBox()
Definition: QnetTool.cpp:265
void updateNet(QString cNetFileName)
Updates the Control Network displayed in the Qnet Tool title bar.
Definition: QnetTool.cpp:1457
void modifyPoint(ControlPoint *point)
Modify control point.
Definition: QnetTool.cpp:2111
QWidget * createToolBarWidget(QStackedWidget *parent)
This method creates the widgets for the tool bar.
Definition: QnetTool.cpp:3612
void mouseButtonRelease(QPoint p, Qt::MouseButton s)
Handle mouse events on CubeViewport.
Definition: QnetTool.cpp:1523
void saveChips()
Slot which calls ControlPointEditor slot to save chips.
Definition: QnetTool.cpp:3493
void openReferenceRadius()
Open a radius source using the shape model of the reference measure of m_editPoint.
Definition: QnetTool.cpp:3863
void drawGroundMeasures(MdiCubeViewport *vp, QPainter *painter)
Draw all Fixed or Constrained points on the ground source viewport.
Definition: QnetTool.cpp:3254
bool findPointLocation()
Attempt to find the control point&#39;s location on the ground source.
Definition: QnetTool.cpp:2163
void nextRightMeasure()
Selects the next right measure when activated by key shortcut.
Definition: QnetTool.cpp:2729
void openTemplateFile()
prompt user for a registration template file to open.
Definition: QnetTool.cpp:3330
void paintViewport(MdiCubeViewport *cvp, QPainter *painter)
Take care of drawing things on a viewPort.
Definition: QnetTool.cpp:3123
void setPointType(int pointType)
Set the point type.
Definition: QnetTool.cpp:1123
void saveNet()
Signal to save control net.
Definition: QnetTool.cpp:1408
void setTemplateModified()
called when the template file is modified by the template editor
Definition: QnetTool.cpp:3376
Widget to display Isis cubes for qt apps.
Definition: CubeViewport.h:121
void selectLeftMeasure(int index)
Select left measure.
Definition: QnetTool.cpp:2770
void refresh()
Refresh all necessary widgets in QnetTool including the PointEditor and CubeViewports.
Definition: QnetTool.cpp:3560
void createFixedPoint(double lat, double lon)
Create new Fixed control point.
Definition: QnetTool.cpp:1788
QGroupBox * createLeftMeasureGroupBox()
Definition: QnetTool.cpp:331
void savePoint()
Save edit point to the Control Network.
Definition: QnetTool.cpp:1064
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:3142
bool okToContinue()
Allows user to set a new template file.
Definition: QnetTool.cpp:3306
void updateLeftMeasureInfo()
Definition: QnetTool.cpp:2848
QAction * toolPadAction(ToolPad *pad)
Adds the Tie tool action to the tool pad.
Definition: QnetTool.cpp:1478
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:3020
void loadTemplateFile(QString)
Updates the current template file being used.
Definition: QnetTool.cpp:3353
a control network
Definition: ControlNet.h:207
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:3395
void createPoint(double lat, double lon)
Create new control point.
Definition: QnetTool.cpp:1675
ControlMeasure * createTemporaryGroundMeasure()
Create a temporary measure to hold the ground point info for ground source.
Definition: QnetTool.cpp:2209
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:4133
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:4117
void colorizeSaveButton()
Turn &quot;Save Point&quot; button text to red.
Definition: QnetTool.cpp:4071
A single control point.
Definition: ControlPoint.h:339
void createMenus()
Customize dropdown menus below title bar.
Definition: QnetTool.cpp:626
void setLockRightMeasure(bool ignore)
Set the &quot;EditLock&quot; keyword of the measure shown in the right viewport to the value of the input param...
Definition: QnetTool.cpp:1347
void previousRightMeasure()
Selects the previous right measure when activated by key shortcut.
Definition: QnetTool.cpp:2748
void loadPoint()
Load point into QnetTool.
Definition: QnetTool.cpp:2246
bool eventFilter(QObject *o, QEvent *e)
Event filter for QnetTool.
Definition: QnetTool.cpp:3102
void setIgnoreRightMeasure(bool ignore)
Set the &quot;Ignore&quot; keyword of the measure shown in the right viewport to the value of the input paramet...
Definition: QnetTool.cpp:1387
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:1424
void writeTemplateFile(QString)
write the contents of the template editor to the file provided.
Definition: QnetTool.cpp:3413
void deletePoint(ControlPoint *point)
Delete control point.
Definition: QnetTool.cpp:1962
void loadMeasureTable()
Load measure information into the measure table.
Definition: QnetTool.cpp:2380
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:3176
void setIgnoreLeftMeasure(bool ignore)
Set the &quot;Ignore&quot; keyword of the measure shown in the left viewport to the value of the input paramete...
Definition: QnetTool.cpp:1317
void setLockPoint(bool ignore)
Set point&#39;s &quot;EditLock&quot; keyword to the value of the input parameter.
Definition: QnetTool.cpp:1224
void viewTemplateFile()
Allows the user to view the template file that is currently set.
Definition: QnetTool.cpp:3467
void showNavWindow(bool checked)
Emits a signal to displays the Navigation window.
Definition: QnetTool.cpp:3595
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:3653
void updateRightMeasureInfo()
Definition: QnetTool.cpp:2936
Qnet tool operations.
Definition: QnetTool.h:251
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:3960
void saveTemplateFile()
save the file opened in the template editor
Definition: QnetTool.cpp:3383
Serial Number list generator.
double demRadius(double latitude, double longitude)
Return a radius values from the dem using bilinear interpolation.
Definition: QnetTool.cpp:4028
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:2805
void updatePointInfo(QString pointId)
Update the current editPoint information in the Point Editor labels.
Definition: QnetTool.cpp:3520
bool IsMeasureLocked(QString serialNumber)
Check for implicitly locked measure in m_editPoint.
Definition: QnetTool.cpp:4094
void openDem()
Open a DEM for ground source radii.
Definition: QnetTool.cpp:3835

U.S. Department of the Interior | U.S. Geological Survey
ISIS | Privacy & Disclaimers | Astrogeology Research Program
To contact us, please post comments and questions on the ISIS Support Center
File Modified: 07/12/2023 23:27:52