Isis 3.0 Programmer Reference
Back | Home
MatchTool.h
1 #ifndef MatchTool_h
2 #define MatchTool_h
3 
4 #include "Tool.h"
5 #include "ControlPoint.h"
6 #include "SerialNumberList.h"
7 
8 #include <QCloseEvent>
9 #include <QHideEvent>
10 #include <QPalette>
11 #include <QPointer>
12 #include <QStatusBar>
13 #include <QStringList>
14 
15 class QAction;
16 class QBoxLayout;
17 class QCheckBox;
18 class QComboBox;
19 class QGroupBox;
20 class QLabel;
21 class QMainWindow;
22 class QObject;
23 class QPainter;
24 class QPoint;
25 class QPushButton;
26 class QSplitter;
27 class QStackedWidget;
28 class QString;
29 class QTableWidget;
30 class QTextEdit;
31 class QWidget;
32 
33 namespace Isis {
34  class ControlMeasure;
35  class ControlNet;
36  class ControlPointEdit;
37  class Cube;
38  class CubeViewport;
39  class MainWindow;
40  class MatchToolNewPointDialog;
41  class MdiCubeViewport;
42  class MatchHoldPointDialog;
43  class SerialNumberList;
44  class Stretch;
45  class ToolPad;
46  class UniversalGroundMap;
47 
211  class MatchTool : public Tool {
212  Q_OBJECT
213 
214  public:
215  MatchTool(QWidget *parent);
216  virtual ~MatchTool();
217  void paintViewport(MdiCubeViewport *mvp, QPainter *painter);
218 
219 // void addTo(Workspace *);
220 
221  // measure column values
222  enum MeasureColumns{
223  FILENAME,
224  CUBESN,
225  SAMPLE,
226  LINE,
227  APRIORISAMPLE,
228  APRIORILINE,
229  SAMPLERESIDUAL,
230  LINERESIDUAL,
231  RESIDUALMAGNITUDE,
232  SAMPLESHIFT,
233  LINESHIFT,
234  PIXELSHIFT,
235  GOODNESSOFFIT,
236  IGNORED,
237  EDITLOCK,
238  TYPE
239  };
240  static const int NUMCOLUMNS = 16;
241 
242  QString measureColumnToString(MeasureColumns column);
243 
244 
245  signals:
246  void editPointChanged();
247  void ignorePointChanged();
248  void ignoreLeftChanged();
249  void ignoreRightChanged();
250  void newControlNetwork(ControlNet *);
251  void stretchChipViewport(Stretch *, CubeViewport *);
252  void measureChanged();
253 
254  public slots:
255  void createPoint(MdiCubeViewport *mvp, double sample, double line);
256  void modifyPoint(ControlPoint *point);
257  void deletePoint(ControlPoint *point);
258  void updatePointInfo(QString pointId);
259  void refresh();
260 
261  protected:
263  bool eventFilter(QObject *o,QEvent *e);
264 
265  protected slots:
266  QWidget *createToolBarWidget(QStackedWidget *parent);
267  void mouseButtonRelease(QPoint p, Qt::MouseButton s);
268 
269  private slots:
270  void showHelp();
271  void enterWhatsThisMode();
272  void paintAllViewports ();
273  void activateTool();
274  void openNet();
275  void saveNet();
276  void saveAsNet();
277  void setLockPoint (bool ignore);
278  void setIgnorePoint (bool ignore);
279  void setLockLeftMeasure (bool ignore);
280  void setIgnoreLeftMeasure (bool ignore);
281  void setLockRightMeasure (bool ignore);
282  void setIgnoreRightMeasure (bool ignore);
283 
284  void nextRightMeasure();
285  void previousRightMeasure();
286  void selectLeftMeasure (int index);
287  void selectRightMeasure (int index);
288  void updateLeftMeasureInfo ();
289  void updateRightMeasureInfo ();
290 
291  void measureSaved();
292  void checkReference();
293  void savePoint();
294  void colorizeSaveButton();
295 
296  void cancelNewPoint();
297  void doneWithMeasures();
298 
299  void openTemplateFile();
300  void viewTemplateFile();
301  void saveChips();
302  void showHideTemplateEditor();
303  void saveTemplateFile();
304  void saveTemplateFileAs();
305  void setTemplateModified();
306  void writeTemplateFile(QString);
307  void clearEditPoint();
308 
309  void exiting();
310 
311  private:
312  void createActions();
313  void createMenus();
314  void createToolBars();
315 
316  void loadPoint();
317  void loadMeasureTable();
318  void drawAllMeasurments (MdiCubeViewport *mvp,QPainter *painter);
319  void createMatchTool(QWidget *parent);
320  QSplitter * createTopSplitter();
321  QGroupBox * createControlPointGroupBox();
322  QGroupBox * createLeftMeasureGroupBox();
323  QGroupBox * createRightMeasureGroupBox();
325  void loadTemplateFile(QString);
326  bool okToContinue();
327  bool IsMeasureLocked(QString serialNumber);
328  void addMeasure(MdiCubeViewport *mvp, double sample, double line);
329  bool validateMeasureChange(ControlMeasure *m);
330 
331  QStringList missingCubes(ControlPoint *point);
332 
333  // TODO pointer, reference, what???
335  QString serialNumber(MdiCubeViewport *mvp);
336  void addViewportToSerialNumberList(MdiCubeViewport *mvp);
337 
338  void readSettings();
339  void writeSettings() const;
340 
341  private:
342 
343  QMainWindow *m_matchTool;
344 
345  QWidget *m_parent;
346  QStatusBar *m_statusBar;
347 
348  QString m_cnetFileName;
349  QLabel *m_cnetFileNameLabel;
350  bool m_coregNet;
351  QString m_coregReferenceSN;
352  bool m_netChanged;
353 
354  QAction *m_createPoint;
355  QAction *m_modifyPoint;
356  QAction *m_deletePoint;
357 
358  QAction *m_saveNet;
359  QAction *m_saveAsNet;
360  QAction *m_closeMatchTool;
361 
362  QAction *m_saveChips;
363  QAction *m_showHideTemplateEditor;
364  QAction *m_openTemplateFile;
365  QAction *m_saveTemplateFile;
366  QAction *m_saveTemplateFileAs;
367 
368  QAction *m_whatsThis;
369  QAction *m_showHelp;
370 
371  ControlPointEdit *m_pointEditor;
372 
373  QPushButton *m_savePoint;
374  QPalette m_saveDefaultPalette;
375 
376  QTextEdit *m_templateEditor;
377  QWidget *m_templateEditorWidget;
378  bool m_templateModified;
379 
380  QLabel *m_templateFileNameLabel;
381  QLabel *m_ptIdValue;
382  QLabel *m_numMeasures;
383 
384  QCheckBox *m_lockPoint;
385  QCheckBox *m_ignorePoint;
386  QLabel *m_leftReference;
387  QLabel *m_leftMeasureType;
388  QLabel *m_leftSampShift;
389  QLabel *m_leftLineShift;
390  QLabel *m_leftGoodness;
391  QLabel *m_rightGoodness;
392  QLabel *m_rightReference;
393  QLabel *m_rightMeasureType;
394  QLabel *m_rightSampShift;
395  QLabel *m_rightLineShift;
396  QCheckBox *m_lockLeftMeasure;
397  QCheckBox *m_ignoreLeftMeasure;
398  QCheckBox *m_lockRightMeasure;
399  QCheckBox *m_ignoreRightMeasure;
400 
401  QComboBox *m_leftCombo;
402  QComboBox *m_rightCombo;
403 
404  QMainWindow *m_measureWindow;
405  QTableWidget *m_measureTable;
406 
407  QPointer<ControlNet> m_controlNet;
408  ControlPoint *m_editPoint;
409  MatchToolNewPointDialog *m_newPointDialog;
410  ControlPoint *m_newPoint;
411  QString m_lastUsedPointId;
412 
413  QStringList m_pointFiles;
414 
415  QString m_leftFile;
416  ControlMeasure *m_leftMeasure;
417  ControlMeasure *m_rightMeasure;
418  Cube *m_leftCube;
419  Cube *m_rightCube;
420 
421  };
422 };
423 #endif
bool okToContinue()
Allows user to set a new template file.
Definition: MatchTool.cpp:2706
Cube display widget for certain Isis MDI applications.
QGroupBox * createControlPointGroupBox()
Definition: MatchTool.cpp:276
QAction * toolPadAction(ToolPad *pad)
Adds the Tie tool action to the tool pad.
Definition: MatchTool.cpp:614
QGroupBox * createLeftMeasureGroupBox()
Definition: MatchTool.cpp:311
void deletePoint(ControlPoint *point)
Delete control point.
Definition: MatchTool.cpp:1686
QSplitter * createTopSplitter()
creates everything above the ControlPointEdit
Definition: MatchTool.cpp:247
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: MatchTool.cpp:1283
void openTemplateFile()
prompt user for a registration template file to open.
Definition: MatchTool.cpp:2731
void updateRightMeasureInfo()
Definition: MatchTool.cpp:2467
void saveChips()
Slot which calls ControlPointEditor slot to save chips.
Definition: MatchTool.cpp:2902
void loadPoint()
Load point into MatchTool.
Definition: MatchTool.cpp:1933
void saveAsNet()
Signal to save the control net.
Definition: MatchTool.cpp:1395
void setTemplateModified()
called when the template file is modified by the template editor
Definition: MatchTool.cpp:2779
void saveTemplateFileAs()
save the contents of template editor to a file chosen by the user
Definition: MatchTool.cpp:2801
void updateLeftMeasureInfo()
Definition: MatchTool.cpp:2394
void modifyPoint(ControlPoint *point)
Modify control point.
Definition: MatchTool.cpp:1867
void writeSettings() const
This method is called when the Main window is closed or hidden to write the size and location setting...
Definition: MatchTool.cpp:3057
Widget to display Isis cubes for qt apps.
Definition: CubeViewport.h:121
SerialNumberList serialNumberList()
Creates a serial number list based on open cube viewports.
Definition: MatchTool.cpp:679
void createPoint(MdiCubeViewport *mvp, double sample, double line)
Create new control point at given samp, line for viewport.
Definition: MatchTool.cpp:1546
void exiting()
This called when qview is exiting.
Definition: MatchTool.cpp:3353
QGroupBox * createRightMeasureGroupBox()
Creates the right measure group box.
Definition: MatchTool.cpp:371
void colorizeSaveButton()
Turn &quot;Save Point&quot; button text to red.
Definition: MatchTool.cpp:2994
void drawAllMeasurments(MdiCubeViewport *mvp, QPainter *painter)
Draw all measurments which are on this viewPort.
Definition: MatchTool.cpp:2607
a control network
Definition: ControlNet.h:207
void createTemplateEditorWidget()
Creates the Widget which contains the template editor and its toolbar.
Definition: MatchTool.cpp:431
bool IsMeasureLocked(QString serialNumber)
Check for implicitly locked measure in m_editPoint.
Definition: MatchTool.cpp:3017
void setIgnorePoint(bool ignore)
Set point&#39;s &quot;Ignore&quot; keyword to the value of the input parameter.
Definition: MatchTool.cpp:1140
Pixel value mapper.
Definition: Stretch.h:72
void writeTemplateFile(QString)
write the contents of the template editor to the file provided.
Definition: MatchTool.cpp:2820
void selectRightMeasure(int index)
Select right measure.
Definition: MatchTool.cpp:2332
A single control point.
Definition: ControlPoint.h:339
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: MatchTool.cpp:3040
bool eventFilter(QObject *o, QEvent *e)
Event filter for MatchTool.
Definition: MatchTool.cpp:2533
void previousRightMeasure()
Selects the previous right measure when activated by key shortcut.
Definition: MatchTool.cpp:2253
void loadMeasureTable()
Load measure information into the measure table.
Definition: MatchTool.cpp:2023
void saveTemplateFile()
save the file opened in the template editor
Definition: MatchTool.cpp:2787
void updatePointInfo(QString pointId)
Update the current editPoint information in the Point Editor labels.
Definition: MatchTool.cpp:2930
void saveNet()
Signal to save control net.
Definition: MatchTool.cpp:1373
void loadTemplateFile(QString)
Updates the current template file being used.
Definition: MatchTool.cpp:2755
void selectLeftMeasure(int index)
Select left measure.
Definition: MatchTool.cpp:2277
MatchTool(QWidget *parent)
Consructs the Match Tool window.
Definition: MatchTool.cpp:57
void viewTemplateFile()
Allows the user to view the template file that is currently set.
Definition: MatchTool.cpp:2876
void refresh()
Refresh all necessary widgets in MatchTool including the PointEditor and CubeViewports.
Definition: MatchTool.cpp:2966
void measureSaved()
This method is connected with the measureSaved() signal from ControlPointEdit.
Definition: MatchTool.cpp:788
void nextRightMeasure()
Selects the next right measure when activated by key shortcut.
Definition: MatchTool.cpp:2234
void paintAllViewports()
This method will repaint the given Point ID in each viewport Note: The pointId parameter is here even...
Definition: MatchTool.cpp:2573
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: MatchTool.cpp:1213
Base class for the Qisis tools.
Definition: Tool.h:81
a control measurement
void setLockPoint(bool ignore)
Set point&#39;s &quot;EditLock&quot; keyword to the value of the input parameter.
Definition: MatchTool.cpp:1121
void savePoint()
Save edit point to the Control Network.
Definition: MatchTool.cpp:1079
Point Editor Widget.
void mouseButtonRelease(QPoint p, Qt::MouseButton s)
Handle mouse events on CubeViewport.
Definition: MatchTool.cpp:1450
void createMenus()
Customize dropdown menus below title bar.
Definition: MatchTool.cpp:569
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: MatchTool.cpp:1243
Serial Number list generator.
void paintViewport(MdiCubeViewport *mvp, QPainter *painter)
Take care of drawing things on a viewPort.
Definition: MatchTool.cpp:2554
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: MatchTool.cpp:1172
Match tool operations.
Definition: MatchTool.h:211
void createMatchTool(QWidget *parent)
create the main window for editing control points
Definition: MatchTool.cpp:165
void createActions()
Creates the menu actions for Match Tool.
Definition: MatchTool.cpp:460
IO Handler for Isis Cubes.
Definition: Cube.h:158

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:23:00