120 QGridLayout *gridLayout =
new QGridLayout();
121 gridLayout->setSizeConstraint(QLayout::SetFixedSize);
125 QString tempFileName =
FileName(
"$ISISROOT/appdata/images/icons").
expanded();
126 QString toolIconDir = tempFileName;
130 QToolButton *leftZoomIn =
new QToolButton();
131 leftZoomIn->setIcon(QPixmap(toolIconDir +
"/viewmag+.png"));
132 leftZoomIn->setIconSize(isize);
133 leftZoomIn->setToolTip(
"Zoom In 2x");
134 leftZoomIn->setWhatsThis(
"Zoom In 2x on left measure.");
136 QToolButton *leftZoomOut =
new QToolButton();
137 leftZoomOut->setIcon(QPixmap(toolIconDir +
"/viewmag-.png"));
138 leftZoomOut->setIconSize(isize);
139 leftZoomOut->setToolTip(
"Zoom Out 2x");
140 leftZoomOut->setWhatsThis(
"Zoom Out 2x on left measure.");
142 QToolButton *leftZoom1 =
new QToolButton();
143 leftZoom1->setIcon(QPixmap(toolIconDir +
"/viewmag1.png"));
144 leftZoom1->setIconSize(isize);
145 leftZoom1->setToolTip(
"Zoom 1:1");
146 leftZoom1->setWhatsThis(
"Show left measure at full resolution.");
148 QHBoxLayout *leftZoomPan =
new QHBoxLayout;
149 leftZoomPan->addWidget(leftZoomIn);
150 leftZoomPan->addWidget(leftZoomOut);
151 leftZoomPan->addWidget(leftZoom1);
154 QToolButton *leftPanUp = 0;
155 QToolButton *leftPanDown = 0;
156 QToolButton *leftPanLeft = 0;
157 QToolButton *leftPanRight = 0;
158 if (p_allowLeftMouse) {
160 leftPanUp =
new QToolButton(parent);
161 leftPanUp->setIcon(QIcon(
FileName(
"$ISISROOT/appdata/images/icons/up.png").
163 leftPanUp->setIconSize(isize);
164 leftPanUp->setToolTip(
"Move up 1 screen pixel");
165 leftPanUp->setStatusTip(
"Move up 1 screen pixel");
166 leftPanUp->setWhatsThis(
"Move the left measure up 1 screen pixel.");
168 leftPanDown =
new QToolButton(parent);
169 leftPanDown->setIcon(QIcon(
FileName(
"$ISISROOT/appdata/images/icons/down.png").
171 leftPanDown->setIconSize(isize);
172 leftPanDown->setToolTip(
"Move down 1 screen pixel");
173 leftPanDown->setStatusTip(
"Move down 1 screen pixel");
174 leftPanDown->setWhatsThis(
"Move the left measure down 1 screen pixel.");
176 leftPanLeft =
new QToolButton(parent);
177 leftPanLeft->setIcon(QIcon(
FileName(
"$ISISROOT/appdata/images/icons/back.png").
179 leftPanLeft->setIconSize(isize);
180 leftPanLeft->setToolTip(
"Move left 1 screen pixel");
181 leftPanLeft->setWhatsThis(
"Move the left measure to the left by 1 screen"
184 leftPanRight =
new QToolButton(parent);
185 leftPanRight->setIcon(QIcon(
FileName(
"$ISISROOT/appdata/images/icons/forward.png").
187 leftPanRight->setIconSize(isize);
188 leftPanRight->setToolTip(
"Move right 1 screen pixel");
189 leftPanRight->setWhatsThis(
"Move the left measure to the right by 1"
192 leftZoomPan->addWidget(leftPanUp);
193 leftZoomPan->addWidget(leftPanDown);
194 leftZoomPan->addWidget(leftPanLeft);
195 leftZoomPan->addWidget(leftPanRight);
198 leftZoomPan->addStretch();
199 gridLayout->addLayout(leftZoomPan, row, 0);
201 p_rightZoomIn =
new QToolButton();
202 p_rightZoomIn->setIcon(QPixmap(toolIconDir +
"/viewmag+.png"));
203 p_rightZoomIn->setIconSize(isize);
204 p_rightZoomIn->setToolTip(
"Zoom In 2x");
205 p_rightZoomIn->setWhatsThis(
"Zoom In 2x on right measure.");
207 p_rightZoomOut =
new QToolButton();
208 p_rightZoomOut->setIcon(QIcon(
FileName(
"$ISISROOT/appdata/images/icons/viewmag-.png").
210 p_rightZoomOut->setIconSize(isize);
211 p_rightZoomOut->setToolTip(
"Zoom Out 2x");
212 p_rightZoomOut->setWhatsThis(
"Zoom Out 2x on right measure.");
214 p_rightZoom1 =
new QToolButton();
215 p_rightZoom1->setIcon(QPixmap(toolIconDir +
"/viewmag1.png"));
216 p_rightZoom1->setIconSize(isize);
217 p_rightZoom1->setToolTip(
"Zoom 1:1");
218 p_rightZoom1->setWhatsThis(
"Show right measure at full resolution.");
220 QHBoxLayout *rightZoomPan =
new QHBoxLayout;
221 rightZoomPan->addWidget(p_rightZoomIn);
222 rightZoomPan->addWidget(p_rightZoomOut);
223 rightZoomPan->addWidget(p_rightZoom1);
226 QToolButton *rightPanUp =
new QToolButton(parent);
227 rightPanUp->setIcon(QIcon(
FileName(
"$ISISROOT/appdata/images/icons/up.png").
229 rightPanUp->setIconSize(isize);
230 rightPanUp->setToolTip(
"Move up 1 screen pixel");
231 rightPanUp->setWhatsThis(
"Move the right measure up 1 screen pixel.");
233 QToolButton *rightPanDown =
new QToolButton(parent);
234 rightPanDown->setIcon(QIcon(
FileName(
"$ISISROOT/appdata/images/icons/down.png").
236 rightPanDown->setIconSize(isize);
237 rightPanDown->setToolTip(
"Move down 1 screen pixel");
238 rightPanUp->setWhatsThis(
"Move the right measure down 1 screen pixel.");
240 QToolButton *rightPanLeft =
new QToolButton(parent);
241 rightPanLeft->setIcon(QIcon(
FileName(
"$ISISROOT/appdata/images/icons/back.png").
243 rightPanLeft->setIconSize(isize);
244 rightPanLeft->setToolTip(
"Move left 1 screen pixel");
245 rightPanLeft->setWhatsThis(
"Move the right measure to the left by 1 screen"
248 QToolButton *rightPanRight =
new QToolButton(parent);
249 rightPanRight->setIcon(QIcon(
FileName(
"$ISISROOT/appdata/images/icons/forward.png").
251 rightPanRight->setIconSize(isize);
252 rightPanRight->setToolTip(
"Move right 1 screen pixel");
253 rightPanRight->setWhatsThis(
"Move the right measure to the right by 1"
256 rightZoomPan->addWidget(rightPanUp);
257 rightZoomPan->addWidget(rightPanDown);
258 rightZoomPan->addWidget(rightPanLeft);
259 rightZoomPan->addWidget(rightPanRight);
260 rightZoomPan->addStretch();
262 gridLayout->addLayout(rightZoomPan, row++, 1);
265 p_leftZoomFactor =
new QLabel();
266 QCheckBox *leftLockStretch =
new QCheckBox(
"lock stretch");
269 QString whatsThisTextForStretchLocking =
"If checked then a new stretch "
270 "will NOT be calculated for each pan or zoom change. Note that stretch"
271 " changes made using the stretch tool will ALWAYS take effect, "
272 "regardless of the state of this checkbox.";
273 leftLockStretch->setWhatsThis(whatsThisTextForStretchLocking);
274 QHBoxLayout *leftzflsLayout =
new QHBoxLayout;
275 leftzflsLayout->addWidget(p_leftZoomFactor);
276 leftzflsLayout->addWidget(leftLockStretch);
277 gridLayout->addLayout(leftzflsLayout, row, 0);
279 p_rightZoomFactor =
new QLabel();
280 QCheckBox *rightLockStretch =
new QCheckBox(
"lock stretch");
281 rightLockStretch->setWhatsThis(whatsThisTextForStretchLocking);
282 QHBoxLayout *rightzflsLayout =
new QHBoxLayout;
283 rightzflsLayout->addWidget(p_rightZoomFactor);
284 rightzflsLayout->addWidget(rightLockStretch);
285 gridLayout->addLayout(rightzflsLayout, row++, 1);
290 if (!p_allowLeftMouse) p_leftView->setDisabled(
true);
292 gridLayout->addWidget(p_leftView, row, 0);
294 connect(
this, SIGNAL(newControlNetwork(
ControlNet *)),
295 p_leftView, SLOT(setControlNet(
ControlNet *)));
302 connect(leftLockStretch, SIGNAL(stateChanged(
int)),
304 SLOT(changeStretchLock(
int)));
305 leftLockStretch->setChecked(
false);
309 connect(leftZoomIn, SIGNAL(clicked()), p_leftView, SLOT(zoomIn()));
310 connect(leftZoomOut, SIGNAL(clicked()), p_leftView, SLOT(zoomOut()));
311 connect(leftZoom1, SIGNAL(clicked()), p_leftView, SLOT(zoom1()));
315 connect(leftZoomOut, SIGNAL(clicked()),
this, SLOT(
updateRightGeom()));
320 connect(p_leftView, SIGNAL(tackPointChanged(
double)),
325 connect(
this, SIGNAL(updateLeftView(
double,
double)),
326 p_leftView, SLOT(refreshView(
double,
double)));
328 connect (p_leftView, SIGNAL(userMovedTackPoint()),
331 if (p_allowLeftMouse) {
333 connect(leftPanUp, SIGNAL(clicked()), p_leftView, SLOT(panUp()));
334 connect(leftPanDown, SIGNAL(clicked()), p_leftView, SLOT(panDown()));
335 connect(leftPanLeft, SIGNAL(clicked()), p_leftView, SLOT(panLeft()));
336 connect(leftPanRight, SIGNAL(clicked()), p_leftView, SLOT(panRight()));
345 gridLayout->addWidget(p_rightView, row, 1);
347 connect(
this, SIGNAL(newControlNetwork(
ControlNet *)),
348 p_rightView, SLOT(setControlNet(
ControlNet *)));
353 connect(rightLockStretch, SIGNAL(stateChanged(
int)),
355 SLOT(changeStretchLock(
int)));
356 rightLockStretch->setChecked(
false);
360 connect(p_rightView, SIGNAL(tackPointChanged(
double)),
362 connect(
this, SIGNAL(updateRightView(
double,
double)),
363 p_rightView, SLOT(refreshView(
double,
double)));
365 connect (p_rightView, SIGNAL(userMovedTackPoint()),
368 connect(p_rightZoomIn, SIGNAL(clicked()), p_rightView, SLOT(zoomIn()));
369 connect(p_rightZoomOut, SIGNAL(clicked()), p_rightView, SLOT(zoomOut()));
370 connect(p_rightZoom1, SIGNAL(clicked()), p_rightView, SLOT(zoom1()));
373 connect(rightPanUp, SIGNAL(clicked()), p_rightView, SLOT(panUp()));
374 connect(rightPanDown, SIGNAL(clicked()), p_rightView, SLOT(panDown()));
375 connect(rightPanLeft, SIGNAL(clicked()), p_rightView, SLOT(panLeft()));
376 connect(rightPanRight, SIGNAL(clicked()), p_rightView, SLOT(panRight()));
387 QButtonGroup *bgroup =
new QButtonGroup();
388 p_nogeom =
new QRadioButton();
389 p_nogeom->setChecked(
true);
390 connect(p_nogeom, SIGNAL(clicked()),
this, SLOT(
setNoGeom()));
392 QCheckBox *linkZoom = NULL;
394 p_nogeom->setText(
"No geom/rotate");
395 p_nogeom->setToolTip(
"Reset right measure to it's native geometry.");
396 p_nogeom->setWhatsThis(
"Reset right measure to it's native geometry. "
397 "If measure was rotated, set rotation back to 0. "
398 "If measure was geomed to match the left measure, "
399 "reset the geometry back to it's native state.");
400 p_geom =
new QRadioButton(
"Geom");
401 p_geom->setToolTip(
"Geom right measure to match geometry of left measure.");
402 p_geom->setWhatsThis(
"Using an affine transform, geom the right measure to match the "
403 "geometry of the left measure.");
404 bgroup->addButton(p_geom);
405 connect(p_geom, SIGNAL(clicked()),
this, SLOT(
setGeom()));
408 linkZoom =
new QCheckBox(
"Link Zoom");
409 linkZoom->setToolTip(
"Link zooming between the left and right views.");
410 linkZoom->setWhatsThis(
"When zooming in the left view, the right view will "
411 "be set to the same zoom factor as the left view.");
412 connect(linkZoom, SIGNAL(toggled(
bool)),
this, SLOT(
setZoomLink(
bool)));
414 p_nogeom->setText(
"No rotate");
415 p_nogeom->setToolTip(
"Reset right measure to it's native geometry.");
416 p_nogeom->setWhatsThis(
"Reset right measure to it's native geometry. "
417 "If measure was rotated, set rotation back to 0.");
419 bgroup->addButton(p_nogeom);
421 QRadioButton *rotate =
new QRadioButton(
"Rotate");
422 bgroup->addButton(rotate);
424 connect(rotate, SIGNAL(clicked()),
this, SLOT(
setRotate()));
431 p_dial =
new QDial();
432 p_dial->setRange(0, 360);
433 p_dial->setWrapping(
false);
434 p_dial->setNotchesVisible(
true);
435 p_dial->setNotchTarget(5.);
436 p_dial->setEnabled(
false);
437 p_dial->setToolTip(
"Rotate right measure");
438 p_dial->setWhatsThis(
"Rotate the right measure by degrees.");
440 p_dialNumber =
new QLCDNumber();
441 p_dialNumber->setEnabled(
false);
442 p_dialNumber->setToolTip(
"Rotate right measure");
443 p_dialNumber->setWhatsThis(
"Rotate the right measure by given number"
445 connect(p_dial, SIGNAL(valueChanged(
int)), p_dialNumber, SLOT(display(
int)));
446 connect(p_dial, SIGNAL(valueChanged(
int)), p_rightView, SLOT(rotateChip(
int)));
448 QCheckBox *showPoints =
new QCheckBox(
"Show control points");
449 showPoints->setToolTip(
"Draw control point crosshairs");
450 showPoints->setWhatsThis(
"This will toggle whether crosshairs are drawn"
451 " for the control points located within the measure''s"
452 " view. For areas of dense measurements, turning this"
453 " off will allow easier viewing of features.");
454 connect(showPoints, SIGNAL(toggled(
bool)), p_leftView, SLOT(setPoints(
bool)));
455 connect(showPoints, SIGNAL(toggled(
bool)), p_rightView, SLOT(setPoints(
bool)));
456 showPoints->setChecked(
true);
458 QCheckBox *cross =
new QCheckBox(
"Show crosshair");
459 connect(cross, SIGNAL(toggled(
bool)), p_leftView, SLOT(setCross(
bool)));
460 connect(cross, SIGNAL(toggled(
bool)), p_rightView, SLOT(setCross(
bool)));
461 cross->setChecked(
true);
462 cross->setToolTip(
"Show the red crosshair across measure view");
463 cross->setWhatsThis(
"This will toggle whether the crosshair across the"
464 " measure view will be shown");
466 QCheckBox *circle =
new QCheckBox(
"Circle");
467 circle->setChecked(
false);
468 circle->setToolTip(
"Draw circle");
469 circle->setWhatsThis(
"Draw circle on measure view. This can aid in"
470 " centering a crater under the crosshair.");
471 connect(circle, SIGNAL(toggled(
bool)),
this, SLOT(
setCircle(
bool)));
473 p_slider =
new QScrollBar(Qt::Horizontal);
474 p_slider->setRange(1, 100);
475 p_slider->setSingleStep(1);
476 connect(p_slider, SIGNAL(valueChanged(
int)), p_leftView, SLOT(setCircleSize(
int)));
477 connect(p_slider, SIGNAL(valueChanged(
int)), p_rightView, SLOT(setCircleSize(
int)));
478 p_slider->setValue(20);
479 p_slider->setDisabled(
true);
481 p_slider->setToolTip(
"Adjust circle size");
482 p_slider->setWhatsThis(
"This allows the cirle size to be adjusted.");
484 QVBoxLayout *vlayout =
new QVBoxLayout();
485 if (!p_useGeometry) {
486 vlayout->addWidget(linkZoom);
488 vlayout->addWidget(p_nogeom);
490 vlayout->addWidget(p_geom);
492 vlayout->addWidget(rotate);
493 vlayout->addWidget(p_dial);
494 vlayout->addWidget(p_dialNumber);
495 vlayout->addWidget(showPoints);
496 vlayout->addWidget(cross);
497 vlayout->addWidget(circle);
498 vlayout->addWidget(p_slider);
499 gridLayout->addLayout(vlayout, row++, 2);
502 p_leftSampLinePosition =
new QLabel();
503 p_leftSampLinePosition->setToolTip(
"Sample/Line under the crosshair");
504 gridLayout->addWidget(p_leftSampLinePosition, row, 0);
505 p_rightSampLinePosition =
new QLabel();
506 p_rightSampLinePosition->setToolTip(
"Sample/Line under the crosshair");
507 gridLayout->addWidget(p_rightSampLinePosition, row++, 1);
511 p_leftLatLonPosition =
new QLabel();
512 p_leftLatLonPosition->setToolTip(
"Latitude/Longitude under the crosshair");
513 gridLayout->addWidget(p_leftLatLonPosition, row, 0);
514 p_rightLatLonPosition =
new QLabel();
515 p_rightLatLonPosition->setToolTip(
"Latitude/Longitude under the crosshair");
516 gridLayout->addWidget(p_rightLatLonPosition, row++, 1);
521 p_autoRegExtension =
new QWidget;
522 p_oldPosition =
new QLabel;
523 p_oldPosition->setToolTip(
"Measure Sample/Line before sub-pixel "
525 p_oldPosition->setWhatsThis(
"Original Sample/Line of the right measure "
526 "before the sub-pixel registration. If you select the \"Undo\" "
527 "button, the measure will revert back to this Sample/Line.");
528 p_goodFit =
new QLabel;
529 p_goodFit->setToolTip(
"Goodness of Fit result from sub-pixel registration.");
530 p_goodFit->setWhatsThis(
"Resulting Goodness of Fit from sub-pixel "
532 QVBoxLayout *autoRegLayout =
new QVBoxLayout;
533 autoRegLayout->setMargin(0);
534 autoRegLayout->addWidget(p_oldPosition);
535 autoRegLayout->addWidget(p_goodFit);
536 p_autoRegExtension->setLayout(autoRegLayout);
537 p_autoRegShown =
false;
538 p_autoRegAttempted =
false;
539 gridLayout->addWidget(p_autoRegExtension, row++, 1);
542 QHBoxLayout *leftLayout =
new QHBoxLayout();
543 QToolButton *stop =
new QToolButton();
544 stop->setIcon(QPixmap(toolIconDir +
"/blinkStop.png"));
545 stop->setIconSize(QSize(22, 22));
546 stop->setToolTip(
"Blink Stop");
547 QString text =
"<b>Function:</b> Stop automatic timed blinking";
548 stop->setWhatsThis(text);
549 connect(stop, SIGNAL(released()),
this, SLOT(
blinkStop()));
551 QToolButton *start =
new QToolButton();
552 start->setIcon(QPixmap(toolIconDir +
"/blinkStart.png"));
553 start->setIconSize(QSize(22, 22));
554 start->setToolTip(
"Blink Start");
555 text =
"<b>Function:</b> Start automatic timed blinking. Cycles \
556 through linked viewports at variable rate";
557 start->setWhatsThis(text);
558 connect(start, SIGNAL(released()),
this, SLOT(
blinkStart()));
560 p_blinkTimeBox =
new QDoubleSpinBox();
561 p_blinkTimeBox->setMinimum(0.1);
562 p_blinkTimeBox->setMaximum(5.0);
563 p_blinkTimeBox->setDecimals(1);
564 p_blinkTimeBox->setSingleStep(0.1);
565 p_blinkTimeBox->setValue(0.5);
566 p_blinkTimeBox->setToolTip(
"Blink Time Delay");
567 text =
"<b>Function:</b> Change automatic blink rate between " +
568 QString::number(p_blinkTimeBox->minimum()) +
" and " +
569 QString::number(p_blinkTimeBox->maximum()) +
" seconds";
570 p_blinkTimeBox->setWhatsThis(text);
571 connect(p_blinkTimeBox, SIGNAL(valueChanged(
double)),
574 leftLayout->addWidget(stop);
575 leftLayout->addWidget(start);
576 leftLayout->addWidget(p_blinkTimeBox);
579 QPushButton *find =
new QPushButton(
"Find");
580 find->setShortcut(Qt::Key_F);
581 find->setToolTip(
"Move right measure to same Latitude/Longitude as left. "
582 "<strong>Shortcut: F</strong>");
583 find->setWhatsThis(
"Find the Latitude/Longitude under the crosshair in the "
584 "left measure and move the right measure to the same "
585 "latitude/longitude.");
586 leftLayout->addWidget(find);
587 connect(find, SIGNAL(clicked()),
this, SLOT(
findPoint()));
590 leftLayout->addStretch();
591 gridLayout->addLayout(leftLayout, row, 0);
593 QHBoxLayout *rightLayout =
new QHBoxLayout();
594 p_autoReg =
new QPushButton(
"Register");
595 p_autoReg->setShortcut(Qt::Key_R);
596 p_autoReg->setToolTip(
"Sub-pixel register the right measure to the left. "
597 "<strong>Shortcut: R</strong>");
598 p_autoReg->setWhatsThis(
"Sub-pixel register the right measure to the left "
599 "and move the result under the crosshair. After "
600 "viewing the results, the option exists to move the "
601 "measure back to the original position by selecting "
602 "<strong>\"Undo Registration\"</strong>.");
603 if (p_allowLeftMouse) {
604 p_saveMeasure =
new QPushButton(
"Save Measures");
605 p_saveMeasure->setToolTip(
"Save the both the left and right measure to the edit control "
606 "point (control point currently being edited). "
607 "<strong>Shortcut: M</strong>. "
608 " <strong>Note: The edit control point "
609 "will not be saved to the network until you select "
610 "<strong>\"Save Point\"</strong>");
613 p_saveMeasure =
new QPushButton(
"Save Measure");
614 p_saveMeasure->setToolTip(
"Save the right measure to the edit control "
615 "point (control point currently being edited). "
616 "<strong>Shortcut: M</strong>. "
617 " <strong>Note: The edit control point "
618 "will not be saved to the network until you select "
619 "<strong>\"Save Point\"</strong>");
621 p_saveMeasure->setShortcut(Qt::Key_M);
622 p_saveDefaultPalette = p_saveMeasure->palette();
624 rightLayout->addWidget(p_autoReg);
625 rightLayout->addWidget(p_saveMeasure);
626 rightLayout->addStretch();
627 gridLayout->addLayout(rightLayout, row, 1);
629 connect(p_autoReg, SIGNAL(clicked()),
this, SLOT(
registerPoint()));
630 connect(p_saveMeasure, SIGNAL(clicked()),
this, SLOT(
saveMeasure()));
632 setLayout(gridLayout);
635 p_autoRegExtension->hide();