Isis Developer Reference
MatchTool.h
Go to the documentation of this file.
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
243  TYPE
244  };
245  static const int NUMCOLUMNS = 16;
246 
247  QString measureColumnToString(MeasureColumns column);
248 
249 
250  signals:
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();
329  void createTemplateEditorWidget();
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???
339  SerialNumberList serialNumberList();
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
FileName.h
Isis::MdiCubeViewport
Cube display widget for certain Isis MDI applications.
Definition: MdiCubeViewport.h:39
Isis::MatchTool::IGNORED
@ IGNORED
Definition: MatchTool.h:241
QWidget
Isis::ControlMeasure::RegisteredPixel
@ RegisteredPixel
Registered to whole pixel (e.g.,pointreg)
Definition: ControlMeasure.h:212
Isis::MatchTool::SAMPLE
@ SAMPLE
Definition: MatchTool.h:230
Isis::ControlMeasure::RegisteredSubPixel
@ RegisteredSubPixel
Registered to sub-pixel (e.g., pointreg)
Definition: ControlMeasure.h:214
Isis::Cube::fileName
virtual QString fileName() const
Returns the opened cube's filename.
Definition: Cube.cpp:1563
MdiCubeViewport.h
Isis::ControlMeasure::MeasureLocked
@ MeasureLocked
Definition: ControlMeasure.h:219
Isis::ControlPoint::GetMeasure
const ControlMeasure * GetMeasure(QString serialNumber) const
Get a control measure based on its cube's serial number.
Definition: ControlPoint.cpp:416
Isis::ControlMeasureLogData::GetNumericalValue
double GetNumericalValue() const
Get the value associated with this log data.
Definition: ControlMeasureLogData.cpp:123
QList
This is free and unencumbered software released into the public domain.
Definition: BoxcarCachingAlgorithm.h:13
Isis::ControlPoint::SetIgnored
Status SetIgnored(bool newIgnoreStatus)
Set whether to ignore or use control point.
Definition: ControlPoint.cpp:653
Isis::MatchTool::createToolBarWidget
QWidget * createToolBarWidget(QStackedWidget *parent)
Definition: MatchTool.cpp:624
ViewportMainWindow.h
Isis::ControlMeasure::SetCubeSerialNumber
Status SetCubeSerialNumber(QString newSerialNumber)
Set cube serial number.
Definition: ControlMeasure.cpp:187
Isis::Tool::cubeViewportList
CubeViewportList * cubeViewportList() const
Return the list of cubeviewports.
Definition: Tool.cpp:390
Isis::ControlPointEdit::setLeftMeasure
void setLeftMeasure(ControlMeasure *leftMeasure, Cube *leftCube, QString pointId)
Set the measure displayed in the left ChipViewport.
Definition: ControlPointEdit.cpp:663
Isis::ControlPoint::SetChooserName
Status SetChooserName(QString name)
Set the point's chooser name.
Definition: ControlPoint.cpp:487
Isis::FileName::name
QString name() const
Returns the name of the file excluding the path and the attributes in the file name.
Definition: FileName.cpp:162
Isis::ControlPoint::PointLocked
@ PointLocked
This is returned when the operation requires Edit Lock to be false but it is currently true.
Definition: ControlPoint.h:408
Isis::Tool
Base class for the Qisis tools.
Definition: Tool.h:67
SpecialPixel.h
Isis::ControlPoint::SetEditLock
Status SetEditLock(bool editLock)
Set the EditLock state.
Definition: ControlPoint.cpp:522
Isis::FileName
File name manipulation and expansion.
Definition: FileName.h:100
MainWindow.h
Isis::ControlPoint::GetReferenceSN
QString GetReferenceSN() const
Definition: ControlPoint.cpp:1763
Isis::MatchTool::FILENAME
@ FILENAME
Definition: MatchTool.h:228
Isis::Stretch
Pixel value mapper.
Definition: Stretch.h:58
QMenu
Isis::Tool::toolIconDir
QString toolIconDir() const
returns the path to the icon directory.
Definition: Tool.h:113
Isis::ControlPoint::GetNumMeasures
int GetNumMeasures() const
Definition: ControlPoint.cpp:1702
Isis::ControlPointEdit::saveChips
void saveChips()
Slot to save registration chips to files and fire off qview.
Definition: ControlPointEdit.cpp:1590
QMainWindow
Isis::SerialNumber::Compose
static QString Compose(Pvl &label, bool def2filename=false)
Compose a SerialNumber from a PVL.
Definition: SerialNumber.cpp:38
Isis::ControlMeasure::SetEditLock
Status SetEditLock(bool editLock)
Definition: ControlMeasure.cpp:281
Isis::MatchTool::SAMPLESHIFT
@ SAMPLESHIFT
Definition: MatchTool.h:237
Isis::MatchTool::measureColumnToString
QString measureColumnToString(MeasureColumns column)
Definition: MatchTool.cpp:2191
Isis::MatchTool
Match tool operations.
Definition: MatchTool.h:216
MatchToolDeletePointDialog.h
Tool.h
Isis::ControlPoint::IsEditLocked
bool IsEditLocked() const
Definition: ControlPoint.cpp:1272
Isis::MatchTool::GOODNESSOFFIT
@ GOODNESSOFFIT
Definition: MatchTool.h:240
Isis::ControlPoint::GetId
QString GetId() const
Return the Id of the control point.
Definition: ControlPoint.cpp:1306
ToolPad.h
Isis::ControlMeasure::GetLogData
ControlMeasureLogData GetLogData(long dataType) const
Definition: ControlMeasure.cpp:773
Isis::ControlMeasure::Candidate
@ Candidate
(e.g., autoseed, interest) AKA predicted, unmeasured, unverified
Definition: ControlMeasure.h:208
Isis::ControlMeasure::SetDateTime
Status SetDateTime()
Date Time - Creation Time.
Definition: ControlMeasure.cpp:247
Isis::ControlPointEdit::setRightMeasure
void setRightMeasure(ControlMeasure *rightMeasure, Cube *rightCube, QString pointId)
Set the measure displayed in the right ChipViewport.
Definition: ControlPointEdit.cpp:724
QToolBar
QStringList
Isis::SerialNumberList
Serial Number list generator.
Definition: SerialNumberList.h:64
Isis::MatchTool::stretchChipViewport
void stretchChipViewport(Stretch *, CubeViewport *)
Isis::ControlMeasure::IsIgnored
bool IsIgnored() const
Definition: ControlMeasure.cpp:630
QComboBox
Isis::SerialNumberList::serialNumber
QString serialNumber(const QString &filename)
Return a serial number given a filename.
Definition: SerialNumberList.cpp:426
Isis::MatchTool::APRIORISAMPLE
@ APRIORISAMPLE
Definition: MatchTool.h:232
Isis::MatchToolNewPointDialog::highlightFile
void highlightFile(QString file)
Definition: MatchToolNewPointDialog.cpp:119
Isis::ControlMeasure::GetCubeSerialNumber
QString GetCubeSerialNumber() const
Return the serial number of the cube containing the coordinate.
Definition: ControlMeasure.cpp:557
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::ignoreRightChanged
void ignoreRightChanged()
Isis::ControlMeasure::GetSampleShift
double GetSampleShift() const
Definition: ControlMeasure.cpp:753
ControlNet.h
Isis::MatchTool::LINESHIFT
@ LINESHIFT
Definition: MatchTool.h:238
Isis::ControlPoint::SetRefMeasure
Status SetRefMeasure(ControlMeasure *cm)
Set the point's reference measure.
Definition: ControlPoint.cpp:570
Pvl.h
Isis::ViewportMainWindow
This was called the Qisis MainWindow.
Definition: ViewportMainWindow.h:43
_FILEINFO_
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:24
Isis::MatchTool::newControlNetwork
void newControlNetwork(ControlNet *)
Isis::MatchTool::updatePointInfo
void updatePointInfo(QString pointId)
Update the current editPoint information in the Point Editor labels.
Definition: MatchTool.cpp:2937
Isis::Tool::toolActivated
void toolActivated()
Isis::MatchToolNewPointDialog
Definition: MatchToolNewPointDialog.h:22
Isis::MatchTool::modifyPoint
void modifyPoint(ControlPoint *point)
Modify control point.
Definition: MatchTool.cpp:1874
Isis::ControlMeasure::GetType
MeasureType GetType() const
Definition: ControlMeasure.cpp:738
Isis::ControlPoint::SetType
Status SetType(PointType newType)
Updates the control point's type.
Definition: ControlPoint.cpp:709
Isis::IException::toString
QString toString() const
Returns a string representation of this exception.
Definition: IException.cpp:537
Isis::MatchTool::PIXELSHIFT
@ PIXELSHIFT
Definition: MatchTool.h:239
Isis::ControlPointEdit::setTemplateFile
bool setTemplateFile(QString)
Allows user to choose a new template file by opening a window from which to select a filename.
Definition: ControlPointEdit.cpp:1506
Isis::ControlMeasure::SetIgnored
Status SetIgnored(bool newIgnoredStatus)
Definition: ControlMeasure.cpp:350
Isis::ControlMeasure::Manual
@ Manual
Hand Measured (e.g., qnet)
Definition: ControlMeasure.h:210
Isis::ControlPointEdit::templateFileName
QString templateFileName()
Definition: ControlPointEdit.h:162
Isis::ControlPoint::SetId
Status SetId(QString id)
Sets the Id of the control point.
Definition: ControlPoint.cpp:552
SerialNumberList.h
Application.h
Isis::MatchTool::MatchTool
MatchTool(QWidget *parent)
Consructs the Match Tool window.
Definition: MatchTool.cpp:57
Isis::ControlMeasure::MeasureTypeToString
static QString MeasureTypeToString(MeasureType type)
Return the String Control Measure type.
Definition: ControlMeasure.cpp:951
Isis::ControlMeasure::SetChooserName
Status SetChooserName()
Set chooser name to a user who last changed the coordinate.
Definition: ControlMeasure.cpp:196
Isis::ControlMeasure::GetLineShift
double GetLineShift() const
Definition: ControlMeasure.cpp:759
PvlEditDialog.h
Isis::MatchTool::NUMCOLUMNS
static const int NUMCOLUMNS
Definition: MatchTool.h:245
Isis::ControlMeasure::IsEditLocked
bool IsEditLocked() const
Return value for p_editLock or implicit lock on reference measure.
Definition: ControlMeasure.cpp:601
Workspace.h
Isis::ControlPoint::IndexOfRefMeasure
int IndexOfRefMeasure() const
Definition: ControlPoint.cpp:1817
Isis::MatchTool::refresh
void refresh()
Refresh all necessary widgets in MatchTool including the PointEditor and CubeViewports.
Definition: MatchTool.cpp:2973
Isis::MatchTool::editPointChanged
void editPointChanged()
ControlPoint.h
Isis::ControlNet
a control network
Definition: ControlNet.h:257
Isis::Cube
IO Handler for Isis Cubes.
Definition: Cube.h:167
Isis::IException
Isis exception class.
Definition: IException.h:91
Isis::CubeViewport
Widget to display Isis cubes for qt apps.
Definition: CubeViewport.h:122
Isis::MatchTool::CUBESN
@ CUBESN
Definition: MatchTool.h:229
Isis::ControlPoint::Parent
ControlNet * Parent()
Definition: ControlPoint.h:466
Isis::Null
const double Null
Value for an Isis Null pixel.
Definition: SpecialPixel.h:95
Isis::ToolPad
Definition: ToolPad.h:14
Isis::MatchTool::mouseButtonRelease
void mouseButtonRelease(QPoint p, Qt::MouseButton s)
Handle mouse events on CubeViewport.
Definition: MatchTool.cpp:1457
IException.h
Isis::IException::Programmer
@ Programmer
This error is for when a programmer made an API call that was illegal.
Definition: IException.h:146
MatchTool.h
std
Namespace for the standard library.
Isis::ControlPoint::GetRefMeasure
const ControlMeasure * GetRefMeasure() const
Get the reference control measure.
Definition: ControlPoint.cpp:457
ControlPointEdit.h
Isis::MatchTool::deletePoint
void deletePoint(ControlPoint *point)
Delete control point.
Definition: MatchTool.cpp:1693
Isis::MatchTool::ignorePointChanged
void ignorePointChanged()
Isis::ControlPoint::Free
@ Free
A Free point is a Control Point that identifies common measurements between two or more cubes.
Definition: ControlPoint.h:384
Isis::ControlPoint::Delete
int Delete(ControlMeasure *measure)
Remove a measurement from the control point, deleting reference measure is allowed.
Definition: ControlPoint.cpp:354
Isis::MatchTool::eventFilter
bool eventFilter(QObject *o, QEvent *e)
Event filter for MatchTool.
Definition: MatchTool.cpp:2540
Isis::ControlPoint::IsIgnored
bool IsIgnored() const
Definition: ControlPoint.cpp:1311
Isis::MatchToolNewPointDialog::pointId
QString pointId() const
Definition: MatchToolNewPointDialog.cpp:131
Isis::MatchTool::LINE
@ LINE
Definition: MatchTool.h:231
QDialog
Isis::ControlMeasureLogData::GoodnessOfFit
@ GoodnessOfFit
GoodnessOfFit is pointreg information for reference measures.
Definition: ControlMeasureLogData.h:67
Isis::ControlPointEdit
Point Editor Widget.
Definition: ControlPointEdit.h:155
Isis::CubeViewport::viewportToCube
void viewportToCube(int x, int y, double &sample, double &line) const
Turns a viewport into a cube.
Definition: CubeViewport.cpp:815
Isis::ControlMeasure::SetType
Status SetType(MeasureType type)
Set how the coordinate was obtained.
Definition: ControlMeasure.cpp:420
Isis::MatchTool::toolPadAction
QAction * toolPadAction(ToolPad *pad)
Adds the Tie tool action to the tool pad.
Definition: MatchTool.cpp:614
Isis::ControlPoint::Status
Status
This is a return status for many of the mutating (setter) method calls.
Definition: ControlPoint.h:393
Isis::SerialNumberList::fileName
QString fileName(const QString &sn)
Return a filename given a serial number.
Definition: SerialNumberList.cpp:399
Isis::ControlPoint::HasSerialNumber
bool HasSerialNumber(QString serialNumber) const
Return true if given serial number exists in point.
Definition: ControlPoint.cpp:1746
Isis::MatchTool::LINERESIDUAL
@ LINERESIDUAL
Definition: MatchTool.h:235
QObject
Isis::Application::UserName
static QString UserName()
Returns the user name.
Definition: Application.cpp:816
Isis::MatchTool::EDITLOCK
@ EDITLOCK
Definition: MatchTool.h:242
Isis::MatchTool::paintViewport
void paintViewport(MdiCubeViewport *mvp, QPainter *painter)
Take care of drawing things on a viewPort.
Definition: MatchTool.cpp:2561
Isis::MatchTool::ignoreLeftChanged
void ignoreLeftChanged()
Isis::MatchToolNewPointDialog::setFiles
void setFiles(QStringList pointFiles)
Definition: MatchToolNewPointDialog.cpp:111
Isis::Cube::open
void open(const QString &cfile, QString access="r")
This method will open an isis cube for reading or reading/writing.
Definition: Cube.cpp:627
ControlMeasureLogData.h
Isis::ControlPoint::IsReferenceExplicit
bool IsReferenceExplicit() const
Definition: ControlPoint.cpp:1755
SerialNumber.h
Isis::MatchTool::MeasureColumns
MeasureColumns
Definition: MatchTool.h:227
QAction
Isis::CubeViewport::cube
Cube * cube() const
Definition: CubeViewport.h:338
Isis::MatchTool::RESIDUALMAGNITUDE
@ RESIDUALMAGNITUDE
Definition: MatchTool.h:236
Isis::MatchTool::SAMPLERESIDUAL
@ SAMPLERESIDUAL
Definition: MatchTool.h:234
Isis::ControlPoint::Add
void Add(ControlMeasure *measure)
Add a measurement to the control point, taking ownership of the measure in the process.
Definition: ControlPoint.cpp:223
Progress.h
Isis::Tool::cubeViewport
MdiCubeViewport * cubeViewport() const
Return the current cubeviewport.
Definition: Tool.h:197
MatchToolNewPointDialog.h
Isis::MatchTool::TYPE
@ TYPE
Definition: MatchTool.h:243
ControlMeasure.h
Isis::ControlPointEdit::refreshChips
void refreshChips()
Definition: ControlPointEdit.cpp:1576
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::ControlMeasure::SetCoordinate
Status SetCoordinate(double sample, double line)
Set the coordinate of the measurement.
Definition: ControlMeasure.cpp:219
Isis::MatchTool::measureChanged
void measureChanged()
Isis::ControlMeasure
a control measurement
Definition: ControlMeasure.h:175
Isis::MatchTool::APRIORILINE
@ APRIORILINE
Definition: MatchTool.h:233
Isis::MatchTool::~MatchTool
virtual ~MatchTool()
Definition: MatchTool.cpp:117