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
Isis::MatchTool::saveChips
void saveChips()
Slot which calls ControlPointEditor slot to save chips.
Definition: MatchTool.cpp:2909
Isis::MatchTool::loadPoint
void loadPoint()
Load point into MatchTool.
Definition: MatchTool.cpp:1940
Isis::MatchTool::saveAsNet
void saveAsNet()
Signal to save the control net.
Definition: MatchTool.cpp:1400
Isis::MdiCubeViewport
Cube display widget for certain Isis MDI applications.
Definition: MdiCubeViewport.h:39
QWidget
Isis::MatchTool::serialNumberList
SerialNumberList serialNumberList()
Creates a serial number list based on open cube viewports.
Definition: MatchTool.cpp:679
Isis::MatchTool::savePoint
void savePoint()
Save edit point to the Control Network.
Definition: MatchTool.cpp:1079
Isis::MatchTool::updateLeftMeasureInfo
void updateLeftMeasureInfo()
Definition: MatchTool.cpp:2401
Isis::Tool
Base class for the Qisis tools.
Definition: Tool.h:67
Isis::MatchTool::drawAllMeasurments
void drawAllMeasurments(MdiCubeViewport *mvp, QPainter *painter)
Draw all measurments which are on this viewPort.
Definition: MatchTool.cpp:2614
Isis::Stretch
Pixel value mapper.
Definition: Stretch.h:58
Isis::MatchTool::createRightMeasureGroupBox
QGroupBox * createRightMeasureGroupBox()
Creates the right measure group box.
Definition: MatchTool.cpp:371
QMainWindow
Isis::MatchTool::saveTemplateFileAs
void saveTemplateFileAs()
save the contents of template editor to a file chosen by the user
Definition: MatchTool.cpp:2808
Isis::MatchTool::openTemplateFile
void openTemplateFile()
prompt user for a registration template file to open.
Definition: MatchTool.cpp:2738
Isis::MatchTool::createControlPointGroupBox
QGroupBox * createControlPointGroupBox()
Definition: MatchTool.cpp:276
Isis::MatchTool
Match tool operations.
Definition: MatchTool.h:216
Isis::MatchTool::createTopSplitter
QSplitter * createTopSplitter()
creates everything above the ControlPointEdit
Definition: MatchTool.cpp:247
QStringList
Isis::MatchTool::exiting
void exiting()
This called when qview is exiting.
Definition: MatchTool.cpp:3360
Isis::SerialNumberList
Serial Number list generator.
Definition: SerialNumberList.h:64
QComboBox
Isis::MatchTool::setIgnorePoint
void setIgnorePoint(bool ignore)
Set point's "Ignore" keyword to the value of the input parameter.
Definition: MatchTool.cpp:1140
Isis::ControlPoint
A single control point.
Definition: ControlPoint.h:354
Isis::MatchTool::createPoint
void createPoint(MdiCubeViewport *mvp, double sample, double line)
Create new control point at given samp, line for viewport.
Definition: MatchTool.cpp:1553
Isis::MatchTool::loadMeasureTable
void loadMeasureTable()
Load measure information into the measure table.
Definition: MatchTool.cpp:2030
Isis::MatchTool::updatePointInfo
void updatePointInfo(QString pointId)
Update the current editPoint information in the Point Editor labels.
Definition: MatchTool.cpp:2937
Isis::MatchTool::saveNet
void saveNet()
Signal to save control net.
Definition: MatchTool.cpp:1373
Isis::MatchToolNewPointDialog
Definition: MatchToolNewPointDialog.h:22
Isis::MatchTool::modifyPoint
void modifyPoint(ControlPoint *point)
Modify control point.
Definition: MatchTool.cpp:1874
Isis::MatchTool::loadTemplateFile
void loadTemplateFile(QString)
Updates the current template file being used.
Definition: MatchTool.cpp:2762
Isis::MatchTool::selectLeftMeasure
void selectLeftMeasure(int index)
Select left measure.
Definition: MatchTool.cpp:2284
Isis::MatchTool::saveTemplateFile
void saveTemplateFile()
save the file opened in the template editor
Definition: MatchTool.cpp:2794
Isis::MatchTool::viewTemplateFile
void viewTemplateFile()
Allows the user to view the template file that is currently set.
Definition: MatchTool.cpp:2883
Isis::MatchTool::MatchTool
MatchTool(QWidget *parent)
Consructs the Match Tool window.
Definition: MatchTool.cpp:57
Isis::MatchTool::colorizeSaveButton
void colorizeSaveButton()
Turn "Save Point" button text to red.
Definition: MatchTool.cpp:3001
Isis::MatchTool::setLockRightMeasure
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
Isis::MatchTool::refresh
void refresh()
Refresh all necessary widgets in MatchTool including the PointEditor and CubeViewports.
Definition: MatchTool.cpp:2973
Isis::MatchTool::measureSaved
void measureSaved()
This method is connected with the measureSaved() signal from ControlPointEdit.
Definition: MatchTool.cpp:788
Isis::MatchTool::createTemplateEditorWidget
void createTemplateEditorWidget()
Creates the Widget which contains the template editor and its toolbar.
Definition: MatchTool.cpp:431
Isis::MatchTool::paintAllViewports
void paintAllViewports()
This method will repaint the given Point ID in each viewport Note: The pointId parameter is here even...
Definition: MatchTool.cpp:2580
Isis::MatchTool::IsMeasureLocked
bool IsMeasureLocked(QString serialNumber)
Check for implicitly locked measure in m_editPoint.
Definition: MatchTool.cpp:3024
Isis::ControlNet
a control network
Definition: ControlNet.h:257
Isis::Cube
IO Handler for Isis Cubes.
Definition: Cube.h:167
Isis::CubeViewport
Widget to display Isis cubes for qt apps.
Definition: CubeViewport.h:122
Isis::MatchTool::setLockLeftMeasure
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
Isis::ToolPad
Definition: ToolPad.h:14
Isis::MatchTool::selectRightMeasure
void selectRightMeasure(int index)
Select right measure.
Definition: MatchTool.cpp:2339
Isis::MatchTool::mouseButtonRelease
void mouseButtonRelease(QPoint p, Qt::MouseButton s)
Handle mouse events on CubeViewport.
Definition: MatchTool.cpp:1457
Isis::MatchTool::createLeftMeasureGroupBox
QGroupBox * createLeftMeasureGroupBox()
Definition: MatchTool.cpp:311
Isis::MatchTool::previousRightMeasure
void previousRightMeasure()
Selects the previous right measure when activated by key shortcut.
Definition: MatchTool.cpp:2260
Isis::MatchTool::deletePoint
void deletePoint(ControlPoint *point)
Delete control point.
Definition: MatchTool.cpp:1693
Isis::MatchTool::readSettings
void readSettings()
This method is called from the constructor so that when the Main window is created,...
Definition: MatchTool.cpp:3047
Isis::MatchTool::nextRightMeasure
void nextRightMeasure()
Selects the next right measure when activated by key shortcut.
Definition: MatchTool.cpp:2241
Isis::MatchTool::eventFilter
bool eventFilter(QObject *o, QEvent *e)
Event filter for MatchTool.
Definition: MatchTool.cpp:2540
Isis::MatchTool::writeTemplateFile
void writeTemplateFile(QString)
write the contents of the template editor to the file provided.
Definition: MatchTool.cpp:2827
Isis::MatchTool::createMatchTool
void createMatchTool(QWidget *parent)
create the main window for editing control points
Definition: MatchTool.cpp:165
Isis::MatchTool::setIgnoreLeftMeasure
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
Isis::MatchTool::createActions
void createActions()
Creates the menu actions for Match Tool.
Definition: MatchTool.cpp:460
Isis::MatchTool::createMenus
void createMenus()
Customize dropdown menus below title bar.
Definition: MatchTool.cpp:569
Isis::MatchTool::okToContinue
bool okToContinue()
Allows user to set a new template file.
Definition: MatchTool.cpp:2713
Isis::MatchTool::setIgnoreRightMeasure
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
Isis::ControlPointEdit
Point Editor Widget.
Definition: ControlPointEdit.h:155
Isis::MatchTool::toolPadAction
QAction * toolPadAction(ToolPad *pad)
Adds the Tie tool action to the tool pad.
Definition: MatchTool.cpp:614
Isis::MatchTool::setLockPoint
void setLockPoint(bool ignore)
Set point's "EditLock" keyword to the value of the input parameter.
Definition: MatchTool.cpp:1121
QObject
Isis::MatchTool::paintViewport
void paintViewport(MdiCubeViewport *mvp, QPainter *painter)
Take care of drawing things on a viewPort.
Definition: MatchTool.cpp:2561
QAction
Isis::MatchTool::writeSettings
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
Isis::MatchTool::setTemplateModified
void setTemplateModified()
called when the template file is modified by the template editor
Definition: MatchTool.cpp:2786
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::ControlMeasure
a control measurement
Definition: ControlMeasure.h:175
Isis::MatchTool::updateRightMeasureInfo
void updateRightMeasureInfo()
Definition: MatchTool.cpp:2474