Isis 3 Programmer Reference
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 
216  class MatchTool : public Tool {
217  Q_OBJECT
218 
219  public:
220  MatchTool(QWidget *parent);
221  virtual ~MatchTool();
222  void paintViewport(MdiCubeViewport *mvp, QPainter *painter);
223 
224 // void addTo(Workspace *);
225 
226  // measure column values
227  enum MeasureColumns{
228  FILENAME,
229  CUBESN,
230  SAMPLE,
231  LINE,
232  APRIORISAMPLE,
233  APRIORILINE,
234  SAMPLERESIDUAL,
235  LINERESIDUAL,
236  RESIDUALMAGNITUDE,
237  SAMPLESHIFT,
238  LINESHIFT,
239  PIXELSHIFT,
240  GOODNESSOFFIT,
241  IGNORED,
242  EDITLOCK,
243  TYPE
244  };
245  static const int NUMCOLUMNS = 16;
246 
247  QString measureColumnToString(MeasureColumns column);
248 
249 
250  signals:
251  void editPointChanged();
252  void ignorePointChanged();
253  void ignoreLeftChanged();
254  void ignoreRightChanged();
255  void newControlNetwork(ControlNet *);
256  void stretchChipViewport(Stretch *, CubeViewport *);
257  void measureChanged();
258 
259  public slots:
260  void createPoint(MdiCubeViewport *mvp, double sample, double line);
261  void modifyPoint(ControlPoint *point);
262  void deletePoint(ControlPoint *point);
263  void updatePointInfo(QString pointId);
264  void refresh();
265 
266  protected:
268  bool eventFilter(QObject *o,QEvent *e);
269 
270  protected slots:
271  QWidget *createToolBarWidget(QStackedWidget *parent);
272  void mouseButtonRelease(QPoint p, Qt::MouseButton s);
273 
274  private slots:
275  void showHelp();
276  void enterWhatsThisMode();
277  void paintAllViewports ();
278  void activateTool();
279  void openNet();
280  void saveNet();
281  void saveAsNet();
282  void setLockPoint (bool ignore);
283  void setIgnorePoint (bool ignore);
284  void setLockLeftMeasure (bool ignore);
285  void setIgnoreLeftMeasure (bool ignore);
286  void setLockRightMeasure (bool ignore);
287  void setIgnoreRightMeasure (bool ignore);
288 
289  void nextRightMeasure();
290  void previousRightMeasure();
291  void selectLeftMeasure (int index);
292  void selectRightMeasure (int index);
293  void updateLeftMeasureInfo ();
294  void updateRightMeasureInfo ();
295 
296  void measureSaved();
297  void checkReference();
298  void savePoint();
299  void colorizeSaveButton();
300 
301  void cancelNewPoint();
302  void doneWithMeasures();
303 
304  void openTemplateFile();
305  void viewTemplateFile();
306  void saveChips();
307  void showHideTemplateEditor();
308  void saveTemplateFile();
309  void saveTemplateFileAs();
310  void setTemplateModified();
311  void writeTemplateFile(QString);
312  void clearEditPoint();
313 
314  void exiting();
315 
316  private:
317  void createActions();
318  void createMenus();
319  void createToolBars();
320 
321  void loadPoint();
322  void loadMeasureTable();
323  void drawAllMeasurments (MdiCubeViewport *mvp,QPainter *painter);
324  void createMatchTool(QWidget *parent);
325  QSplitter * createTopSplitter();
326  QGroupBox * createControlPointGroupBox();
327  QGroupBox * createLeftMeasureGroupBox();
328  QGroupBox * createRightMeasureGroupBox();
330  void loadTemplateFile(QString);
331  bool okToContinue();
332  bool IsMeasureLocked(QString serialNumber);
333  void addMeasure(MdiCubeViewport *mvp, double sample, double line);
334  bool validateMeasureChange(ControlMeasure *m);
335 
336  QStringList missingCubes(ControlPoint *point);
337 
338  // TODO pointer, reference, what???
340  QString serialNumber(MdiCubeViewport *mvp);
341  void addViewportToSerialNumberList(MdiCubeViewport *mvp);
342 
343  void readSettings();
344  void writeSettings() const;
345 
346  private:
347 
348  QMainWindow *m_matchTool;
349 
350  QWidget *m_parent;
351  QStatusBar *m_statusBar;
352 
353  QString m_cnetFileName;
354  QLabel *m_cnetFileNameLabel;
355  bool m_coregNet;
356  QString m_coregReferenceSN;
357  bool m_netChanged;
358 
359  QAction *m_createPoint;
360  QAction *m_modifyPoint;
361  QAction *m_deletePoint;
362 
363  QAction *m_saveNet;
364  QAction *m_saveAsNet;
365  QAction *m_closeMatchTool;
366 
367  QAction *m_saveChips;
368  QAction *m_showHideTemplateEditor;
369  QAction *m_openTemplateFile;
370  QAction *m_saveTemplateFile;
371  QAction *m_saveTemplateFileAs;
372 
373  QAction *m_whatsThis;
374  QAction *m_showHelp;
375 
376  ControlPointEdit *m_pointEditor;
377 
378  QPushButton *m_savePoint;
379  QPalette m_saveDefaultPalette;
380 
381  QTextEdit *m_templateEditor;
382  QWidget *m_templateEditorWidget;
383  bool m_templateModified;
384 
385  QLabel *m_templateFileNameLabel;
386  QLabel *m_ptIdValue;
387  QLabel *m_numMeasures;
388 
389  QCheckBox *m_lockPoint;
390  QCheckBox *m_ignorePoint;
391  QLabel *m_leftReference;
392  QLabel *m_leftMeasureType;
393  QLabel *m_leftSampShift;
394  QLabel *m_leftLineShift;
395  QLabel *m_leftGoodness;
396  QLabel *m_rightGoodness;
397  QLabel *m_rightReference;
398  QLabel *m_rightMeasureType;
399  QLabel *m_rightSampShift;
400  QLabel *m_rightLineShift;
401  QCheckBox *m_lockLeftMeasure;
402  QCheckBox *m_ignoreLeftMeasure;
403  QCheckBox *m_lockRightMeasure;
404  QCheckBox *m_ignoreRightMeasure;
405 
406  QComboBox *m_leftCombo;
407  QComboBox *m_rightCombo;
408 
409  QMainWindow *m_measureWindow;
410  QTableWidget *m_measureTable;
411 
412  QPointer<ControlNet> m_controlNet;
413  ControlPoint *m_editPoint;
414  MatchToolNewPointDialog *m_newPointDialog;
415  ControlPoint *m_newPoint;
416  QString m_lastUsedPointId;
417 
418  QStringList m_pointFiles;
419 
420  QString m_leftFile;
421  ControlMeasure *m_leftMeasure;
422  ControlMeasure *m_rightMeasure;
423  Cube *m_leftCube;
424  Cube *m_rightCube;
425 
426  };
427 };
428 #endif
bool okToContinue()
Allows user to set a new template file.
Definition: MatchTool.cpp:2713
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:1693
QSplitter * createTopSplitter()
creates everything above the ControlPointEdit
Definition: MatchTool.cpp:247
void setIgnoreRightMeasure(bool ignore)
Set the "Ignore" 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:2738
void updateRightMeasureInfo()
Definition: MatchTool.cpp:2474
void saveChips()
Slot which calls ControlPointEditor slot to save chips.
Definition: MatchTool.cpp:2909
void loadPoint()
Load point into MatchTool.
Definition: MatchTool.cpp:1940
void saveAsNet()
Signal to save the control net.
Definition: MatchTool.cpp:1400
void setTemplateModified()
called when the template file is modified by the template editor
Definition: MatchTool.cpp:2786
void saveTemplateFileAs()
save the contents of template editor to a file chosen by the user
Definition: MatchTool.cpp:2808
void updateLeftMeasureInfo()
Definition: MatchTool.cpp:2401
void modifyPoint(ControlPoint *point)
Modify control point.
Definition: MatchTool.cpp:1874
Widget to display Isis cubes for qt apps.
Definition: CubeViewport.h:132
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:1553
void exiting()
This called when qview is exiting.
Definition: MatchTool.cpp:3360
QGroupBox * createRightMeasureGroupBox()
Creates the right measure group box.
Definition: MatchTool.cpp:371
void colorizeSaveButton()
Turn "Save Point" button text to red.
Definition: MatchTool.cpp:3001
void drawAllMeasurments(MdiCubeViewport *mvp, QPainter *painter)
Draw all measurments which are on this viewPort.
Definition: MatchTool.cpp:2614
a control network
Definition: ControlNet.h:271
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:3024
void setIgnorePoint(bool ignore)
Set point&#39;s "Ignore" 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:2827
void selectRightMeasure(int index)
Select right measure.
Definition: MatchTool.cpp:2339
A single control point.
Definition: ControlPoint.h:369
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:3047
bool eventFilter(QObject *o, QEvent *e)
Event filter for MatchTool.
Definition: MatchTool.cpp:2540
void previousRightMeasure()
Selects the previous right measure when activated by key shortcut.
Definition: MatchTool.cpp:2260
void loadMeasureTable()
Load measure information into the measure table.
Definition: MatchTool.cpp:2030
void saveTemplateFile()
save the file opened in the template editor
Definition: MatchTool.cpp:2794
void updatePointInfo(QString pointId)
Update the current editPoint information in the Point Editor labels.
Definition: MatchTool.cpp:2937
void saveNet()
Signal to save control net.
Definition: MatchTool.cpp:1373
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:3064
void loadTemplateFile(QString)
Updates the current template file being used.
Definition: MatchTool.cpp:2762
void selectLeftMeasure(int index)
Select left measure.
Definition: MatchTool.cpp:2284
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:2883
void refresh()
Refresh all necessary widgets in MatchTool including the PointEditor and CubeViewports.
Definition: MatchTool.cpp:2973
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:2241
void paintAllViewports()
This method will repaint the given Point ID in each viewport Note: The pointId parameter is here even...
Definition: MatchTool.cpp:2580
void setIgnoreLeftMeasure(bool ignore)
Set the "Ignore" keyword of the measure shown in the left viewport to the value of the input paramete...
Definition: MatchTool.cpp:1213
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
Base class for the Qisis tools.
Definition: Tool.h:81
a control measurement
void setLockPoint(bool ignore)
Set point&#39;s "EditLock" 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:1457
void createMenus()
Customize dropdown menus below title bar.
Definition: MatchTool.cpp:569
void setLockRightMeasure(bool ignore)
Set the "EditLock" 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:2561
void setLockLeftMeasure(bool ignore)
Set the "EditLock" 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:216
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:170