17#include <QTableWidget>
18#include <QTableWidgetItem>
22#include "Application.h"
23#include "ControlMeasure.h"
24#include "ControlMeasureLogData.h"
25#include "ControlNet.h"
26#include "ControlPoint.h"
27#include "ControlPointEdit.h"
29#include "IException.h"
30#include "MainWindow.h"
31#include "MatchToolDeletePointDialog.h"
32#include "MatchToolNewPointDialog.h"
33#include "MdiCubeViewport.h"
36#include "PvlEditDialog.h"
37#include "SerialNumber.h"
38#include "SerialNumberList.h"
39#include "SpecialPixel.h"
41#include "ViewportMainWindow.h"
62 m_newPointDialog = NULL;
76 m_leftReference = NULL;
77 m_leftMeasureType = NULL;
78 m_leftGoodness = NULL;
79 m_rightReference = NULL;
80 m_rightMeasureType = NULL;
81 m_rightGoodness = NULL;
82 m_lockLeftMeasure = NULL;
83 m_ignoreLeftMeasure = NULL;
84 m_lockRightMeasure = NULL;
85 m_ignoreRightMeasure = NULL;
89 m_rightMeasure = NULL;
90 m_templateModified =
false;
91 m_measureWindow = NULL;
92 m_measureTable = NULL;
102 connect(
this, SIGNAL(toolActivated()),
this, SLOT(activateTool()));
108 if (parentMainWindow) {
109 connect(parent, SIGNAL(closeWindow()),
this, SLOT(
exiting()));
117 MatchTool::~MatchTool () {
123 delete m_pointEditor;
124 m_pointEditor = NULL;
125 delete m_newPointDialog;
126 m_newPointDialog = NULL;
129 delete m_leftMeasure;
130 m_leftMeasure = NULL;
131 delete m_rightMeasure;
132 m_rightMeasure = NULL;
168 m_matchTool->setWindowTitle(
"Match Tool");
169 m_matchTool->setObjectName(
"MatchTool");
170 connect(m_matchTool, SIGNAL(destroyed(
QObject *)),
this, SLOT(clearEditPoint()));
179 connect(
this, SIGNAL(newControlNetwork(
ControlNet *)),
180 m_pointEditor, SIGNAL(newControlNetwork(
ControlNet *)));
184 connect(
this, SIGNAL(measureChanged()),
187 m_savePoint =
new QPushButton (
"Save Point");
188 m_savePoint->setShortcut(Qt::Key_P);
189 m_savePoint->setToolTip(
"Save the edit control point to the control network. "
190 "<strong>Shortcut: P</strong>");
191 m_savePoint->setWhatsThis(
"Save the edit control point to the control "
192 "network which is loaded into memory in its entirety. "
193 "When a control point is selected for editing, "
194 "a copy of the point is made so that the original control "
195 "point remains in the network.");
196 m_saveDefaultPalette = m_savePoint->palette();
197 connect (m_savePoint,SIGNAL(clicked()),
this,SLOT(
savePoint()));
199 QHBoxLayout * addMeasureLayout =
new QHBoxLayout;
200 addMeasureLayout->addStretch();
201 addMeasureLayout->addWidget(m_savePoint);
204 m_cnetFileNameLabel =
new QLabel(
"Control Network: " + m_cnetFileName);
205 m_cnetFileNameLabel->setToolTip(
"Name of opened control network file.");
206 m_cnetFileNameLabel->setWhatsThis(
"Name of opened control network file.");
208 m_templateFileNameLabel =
new QLabel(
"Template File: " +
209 m_pointEditor->templateFileName());
210 m_templateFileNameLabel->setToolTip(
"Sub-pixel registration template File.");
214 m_templateFileNameLabel->setWhatsThis(
"FileName of the sub-pixel "
215 "registration template. Refer to https://astrogeology.usgs.gov/docs/concepts/control-networks/pattern-matching/ for a description of the "
216 "contents of this file.");
218 QVBoxLayout * centralLayout =
new QVBoxLayout;
220 centralLayout->addWidget(m_cnetFileNameLabel);
221 centralLayout->addWidget(m_templateFileNameLabel);
223 centralLayout->addStretch();
224 centralLayout->addWidget(m_pointEditor);
225 centralLayout->addLayout(addMeasureLayout);
227 centralWidget->setLayout(centralLayout);
229 QScrollArea *scrollArea =
new QScrollArea();
230 scrollArea->setObjectName(
"MatchToolScroll");
231 scrollArea->setWidget(centralWidget);
232 scrollArea->setWidgetResizable(
true);
233 centralWidget->adjustSize();
234 m_matchTool->setCentralWidget(scrollArea);
238 connect(
this, SIGNAL(editPointChanged()),
248 QHBoxLayout * measureLayout =
new QHBoxLayout;
252 QVBoxLayout * groupBoxesLayout =
new QVBoxLayout;
254 groupBoxesLayout->addStretch();
255 groupBoxesLayout->addLayout(measureLayout);
258 groupBoxesWidget->setLayout(groupBoxesLayout);
262 QSplitter * topSplitter =
new QSplitter;
263 topSplitter->addWidget(groupBoxesWidget);
264 topSplitter->addWidget(m_templateEditorWidget);
265 topSplitter->setStretchFactor(0, 4);
266 topSplitter->setStretchFactor(1, 3);
268 m_templateEditorWidget->hide();
278 m_ptIdValue =
new QLabel;
279 m_numMeasures =
new QLabel;
280 QVBoxLayout * leftLayout =
new QVBoxLayout;
281 leftLayout->addWidget(m_ptIdValue);
282 leftLayout->addWidget(m_numMeasures);
285 m_lockPoint =
new QCheckBox(
"Edit Lock Point");
286 connect(m_lockPoint, SIGNAL(clicked(
bool)),
this, SLOT(
setLockPoint(
bool)));
287 m_ignorePoint =
new QCheckBox(
"Ignore Point");
288 connect(m_ignorePoint, SIGNAL(clicked(
bool)),
290 connect(
this, SIGNAL(ignorePointChanged()), m_ignorePoint, SLOT(toggle()));
292 QVBoxLayout * rightLayout =
new QVBoxLayout;
293 rightLayout->addWidget(m_lockPoint);
294 rightLayout->addWidget(m_ignorePoint);
296 QHBoxLayout * mainLayout =
new QHBoxLayout;
297 mainLayout->addLayout(leftLayout);
298 mainLayout->addStretch();
299 mainLayout->addLayout(rightLayout);
302 QGroupBox * groupBox =
new QGroupBox(
"Control Point");
303 groupBox->setLayout(mainLayout);
313 m_leftCombo->view()->installEventFilter(
this);
314 m_leftCombo->setToolTip(
"Choose left control measure");
315 m_leftCombo->setWhatsThis(
"Choose left control measure identified by "
317 connect(m_leftCombo, SIGNAL(activated(
int)),
319 m_lockLeftMeasure =
new QCheckBox(
"Edit Lock Measure");
320 connect(m_lockLeftMeasure, SIGNAL(clicked(
bool)),
322 m_ignoreLeftMeasure =
new QCheckBox(
"Ignore Measure");
323 connect(m_ignoreLeftMeasure, SIGNAL(clicked(
bool)),
325 connect(
this, SIGNAL(ignoreLeftChanged()),
326 m_ignoreLeftMeasure, SLOT(toggle()));
327 m_leftReference =
new QLabel();
328 m_leftMeasureType =
new QLabel();
329 m_leftSampShift =
new QLabel();
330 m_leftSampShift->setToolTip(
"Sample shift between apriori and current");
331 m_leftSampShift->setWhatsThis(
"The shift between the apriori sample and "
332 "the current sample. The apriori sample is set "
333 "when creating a new measure.");
334 m_leftLineShift =
new QLabel();
335 m_leftLineShift->setToolTip(
"Line shift between apriori and current");
336 m_leftLineShift->setWhatsThis(
"The shift between the apriori line and "
337 "the current line. The apriori line is set "
338 "when creating a new measure.");
339 m_leftGoodness =
new QLabel();
340 m_leftGoodness->setToolTip(
"Goodness of Fit result from sub-pixel "
342 m_leftGoodness->setWhatsThis(
"Resulting Goodness of Fit from sub-pixel "
344 QVBoxLayout * leftLayout =
new QVBoxLayout;
345 leftLayout->addWidget(m_leftCombo);
346 leftLayout->addWidget(m_lockLeftMeasure);
347 leftLayout->addWidget(m_ignoreLeftMeasure);
348 leftLayout->addWidget(m_leftReference);
349 leftLayout->addWidget(m_leftMeasureType);
350 leftLayout->addWidget(m_leftSampShift);
351 leftLayout->addWidget(m_leftLineShift);
352 leftLayout->addWidget(m_leftGoodness);
354 QGroupBox * leftGroupBox =
new QGroupBox(
"Left Measure");
355 leftGroupBox->setLayout(leftLayout);
374 m_rightCombo->view()->installEventFilter(
this);
378 QShortcut *nextMeasure =
new QShortcut(Qt::Key_PageDown, m_matchTool);
380 QShortcut *prevMeasure =
new QShortcut(Qt::Key_PageUp, m_matchTool);
383 m_rightCombo->setToolTip(
"Choose right control measure. "
384 "<strong>Shorcuts: PageUp/PageDown</strong>");
385 m_rightCombo->setWhatsThis(
"Choose right control measure identified by "
387 "Note: PageUp selects previous measure; "
388 "PageDown selects next measure.");
389 connect(m_rightCombo, SIGNAL(activated(
int)),
391 m_lockRightMeasure =
new QCheckBox(
"Edit Lock Measure");
392 connect(m_lockRightMeasure, SIGNAL(clicked(
bool)),
394 m_ignoreRightMeasure =
new QCheckBox(
"Ignore Measure");
395 connect(m_ignoreRightMeasure, SIGNAL(clicked(
bool)),
397 connect(
this, SIGNAL(ignoreRightChanged()),
398 m_ignoreRightMeasure, SLOT(toggle()));
399 m_rightReference =
new QLabel();
400 m_rightMeasureType =
new QLabel();
401 m_rightSampShift =
new QLabel();
402 m_rightSampShift->setToolTip(m_leftSampShift->toolTip());
403 m_rightSampShift->setWhatsThis(m_leftSampShift->whatsThis());
404 m_rightLineShift =
new QLabel();
405 m_rightLineShift->setToolTip(m_leftLineShift->toolTip());
406 m_rightLineShift->setWhatsThis(m_leftLineShift->whatsThis());
407 m_rightGoodness =
new QLabel();
408 m_rightGoodness->setToolTip(m_leftGoodness->toolTip());
409 m_rightGoodness->setWhatsThis(m_leftGoodness->whatsThis());
412 QVBoxLayout * rightLayout =
new QVBoxLayout;
413 rightLayout->addWidget(m_rightCombo);
414 rightLayout->addWidget(m_lockRightMeasure);
415 rightLayout->addWidget(m_ignoreRightMeasure);
416 rightLayout->addWidget(m_rightReference);
417 rightLayout->addWidget(m_rightMeasureType);
418 rightLayout->addWidget(m_rightSampShift);
419 rightLayout->addWidget(m_rightLineShift);
420 rightLayout->addWidget(m_rightGoodness);
422 QGroupBox * rightGroupBox =
new QGroupBox(
"Right Measure");
423 rightGroupBox->setLayout(rightLayout);
425 return rightGroupBox;
434 toolBar->addAction(m_openTemplateFile);
435 toolBar->addSeparator();
436 toolBar->addAction(m_saveTemplateFile);
437 toolBar->addAction(m_saveTemplateFileAs);
439 m_templateEditor =
new QTextEdit;
440 connect(m_templateEditor, SIGNAL(textChanged()),
this,
443 QVBoxLayout *mainLayout =
new QVBoxLayout;
444 mainLayout->addWidget(toolBar);
445 mainLayout->addWidget(m_templateEditor);
447 m_templateEditorWidget =
new QWidget;
448 m_templateEditorWidget->setLayout(mainLayout);
462 "Save Control Network ...",
464 m_saveNet->setShortcut(Qt::CTRL + Qt::Key_S);
465 m_saveNet->setToolTip(
"Save current control network");
466 m_saveNet->setStatusTip(
"Save current control network");
467 QString whatsThis =
"<b>Function:</b> Saves the current <i>"
468 "control network</i>";
469 m_saveNet->setWhatsThis(whatsThis);
470 connect(m_saveNet, SIGNAL(triggered()),
this, SLOT(
saveNet()));
473 "Save Control Network &As...",
475 m_saveAsNet->setToolTip(
"Save current control network to chosen file");
476 m_saveAsNet->setStatusTip(
"Save current control network to chosen file");
477 whatsThis =
"<b>Function:</b> Saves the current <i>"
478 "control network</i> under chosen filename";
479 m_saveAsNet->setWhatsThis(whatsThis);
480 connect(m_saveAsNet, SIGNAL(triggered()),
this, SLOT(
saveAsNet()));
485 m_closeMatchTool->setToolTip(
"Close this window");
486 m_closeMatchTool->setStatusTip(
"Close this window");
487 m_closeMatchTool->setShortcut(Qt::ALT + Qt::Key_F4);
488 whatsThis =
"<b>Function:</b> Closes the Match Tool window for this point "
489 "<p><b>Shortcut:</b> Alt+F4 </p>";
490 m_closeMatchTool->setWhatsThis(whatsThis);
491 connect(m_closeMatchTool, SIGNAL(triggered()), m_matchTool, SLOT(close()));
494 "&View/edit registration template",
496 m_showHideTemplateEditor->setCheckable(
true);
497 m_showHideTemplateEditor->setToolTip(
"View and/or edit the registration template");
498 m_showHideTemplateEditor->setStatusTip(
"View and/or edit the registration template");
499 whatsThis =
"<b>Function:</b> Displays the curent registration template. "
500 "The user may edit and save changes under a chosen filename.";
501 m_showHideTemplateEditor->setWhatsThis(whatsThis);
502 connect(m_showHideTemplateEditor, SIGNAL(triggered()),
this,
503 SLOT(showHideTemplateEditor()));
506 "Save registration chips",
508 m_saveChips->setToolTip(
"Save registration chips");
509 m_saveChips->setStatusTip(
"Save registration chips");
510 whatsThis =
"<b>Function:</b> Save registration chips to file. "
511 "Each chip: pattern, search, fit will be saved to a separate file.";
512 m_saveChips->setWhatsThis(whatsThis);
513 connect(m_saveChips, SIGNAL(triggered()),
this, SLOT(
saveChips()));
516 "&Open registration template",
518 m_openTemplateFile->setToolTip(
"Set registration template");
519 m_openTemplateFile->setStatusTip(
"Set registration template");
520 whatsThis =
"<b>Function:</b> Allows user to select a new file to set as "
521 "the registration template";
522 m_openTemplateFile->setWhatsThis(whatsThis);
523 connect(m_openTemplateFile, SIGNAL(triggered()),
this, SLOT(
openTemplateFile()));
526 "&Save template file",
528 m_saveTemplateFile->setToolTip(
"Save the template file");
529 m_saveTemplateFile->setStatusTip(
"Save the template file");
530 m_saveTemplateFile->setWhatsThis(
"Save the registration template file");
531 connect(m_saveTemplateFile, SIGNAL(triggered()),
this,
535 "&Save template as...",
537 m_saveTemplateFileAs->setToolTip(
"Save the template file as");
538 m_saveTemplateFileAs->setStatusTip(
"Save the template file as");
539 m_saveTemplateFileAs->setWhatsThis(
"Save the registration template file as");
540 connect(m_saveTemplateFileAs, SIGNAL(triggered()),
this,
546 m_whatsThis->setShortcut(Qt::SHIFT | Qt::Key_F1);
547 m_whatsThis->setToolTip(
"Activate What's This and click on items on "
548 "user interface to see more information.");
549 connect(m_whatsThis, SIGNAL(triggered()),
this, SLOT(enterWhatsThisMode()));
551 m_showHelp =
new QAction(QPixmap(
toolIconDir() +
"/help-contents.png"),
"Help", m_matchTool);
552 m_showHelp->setToolTip(
"Help");
553 connect(m_showHelp, SIGNAL(triggered()),
this, SLOT(showHelp()));
570 QMenu *fileMenu = m_matchTool->menuBar()->addMenu(
"&File");
571 fileMenu->addAction(m_saveNet);
572 fileMenu->addAction(m_saveAsNet);
573 fileMenu->addAction(m_closeMatchTool);
575 QMenu * regMenu = m_matchTool->menuBar()->addMenu(
"&Registration");
576 regMenu->addAction(m_openTemplateFile);
577 regMenu->addAction(m_showHideTemplateEditor);
578 regMenu->addAction(m_saveChips);
580 QMenu *helpMenu = m_matchTool->menuBar()->addMenu(
"&Help");
581 helpMenu->addAction(m_whatsThis);
585 void MatchTool::createToolBars() {
588 toolBar->setObjectName(
"TemplateEditorToolBar");
589 toolBar->setFloatable(
false);
590 toolBar->addAction(m_saveNet);
591 toolBar->addSeparator();
592 toolBar->addAction(m_showHideTemplateEditor);
593 toolBar->addAction(m_saveChips);
594 toolBar->addAction(m_showHelp);
595 toolBar->addAction(m_whatsThis);
597 m_matchTool->addToolBar(Qt::TopToolBarArea, toolBar);
615 action->setIcon(QPixmap(
toolIconDir()+
"/stock_draw-connector-with-arrows.png"));
616 action->setToolTip(
"Match Tool - Control Point Editor (T)");
617 action->setShortcut(Qt::Key_T);
623 QWidget *MatchTool::createToolBarWidget(QStackedWidget *parent) {
627 QToolButton *openNetButton =
new QToolButton(hbox);
628 openNetButton->setIcon(QPixmap(
toolIconDir() +
"/fileopen.png"));
629 openNetButton->setIconSize(QSize(22,22));
630 openNetButton->setToolTip(
"Open control network");
631 openNetButton->setEnabled(
true);
632 connect(openNetButton, SIGNAL(clicked()),
this, SLOT(openNet()));
634 QToolButton *saveAsNetButton =
new QToolButton(hbox);
635 saveAsNetButton->setDefaultAction(m_saveAsNet);
636 saveAsNetButton->setIconSize(QSize(22,22));
638 QToolButton *saveNetButton =
new QToolButton(hbox);
639 saveNetButton->setDefaultAction(m_saveNet);
640 saveNetButton->setIconSize(QSize(22,22));
642 QToolButton *helpButton =
new QToolButton(hbox);
643 helpButton->setDefaultAction(m_showHelp);
644 helpButton->setIconSize(QSize(22, 22));
646 QHBoxLayout *layout =
new QHBoxLayout;
647 layout->setMargin(0);
648 layout->addWidget(openNetButton);
649 layout->addWidget(saveAsNetButton);
650 layout->addWidget(saveNetButton);
651 layout->addStretch();
652 layout->addWidget(helpButton);
653 hbox->setLayout(layout);
660 void MatchTool::activateTool() {
663 m_controlNet =
new ControlNet();
713 QString serialNumber;
719 catch (IException &e) {
720 serialNumber =
"Unknown";
792 m_editPoint->GetMeasure(m_leftMeasure->GetCubeSerialNumber());
794 m_editPoint->GetMeasure(m_rightMeasure->GetCubeSerialNumber());
796 if (*origLeftMeasure == *m_leftMeasure && *origRightMeasure == *m_rightMeasure) {
800 if (m_editPoint->IsIgnored()) {
801 QString message =
"You are saving changes to a measure on an ignored ";
802 message +=
"point. Do you want to set Ignore = False on the point and ";
803 message +=
"both measures?";
804 switch (QMessageBox::question(m_matchTool,
"Match Tool Save Measure",
805 message,
"&Yes",
"&No", 0, 0)) {
808 m_editPoint->SetIgnored(
false);
809 emit ignorePointChanged();
810 if (m_leftMeasure->IsIgnored()) {
811 m_leftMeasure->SetIgnored(
false);
812 emit ignoreLeftChanged();
814 if (m_rightMeasure->IsIgnored()) {
815 m_rightMeasure->SetIgnored(
false);
816 emit ignoreRightChanged();
824 bool savedAMeasure =
false;
826 bool leftChangeOk = validateMeasureChange(m_leftMeasure);
829 *origLeftMeasure = *m_leftMeasure;
830 savedAMeasure =
true;
832 bool rightChangeOk = validateMeasureChange(m_rightMeasure);
835 *origRightMeasure = *m_rightMeasure;
836 savedAMeasure =
true;
840 if (m_leftMeasure->GetCubeSerialNumber() == m_rightMeasure->GetCubeSerialNumber()) {
841 *m_leftMeasure = *m_rightMeasure;
843 m_pointEditor->setLeftMeasure (m_leftMeasure, m_leftCube,
844 m_editPoint->GetId());
852 emit editPointChanged();
873 if (*m == *origMeasure)
return false;
877 QString side =
"right";
890 QString message =
"The " + side +
" measure is editLocked ";
891 message +=
"for editing. Do you want to set EditLock = False for this ";
892 message +=
"measure?";
893 int response = QMessageBox::question(m_matchTool,
"Match Tool Save Measure",
894 message, QMessageBox::Yes | QMessageBox::No);
896 if (response == QMessageBox::Yes) {
897 m->SetEditLock(
false);
898 if (side ==
"left") {
899 m_lockLeftMeasure->setChecked(
false);
902 m_lockRightMeasure->setChecked(
false);
911 if (origMeasure->IsIgnored() && m->IsIgnored()) {
912 QString message =
"The " + side +
"measure is ignored. ";
913 message +=
"Do you want to set Ignore = False on the measure?";
914 switch(QMessageBox::question(m_matchTool,
"Match Tool Save Measure",
915 message,
"&Yes",
"&No", 0, 0)){
918 m->SetIgnored(
false);
919 if (side ==
"left") {
920 emit ignoreLeftChanged();
923 emit ignoreRightChanged();
932 ControlMeasure *refMeasure = m_editPoint->GetRefMeasure();
933 if (m_editPoint->IsReferenceExplicit()) {
935 if (m->GetSample() != origMeasure->GetSample() || m->GetLine() != origMeasure->GetLine()) {
936 QString message =
"You are making a change to the reference measure. You ";
937 message +=
"may need to move all of the other measures to match the new ";
938 message +=
" coordinate of the reference measure. Do you really want to ";
939 message +=
" change the reference measure's location? ";
940 switch(QMessageBox::question(m_matchTool,
"Match Tool Save Measure",
941 message,
"&Yes",
"&No", 0, 0)){
953 else if (side ==
"left" && (refMeasure->GetCubeSerialNumber() != m->
GetCubeSerialNumber())) {
955 QString message =
"This control network was created by the <i>coreg</i> program, and the "
956 "reference measure needs to remain the same as what <i>coreg</i> set. "
957 "Therefore, you cannot change which measure is the reference. To "
958 "save this point, move the reference measure (measure in BOLD) back "
960 QMessageBox::information(m_matchTool,
"Cannot change reference", message);
963 QString message =
"This point already contains a reference measure. ";
964 message +=
"Would you like to replace it with the measure on the left?";
965 int response = QMessageBox::question(m_matchTool,
966 "Match Tool Save Measure", message,
967 QMessageBox::Yes | QMessageBox::No,
970 if (response == QMessageBox::Yes) {
974 QString fname = FileName(file).name();
975 int iref = m_leftCombo->findText(fname);
978 QVariant font = m_leftCombo->itemData(iref,Qt::FontRole);
979 m_leftCombo->setItemData(iref,QFont(
"DejaVu Sans", 12, QFont::Bold), Qt::FontRole);
980 iref = m_rightCombo->findText(fname);
981 m_rightCombo->setItemData(iref,QFont(
"DejaVu Sans", 12, QFont::Bold), Qt::FontRole);
984 fname = FileName(file).name();
985 iref = m_leftCombo->findText(fname);
986 m_leftCombo->setItemData(iref,font,Qt::FontRole);
987 iref = m_rightCombo->findText(fname);
988 m_rightCombo->setItemData(iref,font,Qt::FontRole);
997 if (side ==
"left") {
1019 void MatchTool::checkReference() {
1024 ControlMeasure *refMeasure = m_editPoint->GetRefMeasure();
1025 if (refMeasure->GetCubeSerialNumber() != m_leftMeasure->GetCubeSerialNumber()) {
1026 QString message =
"This point already contains a reference measure. ";
1027 message +=
"Would you like to replace it with the measure on the left?";
1028 int response = QMessageBox::question(m_matchTool,
1029 "Match Tool Save Measure", message,
1030 QMessageBox::Yes | QMessageBox::No,
1033 if (response == QMessageBox::Yes) {
1037 QString fname = FileName(file).name();
1038 int iref = m_leftCombo->findText(fname);
1041 QVariant font = m_leftCombo->itemData(iref,Qt::FontRole);
1042 m_leftCombo->setItemData(iref,QFont(
"DejaVu Sans", 12, QFont::Bold), Qt::FontRole);
1043 iref = m_rightCombo->findText(fname);
1044 m_rightCombo->setItemData(iref,QFont(
"DejaVu Sans", 12, QFont::Bold), Qt::FontRole);
1047 fname = FileName(file).name();
1048 iref = m_leftCombo->findText(fname);
1049 m_leftCombo->setItemData(iref,font,Qt::FontRole);
1050 iref = m_rightCombo->findText(fname);
1051 m_rightCombo->setItemData(iref,font,Qt::FontRole);
1053 m_editPoint->SetRefMeasure(m_leftMeasure->GetCubeSerialNumber());
1083 *updatePoint = *m_editPoint;
1087 if (m_controlNet->ContainsPoint(updatePoint->
GetId())) {
1089 p = m_controlNet->GetPoint(QString(updatePoint->
GetId()));
1095 m_controlNet->AddPoint(updatePoint);
1099 m_savePoint->setPalette(m_saveDefaultPalette);
1102 emit editPointChanged();
1104 m_netChanged =
true;
1106 m_pointEditor->refreshChips();
1121 if (m_editPoint == NULL)
return;
1123 m_editPoint->SetEditLock(lock);
1140 if (m_editPoint == NULL)
return;
1144 m_ignorePoint->setChecked(m_editPoint->IsIgnored());
1145 QString message =
"Unable to change Ignored on point. Set EditLock ";
1146 message +=
" to False.";
1147 QMessageBox::critical(m_matchTool,
"Error", message);
1173 if (m_editPoint->IsEditLocked()) {
1174 m_lockLeftMeasure->setChecked(m_leftMeasure->IsEditLocked());
1175 QMessageBox::warning(m_matchTool,
"Point Locked",
"Point is Edit Locked. You must un-lock point"
1176 " before changing a measure.");
1177 m_lockLeftMeasure->setChecked(m_leftMeasure->IsEditLocked());
1181 if (m_leftMeasure != NULL) m_leftMeasure->SetEditLock(lock);
1185 if (m_rightMeasure != NULL) {
1186 if (m_rightMeasure->GetCubeSerialNumber() == m_leftMeasure->GetCubeSerialNumber()) {
1187 m_rightMeasure->SetEditLock(lock);
1188 m_lockRightMeasure->setChecked(lock);
1191 emit measureChanged();
1213 if (m_leftMeasure != NULL) m_leftMeasure->SetIgnored(ignore);
1217 if (m_rightMeasure != NULL) {
1218 if (m_rightMeasure->GetCubeSerialNumber() == m_leftMeasure->GetCubeSerialNumber()) {
1219 m_rightMeasure->SetIgnored(ignore);
1220 m_ignoreRightMeasure->setChecked(ignore);
1223 emit measureChanged();
1244 if (m_editPoint->IsEditLocked()) {
1245 m_lockRightMeasure->setChecked(m_rightMeasure->IsEditLocked());
1246 QMessageBox::warning(m_matchTool,
"Point Locked",
"Point is Edit Locked. You must un-lock point"
1247 " before changing a measure.");
1248 m_lockRightMeasure->setChecked(m_rightMeasure->IsEditLocked());
1252 if (m_rightMeasure != NULL) m_rightMeasure->SetEditLock(lock);
1255 if (m_leftMeasure != NULL) {
1256 if (m_leftMeasure->GetCubeSerialNumber() == m_rightMeasure->GetCubeSerialNumber()) {
1257 m_leftMeasure->SetEditLock(lock);
1258 m_lockLeftMeasure->setChecked(lock);
1261 emit measureChanged();
1283 if (m_rightMeasure != NULL) m_rightMeasure->SetIgnored(ignore);
1287 if (m_leftMeasure != NULL) {
1288 if (m_rightMeasure->GetCubeSerialNumber() == m_leftMeasure->GetCubeSerialNumber()) {
1289 m_leftMeasure->SetIgnored(ignore);
1290 m_ignoreLeftMeasure->setChecked(ignore);
1293 emit measureChanged();
1298 void MatchTool::openNet() {
1301 if (m_controlNet->GetNumPoints() != 0 && m_netChanged) {
1302 QString message =
"A control net has already been created. Do you want to save before "
1303 "opening a new control net?";
1304 int response = QMessageBox::question(m_matchTool,
"Save current control net?",
1306 QMessageBox::Yes | QMessageBox::No,
1309 if (response == QMessageBox::Yes) {
1312 m_matchTool->setVisible(
false);
1314 delete m_controlNet;
1315 m_controlNet = NULL;
1318 m_newPointDialog = NULL;
1322 m_netChanged =
false;
1324 QApplication::restoreOverrideCursor();
1325 QString filter =
"Control net (*.net *.cnet *.ctl);;";
1326 filter +=
"Pvl file (*.pvl);;";
1327 filter +=
"Text file (*.txt);;";
1328 filter +=
"All (*)";
1329 m_cnetFileName = QFileDialog::getOpenFileName((QWidget *)parent(),
1330 "Select a control network",
1333 QApplication::setOverrideCursor(Qt::WaitCursor);
1334 if (!m_cnetFileName.isEmpty()) {
1337 m_controlNet =
new ControlNet(m_cnetFileName, &progress);
1339 m_coregReferenceSN =
"";
1340 if (m_controlNet->GetNetworkId() ==
"Coreg") {
1344 m_coregReferenceSN = m_controlNet->GetPoint(0)->GetReferenceSN();
1347 catch (IException &e) {
1348 QApplication::restoreOverrideCursor();
1349 QString message =
"Invalid control network. \n";
1350 message += e.toString();
1351 QMessageBox::critical(m_matchTool,
"Error", message);
1352 m_cnetFileName.clear();
1353 delete m_controlNet;
1354 m_controlNet = NULL;
1358 QApplication::restoreOverrideCursor();
1359 m_matchTool->setWindowTitle(
"Match Tool - Control Network File: " + m_cnetFileName);
1360 m_cnetFileNameLabel->setText(
"Control Network: " + m_cnetFileName);
1373 if (m_cnetFileName.isEmpty()) {
1374 QString message =
"This is a new network, you must select "
1375 "\"Save As\" under the File Menu or on the toolbar.";
1376 QMessageBox::critical(m_matchTool,
"Error", message);
1380 m_controlNet->Write(m_cnetFileName);
1381 m_netChanged =
false;
1384 QMessageBox::critical(m_matchTool, tr(
"Error Writing Control Net"), e.
what());
1401 QString fn = QFileDialog::getSaveFileName(m_matchTool,
1402 "Choose filename to save under",
1404 "Control Files (*.net)");
1409 m_controlNet->Write(fn);
1410 m_netChanged =
false;
1413 QMessageBox::critical(m_matchTool, tr(
"Error Writing Control Net"), e.
what());
1416 m_cnetFileName = fn;
1417 m_matchTool->setWindowTitle(
"Match Tool - Control Network File: " + m_cnetFileName);
1418 m_cnetFileNameLabel->setText(
"Control Network: " + m_cnetFileName);
1458 if (mvp == NULL)
return;
1466 if (s == Qt::LeftButton) {
1468 if (!m_controlNet || m_controlNet->GetNumPoints() == 0) {
1469 QString message =
"No points exist for editing. Create points ";
1470 message +=
"using the right mouse button.";
1471 QMessageBox::warning(m_matchTool,
"Warning", message);
1479 point = m_controlNet->FindClosest(sn, samp, line);
1482 QString message =
"Cannot find point for editing.";
1484 QMessageBox::warning(m_matchTool,
"Warning", message);
1490 else if (s == Qt::MiddleButton) {
1491 if (!m_controlNet || m_controlNet->GetNumPoints() == 0) {
1492 QString message =
"No points exist for deleting. Create points ";
1493 message +=
"using the right mouse button.";
1494 QMessageBox::warning(m_matchTool,
"Warning", message);
1499 ControlPoint *point = m_controlNet->FindClosest(sn, samp, line);
1501 if (point == NULL) {
1502 QString message =
"No points exist for deleting. Create points ";
1503 message +=
"using the right mouse button.";
1504 QMessageBox::warning(m_matchTool,
"Warning", message);
1510 else if (s == Qt::RightButton) {
1511 if (m_newPointDialog) {
1512 addMeasure(mvp, samp, line);
1520 QString message =
"Cannot create control point.\n\n";
1522 QMessageBox::critical(m_matchTool,
"Error", message);
1535 for (
int i=0; i<point->GetNumMeasures(); i++) {
1541 return missingCubes;
1555 connect(m_newPointDialog, SIGNAL(measuresFinished()),
this, SLOT(doneWithMeasures()));
1556 connect(m_newPointDialog, SIGNAL(newPointCanceled()),
this, SLOT(cancelNewPoint()));
1561 images<<cubeFile.
name();
1563 m_newPointDialog->setFiles(images);
1564 m_newPointDialog->show();
1568 m_newPointDialog->highlightFile(current);
1587 void MatchTool::addMeasure(
MdiCubeViewport *cvp,
double sample,
double line) {
1591 m_newPointDialog->highlightFile(current);
1592 m_newPointDialog->raise();
1612 void MatchTool::doneWithMeasures() {
1614 m_lastUsedPointId = m_newPointDialog->pointId();
1615 m_newPoint->SetId(m_lastUsedPointId);
1625 if (!m_newPoint->HasSerialNumber(m_coregReferenceSN)) {
1626 QString message =
"This is a coreg network which needs the cube with serial number " +
1627 m_coregReferenceSN +
" as the reference measure. This new control point does "
1628 "not have a measure for that serial number, so this point cannot be created until "
1629 "the cube listed above is added (Right-click on cube).";
1630 QMessageBox::critical(m_matchTool,
"Error", message);
1631 m_newPointDialog->show();
1635 m_newPoint->SetRefMeasure(m_newPoint->GetMeasure(m_coregReferenceSN));
1639 if (m_editPoint != NULL && m_editPoint->Parent() == NULL) {
1643 m_editPoint = m_newPoint;
1646 delete m_newPointDialog;
1647 m_newPointDialog = NULL;
1651 m_matchTool->setVisible(
true);
1652 m_matchTool->raise();
1654 emit editPointChanged();
1660 void MatchTool::cancelNewPoint() {
1662 delete m_newPointDialog;
1663 m_newPointDialog = NULL;
1695 if (mCubes.size() > 0) {
1696 QString msgTitle =
"Missing Cubes";
1697 QString message =
"This point is missing cubes for the following measures and cannot be ";
1698 message +=
"loaded into the editor. Do you still want to delete this point?\n\n";
1699 for (
int i=0; i<mCubes.size(); i++) {
1700 message += mCubes.at(i) +
"\n";
1702 QMessageBox msgBox(QMessageBox::Critical, msgTitle, message, QMessageBox::NoButton, m_matchTool,
1704 QPushButton *yesButton = msgBox.addButton(
"Yes", QMessageBox::AcceptRole);
1705 QPushButton *noButton = msgBox.addButton(
"No", QMessageBox::RejectRole);
1706 msgBox.setDefaultButton(yesButton);
1708 if (msgBox.clickedButton() == noButton) {
1712 m_matchTool->setVisible(
false);
1719 if (m_editPoint != NULL && m_editPoint->Parent() == NULL) {
1724 *m_editPoint = *point;
1727 if (mCubes.size() == 0) {
1733 emit editPointChanged();
1737 QString CPId = m_editPoint->GetId();
1738 deletePointDialog->pointIdValue->setText(CPId);
1740 for (
int i=0; i<m_editPoint->GetNumMeasures(); i++) {
1749 deletePointDialog->fileList->addItem(file);
1752 if (deletePointDialog->exec()) {
1754 int numDeleted = deletePointDialog->fileList->selectedItems().count();
1757 if (deletePointDialog->deleteAllCheckBox->isChecked() ||
1758 numDeleted == m_editPoint->GetNumMeasures()) {
1761 if (!deletePointDialog->deleteAllCheckBox->isChecked()) {
1762 QString message =
"You have selected all measures in this point to be deleted. This "
1763 "control point will be deleted. Do you want to delete this control point?";
1764 int response = QMessageBox::question(m_matchTool,
1765 "Delete control point", message,
1766 QMessageBox::Yes | QMessageBox::No,
1769 if (response == QMessageBox::No) {
1774 m_matchTool->setVisible(
false);
1777 QMessageBox::information(m_matchTool,
"EditLocked Point",
1778 "This point is EditLocked and cannot be deleted.");
1781 if (m_editPoint != NULL && m_editPoint->Parent() == NULL) {
1790 int lockedMeasures = 0;
1791 for (
int i=0; i<deletePointDialog->fileList->count(); i++) {
1792 QListWidgetItem *item = deletePointDialog->fileList->item(i);
1793 if (!item->isSelected())
continue;
1796 if (m_editPoint->IsReferenceExplicit() &&
1797 (m_editPoint->GetRefMeasure()->GetCubeSerialNumber() ==
1798 (*m_editPoint)[i]->GetCubeSerialNumber())) {
1799 QString message =
"You are trying to delete the Reference measure."
1800 " Do you really want to delete the Reference measure?";
1801 switch (QMessageBox::question(m_matchTool,
1802 "Delete Reference measure?", message,
1803 "&Yes",
"&No", 0, 0)) {
1811 if (numDeleted == 1) {
1818 if (m_editPoint->Delete(i) == ControlMeasure::MeasureLocked) {
1823 if (lockedMeasures > 0) {
1824 QMessageBox::information(m_matchTool,
"EditLocked Measures",
1825 QString::number(lockedMeasures) +
" / "
1827 deletePointDialog->fileList->selectedItems().size()) +
1828 " measures are EditLocked and were not deleted.");
1831 if (mCubes.size() == 0) {
1833 m_matchTool->setVisible(
true);
1834 m_matchTool->raise();
1837 m_pointEditor->templateFileName());
1842 ControlPoint *p = m_controlNet->GetPoint(QString(m_editPoint->GetId()));
1845 if (m_editPoint != NULL && m_editPoint->Parent() == NULL) {
1854 m_netChanged =
true;
1859 emit editPointChanged();
1876 if (point->GetNumMeasures() == 0) {
1877 QString message =
"This point has no measures.";
1878 QMessageBox::warning(m_matchTool,
"Warning", message);
1879 emit editPointChanged();
1885 if (mCubes.size() > 0) {
1886 QString msgTitle =
"Missing Cubes";
1887 QString message =
"This point is missing cubes and cannot be loaded into the editor. Open ";
1888 message +=
"the cubes for the following measures before selecting this point.\n\n";
1889 for (
int i=0; i<mCubes.size(); i++) {
1890 message += mCubes.at(i) +
"\n";
1892 QMessageBox msgBox(QMessageBox::Critical, msgTitle, message, QMessageBox::NoButton, m_matchTool,
1900 if (m_editPoint != NULL && m_editPoint->Parent() == NULL) {
1905 *m_editPoint = *point;
1908 m_matchTool->setVisible(
true);
1909 m_matchTool->raise();
1911 m_pointEditor->templateFileName());
1914 emit editPointChanged();
1917 m_savePoint->setPalette(m_saveDefaultPalette);
1942 QString CPId = m_editPoint->GetId();
1943 QString ptId(
"Point ID: ");
1944 ptId += (QString) CPId;
1945 m_ptIdValue->setText(ptId);
1948 QString ptsize =
"Number of Measures: " +
1949 QString::number(m_editPoint->GetNumMeasures());
1950 m_numMeasures->setText(ptsize);
1953 m_lockPoint->setChecked(m_editPoint->IsEditLocked());
1956 m_ignorePoint->setChecked(m_editPoint->IsIgnored());
1959 m_leftCombo->clear();
1960 m_rightCombo->clear();
1961 m_pointFiles.clear();
1964 for (
int i=0; i<m_editPoint->GetNumMeasures(); i++) {
1969 m_leftCombo->addItem(tempFileName);
1970 m_rightCombo->addItem(tempFileName);
1971 if (m_editPoint->IsReferenceExplicit() &&
1973 m_leftCombo->setItemData(i,QFont(
"DejaVu Sans", 12, QFont::Bold), Qt::FontRole);
1974 m_rightCombo->setItemData(i,QFont(
"DejaVu Sans", 12, QFont::Bold), Qt::FontRole);
1989 if (m_editPoint->IsReferenceExplicit()) {
1990 leftIndex = m_editPoint->IndexOfRefMeasure();
1993 if (!m_leftFile.isEmpty()) {
1994 leftIndex = m_leftCombo->findText(
FileName(m_leftFile).name());
1996 if (leftIndex < 0 ) leftIndex = 0;
2001 if (leftIndex == 0) {
2010 if (rightIndex > m_editPoint->GetNumMeasures()-1) rightIndex = 0;
2011 m_rightCombo->setCurrentIndex(rightIndex);
2012 m_leftCombo->setCurrentIndex(leftIndex);
2030 if (m_measureWindow == NULL) {
2032 m_measureTable =
new QTableWidget();
2033 m_measureTable->setMinimumWidth(1600);
2034 m_measureTable->setAlternatingRowColors(
true);
2035 m_measureWindow->setCentralWidget(m_measureTable);
2038 m_measureTable->clear();
2039 m_measureTable->setSortingEnabled(
false);
2041 m_measureTable->setRowCount(m_editPoint->GetNumMeasures());
2042 m_measureTable->setColumnCount(NUMCOLUMNS);
2045 for (
int i=0; i<NUMCOLUMNS; i++) {
2046 labels<<measureColumnToString((MeasureColumns)i);
2048 m_measureTable->setHorizontalHeaderLabels(labels);
2051 for (
int row=0; row<m_editPoint->GetNumMeasures(); row++) {
2056 QTableWidgetItem *tableItem =
new QTableWidgetItem(QString(file));
2057 m_measureTable->setItem(row,column++,tableItem);
2060 m_measureTable->setItem(row,column++,tableItem);
2062 tableItem =
new QTableWidgetItem();
2063 tableItem->setData(0,m.GetSample());
2064 m_measureTable->setItem(row,column++,tableItem);
2066 tableItem =
new QTableWidgetItem();
2067 tableItem->setData(0,m.GetLine());
2068 m_measureTable->setItem(row,column++,tableItem);
2070 if (m.GetAprioriSample() ==
Null) {
2071 tableItem =
new QTableWidgetItem(
"Null");
2074 tableItem =
new QTableWidgetItem();
2075 tableItem->setData(0,m.GetAprioriSample());
2077 m_measureTable->setItem(row,column++,tableItem);
2079 if (m.GetAprioriLine() ==
Null) {
2080 tableItem =
new QTableWidgetItem(
"Null");
2083 tableItem =
new QTableWidgetItem();
2084 tableItem->setData(0,m.GetAprioriLine());
2086 m_measureTable->setItem(row,column++,tableItem);
2088 if (m.GetSampleResidual() ==
Null) {
2089 tableItem =
new QTableWidgetItem(QString(
"Null"));
2092 tableItem =
new QTableWidgetItem();
2093 tableItem->setData(0,m.GetSampleResidual());
2095 m_measureTable->setItem(row,column++,tableItem);
2097 if (m.GetLineResidual() ==
Null) {
2098 tableItem =
new QTableWidgetItem(QString(
"Null"));
2101 tableItem =
new QTableWidgetItem();
2102 tableItem->setData(0,m.GetLineResidual());
2104 m_measureTable->setItem(row,column++,tableItem);
2107 tableItem =
new QTableWidgetItem(QString(
"Null"));
2110 tableItem =
new QTableWidgetItem();
2113 m_measureTable->setItem(row,column++,tableItem);
2115 double sampleShift = m.GetSampleShift();
2116 if (sampleShift ==
Null) {
2117 tableItem =
new QTableWidgetItem(QString(
"Null"));
2120 tableItem =
new QTableWidgetItem();
2121 tableItem->setData(0,sampleShift);
2123 m_measureTable->setItem(row,column++,tableItem);
2125 double lineShift = m.GetLineShift();
2126 if (lineShift ==
Null) {
2127 tableItem =
new QTableWidgetItem(QString(
"Null"));
2130 tableItem =
new QTableWidgetItem();
2131 tableItem->setData(0,lineShift);
2133 m_measureTable->setItem(row,column++,tableItem);
2135 double pixelShift = m.GetPixelShift();
2136 if (pixelShift ==
Null) {
2137 tableItem =
new QTableWidgetItem(QString(
"Null"));
2140 tableItem =
new QTableWidgetItem();
2141 tableItem->setData(0,pixelShift);
2143 m_measureTable->setItem(row,column++,tableItem);
2145 double goodnessOfFit = m.GetLogData(
2147 if (goodnessOfFit ==
Null) {
2148 tableItem =
new QTableWidgetItem(QString(
"Null"));
2151 tableItem =
new QTableWidgetItem();
2152 tableItem->setData(0,goodnessOfFit);
2154 m_measureTable->setItem(row,column++,tableItem);
2156 if (m.IsIgnored()) tableItem =
new QTableWidgetItem(
"True");
2157 if (!m.IsIgnored()) tableItem =
new QTableWidgetItem(
"False");
2158 m_measureTable->setItem(row,column++,tableItem);
2161 tableItem =
new QTableWidgetItem(
"True");
2163 tableItem =
new QTableWidgetItem(
"False");
2164 m_measureTable->setItem(row,column++,tableItem);
2166 tableItem =
new QTableWidgetItem(
2168 m_measureTable->setItem(row,column,tableItem);
2171 if (m_editPoint->IsReferenceExplicit() &&
2176 for (
int col=0; col<m_measureTable->columnCount(); col++)
2177 m_measureTable->item(row, col)->setFont(font);
2182 m_measureTable->resizeColumnsToContents();
2183 m_measureTable->resizeRowsToContents();
2184 m_measureTable->setSortingEnabled(
true);
2185 m_measureWindow->show();
2190 QString MatchTool::measureColumnToString(MatchTool::MeasureColumns column) {
2200 case SAMPLERESIDUAL:
2201 return "Sample Residual";
2203 return "Line Residual";
2204 case RESIDUALMAGNITUDE:
2205 return "Residual Magnitude";
2207 return "Sample Shift";
2209 return "Line Shift";
2211 return "Pixel Shift";
2213 return "Goodness of Fit";
2219 return "Measure Type";
2221 return "Apriori Sample";
2223 return "Apriori Line";
2226 "Invalid measure column passed to measureColumnToString", _FILEINFO_);
2241 int curIndex = m_rightCombo->currentIndex();
2242 if (curIndex < m_rightCombo->count() - 1) {
2244 m_rightCombo->setCurrentIndex(curIndex + 1);
2260 int curIndex = m_rightCombo->currentIndex();
2263 m_rightCombo->setCurrentIndex(curIndex - 1);
2284 QString file = m_pointFiles[index];
2291 QString message =
"Make sure the correct cube is opened.\n\n";
2293 QMessageBox::critical(m_matchTool,
"Error", message);
2298 int i = m_leftCombo->findText(
FileName(file).name());
2300 m_leftCombo->setCurrentIndex(i);
2306 if (m_leftMeasure != NULL) {
2307 delete m_leftMeasure;
2308 m_leftMeasure = NULL;
2312 *m_leftMeasure = *((*m_editPoint)[serial]);
2315 if (m_leftCube != NULL)
delete m_leftCube;
2316 m_leftCube =
new Cube();
2317 m_leftCube->open(file);
2320 m_pointEditor->setLeftMeasure (m_leftMeasure, m_leftCube,
2321 m_editPoint->GetId());
2340 QString file = m_pointFiles[index];
2347 QString message =
"Make sure the correct cube is opened.\n\n";
2349 QMessageBox::critical(m_matchTool,
"Error", message);
2354 int i = m_rightCombo->findText(
FileName(file).name());
2356 m_rightCombo->setCurrentIndex(i);
2362 if (m_rightMeasure != NULL) {
2363 delete m_rightMeasure;
2364 m_rightMeasure = NULL;
2368 *m_rightMeasure = *((*m_editPoint)[serial]);
2371 if (m_rightCube != NULL)
delete m_rightCube;
2372 m_rightCube =
new Cube();
2373 m_rightCube->open(file);
2376 m_pointEditor->setRightMeasure (m_rightMeasure,m_rightCube,
2377 m_editPoint->GetId());
2404 m_leftMeasure->GetCubeSerialNumber()));
2406 m_ignoreLeftMeasure->setChecked(m_leftMeasure->IsIgnored());
2408 QString s =
"Reference: ";
2409 if (m_editPoint->IsReferenceExplicit() &&
2410 (QString(m_leftMeasure->GetCubeSerialNumber()) == m_editPoint->GetReferenceSN())) {
2416 m_leftReference->setText(s);
2418 s =
"Measure Type: ";
2423 m_leftMeasureType->setText(s);
2425 if (m_leftMeasure->GetSampleShift() ==
Null) {
2426 s =
"Sample Shift: Null";
2429 s =
"Sample Shift: " + QString::number(m_leftMeasure->GetSampleShift());
2431 m_leftSampShift->setText(s);
2433 if (m_leftMeasure->GetLineShift() ==
Null) {
2434 s =
"Line Shift: Null";
2437 s =
"Line Shift: " + QString::number(m_leftMeasure->GetLineShift());
2439 m_leftLineShift->setText(s);
2441 double goodnessOfFit = m_leftMeasure->GetLogData(
2443 if (goodnessOfFit ==
Null) {
2444 s =
"Goodness of Fit: Null";
2447 s =
"Goodness of Fit: " + QString::number(goodnessOfFit);
2449 m_leftGoodness->setText(s);
2477 m_rightMeasure->GetCubeSerialNumber()));
2479 m_ignoreRightMeasure->setChecked(m_rightMeasure->IsIgnored());
2481 QString s =
"Reference: ";
2482 if (m_editPoint->IsReferenceExplicit() &&
2483 (QString(m_rightMeasure->GetCubeSerialNumber()) == m_editPoint->GetReferenceSN())) {
2490 m_rightReference->setText(s);
2492 s =
"Measure Type: ";
2497 m_rightMeasureType->setText(s);
2499 if (m_rightMeasure->GetSampleShift() ==
Null) {
2500 s =
"Sample Shift: Null";
2503 s =
"Sample Shift: " + QString::number(m_rightMeasure->GetSampleShift());
2505 m_rightSampShift->setText(s);
2507 if (m_rightMeasure->GetLineShift() ==
Null) {
2508 s =
"Line Shift: Null";
2511 s =
"Line Shift: " + QString::number(m_rightMeasure->GetLineShift());
2513 m_rightLineShift->setText(s);
2515 double goodnessOfFit = m_rightMeasure->GetLogData(
2517 if (goodnessOfFit ==
Null) {
2518 s =
"Goodness of Fit: Null";
2521 s =
"Goodness of Fit: " + QString::number(goodnessOfFit);
2523 m_rightGoodness->setText(s);
2540 if(e->type() != QEvent::Leave)
return false;
2541 if(o == m_leftCombo->view()) {
2543 m_leftCombo->hidePopup();
2545 if (o == m_rightCombo->view()) {
2547 m_rightCombo->hidePopup();
2587 mvp->viewport()->update();
2616 if ( (m_controlNet == NULL || m_controlNet->GetNumPoints() == 0) && m_newPoint == NULL &&
2617 m_editPoint == NULL)
2620 QString sn = serialNumber(mvp);
2624 if (m_newPoint != NULL) {
2626 if (m_newPoint->HasSerialNumber(sn)) {
2628 double samp = (*m_newPoint)[sn]->GetSample();
2629 double line = (*m_newPoint)[sn]->GetLine();
2633 QBrush brush(Qt::red);
2637 painter->setPen(pen);
2638 painter->drawLine(x - 5, y, x + 5, y);
2639 painter->drawLine(x, y - 5, x, y + 5);
2644 if (!m_controlNet->GetCubeSerials().contains(
2652 m_controlNet->GetMeasuresInCube(sn);
2654 for (
int i = 0; i < measures.count(); i++) {
2657 double samp = m->GetSample();
2658 double line = m->GetLine();
2662 if (m->Parent()->IsIgnored()) {
2663 painter->setPen(QColor(255, 255, 0));
2666 else if (m->IsIgnored()) {
2667 painter->setPen(QColor(255, 255, 0));
2670 painter->setPen(Qt::green);
2673 painter->drawLine(x - 5, y, x + 5, y);
2674 painter->drawLine(x, y - 5, x, y + 5);
2677 if (m_editPoint != NULL && m_newPoint == NULL) {
2679 if (m_editPoint->HasSerialNumber(sn)) {
2681 double samp = (*m_editPoint)[sn]->GetSample();
2682 double line = (*m_editPoint)[sn]->GetLine();
2686 QBrush brush(Qt::red);
2690 painter->setPen(pen);
2691 painter->drawLine(x - 5, y, x + 5, y);
2692 painter->drawLine(x, y - 5, x, y + 5);
2714 if (m_templateModified) {
2715 int r = QMessageBox::warning(m_matchTool, tr(
"OK to continue?"),
2716 tr(
"The currently opened registration template has been modified.\n"
2718 QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel,
2721 if (r == QMessageBox::Yes)
2723 else if (r == QMessageBox::Cancel)
2742 QString filename = QFileDialog::getOpenFileName(m_matchTool,
2743 "Select a registration template",
".",
2744 "Registration template files (*.def *.pvl);;All files (*)");
2746 if (filename.isEmpty())
2749 if (m_pointEditor->setTemplateFile(filename)) {
2763 QFile file(
FileName((QString) fn).expanded());
2764 if (!file.open(QIODevice::ReadOnly)) {
2765 QString msg =
"Failed to open template file \"" + fn +
"\"";
2766 QMessageBox::warning(m_matchTool,
"IO Error", msg);
2770 QTextStream stream(&file);
2771 m_templateEditor->setText(stream.readAll());
2774 QScrollBar * sb = m_templateEditor->verticalScrollBar();
2775 sb->setValue(sb->minimum());
2777 m_templateModified =
false;
2778 m_saveTemplateFile->setEnabled(
false);
2779 m_templateFileNameLabel->setText(
"Template File: " + fn);
2786 m_templateModified =
true;
2787 m_saveTemplateFile->setEnabled(
true);
2795 if (!m_templateModified)
2799 m_pointEditor->templateFileName();
2809 QString filename = QFileDialog::getSaveFileName(m_matchTool,
2810 "Save registration template",
".",
2811 "Registration template files (*.def *.pvl);;All files (*)");
2813 if (filename.isEmpty())
2828 QString contents = m_templateEditor->toPlainText();
2839 QMessageBox::warning(m_matchTool,
"Error", message);
2843 QString expandedFileName(
2844 FileName((QString) fn).expanded());
2846 QFile file(expandedFileName);
2848 if (!file.open(QIODevice::WriteOnly | QIODevice::Truncate)) {
2849 QString msg =
"Failed to save template file to \"" + fn +
"\"\nDo you "
2851 QMessageBox::warning(m_matchTool,
"IO Error", msg);
2856 QTextStream stream(&file);
2860 if (m_pointEditor->setTemplateFile(fn)) {
2861 m_templateModified =
false;
2862 m_saveTemplateFile->setEnabled(
false);
2863 m_templateFileNameLabel->setText(
"Template File: " + fn);
2885 Pvl templatePvl(m_pointEditor->templateFileName());
2889 registrationDialog.setWindowTitle(
"View or Edit Template File: "
2891 registrationDialog.resize(550,360);
2892 registrationDialog.exec();
2896 QMessageBox::information(m_matchTool,
"Error", message);
2909 m_pointEditor->saveChips();
2914 void MatchTool::showHideTemplateEditor() {
2916 if (!m_templateEditorWidget)
2919 m_templateEditorWidget->setVisible(!m_templateEditorWidget->isVisible());
2937 if (m_editPoint == NULL)
return;
2938 if (pointId != m_editPoint->GetId())
return;
2943 ControlPoint *updatedPoint = m_controlNet->GetPoint(pointId);
2944 m_editPoint->
SetEditLock(updatedPoint->IsEditLocked());
2945 m_editPoint->SetIgnored(updatedPoint->IsIgnored());
2948 m_lockPoint->setChecked(m_editPoint->IsEditLocked());
2951 m_ignorePoint->setChecked(m_editPoint->IsIgnored());
2976 if (m_editPoint != NULL) {
2978 QString
id = m_ptIdValue->text().remove(
"Point ID: ");
2979 m_controlNet->GetPoint(
id);
2984 emit editPointChanged();
3002 QColor qc = Qt::red;
3003 QPalette p = m_savePoint->palette();
3004 p.setColor(QPalette::ButtonText,qc);
3005 m_savePoint->setPalette(p);
3025 if (m_editPoint == NULL)
return false;
3028 if (m_editPoint->IsEditLocked() && m_editPoint->IsReferenceExplicit() &&
3029 (m_editPoint->GetReferenceSN() == serialNumber)) {
3034 return m_editPoint->GetMeasure(serialNumber)->IsEditLocked();
3047 FileName config(
"$HOME/.Isis/qview/MatchTool.config");
3048 QSettings settings(config.
expanded(),
3049 QSettings::NativeFormat);
3050 QPoint pos = settings.value(
"pos", QPoint(300, 100)).toPoint();
3051 QSize size = settings.value(
"size", QSize(900, 500)).toSize();
3052 m_matchTool->resize(size);
3053 m_matchTool->move(pos);
3066 if (!m_matchTool->isVisible())
return;
3067 FileName config(
"$HOME/.Isis/qview/MatchTool.config");
3068 QSettings settings(config.
expanded(),
3069 QSettings::NativeFormat);
3070 settings.setValue(
"pos", m_matchTool->pos());
3071 settings.setValue(
"size", m_matchTool->size());
3076 void MatchTool::enterWhatsThisMode() {
3077 QWhatsThis::enterWhatsThisMode();
3081 void MatchTool::clearEditPoint() {
3087 void MatchTool::showHelp() {
3089 QDialog *helpDialog =
new QDialog(m_matchTool);
3090 helpDialog->setWindowTitle(
"Match Tool Help");
3092 QVBoxLayout *mainLayout =
new QVBoxLayout;
3093 helpDialog->setLayout(mainLayout);
3095 QLabel *matchTitle =
new QLabel(
"<h2>Match Tool</h2>");
3096 mainLayout->addWidget(matchTitle);
3098 QLabel *matchSubtitle =
new QLabel(
"A tool for interactively measuring and editing sample/line "
3099 "registration points between cubes. These "
3100 "points contain sample, line postions only, no latitude or "
3101 "longitude values are used or recorded.");
3102 matchSubtitle->setWordWrap(
true);
3103 mainLayout->addWidget(matchSubtitle);
3105 QTabWidget *tabArea =
new QTabWidget;
3106 tabArea->setDocumentMode(
true);
3107 mainLayout->addWidget(tabArea);
3110 QScrollArea *overviewTab =
new QScrollArea;
3111 overviewTab->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
3112 overviewTab->setWidgetResizable(
true);
3113 QWidget *overviewContainer =
new QWidget;
3114 QVBoxLayout *overviewLayout =
new QVBoxLayout;
3115 overviewContainer->setLayout(overviewLayout);
3117 QLabel *purposeTitle =
new QLabel(
"<h2>Purpose</h2>");
3118 overviewLayout->addWidget(purposeTitle);
3120 QLabel *purposeText =
new QLabel(
"<p>This tool is for recording and editing registration "
3121 "points measured between cubes displayed in the <i>qview</i> main window.</p> <p>The "
3122 "recorded registration points are sample and line pixel coordinates only. Therefore, this "
3123 "tool can be used on any images including ones that do not contain a camera model "
3124 "(i.e, The existence of the Isis Instrument Group on the image labels is not required). "
3125 "This also means that the tool differs from the <i>qnet</i> control point network "
3126 "application in that no latitude or longitude values are ever used or recorded "
3127 "(regardless if the image has a camera model in Isis).</p>"
3128 "<p>The output control point network that this tool generates is primarily used 1) as "
3129 "input for an image-wide sample/line translation to register one image to another by "
3130 "'moving' pixel locations - refer to the documentation for applications such as "
3131 "<i>translate</i> and <i>warp</i>, or 2) to export the file and use the recorded "
3132 "measurements in other spreadsheet or plotting packages to visualize magnitude "
3133 "and direction of varying translations of the images relative to one another.</p> "
3134 "<p>An automated version of this match tool is the <i>coreg</i> application. This tool "
3135 "can be used to visually evaluate and edit the control point network created by "
3136 "<i>coreg</i>.</p> "
3137 "<p>The format of the output point network file is binary. This tool uses the Isis control "
3138 " network framework to create, co-register and save all control points and pixel "
3139 "measurements. The application <i>cnetbin2pvl</i> can be used to convert from binary to "
3140 "a readable PVL format."
3141 "<p>The Mouse Button functions are: (same as <i>qnet</i>)<ul><li>Modify Point=Left</li> "
3142 "<li>Delete Point=Middle</li><li>Create New Point=Right</li></ul></p>"
3143 "<p>Control Points are drawn on the associated displayed cubes with the following colors: "
3144 "Green=Valid registration point; Yellow=Ignored point; Red=Active point being edited");
3145 purposeText->setWordWrap(
true);
3146 overviewLayout->addWidget(purposeText);
3148 overviewTab->setWidget(overviewContainer);
3151 QScrollArea *quickTab =
new QScrollArea;
3152 quickTab->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
3153 quickTab->setWidgetResizable(
true);
3154 QWidget *quickContainer =
new QWidget;
3155 QVBoxLayout *quickLayout =
new QVBoxLayout;
3156 quickContainer->setLayout(quickLayout);
3158 QLabel *quickTitle =
new QLabel(
"<h2>Quick Start</h2>");
3159 quickLayout->addWidget(quickTitle);
3161 QLabel *quickSubTitle =
new QLabel(
"<h3>Preparation:</h3>");
3162 quickLayout->addWidget(quickSubTitle);
3164 QLabel *quickPrep =
new QLabel(
"<p><ul>"
3165 "<li>Open the cubes with overlapping areas for choosing control points</li>"
3166 "<li>Choose the match tool <img src=\"" +
toolIconDir() +
3167 "/stock_draw-connector-with-arrows.png\" width=22 height=22> "
3168 "from the toolpad on the right side of the <i>qview</i> main window</li>");
3169 quickPrep->setWordWrap(
true);
3170 quickLayout->addWidget(quickPrep);
3172 QLabel *morePrep =
new QLabel(
"<p>Once the Match tool is activated the tool bar at the top "
3173 "of the main window contains file action buttons and a help button:");
3174 morePrep->setWordWrap(
true);
3175 quickLayout->addWidget(morePrep);
3177 QLabel *fileButtons =
new QLabel(
"<p><ul>"
3178 "<li><img src=\"" +
toolIconDir() +
"/fileopen.png\" width=22 height=22> Open an existing "
3179 "control network <b>Note:</b> If you do not open an existing network, a new one will "
3181 "<li><img src=\"" +
toolIconDir() +
"/mActionFileSaveAs.png\" width=22 height=22> Save "
3182 "control network as ...</li>"
3183 "<li><img src=\"" +
toolIconDir() +
"/mActionFileSave.png\" width=22 height=22> Save "
3184 "control network to current file</li>"
3185 "<li><img src=\"" +
toolIconDir() +
"/help-contents.png\" width=22 height=22> Show Help "
3187 fileButtons->setWordWrap(
true);
3188 quickLayout->addWidget(fileButtons);
3190 QLabel *quickFunctionTitle =
new QLabel(
"<h3>Cube Viewport Functions:</h3>");
3191 quickLayout->addWidget(quickFunctionTitle);
3193 QLabel *quickFunction =
new QLabel(
3194 "The match tool window will be shown once "
3195 "you click in a cube viewport window using one of the following "
3196 "mouse functions. <b>Note:</b> Existing control points are drawn on the cube viewports");
3197 quickFunction->setWordWrap(
true);
3198 quickLayout->addWidget(quickFunction);
3200 QLabel *quickDesc =
new QLabel(
"<p><ul>"
3201 "<li>Left Click - Modify the control point closest to the click <b>Note:</b> "
3202 "All cubes in the control point must be displayed before loading the point</li>"
3203 "<li>Middle Click - Delete the control point closest to the click</li>"
3204 "<li>Right Click - Create a new control point at the click location</li></ul></p>");
3205 quickDesc->setWordWrap(
true);
3206 quickDesc->setOpenExternalLinks(
true);
3207 quickLayout->addWidget(quickDesc);
3209 quickTab->setWidget(quickContainer);
3212 QScrollArea *controlPointTab =
new QScrollArea;
3213 controlPointTab->setWidgetResizable(
true);
3214 controlPointTab->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
3215 QWidget *controlPointContainer =
new QWidget;
3216 QVBoxLayout *controlPointLayout =
new QVBoxLayout;
3217 controlPointContainer->setLayout(controlPointLayout);
3219 QLabel *controlPointTitle =
new QLabel(
"<h2>Control Point Editing</h2>");
3220 controlPointLayout->addWidget(controlPointTitle);
3222 QLabel *mouseLabel =
new QLabel(
"<p><h3>When the \"Match\" tool "
3223 "is activated, the mouse buttons have the following function in the "
3224 "cube viewports of the main qview window:</h3>");
3225 mouseLabel->setWordWrap(
true);
3226 mouseLabel->setScaledContents(
true);
3227 controlPointLayout->addWidget(mouseLabel);
3229 QLabel *controlPointDesc =
new QLabel(
"<ul>"
3230 "<li>Left click - Edit the closest control point <b>Note:</b> "
3231 "All cubes in the control point must be displayed before loading the point</li>"
3232 "<li>Middle click - Delete the closest control point</li>"
3233 "<li>Right click - Create new control point at cursor location. This will bring up a new "
3234 "point dialog which allows you to enter a point id and will list all cube viewports, "
3235 "highlighting cubes where the point has been chosen by clicking on the cube's viewport. "
3236 "When the desired cubes have been chosen, select the \"Done\" button which will load the "
3237 "control point into the control point editor window which will allow the control measure "
3238 "positions to be refined.</li>");
3239 controlPointDesc->setWordWrap(
true);
3240 controlPointLayout->addWidget(controlPointDesc);
3242 QLabel *controlPointEditing =
new QLabel(
3243 "<h4>Changing Control Measure Locations</h4>"
3244 "<p>Both the left and right control measure positions can be adjusted by:"
3246 "<li>Move the cursor location under the crosshair by clicking the left mouse "
3248 "<li>Move 1 pixel at a time by using arrow keys on the keyboard</li>"
3249 "<li>Move 1 pixel at a time by using arrow buttons above the right and left views</li>"
3251 "<h4>Other Point Editor Functions</h4>"
3252 "<p>Along the right border of the window:</p>"
3254 "<li><strong>Link Zoom</strong> This will link the two small viewports together when "
3255 "zooming (ie. If this is checked, if the left view is zoomed, the right view will "
3256 "match the left view's zoom factor. "
3257 "<b>Note:</b> Zooming is controlled from the left view.</li>"
3258 "<li><strong>No Rotate:</strong> Turn off the rotation and bring right view back to "
3259 "its original orientation</li>"
3260 "<li><strong>Rotate:</strong> Rotate the right view using either the dial "
3261 "or entering degrees </li>"
3262 "<li><strong>Show control points:</strong> Draw crosshairs at all control "
3263 "point locations visible within the view</li>"
3264 "<li><strong>Show crosshair:</strong> Show a red crosshair across the entire "
3266 "<li><strong>Circle:</strong> Draw circle which may help center measure "
3267 "on a crater</li></ul"
3268 "<p>Below the left view:</p>"
3269 "<ul><li><strong>Blink controls:</strong> Blink the left and right view in the "
3270 "left view window using the \"Blink Start\" button <img src=\"" +
toolIconDir() +
3271 "/blinkStart.png\" width=22 height=22> and \"Blink Stop\" button <img src=\"" +
3272 toolIconDir() +
"/blinkStop.png\" width=22 height=22>. The arrow keys above the left "
3273 "and right views and the keyboard arrow keys may be used to move the both views while "
3275 "<li><strong>Register:</strong> Sub-pixel register the right view to "
3276 "the left view. A default registration template is used for setting parameters "
3277 "passed to the sub-pixel registration tool. The user may load in a predefined "
3278 "template or edit the current loaded template to influence successful "
3279 "co-registration results. For more information regarding the pattern matching "
3280 "functionlity or how to create a parameter template, refer to the Isis PatternMatch "
3281 "document and the <i>autoregtemplate</i> application. <strong>Shortcut: R.</strong>"
3283 "<li><strong>Save Measures:</strong> Save the two control measures using the sample, "
3284 "line positions under the crosshairs. <strong>Shortcut: M.</strong></li>"
3285 "<li><strong>Save Point:</strong> Save the control point to the control network. "
3286 "<strong>Shortcut: P.</strong></li>"
3288 controlPointEditing->setWordWrap(
true);
3289 controlPointLayout->addWidget(controlPointEditing);
3291 controlPointTab->setWidget(controlPointContainer);
3294 QScrollArea *coregTab =
new QScrollArea;
3295 coregTab->setWidgetResizable(
true);
3296 coregTab->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
3297 QWidget *coregContainer =
new QWidget;
3298 QVBoxLayout *coregLayout =
new QVBoxLayout;
3299 coregContainer->setLayout(coregLayout);
3301 QLabel *coregTitle =
new QLabel(
"<h2>Coreg Guidance</h2>");
3302 coregLayout->addWidget(coregTitle);
3304 QLabel *coregDesc =
new QLabel(
"<p>When opening control networks created by <i>coreg</i>, "
3305 "there are some things to keep in mind. First, all control points must have the same "
3306 "reference measure (this is the image filename passed to the <i>coreg</i> 'match' parameter)."
3307 "<p>In order to retain the integrity of the input <i>coreg</i> network, you cannot change "
3308 "which image is the reference measure on any of the existing points. "
3309 "<p>When creating a new control point to add to the <i>coreg</i> network, this tool will "
3310 "automatically set the reference measure to the same image as the other control points in "
3311 "the network as long as the reference image was one of the images selected with "
3312 "the right mouse button from the new point dialog. If this image was not selected when "
3313 "creating a new point, it "
3314 "does not contain a required measurement, therefore, you will get an error and the new "
3315 "point will not be created.</p> <p>The reference measure is always loaded on the left side "
3316 "of the control point editor. If you load a measure that is not the reference measure "
3317 "on the left side and try to save the point, you will receive an error message. You will "
3318 "need to move the reference measure back to the left side before saving the control point."
3319 "</p><p><b>Note:</b> This error checking will not happen on control networks created by "
3320 "<i>coreg</i> prior to Isis3.4.2. For older <i>coreg</i> control networks the user must be "
3321 "aware and make sure the correct image is set to the same <i>coreg</i> reference measure.");
3322 coregDesc->setWordWrap(
true);
3323 coregDesc->setScaledContents(
true);
3324 coregLayout->addWidget(coregDesc);
3326 coregTab->setWidget(coregContainer);
3328 tabArea->addTab(overviewTab,
"&Overview");
3329 tabArea->addTab(quickTab,
"&Quick Start");
3330 tabArea->addTab(controlPointTab,
"&Control Point Editing");
3331 tabArea->addTab(coregTab,
"&Coreg Guidance");
3333 QHBoxLayout *buttonsLayout =
new QHBoxLayout;
3335 buttonsLayout->addStretch();
3337 QPushButton *closeButton =
new QPushButton(
"&Close");
3338 closeButton->setIcon(QPixmap(
toolIconDir() +
"/guiStop.png"));
3339 closeButton->setDefault(
true);
3340 connect(closeButton, SIGNAL(clicked()),
3341 helpDialog, SLOT(close()));
3342 buttonsLayout->addWidget(closeButton);
3344 mainLayout->addLayout(buttonsLayout);
3363 if ( m_controlNet->GetNumPoints() == 0 ||
3364 !m_controlNet->ContainsPoint(m_editPoint->GetId())) {
3365 QString message =
"\n\nDo you want to save the point in the editor?";
3366 int response = QMessageBox::question(m_matchTool,
"Save point in editor", message,
3367 QMessageBox::Yes | QMessageBox::No,
3369 if (response == QMessageBox::Yes) {
3375 if (m_controlNet && m_controlNet->GetNumPoints() != 0 && m_netChanged) {
3376 QString message =
"The currently open control net has changed. Do you want to save?";
3377 int response = QMessageBox::question(m_matchTool,
"Save current control net?",
3379 QMessageBox::Yes | QMessageBox::No,
3382 if (response == QMessageBox::Yes) {
static QString UserName()
Returns the user name.
bool IsEditLocked() const
Return value for p_editLock or implicit lock on reference measure.
Status SetCubeSerialNumber(QString newSerialNumber)
Set cube serial number.
static QString MeasureTypeToString(MeasureType type)
Return the String Control Measure type.
Status SetCoordinate(double sample, double line)
Set the coordinate of the measurement.
QString GetCubeSerialNumber() const
Return the serial number of the cube containing the coordinate.
@ Manual
Hand Measured (e.g., qnet)
@ Candidate
(e.g., autoseed, interest) AKA predicted, unmeasured, unverified
@ RegisteredSubPixel
Registered to sub-pixel (e.g., pointreg)
@ RegisteredPixel
Registered to whole pixel (e.g.,pointreg)
Status SetType(MeasureType type)
Set how the coordinate was obtained.
Status SetDateTime()
Date Time - Creation Time.
Status SetChooserName()
Set chooser name to a user who last changed the coordinate.
double GetResidualMagnitude() const
Return Residual magnitude.
@ GoodnessOfFit
GoodnessOfFit is pointreg information for reference measures.
double GetNumericalValue() const
Get the value associated with this log data.
Status
This is a return status for many of the mutating (setter) method calls.
@ PointLocked
This is returned when the operation requires Edit Lock to be false but it is currently true.
Status SetEditLock(bool editLock)
Set the EditLock state.
int Delete(ControlMeasure *measure)
Remove a measurement from the control point, deleting reference measure is allowed.
void Add(ControlMeasure *measure)
Add a measurement to the control point, taking ownership of the measure in the process.
@ Free
A Free point is a Control Point that identifies common measurements between two or more cubes.
const ControlMeasure * GetMeasure(QString serialNumber) const
Get a control measure based on its cube's serial number.
QString GetId() const
Return the Id of the control point.
bool HasSerialNumber(QString serialNumber) const
Return true if given serial number exists in point.
IO Handler for Isis Cubes.
virtual QString fileName() const
Returns the opened cube's filename.
Widget to display Isis cubes for qt apps.
void viewportToCube(int x, int y, double &sample, double &line) const
Turns a viewport into a cube.
void cubeToViewport(double sample, double line, int &x, int &y) const
Turns a cube into a viewport.
File name manipulation and expansion.
QString name() const
Returns the name of the file excluding the path and the attributes in the file name.
QString expanded() const
Returns a QString of the full file name including the file path, excluding the attributes.
@ Programmer
This error is for when a programmer made an API call that was illegal.
const char * what() const
Returns a string representation of this exception in its current state.
QString toString() const
Returns a string representation of this exception.
Cube display widget for certain Isis MDI applications.
QString fileName() const
Returns the filename used to initialise the Pvl object.
PvlEditDialog creates a QDialog window in which a QTextEdit box displays the contents of a pvl file.
Container for cube-like labels.
static QString Compose(Pvl &label, bool def2filename=false)
Compose a SerialNumber from a PVL.
Serial Number list generator.
bool hasSerialNumber(QString sn)
Determines whether or not the requested serial number exists in the list.
void remove(const QString &sn)
Remove the specified serial number from the list.
QString serialNumber(const QString &filename)
Return a serial number given a filename.
void add(const QString &filename, bool def2filename=false)
Adds a new filename / serial number pair to the SerialNumberList.
QString fileName(const QString &sn)
Return a filename given a serial number.
This was called the Qisis MainWindow.
This is free and unencumbered software released into the public domain.
This is free and unencumbered software released into the public domain.
const double Null
Value for an Isis Null pixel.
Namespace for the standard library.