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
15class QAction;
16class QBoxLayout;
17class QCheckBox;
18class QComboBox;
19class QGroupBox;
20class QLabel;
21class QMainWindow;
22class QObject;
23class QPainter;
24class QPoint;
25class QPushButton;
26class QSplitter;
27class QStackedWidget;
28class QString;
29class QTableWidget;
30class QTextEdit;
31class QWidget;
32
33namespace 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();
291 void selectLeftMeasure (int index);
292 void selectRightMeasure (int index);
293 void updateLeftMeasureInfo ();
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
a control measurement
a control network
Definition ControlNet.h:258
Point Editor Widget.
A single control point.
IO Handler for Isis Cubes.
Definition Cube.h:168
Widget to display Isis cubes for qt apps.
Match tool operations.
Definition MatchTool.h:216
void readSettings()
This method is called from the constructor so that when the Main window is created,...
void openTemplateFile()
prompt user for a registration template file to open.
bool eventFilter(QObject *o, QEvent *e)
Event filter for MatchTool.
void setLockLeftMeasure(bool ignore)
Set the "EditLock" keyword of the measure shown in the left viewport to the value of the input parame...
void modifyPoint(ControlPoint *point)
Modify control point.
void mouseButtonRelease(QPoint p, Qt::MouseButton s)
Handle mouse events on CubeViewport.
void saveAsNet()
Signal to save the control net.
void setLockRightMeasure(bool ignore)
Set the "EditLock" keyword of the measure shown in the right viewport to the value of the input param...
QGroupBox * createRightMeasureGroupBox()
Creates the right measure group box.
void colorizeSaveButton()
Turn "Save Point" button text to red.
void writeTemplateFile(QString)
write the contents of the template editor to the file provided.
void loadTemplateFile(QString)
Updates the current template file being used.
void createActions()
Creates the menu actions for Match Tool.
void updateRightMeasureInfo()
void savePoint()
Save edit point to the Control Network.
void deletePoint(ControlPoint *point)
Delete control point.
void previousRightMeasure()
Selects the previous right measure when activated by key shortcut.
void loadPoint()
Load point into MatchTool.
void saveNet()
Signal to save control net.
void updateLeftMeasureInfo()
void refresh()
Refresh all necessary widgets in MatchTool including the PointEditor and CubeViewports.
void setIgnoreLeftMeasure(bool ignore)
Set the "Ignore" keyword of the measure shown in the left viewport to the value of the input paramete...
SerialNumberList serialNumberList()
Creates a serial number list based on open cube viewports.
void setIgnoreRightMeasure(bool ignore)
Set the "Ignore" keyword of the measure shown in the right viewport to the value of the input paramet...
void saveTemplateFile()
save the file opened in the template editor
void paintViewport(MdiCubeViewport *mvp, QPainter *painter)
Take care of drawing things on a viewPort.
QGroupBox * createControlPointGroupBox()
bool okToContinue()
Allows user to set a new template file.
QSplitter * createTopSplitter()
creates everything above the ControlPointEdit
QGroupBox * createLeftMeasureGroupBox()
void nextRightMeasure()
Selects the next right measure when activated by key shortcut.
void exiting()
This called when qview is exiting.
void paintAllViewports()
This method will repaint the given Point ID in each viewport Note: The pointId parameter is here even...
void saveChips()
Slot which calls ControlPointEditor slot to save chips.
void setLockPoint(bool ignore)
Set point's "EditLock" keyword to the value of the input parameter.
void setIgnorePoint(bool ignore)
Set point's "Ignore" keyword to the value of the input parameter.
void saveTemplateFileAs()
save the contents of template editor to a file chosen by the user
void createPoint(MdiCubeViewport *mvp, double sample, double line)
Create new control point at given samp, line for viewport.
void loadMeasureTable()
Load measure information into the measure table.
void createMenus()
Customize dropdown menus below title bar.
void selectLeftMeasure(int index)
Select left measure.
void drawAllMeasurments(MdiCubeViewport *mvp, QPainter *painter)
Draw all measurments which are on this viewPort.
void selectRightMeasure(int index)
Select right measure.
void measureSaved()
This method is connected with the measureSaved() signal from ControlPointEdit.
void viewTemplateFile()
Allows the user to view the template file that is currently set.
void setTemplateModified()
called when the template file is modified by the template editor
void writeSettings() const
This method is called when the Main window is closed or hidden to write the size and location setting...
MatchTool(QWidget *parent)
Consructs the Match Tool window.
Definition MatchTool.cpp:57
void createTemplateEditorWidget()
Creates the Widget which contains the template editor and its toolbar.
void updatePointInfo(QString pointId)
Update the current editPoint information in the Point Editor labels.
QAction * toolPadAction(ToolPad *pad)
Adds the Tie tool action to the tool pad.
void createMatchTool(QWidget *parent)
create the main window for editing control points
bool IsMeasureLocked(QString serialNumber)
Check for implicitly locked measure in m_editPoint.
Cube display widget for certain Isis MDI applications.
Serial Number list generator.
Pixel value mapper.
Definition Stretch.h:58
Base class for the Qisis tools.
Definition Tool.h:67
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16