Isis 3 Programmer Reference
ZoomTool.cpp
Go to the documentation of this file.
1 
20 #include <iostream>
21 
22 #include <QAction>
23 #include <QApplication>
24 #include <QHBoxLayout>
25 #include <QLabel>
26 #include <QLineEdit>
27 #include <QMenu>
28 #include <QMenuBar>
29 #include <QMessageBox>
30 #include <QPushButton>
31 #include <QStackedWidget>
32 #include <QToolButton>
33 #include <QValidator>
34 
35 #include "IException.h"
36 #include "IString.h"
37 #include "MainWindow.h"
38 #include "MdiCubeViewport.h"
39 #include "RubberBandTool.h"
40 #include "ToolPad.h"
41 #include "Workspace.h"
42 #include "ZoomTool.h"
43 
44 namespace Isis {
51  ZoomTool::ZoomTool(QWidget *parent) : Tool(parent) {
52  p_zoomIn2X = new QAction(parent);
53  p_zoomIn2X->setShortcut(Qt::Key_Plus);
54  p_zoomIn2X->setText("Zoom In");
55  p_zoomIn2X->setIcon(QPixmap(toolIconDir() + "/viewmag+.png"));
56  connect(p_zoomIn2X, SIGNAL(triggered()), this, SLOT(zoomIn2X()));
57 
58  p_zoomIn4X = new QAction(parent);
59  p_zoomIn4X->setText("Zoom In 4X");
60  p_zoomIn4X->setShortcut(Qt::CTRL + Qt::Key_Plus);
61  connect(p_zoomIn4X, SIGNAL(triggered()), this, SLOT(zoomIn4X()));
62 
63  p_zoomIn8X = new QAction(parent);
64  p_zoomIn8X->setShortcut(Qt::ALT + Qt::Key_Plus);
65  p_zoomIn8X->setText("Zoom In 8X");
66  connect(p_zoomIn8X, SIGNAL(triggered()), this, SLOT(zoomIn8X()));
67 
68  p_zoomOut2X = new QAction(parent);
69  p_zoomOut2X->setShortcut(Qt::Key_Minus);
70  p_zoomOut2X->setText("Zoom Out");
71  p_zoomOut2X->setIcon(QPixmap(toolIconDir() + "/viewmag-.png"));
72  connect(p_zoomOut2X, SIGNAL(triggered()), this, SLOT(zoomOut2X()));
73 
74  p_zoomOut4X = new QAction(parent);
75  p_zoomOut4X->setShortcut(Qt::CTRL + Qt::Key_Minus);
76  p_zoomOut4X->setText("Zoom Out 4X");
77  connect(p_zoomOut4X, SIGNAL(triggered()), this, SLOT(zoomOut4X()));
78 
79  p_zoomOut8X = new QAction(parent);
80  p_zoomOut8X->setShortcut(Qt::ALT + Qt::Key_Minus);
81  p_zoomOut8X->setText("Zoom Out 8X");
82  connect(p_zoomOut8X, SIGNAL(triggered()), this, SLOT(zoomOut8X()));
83 
84  p_zoomActual = new QAction(parent);
85  p_zoomActual->setShortcut(Qt::Key_Slash);
86  p_zoomActual->setText("&Actual Pixels");
87  p_zoomActual->setIcon(QPixmap(toolIconDir() + "/viewmag1.png"));
88  connect(p_zoomActual, SIGNAL(triggered()), this, SLOT(zoomActual()));
89 
90  p_zoomFit = new QAction(parent);
91  p_zoomFit->setShortcut(Qt::Key_Asterisk);
92  p_zoomFit->setText("&Fit in Window");
93  p_zoomFit->setIcon(QPixmap(toolIconDir() + "/viewmagfit.png"));
94  connect(p_zoomFit, SIGNAL(triggered()), this, SLOT(zoomFit()));
95 
96  }
97 
108  QAction *action = new QAction(toolpad);
109  action->setIcon(QPixmap(toolIconDir() + "/viewmag.png"));
110  action->setToolTip("Zoom (Z)");
111  action->setShortcut(Qt::Key_Z);
112  QString text =
113  "<b>Function:</b> Zoom in or out of the current cube. \
114  <p><b>Shortcut:</b> Z</p> ";
115  action->setWhatsThis(text);
116  return action;
117  }
118 
119 
128  void ZoomTool::addTo(QMenu *menu) {
129  menu->addAction(p_zoomFit);
130  menu->addAction(p_zoomActual);
131  menu->addAction(p_zoomIn2X);
132  menu->addAction(p_zoomOut2X);
133  }
134 
135 
154  QWidget *ZoomTool::createToolBarWidget(QStackedWidget *parent) {
155  QWidget *hbox = new QWidget(parent);
156 
157  QToolButton *zoomInButton = new QToolButton(hbox);
158  zoomInButton->setIcon(QPixmap(toolIconDir() + "/viewmag+.png"));
159  zoomInButton->setToolTip("Zoom In");
160  QString text =
161  "<b>Function:</b> Zoom in 2X at the center of the active viewport \
162  <p><b>Shortcut:</b> +</p> \
163  <p><b>Mouse:</b> LeftButton zooms in 2X under pointer</p> \
164  <p><b>Modifiers:</b> Shortcuts and mouse clicks can be augmented \
165  using the Ctrl or Alt key for 4X and 8X zooms, respectively</p> \
166  <p><b>Hint:</b> Left click and drag for a local zoom which scales data \
167  in the red marquee to the viewport</p>";
168  zoomInButton->setWhatsThis(text);
169  connect(zoomInButton, SIGNAL(clicked()), this, SLOT(zoomIn2X()));
170  zoomInButton->setAutoRaise(true);
171  zoomInButton->setIconSize(QSize(22, 22));
172 
173  QToolButton *zoomOutButton = new QToolButton(hbox);
174  zoomOutButton->setIcon(QPixmap(toolIconDir() + "/viewmag-.png"));
175  zoomOutButton->setToolTip("Zoom Out");
176  text =
177  "<b>Function:</b> Zoom out 2X at the center of the active viewport \
178  <p><b>Shortcut:</b> +</p> \
179  <p><b>Mouse:</b> RightButton zooms out 2X under pointer</p> \
180  <p><b>Modifiers:</b> Shortcuts and mouse clicks can be augmented \
181  using the Ctrl or Alt key for 4X and 8X zooms, respectively</p> \
182  <p><b>Hint:</b> Left click and drag for a local zoom which scales data \
183  in the red marquee to the viewport</p>";
184  zoomOutButton->setWhatsThis(text);
185  connect(zoomOutButton, SIGNAL(clicked()), this, SLOT(zoomOut2X()));
186  zoomOutButton->setAutoRaise(true);
187  zoomOutButton->setIconSize(QSize(22, 22));
188 
189  QToolButton *zoomActButton = new QToolButton(hbox);
190  zoomActButton->setIcon(QPixmap(toolIconDir() + "/viewmag1.png"));
191  zoomActButton->setToolTip("Zoom 1:1");
192  text =
193  "<b>Function:</b> Zoom the active viewport to 1:1 such that one \
194  viewport pixel represents one cube pixel. That is, 100% scale. \
195  <p><b>Shortcut:</b> /</p> \
196  <p><b>Mouse:</b> Ctrl+MiddleButton zooms 1:1 under pointer</p> \
197  <p><b>Hint:</b> MiddleButton (without Ctrl) retains current \
198  scale but moves the pixel under the pointer to the center of the \
199  viewport</p>";
200  zoomActButton->setWhatsThis(text);
201  connect(zoomActButton, SIGNAL(clicked()), this, SLOT(zoomActual()));
202  zoomActButton->setAutoRaise(true);
203  zoomActButton->setIconSize(QSize(22, 22));
204 
205  // Create menu on the zoomFit button to select fitting the cube for
206  // width or height.
207  QMenu *zoomFitMenu = new QMenu();
208  QAction *fitWidth = new QAction(this);
209  fitWidth->setText("Fit Width");
210  connect(fitWidth, SIGNAL(triggered(bool)), this, SLOT(zoomFitWidth()));
211  zoomFitMenu->addAction(fitWidth);
212 
213  QAction *fitHeight = new QAction(this);
214  fitHeight->setText("Fit Height");
215  connect(fitHeight, SIGNAL(triggered(bool)), this, SLOT(zoomFitHeight()));
216  zoomFitMenu->addAction(fitHeight);
217 
218  QToolButton *zoomFitButton = new QToolButton(hbox);
219  zoomFitButton->setIcon(QPixmap(toolIconDir() + "/viewmagfit.png"));
220  zoomFitButton->setMenu(zoomFitMenu);
221  zoomFitButton->setPopupMode(QToolButton::MenuButtonPopup);
222  zoomFitButton->setToolTip("Fit in viewport");
223  text =
224  "<b>Function:</b> Fit the entire cube inside the active viewport. For \
225  extremely large cubes, this may not be possible. \
226  <p><b>Shortcut:</b> *</p> \
227  <p><b>Hint:</b> Many shortcuts for the zoom tool and other tools \
228  are easily available on the numeric keypad </p>";
229  zoomFitButton->setWhatsThis(text);
230  connect(zoomFitButton, SIGNAL(clicked()), this, SLOT(zoomFit()));
231  zoomFitButton->setAutoRaise(true);
232  zoomFitButton->setIconSize(QSize(22, 22));
233 
234  p_zoomLineEdit = new QLineEdit(hbox);
235  p_zoomLineEdit->setText("");
236  p_zoomLineEdit->setMaxLength(8);
237  p_zoomLineEdit->setMaximumWidth(80);
238 
239  QDoubleValidator *dval = new QDoubleValidator(hbox);
240  p_zoomLineEdit->setValidator(dval);
241 
242  QSizePolicy policy = p_zoomLineEdit->sizePolicy();
243  policy.setHorizontalPolicy(QSizePolicy::Fixed);
244  p_zoomLineEdit->setSizePolicy(policy);
245 
246  p_zoomLineEdit->setToolTip("Scale");
247  text =
248  "<b>Function:</b> Shows the scale of the active viewport. Additionally, \
249  you can manually enter the scale.";
250  p_zoomLineEdit->setWhatsThis(text);
251  connect(p_zoomLineEdit, SIGNAL(returnPressed()), this, SLOT(zoomManual()));
252 
253  QHBoxLayout *layout = new QHBoxLayout(hbox);
254  layout->setMargin(0);
255  layout->addWidget(zoomInButton);
256  layout->addWidget(zoomOutButton);
257  layout->addWidget(zoomActButton);
258  layout->addWidget(zoomFitButton);
259  layout->addWidget(p_zoomLineEdit);
260  layout->addStretch(1);
261  hbox->setLayout(layout);
262  return hbox;
263  }
264 
270  zoomBy(2.0);
271  }
272 
273 
279  zoomBy(4.0);
280  }
281 
282 
288  zoomBy(8.0);
289  }
290 
291 
297  zoomBy(1.0 / 2.0);
298  }
299 
300 
306  zoomBy(1.0 / 4.0);
307  }
308 
309 
315  zoomBy(1.0 / 8.0);
316  }
317 
318 
324  // zoom factor passed in is 0
325  // this will indicate to set new scale to 1 in zoomBy()
326  zoomBy(0.0);
327  }
328 
329 
341  void ZoomTool::zoomBy(double factor) {
343  if(d == NULL) return;
344  double newScale = d->scale() * factor;
345  if(newScale == 0.0) {
346  // if zoomActual was called (1:1) the factor was set to 0.
347  // change scale to 1.0
348  newScale = 1.0;
349  }
350  setScale(d, newScale);
351  updateTool();
352 
353  if(cubeViewport()->isLinked()) {
354  for(int i = 0; i < (int)cubeViewportList()->size(); i++) {
355  d = (*(cubeViewportList()))[i];
356  if(d == cubeViewport()) continue;
357  if(d->isLinked()) {
358  newScale = d->scale() * factor;
359  if(newScale == 0.0) {
360  // if zoomActual was called (1:1) the factor was set to 0.
361  // change scale to 1.0
362  newScale = 1.0;
363  }
364  setScale(d, newScale);
365  }
366  }
367  }
368  }
369 
370 
381  if (d == NULL) return;
382  setScale(d, d->fitScale(), d->cubeSamples() / 2.0 + 0.5, d->cubeLines() / 2.0 + 0.5);
383  updateTool();
384 
385  if (d->isLinked()) {
386  for (int i = 0; i < (int)cubeViewportList()->size(); i++) {
387  d = (*(cubeViewportList()))[i];
388  if (d == cubeViewport()) continue;
389  if (d->isLinked()) {
390  setScale(d, d->fitScale(), d->cubeSamples() / 2.0 + 0.5, d->cubeLines() / 2.0 + 0.5);
391  }
392  }
393  }
394  }
395 
396 
397 
407  if (d == NULL) return;
408  setScale(d, d->fitScaleWidth(), d->cubeSamples() / 2.0 + 0.5, d->cubeLines() / 2.0 + 0.5);
409  updateTool();
410 
411  if (d->isLinked()) {
412  for (int i = 0; i < (int)cubeViewportList()->size(); i++) {
413  d = (*(cubeViewportList()))[i];
414  if (d == cubeViewport()) continue;
415  if (d->isLinked()) {
416  setScale(d, d->fitScaleWidth(), d->cubeSamples() / 2.0 + 0.5, d->cubeLines() / 2.0 + 0.5);
417  }
418  }
419  }
420  }
421 
422 
433  if (d == NULL) return;
434  setScale(d, d->fitScaleHeight(), d->cubeSamples() / 2.0 + 0.5, d->cubeLines() / 2.0 + 0.5);
435  updateTool();
436 
437  if (d->isLinked()) {
438  for (int i = 0; i < (int)cubeViewportList()->size(); i++) {
439  d = (*(cubeViewportList()))[i];
440  if (d == cubeViewport()) continue;
441  if (d->isLinked()) {
442  setScale(d, d->fitScaleHeight(), d->cubeSamples() / 2.0 + 0.5,
443  d->cubeLines() / 2.0 + 0.5);
444  }
445  }
446  }
447  }
448 
449 
460  if(d == NULL) return;
461  QString strScale = p_zoomLineEdit->text();
462  double newScale = strScale.toDouble() / 100.;
463  setScale(d, newScale);
464  d->setFocus();
465  updateTool();
466 
467  if(d->isLinked()) {
468  for(int i = 0; i < (int)cubeViewportList()->size(); i++) {
469  d = (*(cubeViewportList()))[i];
470  if(d == cubeViewport()) continue;
471  if(d->isLinked()) setScale(d, newScale);
472  }
473  }
474  }
475 
476 
483  if(cubeViewport() == NULL) {
484  p_zoomLineEdit->setText("");
485  }
486  else {
487  double scale = cubeViewport()->scale() * 100.0;
488  QString strScale;
489  strScale.setNum(scale);
490  p_zoomLineEdit->setText(strScale);
491  }
492  }
493 
494 
508  QApplication::processEvents();
510  if(!rubberBandTool()->isValid()) return;
511 
512  // The RubberBandTool has a rectangle
513  if(!rubberBandTool()->figureIsPoint()) {
514  QRect r = rubberBandTool()->rectangle();
515  if((r.width() >= 5) && (r.height() >= 5)) {
516  int x = r.x() + r.width() / 2;
517  int y = r.y() + r.height() / 2;
518  double xscale = (double) d->viewport()->width() / r.width();
519  double yscale = (double) d->viewport()->height() / r.height();
520  double newScale = xscale < yscale ? xscale : yscale;
521  if(rubberBandTool()->mouseButton() & Qt::RightButton) {
522  newScale = 1.0 / newScale;
523  }
524  newScale *= d->scale();
525  setScale(d, newScale, x, y);
526  updateTool();
527  if(d->isLinked()) {
528  for(int i = 0; i < (int)cubeViewportList()->size(); i++) {
529  d = (*(cubeViewportList()))[i];
530  if(d == cubeViewport()) continue;
531  if(d->isLinked()) {
532  int x = r.x() + r.width() / 2;
533  int y = r.y() + r.height() / 2;
534  double xscale = (double) d->viewport()->width() / r.width();
535  double yscale = (double) d->viewport()->height() / r.height();
536  double newScale = xscale < yscale ? xscale : yscale;
537  if(rubberBandTool()->mouseButton() & Qt::RightButton) {
538  newScale = 1.0 / newScale;
539  }
540  newScale *= d->scale();
541  setScale(d, newScale, x, y);
542  }
543  }
544  }
545  }
546  }
547  // The RubberBandTool has a point (mouse click)
548  else {
549  double factor = 2.0;
550  if(rubberBandTool()->mouseButton() & Qt::ControlModifier) {
551  factor = 4.0;
552  }
553  if(rubberBandTool()->mouseButton() & Qt::ShiftModifier) {
554  factor = 8.0;
555  }
556  if(rubberBandTool()->mouseButton() & Qt::RightButton) {
557  factor = 1.0 / factor;
558  }
559  if(rubberBandTool()->mouseButton() & Qt::MidButton) {
560  factor = 1.0;
561  }
562  if(rubberBandTool()->mouseButton() == Qt::MidButton + Qt::ControlModifier) {
563  factor = 0.0;
564  }
565 // MdiCubeViewport *d = cubeViewport();
566  double newScale = d->scale() * factor;
567  if(newScale == 0.0) {
568  // ctrl+middle (1:1) the factor was set to 0.
569  // change scale to 1.0
570  newScale = 1.0;
571  }
572  QPoint p = rubberBandTool()->vertices()[0];
573  setScale(d, newScale, p.x(), p.y());
574  updateTool();
575 
576  if(d->isLinked()) {
577  for(int i = 0; i < (int)cubeViewportList()->size(); i++) {
578  d = (*(cubeViewportList()))[i];
579  if(d == cubeViewport()) continue;
580  if(d->isLinked()) {
581  newScale = d->scale() * factor;
582  if(newScale == 0.0) {
583  // ctrl+middle (1:1) the factor was set to 0.
584  // change scale to 1.0
585  newScale = 1.0;
586  }
587  newScale = setScale(d, newScale, p.x(), p.y());
588  }
589  }
590  }
591  p_lastScale = newScale;
592  }
593  }
594 
595 
602  rubberBandTool()->enable(RubberBandTool::RectangleMode);
603  rubberBandTool()->enablePoints();
604  rubberBandTool()->enableAllClicks();
605  rubberBandTool()->setDrawActiveViewportOnly(false);
606  }
607 
625  double ZoomTool::setScale(MdiCubeViewport *d, double newScale) {
626 
627  double oldScale = d->scale();
628  try {
629  if (newScale <= 0.0) {
631  "Scale value must be greater than 0.",
632  _FILEINFO_);
633  }
634  d->setScale(newScale);
635  }
636  catch (IException &e) {
637  IException fullError(e,
639  "Unable to rescale image to ["
640  + IString(newScale*100) + "]",
641  _FILEINFO_);
642  QString message = fullError.toString();
643  QMessageBox::warning((QWidget *)parent(), "Warning", message);
644  newScale = oldScale;
645  d->setScale(newScale);
646  }
647  return newScale;
648  }
649 
650 
671  double ZoomTool::setScale(MdiCubeViewport *d, double newScale, int x, int y) {
672  double oldScale = d->scale();
673  try {
674  if (newScale <= 0.0) {
676  "Scale value must be greater than 0.", _FILEINFO_);
677  }
678  d->setScale(newScale, x, y);
679  }
680  catch (IException &e) {
681  IException fullError(e, IException::User,
682  "Unable to rescale image to ["
683  + IString(newScale * 100) + "]",
684  _FILEINFO_);
685  QString message = fullError.toString();
686  QMessageBox::warning((QWidget *)parent(), "Warning", message);
687  newScale = oldScale;
688  d->setScale(newScale, x, y);
689  }
690  return newScale;
691  }
692 
713  double ZoomTool::setScale(MdiCubeViewport *d, double newScale, double samp, double line) {
714  double oldScale = d->scale();
715  try {
716  if (newScale <= 0.0) {
718  "Scale value must be greater than 0.", _FILEINFO_);
719  }
720  d->setScale(newScale, samp, line);
721  }
722  catch (IException &e) {
723  IException fullError(e,
725  "Unable to rescale image to ["
726  + IString(newScale*100) + "]",
727  _FILEINFO_);
728  QString message = fullError.toString();
729  QMessageBox::warning((QWidget *)parent(), "Warning", message);
730  newScale = oldScale;
731  d->setScale(newScale, samp, line);
732  }
733  return newScale;
734  }
735 
736 }
Cube display widget for certain Isis MDI applications.
QAction * p_zoomActual
Zoom to actual size action.
Definition: ZoomTool.h:121
int cubeLines() const
Return the number of lines in the cube.
QString toolIconDir() const
returns the path to the icon directory.
Definition: Tool.h:127
QAction * p_zoomIn8X
Zoom in 8 times.
Definition: ZoomTool.h:115
void zoomFit()
Fits the cube in the viewport.
Definition: ZoomTool.cpp:379
void updateTool()
This method updates the line edits text to the correct zoom value.
Definition: ZoomTool.cpp:482
QList< QPoint > vertices()
This method returns the vertices.
CubeViewportList * cubeViewportList() const
Return the list of cubeviewports.
Definition: Tool.cpp:390
QAction * p_zoomOut8X
Zoom out 8 times.
Definition: ZoomTool.h:119
QRect rectangle()
This method returns a rectangle from the vertices set by the RubberBandTool.
QAction * p_zoomFit
Fit the cube in the viewport action.
Definition: ZoomTool.h:122
void zoomManual()
This method zooms by the value input in the line edit next to the zoom tools.
Definition: ZoomTool.cpp:458
void setScale(double scale)
Change the scale of the cube to the given parameter value.
void setDrawActiveViewportOnly(bool activeOnly=false)
This called to set whether rubber band is drawn on active viewport only rather than all linked viewpo...
double fitScale() const
Determine the scale that causes the full cube to fit in the viewport.
void zoomIn2X()
Zooms in 2 times.
Definition: ZoomTool.cpp:269
QAction * p_zoomOut4X
Zoom out 4 times.
Definition: ZoomTool.h:118
double p_lastScale
Last scale.
Definition: ZoomTool.h:125
QLineEdit * p_zoomLineEdit
Line edit for manual zoom factor.
Definition: ZoomTool.h:124
void zoomOut2X()
Zoom out 2 times.
Definition: ZoomTool.cpp:296
void zoomIn8X()
Zooms in 8 times.
Definition: ZoomTool.cpp:287
QAction * p_zoomOut2X
Zoom out 2 times.
Definition: ZoomTool.h:117
double fitScaleWidth() const
Determine the scale of cube in the width to fit in the viewport.
void zoomFitHeight()
Slot for the "Fit to Heighth" menu item on the Fit button.
Definition: ZoomTool.cpp:431
ZoomTool(QWidget *parent)
ZoomTool constructor.
Definition: ZoomTool.cpp:51
void addTo(QMenu *menu)
Adds the zoom action to the given menu.
Definition: ZoomTool.cpp:128
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:40
A type of error that could only have occurred due to a mistake on the user&#39;s part (e...
Definition: IException.h:142
void enableRubberBandTool()
This methods enables the RubberBandTool, it also sets the RubberBandTool to allow points and to allow...
Definition: ZoomTool.cpp:601
bool isLinked() const
Is the viewport linked with other viewports.
void zoomOut4X()
Zoom out 4 times.
Definition: ZoomTool.cpp:305
void rubberBandComplete()
This method is called when the RubberBandTool is complete.
Definition: ZoomTool.cpp:507
void zoomActual()
Zoom back to 1 to 1.
Definition: ZoomTool.cpp:323
int cubeSamples() const
Return the number of samples in the cube.
QString toString() const
Returns a string representation of this exception.
Definition: IException.cpp:553
void zoomBy(double factor)
Zoom by the given factor.
Definition: ZoomTool.cpp:341
Isis exception class.
Definition: IException.h:107
Adds specific functionality to C++ strings.
Definition: IString.h:181
QAction * p_zoomIn4X
Zoom in 4 times.
Definition: ZoomTool.h:114
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
Base class for the Qisis tools.
Definition: Tool.h:81
void zoomFitWidth()
Slot for the "Fit to Width" menu item on the Fit button.
Definition: ZoomTool.cpp:405
MdiCubeViewport * cubeViewport() const
Return the current cubeviewport.
Definition: Tool.h:211
QWidget * createToolBarWidget(QStackedWidget *parent)
Creates the widget to add to the tool bar.
Definition: ZoomTool.cpp:154
QAction * toolPadAction(ToolPad *toolpad)
Adds the action to the toolpad.
Definition: ZoomTool.cpp:107
void zoomOut8X()
Zoom out 8 times.
Definition: ZoomTool.cpp:314
double fitScaleHeight() const
Determine the scale of cube in heighth to fit in the viewport.
double setScale(MdiCubeViewport *d, double newScale)
This method will attempt to reset the scale for the given MdiCubeViewport using the new scale value...
Definition: ZoomTool.cpp:625
void zoomIn4X()
Zooms in 4 times.
Definition: ZoomTool.cpp:278
QAction * p_zoomIn2X
Zoom in 2 times.
Definition: ZoomTool.h:113
double scale() const
Definition: CubeViewport.h:224
void enable(RubberBandMode mode, bool showIndicatorColors=false)
This is called when changing modes or turning on.