1 #include "ControlMeasureEditWidget.h"
3 #include <QApplication>
4 #include <QButtonGroup>
8 #include <QDoubleSpinBox>
10 #include <QGridLayout>
11 #include <QHBoxLayout>
13 #include <QListWidget>
14 #include <QMessageBox>
16 #include <QPushButton>
17 #include <QRadioButton>
22 #include <QToolButton>
60 bool useGeometry) :
QWidget(parent) {
64 m_timerOnRight =
false;
83 "Cannot create AutoRegFactory. As a result, "
84 "sub-pixel registration will not work.",
86 QString message = fullError.
toString();
87 QMessageBox::information((
QWidget *)parent,
"Error", message);
130 QGridLayout *gridLayout =
new QGridLayout();
131 gridLayout->setSizeConstraint(QLayout::SetFixedSize);
135 QString tempFileName =
FileName(
"$base/icons").expanded();
136 QString toolIconDir = tempFileName;
140 QToolButton *leftZoomIn =
new QToolButton();
141 leftZoomIn->setIcon(QPixmap(toolIconDir +
"/viewmag+.png"));
142 leftZoomIn->setIconSize(isize);
143 leftZoomIn->setToolTip(
"Zoom In 2x");
144 leftZoomIn->setWhatsThis(
"Zoom In 2x on left measure.");
145 leftZoomIn->setShortcut(Qt::Key_Plus);
147 QToolButton *leftZoomOut =
new QToolButton();
148 leftZoomOut->setIcon(QPixmap(toolIconDir +
"/viewmag-.png"));
149 leftZoomOut->setIconSize(isize);
150 leftZoomOut->setToolTip(
"Zoom Out 2x");
151 leftZoomOut->setWhatsThis(
"Zoom Out 2x on left measure.");
152 leftZoomOut->setShortcut(Qt::Key_Minus);
154 QToolButton *leftZoom1 =
new QToolButton();
155 leftZoom1->setIcon(QPixmap(toolIconDir +
"/viewmag1.png"));
156 leftZoom1->setIconSize(isize);
157 leftZoom1->setToolTip(
"Zoom 1:1");
158 leftZoom1->setWhatsThis(
"Show left measure at full resolution.");
159 leftZoom1->setShortcut(Qt::Key_Slash);
161 QHBoxLayout *leftZoomPan =
new QHBoxLayout;
162 leftZoomPan->addWidget(leftZoomIn);
163 leftZoomPan->addWidget(leftZoomOut);
164 leftZoomPan->addWidget(leftZoom1);
167 QToolButton *leftPanUp = 0;
168 QToolButton *leftPanDown = 0;
169 QToolButton *leftPanLeft = 0;
170 QToolButton *leftPanRight = 0;
173 leftPanUp =
new QToolButton(parent);
174 leftPanUp->setIcon(QIcon(
FileName(
"$base/icons/up.png").
176 leftPanUp->setIconSize(isize);
177 leftPanUp->setToolTip(
"Move up 1 screen pixel");
178 leftPanUp->setStatusTip(
"Move up 1 screen pixel");
179 leftPanUp->setWhatsThis(
"Move the left measure up 1 screen pixel.");
181 leftPanDown =
new QToolButton(parent);
182 leftPanDown->setIcon(QIcon(
FileName(
"$base/icons/down.png").
184 leftPanDown->setIconSize(isize);
185 leftPanDown->setToolTip(
"Move down 1 screen pixel");
186 leftPanDown->setStatusTip(
"Move down 1 screen pixel");
187 leftPanDown->setWhatsThis(
"Move the left measure down 1 screen pixel.");
189 leftPanLeft =
new QToolButton(parent);
190 leftPanLeft->setIcon(QIcon(
FileName(
"$base/icons/back.png").
192 leftPanLeft->setIconSize(isize);
193 leftPanLeft->setToolTip(
"Move left 1 screen pixel");
194 leftPanLeft->setWhatsThis(
"Move the left measure to the left by 1 screen"
197 leftPanRight =
new QToolButton(parent);
198 leftPanRight->setIcon(QIcon(
FileName(
"$base/icons/forward.png").
200 leftPanRight->setIconSize(isize);
201 leftPanRight->setToolTip(
"Move right 1 screen pixel");
202 leftPanRight->setWhatsThis(
"Move the left measure to the right by 1"
205 leftZoomPan->addWidget(leftPanUp);
206 leftZoomPan->addWidget(leftPanDown);
207 leftZoomPan->addWidget(leftPanLeft);
208 leftZoomPan->addWidget(leftPanRight);
211 leftZoomPan->addStretch();
212 gridLayout->addLayout(leftZoomPan, row, 0);
215 m_rightZoomIn->setIcon(QPixmap(toolIconDir +
"/viewmag+.png"));
230 m_rightZoom1->setIcon(QPixmap(toolIconDir +
"/viewmag1.png"));
233 m_rightZoom1->setWhatsThis(
"Show right measure at full resolution.");
236 QHBoxLayout *rightZoomPan =
new QHBoxLayout;
242 QToolButton *rightPanUp =
new QToolButton(parent);
243 rightPanUp->setIcon(QIcon(
FileName(
"$base/icons/up.png").
245 rightPanUp->setIconSize(isize);
246 rightPanUp->setToolTip(
"Move up 1 screen pixel");
247 rightPanUp->setWhatsThis(
"Move the right measure up 1 screen pixel.");
249 QToolButton *rightPanDown =
new QToolButton(parent);
250 rightPanDown->setIcon(QIcon(
FileName(
"$base/icons/down.png").
252 rightPanDown->setIconSize(isize);
253 rightPanDown->setToolTip(
"Move down 1 screen pixel");
254 rightPanUp->setWhatsThis(
"Move the right measure down 1 screen pixel.");
256 QToolButton *rightPanLeft =
new QToolButton(parent);
257 rightPanLeft->setIcon(QIcon(
FileName(
"$base/icons/back.png").
259 rightPanLeft->setIconSize(isize);
260 rightPanLeft->setToolTip(
"Move left 1 screen pixel");
261 rightPanLeft->setWhatsThis(
"Move the right measure to the left by 1 screen"
264 QToolButton *rightPanRight =
new QToolButton(parent);
265 rightPanRight->setIcon(QIcon(
FileName(
"$base/icons/forward.png").
267 rightPanRight->setIconSize(isize);
268 rightPanRight->setToolTip(
"Move right 1 screen pixel");
269 rightPanRight->setWhatsThis(
"Move the right measure to the right by 1"
272 rightZoomPan->addWidget(rightPanUp);
273 rightZoomPan->addWidget(rightPanDown);
274 rightZoomPan->addWidget(rightPanLeft);
275 rightZoomPan->addWidget(rightPanRight);
276 rightZoomPan->addStretch();
278 gridLayout->addLayout(rightZoomPan, row++, 1);
282 QCheckBox *leftLockStretch =
new QCheckBox(
"lock stretch");
285 QString whatsThisTextForStretchLocking =
"If checked then a new stretch "
286 "will NOT be calculated for each pan or zoom change. Note that stretch"
287 " changes made using the stretch tool will ALWAYS take effect, "
288 "regardless of the state of this checkbox.";
289 leftLockStretch->setWhatsThis(whatsThisTextForStretchLocking);
290 QHBoxLayout *leftzflsLayout =
new QHBoxLayout;
292 leftzflsLayout->addWidget(leftLockStretch);
293 gridLayout->addLayout(leftzflsLayout, row, 0);
296 QCheckBox *rightLockStretch =
new QCheckBox(
"lock stretch");
297 rightLockStretch->setWhatsThis(whatsThisTextForStretchLocking);
298 QHBoxLayout *rightzflsLayout =
new QHBoxLayout;
300 rightzflsLayout->addWidget(rightLockStretch);
301 gridLayout->addLayout(rightzflsLayout, row++, 1);
310 connect(
this, SIGNAL(newControlNetwork(
ControlNet *)),
318 connect(leftLockStretch, SIGNAL(stateChanged(
int)),
320 SLOT(changeStretchLock(
int)));
321 leftLockStretch->setChecked(
false);
325 connect(leftZoomIn, SIGNAL(clicked()),
m_leftView, SLOT(zoomIn()));
326 connect(leftZoomOut, SIGNAL(clicked()),
m_leftView, SLOT(zoomOut()));
327 connect(leftZoom1, SIGNAL(clicked()),
m_leftView, SLOT(zoom1()));
331 connect(leftZoomOut, SIGNAL(clicked()),
this, SLOT(
updateRightGeom()));
336 connect(
m_leftView, SIGNAL(tackPointChanged(
double)),
341 connect(
this, SIGNAL(updateLeftView(
double,
double)),
342 m_leftView, SLOT(refreshView(
double,
double)));
344 connect (
m_leftView, SIGNAL(userMovedTackPoint()),
349 connect(leftPanUp, SIGNAL(clicked()),
m_leftView, SLOT(panUp()));
350 connect(leftPanDown, SIGNAL(clicked()),
m_leftView, SLOT(panDown()));
351 connect(leftPanLeft, SIGNAL(clicked()),
m_leftView, SLOT(panLeft()));
352 connect(leftPanRight, SIGNAL(clicked()),
m_leftView, SLOT(panRight()));
363 connect(
this, SIGNAL(newControlNetwork(
ControlNet *)),
369 connect(rightLockStretch, SIGNAL(stateChanged(
int)),
371 SLOT(changeStretchLock(
int)));
372 rightLockStretch->setChecked(
false);
376 connect(
m_rightView, SIGNAL(tackPointChanged(
double)),
378 connect(
this, SIGNAL(updateRightView(
double,
double)),
381 connect (
m_rightView, SIGNAL(userMovedTackPoint()),
389 connect(rightPanUp, SIGNAL(clicked()),
m_rightView, SLOT(panUp()));
390 connect(rightPanDown, SIGNAL(clicked()),
m_rightView, SLOT(panDown()));
391 connect(rightPanLeft, SIGNAL(clicked()),
m_rightView, SLOT(panLeft()));
392 connect(rightPanRight, SIGNAL(clicked()),
m_rightView, SLOT(panRight()));
403 QButtonGroup *bgroup =
new QButtonGroup();
408 QCheckBox *linkZoom = NULL;
410 m_nogeom->setText(
"No geom/rotate");
411 m_nogeom->setToolTip(
"Reset right measure to it's native geometry.");
412 m_nogeom->setWhatsThis(
"Reset right measure to it's native geometry. "
413 "If measure was rotated, set rotation back to 0. "
414 "If measure was geomed to match the left measure, "
415 "reset the geometry back to it's native state.");
416 m_geom =
new QRadioButton(
"Geom");
417 m_geom->setToolTip(
"Geom right measure to match geometry of left measure.");
418 m_geom->setWhatsThis(
"Using an affine transform, geom the right measure to match the "
419 "geometry of the left measure.");
420 bgroup->addButton(
m_geom);
424 linkZoom =
new QCheckBox(
"Link Zoom");
425 linkZoom->setToolTip(
"Link zooming between the left and right views.");
426 linkZoom->setWhatsThis(
"When zooming in the left view, the right view will "
427 "be set to the same zoom factor as the left view.");
428 connect(linkZoom, SIGNAL(toggled(
bool)),
this, SLOT(
setZoomLink(
bool)));
431 m_nogeom->setToolTip(
"Reset right measure to it's native geometry.");
432 m_nogeom->setWhatsThis(
"Reset right measure to it's native geometry. "
433 "If measure was rotated, set rotation back to 0.");
437 QRadioButton *rotate =
new QRadioButton(
"Rotate");
438 bgroup->addButton(rotate);
440 connect(rotate, SIGNAL(clicked()),
this, SLOT(
setRotate()));
449 m_dial->setWrapping(
false);
450 m_dial->setNotchesVisible(
true);
451 m_dial->setNotchTarget(5.);
452 m_dial->setEnabled(
false);
453 m_dial->setToolTip(
"Rotate right measure");
454 m_dial->setWhatsThis(
"Rotate the right measure by degrees.");
459 m_dialNumber->setWhatsThis(
"Rotate the right measure by given number"
464 QCheckBox *showPoints =
new QCheckBox(
"Show control points");
465 showPoints->setToolTip(
"Draw control point crosshairs");
466 showPoints->setWhatsThis(
"This will toggle whether crosshairs are drawn"
467 " for the control points located within the measure''s"
468 " view. For areas of dense measurements, turning this"
469 " off will allow easier viewing of features.");
470 connect(showPoints, SIGNAL(toggled(
bool)),
m_leftView, SLOT(setPoints(
bool)));
471 connect(showPoints, SIGNAL(toggled(
bool)),
m_rightView, SLOT(setPoints(
bool)));
472 showPoints->setChecked(
true);
474 QCheckBox *cross =
new QCheckBox(
"Show crosshair");
475 connect(cross, SIGNAL(toggled(
bool)),
m_leftView, SLOT(setCross(
bool)));
476 connect(cross, SIGNAL(toggled(
bool)),
m_rightView, SLOT(setCross(
bool)));
477 cross->setChecked(
true);
478 cross->setToolTip(
"Show the red crosshair across measure view");
479 cross->setWhatsThis(
"This will toggle whether the crosshair across the"
480 " measure view will be shown");
482 QCheckBox *circle =
new QCheckBox(
"Circle");
483 circle->setChecked(
false);
484 circle->setToolTip(
"Draw circle");
485 circle->setWhatsThis(
"Draw circle on measure view. This can aid in"
486 " centering a crater under the crosshair.");
487 connect(circle, SIGNAL(toggled(
bool)),
this, SLOT(
setCircle(
bool)));
489 m_slider =
new QScrollBar(Qt::Horizontal);
497 m_slider->setToolTip(
"Adjust circle size");
498 m_slider->setWhatsThis(
"This allows the cirle size to be adjusted.");
500 QVBoxLayout *vlayout =
new QVBoxLayout();
502 vlayout->addWidget(linkZoom);
506 vlayout->addWidget(
m_geom);
508 vlayout->addWidget(rotate);
509 vlayout->addWidget(
m_dial);
511 vlayout->addWidget(showPoints);
512 vlayout->addWidget(cross);
513 vlayout->addWidget(circle);
515 gridLayout->addLayout(vlayout, row++, 2);
520 m_oldPosition->setToolTip(
"Measure Sample/Line before sub-pixel "
522 m_oldPosition->setWhatsThis(
"Original Sample/Line of the right measure "
523 "before the sub-pixel registration. If you select the \"Undo\" "
524 "button, the measure will revert back to this Sample/Line.");
526 m_goodFit->setToolTip(
"Goodness of Fit result from sub-pixel registration.");
527 m_goodFit->setWhatsThis(
"Resulting Goodness of Fit from sub-pixel "
529 QVBoxLayout *autoRegLayout =
new QVBoxLayout;
530 autoRegLayout->setMargin(0);
539 QHBoxLayout *leftLayout =
new QHBoxLayout();
540 QToolButton *stop =
new QToolButton();
541 stop->setIcon(QPixmap(toolIconDir +
"/blinkStop.png"));
542 stop->setIconSize(QSize(22, 22));
543 stop->setToolTip(
"Blink Stop");
544 QString text =
"<b>Function:</b> Stop automatic timed blinking";
545 stop->setWhatsThis(text);
546 connect(stop, SIGNAL(released()),
this, SLOT(
blinkStop()));
548 QToolButton *start =
new QToolButton();
549 start->setIcon(QPixmap(toolIconDir +
"/blinkStart.png"));
550 start->setIconSize(QSize(22, 22));
551 start->setToolTip(
"Blink Start");
552 text =
"<b>Function:</b> Start automatic timed blinking. Cycles \
553 through linked viewports at variable rate";
554 start->setWhatsThis(text);
555 connect(start, SIGNAL(released()),
this, SLOT(
blinkStart()));
564 text =
"<b>Function:</b> Change automatic blink rate between " +
571 leftLayout->addWidget(stop);
572 leftLayout->addWidget(start);
576 QPushButton *find =
new QPushButton(
"Find");
577 find->setToolTip(
"Move right measure to same Latitude/Longitude as left.");
578 find->setWhatsThis(
"Find the Latitude/Longitude under the crosshair in the "
579 "left measure and move the right measure to the same "
580 "latitude/longitude.");
581 leftLayout->addWidget(find);
582 connect(find, SIGNAL(clicked()),
this, SLOT(
findPoint()));
585 leftLayout->addStretch();
586 gridLayout->addLayout(leftLayout, row, 0);
588 QHBoxLayout *rightLayout =
new QHBoxLayout();
590 m_autoReg->setToolTip(
"Sub-pixel register the right measure to the left");
591 m_autoReg->setWhatsThis(
"Sub-pixel register the right measure to the left "
592 "and move the result under the crosshair. After "
593 "viewing the results, the option exists to move the "
594 "measure back to the original position by selecting "
595 "<strong>\"Undo Registration\"</strong>.");
598 m_saveMeasure->setToolTip(
"Save the both the left and right measure to the edit control "
599 "point (control point currently being edited). "
600 " <strong>Note: The edit control point "
601 "will not be saved to the network until you select "
602 "<strong>\"Save Point\"</strong>");
606 m_saveMeasure->setToolTip(
"Save the right measure to the edit control "
607 "point (control point currently being edited). "
608 " <strong>Note: The edit control point "
609 "will not be saved to the network until you select "
610 "<strong>\"Save Point\"</strong>");
614 m_blinkExtension =
new QWidget;
616 QPushButton *blinkButton =
new QPushButton(
"Blink");
617 blinkButton->setCheckable(
true);
618 connect(blinkButton, &QAbstractButton::toggled, m_blinkExtension, &QWidget::setVisible);
619 connect(blinkButton, SIGNAL(clicked()),
this, SLOT(showBlinkExtension()));
621 QHBoxLayout *rightBlinkLayout =
new QHBoxLayout();
622 QToolButton *stopRight =
new QToolButton();
623 stopRight->setIcon(QPixmap(toolIconDir +
"/blinkStop.png"));
624 stopRight->setIconSize(QSize(22, 22));
625 stopRight->setToolTip(
"Blink Stop");
626 text =
"<b>Function:</b> Stop automatic timed blinking";
627 stopRight->setWhatsThis(text);
628 connect(stopRight, SIGNAL(released()),
this, SLOT(
blinkStopRight()));
630 QToolButton *startRight =
new QToolButton();
631 startRight->setIcon(QPixmap(toolIconDir +
"/blinkStart.png"));
632 startRight->setIconSize(QSize(22, 22));
633 startRight->setToolTip(
"Blink Start");
634 text =
"<b>Function:</b> Start automatic timed blinking. Cycles \
635 through linked viewports at variable rate";
636 startRight->setWhatsThis(text);
637 connect(startRight, SIGNAL(released()),
this, SLOT(
blinkStartRight()));
639 m_blinkTimeBoxRight =
new QDoubleSpinBox();
640 m_blinkTimeBoxRight->setMinimum(0.1);
641 m_blinkTimeBoxRight->setMaximum(5.0);
642 m_blinkTimeBoxRight->setDecimals(1);
643 m_blinkTimeBoxRight->setSingleStep(0.1);
644 m_blinkTimeBoxRight->setValue(0.5);
645 m_blinkTimeBoxRight->setToolTip(
"Blink Time Delay");
646 text =
"<b>Function:</b> Change automatic blink rate between " +
649 m_blinkTimeBoxRight->setWhatsThis(text);
650 connect(m_blinkTimeBoxRight, SIGNAL(valueChanged(
double)),
653 rightBlinkLayout->addWidget(stopRight);
654 rightBlinkLayout->addWidget(startRight);
655 rightBlinkLayout->addWidget(m_blinkTimeBoxRight);
657 m_blinkListWidget =
new QListWidget(m_blinkExtension);
658 m_blinkListWidget->setMinimumHeight(100);
659 m_blinkListWidget->setSelectionMode(QAbstractItemView::ExtendedSelection);
660 m_blinkListWidget->setDragEnabled(
true);
661 m_blinkListWidget->setAcceptDrops(
true);
662 m_blinkListWidget->setDropIndicatorShown(
true);
663 m_blinkListWidget->setDragDropMode(QAbstractItemView::InternalMove);
669 rightBlinkLayout->addWidget(m_blinkListWidget);
671 m_blinkExtension->setLayout(rightBlinkLayout);
680 rightLayout->addWidget(blinkButton);
681 rightLayout->addStretch();
682 gridLayout->addLayout(rightLayout, row++, 1);
683 gridLayout->addWidget(m_blinkExtension, row, 1);
687 setLayout(gridLayout);
691 m_blinkExtension->hide();
721 Cube *leftCube, QString pointId) {
780 Cube *rightCube, QString pointId) {
813 QString message = fullError.
toString();
814 QMessageBox::information((
QWidget *)parent(),
"Error", message);
818 m_geom->setChecked(
false);
849 QString pos =
"Zoom Factor: " + QString::number(zoomFactor);
877 QString pos =
"Zoom Factor: " + QString::number(zoomFactor);
892 p.setColor(QPalette::ButtonText,qc);
924 QString message =
"Latitude: " + QString::number(lat) +
" Longitude: " +
925 QString::number(lon) +
" is not on the right image. Right measure " +
927 QMessageBox::warning((
QWidget *)parent(),
"Warning",message);
995 QString msg =
"Cannot register this point, unable to Load chips.\n";
997 QMessageBox::information((
QWidget *)parent(),
"Error", msg);
1004 QString msg =
"Cannot sub-pixel register this point.\n";
1006 msg +=
"\n\nNot enough valid data in Pattern Chip.\n";
1007 msg +=
" PatternValidPercent = ";
1011 msg +=
"\n\nNo valid data in Fit Chip.";
1014 msg +=
"\n\nGoodness of Fit Tolerance not met.\n";
1016 msg +=
"\nGoodnessOfFitTolerance = ";
1020 msg +=
"\n\nNot enough valid points in the fit chip window for sub-pixel ";
1021 msg +=
"accuracy. Probably too close to edge.\n";
1024 msg +=
"\n\nCould not model surface for sub-pixel accuracy.\n";
1027 double sampDist, lineDist;
1029 msg +=
"\n\nSub pixel algorithm moves registration more than tolerance.\n";
1030 msg +=
"\nSampleMovement = " + QString::number(sampDist) +
1031 " LineMovement = " + QString::number(lineDist);
1032 msg +=
"\nDistanceTolerance = " +
1036 double score1, score2;
1038 msg +=
"\n\nPattern data max or min does not pass z-score test.\n";
1040 msg +=
"\nCalculatedZscores = " + QString::number(score1) +
", " + QString::number(score2);
1043 msg +=
"\n\nError occured in Adaptive algorithm.";
1046 msg +=
"\n\nUnknown registration error.";
1049 QMessageBox::information((
QWidget *)parent(),
"Error", msg);
1054 QString msg =
"Cannot register this point.\n";
1056 QMessageBox::information((
QWidget *)parent(),
"Error", msg);
1070 QString oldPos =
"Original Sample: " +
1071 QString::number(
m_rightMeasure->GetSample()) +
" Original Line: " +
1075 QString goodFit =
"Goodness of Fit: " +
1081 m_autoReg->setText(
"Undo Registration");
1122 QString message =
"The right measure is locked. You must first unlock the measure by ";
1123 message +=
"clicking the check box above labeled \"Edit Lock Measure\".";
1124 QMessageBox::warning((
QWidget *)parent(),
"Warning",message);
1141 double minZScore, maxZScore;
1175 QString message =
"The left measure is locked. You must first unlock the measure by ";
1176 message +=
"clicking the check box above labeled \"Edit Lock Measure\".";
1177 QMessageBox::warning((
QWidget *)parent(),
"Warning",message);
1201 emit measureSaved();
1222 QString message = fullError.
toString();
1223 QMessageBox::information((
QWidget *)parent(),
"Error", message);
1226 m_geom->setChecked(
false);
1267 QApplication::setOverrideCursor(Qt::WaitCursor);
1271 QString text =
"Zoom in 2X";
1275 text =
"Zoom out 2X";
1287 QApplication::restoreOverrideCursor();
1289 m_dial->setEnabled(
true);
1291 m_dial->setNotchesVisible(
true);
1309 QApplication::setOverrideCursor(Qt::WaitCursor);
1312 QString text =
"Zoom functions disabled when Geom is set";
1326 m_dial->setEnabled(
false);
1337 QString message = fullError.
toString();
1338 QMessageBox::information((
QWidget *)parent(),
"Error", message);
1341 m_geom->setChecked(
false);
1344 QApplication::restoreOverrideCursor();
1356 QApplication::setOverrideCursor(Qt::WaitCursor);
1358 QString text =
"Zoom in 2X";
1362 text =
"Zoom out 2X";
1373 m_dial->setEnabled(
false);
1379 QApplication::restoreOverrideCursor();
1527 "Cannot create AutoRegFactory for " +
1529 ". As a result, current template file will remain set to " +
1531 QString message = fullError.
toString();
1532 QMessageBox::information((
QWidget *)parent(),
"Error", message);
1550 m_saveMeasure->setToolTip(
"Save the both the left and right measure to the edit control "
1551 "point (control point currently being edited). "
1552 " <strong>Note: The edit control point "
1553 "will not be saved to the network until you select "
1554 "<strong>\"Save Point\"</strong>");
1558 m_saveMeasure->setToolTip(
"Save the right measure to the edit control "
1559 "point (control point currently being edited). "
1560 " <strong>Note: The edit control point "
1561 "will not be saved to the network until you select "
1562 "<strong>\"Save Point\"</strong>");
1567 void ControlMeasureEditWidget::refreshChips() {
1586 QString message =
"Point must be Registered before chips can be saved.";
1587 QMessageBox::warning((
QWidget *)parent(),
"Warning", message);
1592 QString baseFile =
m_pointId.replace(
" ",
"_") +
"_" +
1597 QString fname = baseFile +
"Search.cub";
1598 QString command =
"$ISISROOT/bin/qview \'" + fname +
"\'";
1600 fname = baseFile +
"Pattern.cub";
1601 command +=
" \'" + fname +
"\'";
1603 fname = baseFile +
"Fit.cub";
1604 command +=
" \'" + fname +
"\' &";
1622 m_editPoint = editPoint;
1623 m_serialNumberList = snList;
1626 m_blinkListWidget->clear();
1630 void ControlMeasureEditWidget::showBlinkExtension() {
1631 m_blinkListWidget->clear();
1633 for (
int i=0; i<m_editPoint->GetNumMeasures(); i++) {
1634 ControlMeasure &m = *(*m_editPoint)[i];
1635 QString file = m_serialNumberList->
fileName(m.GetCubeSerialNumber());
1639 m_blinkListWidget->addItem(file);
1654 if ( m_timerOnRight )
return;
1658 if (selected.size() < 1) {
1659 QMessageBox::information((
QWidget *)parent(),
"Error",
"No files selected for blinking.");
1664 for (
int i=0; i<selected.size(); i++) {
1665 QString file = selected.at(i)->text();
1666 QString serial = m_serialNumberList->
serialNumber(file);
1667 Cube *blinkCube =
new Cube(selected.at(i)->text());
1670 blinkChip->TackCube(blinkMeasure->GetSample(), blinkMeasure->GetLine());
1671 blinkChip->Load(*blinkCube);
1673 blinkViewport->
setChip(blinkChip, blinkCube);
1674 m_blinkChipViewportListRight.append(blinkViewport);
1677 m_blinkIndexRight = 0;
1679 m_timerOnRight =
true;
1680 int msec = (int)(m_blinkTimeBoxRight->value() * 1000.0);
1681 m_timerRight =
new QTimer(
this);
1683 m_timerRight->start(msec);
1690 m_timerRight->stop();
1691 m_timerOnRight =
false;
1692 m_blinkChipViewportListRight.clear();
1705 if ( m_timerOnRight ) m_timerRight->setInterval((
int)(interval * 1000.));
1712 m_blinkIndexRight++;
1713 if (m_blinkIndexRight > m_blinkChipViewportListRight.size()-1) {
1714 m_blinkIndexRight = 0;
Status SetType(MeasureType type)
Set how the coordinate was obtained.
Error occured in Adaptive algorithm.
void zoom(double zoomFactor)
Zoom by a specified factor.
void ZScores(double &score1, double &score2) const
Return the ZScores of the pattern chip.
double DistanceTolerance() const
Return distance tolerance.
double Sample() const
Returns the current line value of the camera model or projection.
File name manipulation and expansion.
double Tolerance() const
Return match algorithm tolerance.
A small chip of data used for pattern matching.
Chip * RegistrationSearchChip()
Return pointer to search chip used in registration.
Not enough valid data in pattern chip.
Not enough points to fit a surface model for sub-pixel accuracy.
QString serialNumber(const QString &filename)
Return a serial number given a filename.
Chip * RegistrationPatternChip()
Return pointer to pattern chip used in registration.
Surface model moves registration more than one pixel.
Statistical and similar ControlMeasure associated information.
void TackCube(const double cubeSample, const double cubeLine)
This sets which cube position will be located at the chip tack position.
AutoReg::RegisterStatus Register()
Walk the pattern chip through the search chip to find the best registration.
Chip * SearchChip()
Return pointer to search chip.
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
double UniversalLatitude() const
Returns the universal latitude of the camera model or projection.
Widget to display Isis cubes for qt apps.
Registered to sub-pixel (e.g., pointreg)
double Line() const
Returns the current line value of the camera model or projection.
A type of error that occurred when performing an actual I/O operation.
double tackLine()
Returns tack line.
double tackSample()
Return the position of cube under cross hair.
Control measures store z-scores in pairs.
QString fileName(const QString &sn)
Return a filename given a serial number.
static void RunSystemCommand(QString commandLine)
This runs arbitrary system commands.
double PatternValidPercent() const
Return pattern chip valid percent. The default value is.
double CubeSample() const
Return the search chip cube sample that best matched.
double GoodnessOfFit() const
Return the goodness of fit of the match algorithm.
Hand Measured (e.g., qnet)
Chip * PatternChip()
Return pointer to pattern chip.
void Write(const QString &filename)
Writes the contents of the Chip to a cube.
bool Success() const
Return whether the match algorithm succeeded or not.
#define _FILEINFO_
Macro for the filename and line number.
void SetLogData(ControlMeasureLogData)
This adds or updates the log data information associated with data's type.
A type of error that could only have occurred due to a mistake on the user's part (e...
double UniversalLongitude() const
Returns the universal longitude of the camera model or projection.
void geomChip(Chip *matchChip, Cube *matchChipCube)
Slot to geom chip (apply geometry transformation)
double zoomFactor()
Return the zoom factor.
Fit chip did not have any valid data.
Container for cube-like labels.
void Load(Cube &cube, const double rotation=0.0, const double scale=1.0, const int band=1)
Load cube data into the Chip.
bool IsEditLocked() const
Return value for p_editLock or implicit lock on reference measure.
bool SetImage(double sample, double line)
Returns whether the sample/line postion was set successfully in the camera model or projection...
static AutoReg * Create(Pvl &pvl)
Create an AutoReg object using a PVL specification.
GoodnessOfFit is pointreg information for reference measures.
Goodness of fit tolerance not satisfied.
RegisterStatus
Enumeration of the Register() method's return status.
void Distance(double &sampDistance, double &lineDistance)
Return the distance point moved.
void setChip(Chip *chip, Cube *chipCube)
Set chip.
QString toString() const
Returns a string representation of this exception.
static QString UserName()
Returns the user name.
Status SetChooserName()
Set chooser name to a user who last changed the coordinate.
bool SetUniversalGround(double lat, double lon)
Returns whether the lat/lon position was set successfully in the camera model or projection.
QString GetCubeSerialNumber() const
Return the serial number of the cube containing the coordinate.
Status SetCoordinate(double sample, double line)
Set the coordinate of the measurement.
Chip * FitChip()
Return pointer to fit chip.
void DeleteLogData(long dataType)
This deletes log data of the specified type.
Status SetDateTime()
Date Time - Creation Time.
Could not model surface for sub-pixel accuracy.
Pattern data max or min does not pass the z-score test.
void setCircle(bool checked)
Slot to change state of circle.
double MinimumZScore() const
Return minimumPatternZScore.
const int VIEWSIZE
Constant representing the length and width of the chip viewports.
Serial Number list generator.
const ControlMeasure * GetMeasure(QString serialNumber) const
Get a control measure based on its cube's serial number.
double CubeLine() const
Return the search chip cube line that best matched.
void loadView(ChipViewport &newView)
Load with another ChipViewport, used for blinking.
void nogeomChip()
Slot to un-geom chip (revert geometry transformation)
IO Handler for Isis Cubes.