Isis 3 Programmer Reference
Isis::MosaicZoomTool Class Reference

Handles zoom operations for Isis qt apps. More...

#include <MosaicZoomTool.h>

Inheritance diagram for Isis::MosaicZoomTool:
Inheritance graph
Collaboration diagram for Isis::MosaicZoomTool:
Collaboration graph

Public Slots

void zoomIn2X (QPointF center=QPointF())
 Zooms in 2 times.
 
void zoomOut2X (QPointF center=QPointF())
 Zoom out 2 times.
 
void zoomActual (QPointF center=QPointF())
 Zoom back to 1 to 1.
 
void zoomFit ()
 Fits the in the graphics view.
 
void zoomFitWidth ()
 Slot for the "Fit to Width" menu item on the Fit button.
 
void zoomFitHeight ()
 Slot for the "Fit to Heighth" menu item on the Fit button.
 
void zoomManual ()
 This method zooms by the value input in the line edit next to the zoom tools.
 
void activate (bool)
 Activates the tool.
 

Signals

void activated (bool)
 

Public Member Functions

 MosaicZoomTool (MosaicSceneWidget *)
 MosaicZoomTool constructor.
 
void updateResolutionBox ()
 Updates the text in the screen resolution display box to the current screen resolution, in meters per pixel.
 
QList< QAction * > getViewActions ()
 
bool isActive () const
 Returns the activeness of this toool.
 
QPixmap getIcon (QString iconName) const
 returns the path to the icon directory.
 
virtual void addTo (QMenu *menu)
 
virtual void addTo (ToolPad *toolPad)
 
virtual void addTo (QToolBar *toolBar)
 
virtual PvlObject toPvl () const
 
virtual void fromPvl (const PvlObject &obj)
 
virtual QString projectPvlObjectName () const
 

Protected Slots

void updateTool ()
 This method updates the line edits text to the correct zoom value.
 

Protected Member Functions

QActiongetPrimaryAction ()
 This method returns an action that is used to activate this tool.
 
QWidgetgetToolBarWidget ()
 Creates the widget to add to the tool bar.
 
void mouseButtonRelease (QPointF, Qt::MouseButton s)
 
void mouseWheel (QPointF, int)
 
void rubberBandComplete (QRectF r, Qt::MouseButton s)
 This method is called when the RubberBandTool is complete.
 
virtual void mouseEnter ()
 
virtual void mouseMove (QPointF)
 
virtual void mouseLeave ()
 
virtual void mouseDoubleClick (QPointF)
 
virtual void mouseButtonPress (QPointF, Qt::MouseButton s)
 
void toolBarDestroyed (QObject *obj)
 
MosaicSceneWidgetgetWidget ()
 

Private Member Functions

double limitZoomBy (double factor)
 
void zoomBy (double factor, QPointF center=QPointF())
 Zoom IN by the given factor.
 
void enableToolBar ()
 Enables entire tool bar.
 
void disableToolBar ()
 Disables entire tool bar.
 

Private Attributes

QLineEdit * p_zoomLineEdit
 Line edit for manual zoom factor.
 
QDoubleSpinBox * p_scaleBox
 
double p_screenResolution
 
QPointer< QActionm_zoomInAction
 
QPointer< QActionm_zoomOutAction
 
QPointer< QActionm_zoomFitAction
 
bool p_active
 Is the tool active?
 
MosaicSceneWidgetp_widget
 
QActionp_primaryAction
 
QActionp_toolBarAction
 

Detailed Description

Handles zoom operations for Isis qt apps.

Author
????-??-?? Stacy Alley
History

2011-09-27 Steven Lambright - Improved user documentation

2011-11-04 Steven Lambright - Mouse wheel improved

Definition at line 26 of file MosaicZoomTool.h.

Constructor & Destructor Documentation

◆ MosaicZoomTool()

Isis::MosaicZoomTool::MosaicZoomTool ( MosaicSceneWidget * scene)

MosaicZoomTool constructor.

Parameters
parent

Definition at line 27 of file MosaicZoomTool.cpp.

References Isis::MosaicTool::getIcon(), zoomFit(), zoomIn2X(), and zoomOut2X().

Member Function Documentation

◆ activate

void Isis::MosaicTool::activate ( bool on)
slotinherited

Activates the tool.

Parameters
on

Definition at line 148 of file MosaicTool.cpp.

◆ addTo() [1/3]

virtual void Isis::MosaicTool::addTo ( QMenu * menu)
inlinevirtualinherited

Definition at line 63 of file MosaicTool.h.

◆ addTo() [2/3]

void Isis::MosaicTool::addTo ( QToolBar * toolBar)
virtualinherited

Definition at line 70 of file MosaicTool.cpp.

◆ addTo() [3/3]

void Isis::MosaicTool::addTo ( ToolPad * toolPad)
virtualinherited

Definition at line 52 of file MosaicTool.cpp.

◆ disableToolBar()

void Isis::MosaicTool::disableToolBar ( )
privateinherited

Disables entire tool bar.

Definition at line 174 of file MosaicTool.cpp.

◆ enableToolBar()

void Isis::MosaicTool::enableToolBar ( )
privateinherited

Enables entire tool bar.

Definition at line 185 of file MosaicTool.cpp.

◆ fromPvl()

void Isis::MosaicTool::fromPvl ( const PvlObject & obj)
virtualinherited

Reimplemented in Isis::MosaicGridTool.

Definition at line 101 of file MosaicTool.cpp.

◆ getIcon()

◆ getPrimaryAction()

QAction * Isis::MosaicZoomTool::getPrimaryAction ( )
protectedvirtual

This method returns an action that is used to activate this tool.

This method will only be called once so it can new the action without a problem.

Implements Isis::MosaicTool.

Definition at line 116 of file MosaicZoomTool.cpp.

References Isis::MosaicTool::getIcon().

◆ getToolBarWidget()

QWidget * Isis::MosaicZoomTool::getToolBarWidget ( )
protectedvirtual

Creates the widget to add to the tool bar.

Parameters
parent
Returns
QWidget*

Reimplemented from Isis::MosaicTool.

Definition at line 143 of file MosaicZoomTool.cpp.

References zoomManual().

◆ getViewActions()

QList< QAction * > Isis::MosaicZoomTool::getViewActions ( )
virtual

Reimplemented from Isis::MosaicTool.

Definition at line 105 of file MosaicZoomTool.cpp.

◆ getWidget()

MosaicSceneWidget * Isis::MosaicTool::getWidget ( )
inlineprotectedinherited

Definition at line 96 of file MosaicTool.h.

◆ isActive()

bool Isis::MosaicTool::isActive ( ) const
inlineinherited

Returns the activeness of this toool.

Returns
bool

Definition at line 50 of file MosaicTool.h.

References Isis::MosaicTool::p_active.

Referenced by rubberBandComplete(), Isis::MosaicControlNetTool::updateTool(), Isis::MosaicFindTool::updateTool(), Isis::MosaicSelectTool::updateTool(), and updateTool().

◆ limitZoomBy()

double Isis::MosaicZoomTool::limitZoomBy ( double factor)
private

Definition at line 252 of file MosaicZoomTool.cpp.

◆ mouseButtonPress()

void Isis::MosaicTool::mouseButtonPress ( QPointF ,
Qt::MouseButton s )
protectedvirtualinherited

Definition at line 130 of file MosaicTool.cpp.

◆ mouseButtonRelease()

void Isis::MosaicZoomTool::mouseButtonRelease ( QPointF mouseLoc,
Qt::MouseButton s )
protectedvirtual

Reimplemented from Isis::MosaicTool.

Definition at line 186 of file MosaicZoomTool.cpp.

◆ mouseDoubleClick()

void Isis::MosaicTool::mouseDoubleClick ( QPointF )
protectedvirtualinherited

Definition at line 126 of file MosaicTool.cpp.

◆ mouseEnter()

virtual void Isis::MosaicTool::mouseEnter ( )
inlineprotectedvirtualinherited

Definition at line 81 of file MosaicTool.h.

◆ mouseLeave()

virtual void Isis::MosaicTool::mouseLeave ( )
inlineprotectedvirtualinherited

Definition at line 83 of file MosaicTool.h.

◆ mouseMove()

void Isis::MosaicTool::mouseMove ( QPointF )
protectedvirtualinherited

Definition at line 122 of file MosaicTool.cpp.

◆ mouseWheel()

void Isis::MosaicZoomTool::mouseWheel ( QPointF mouseLoc,
int delta )
protectedvirtual

Reimplemented from Isis::MosaicTool.

Definition at line 197 of file MosaicZoomTool.cpp.

◆ projectPvlObjectName()

QString Isis::MosaicTool::projectPvlObjectName ( ) const
virtualinherited

Reimplemented in Isis::MosaicGridTool.

Definition at line 110 of file MosaicTool.cpp.

◆ rubberBandComplete()

void Isis::MosaicZoomTool::rubberBandComplete ( QRectF r,
Qt::MouseButton s )
protectedvirtual

This method is called when the RubberBandTool is complete.

The view is centered on the center point of the rubberband's rectangle, then zoomed based on the largest side of the rectange. (Width or height.)

Reimplemented from Isis::MosaicTool.

Definition at line 382 of file MosaicZoomTool.cpp.

References Isis::MosaicTool::isActive(), updateResolutionBox(), and zoomBy().

◆ toolBarDestroyed()

void Isis::MosaicTool::toolBarDestroyed ( QObject * obj)
protectedinherited

Definition at line 165 of file MosaicTool.cpp.

◆ toPvl()

PvlObject Isis::MosaicTool::toPvl ( ) const
virtualinherited

Reimplemented in Isis::MosaicGridTool.

Definition at line 89 of file MosaicTool.cpp.

◆ updateResolutionBox()

void Isis::MosaicZoomTool::updateResolutionBox ( )

Updates the text in the screen resolution display box to the current screen resolution, in meters per pixel.

Definition at line 83 of file MosaicZoomTool.cpp.

Referenced by rubberBandComplete(), updateTool(), zoomBy(), and zoomFit().

◆ updateTool

void Isis::MosaicZoomTool::updateTool ( )
protectedslot

This method updates the line edits text to the correct zoom value.

Definition at line 359 of file MosaicZoomTool.cpp.

References Isis::MosaicTool::isActive(), and updateResolutionBox().

◆ zoomActual

void Isis::MosaicZoomTool::zoomActual ( QPointF center = QPointF())
slot

Zoom back to 1 to 1.

Definition at line 247 of file MosaicZoomTool.cpp.

References zoomBy().

◆ zoomBy()

void Isis::MosaicZoomTool::zoomBy ( double factor,
QPointF center = QPointF() )
private

Zoom IN by the given factor.

Parameters
factor

Definition at line 295 of file MosaicZoomTool.cpp.

References updateResolutionBox().

Referenced by rubberBandComplete(), zoomActual(), zoomIn2X(), zoomManual(), and zoomOut2X().

◆ zoomFit

void Isis::MosaicZoomTool::zoomFit ( )
slot

Fits the in the graphics view.

Definition at line 312 of file MosaicZoomTool.cpp.

References Isis::MosaicSceneWidget::refit(), and updateResolutionBox().

Referenced by MosaicZoomTool().

◆ zoomFitHeight

void Isis::MosaicZoomTool::zoomFitHeight ( )
slot

Slot for the "Fit to Heighth" menu item on the Fit button.

This will display the cube so that the entire cube heighth is displayed.

Definition at line 332 of file MosaicZoomTool.cpp.

◆ zoomFitWidth

void Isis::MosaicZoomTool::zoomFitWidth ( )
slot

Slot for the "Fit to Width" menu item on the Fit button.

Definition at line 322 of file MosaicZoomTool.cpp.

◆ zoomIn2X

void Isis::MosaicZoomTool::zoomIn2X ( QPointF center = QPointF())
slot

Zooms in 2 times.

Definition at line 229 of file MosaicZoomTool.cpp.

References zoomBy().

Referenced by MosaicZoomTool().

◆ zoomManual

void Isis::MosaicZoomTool::zoomManual ( )
slot

This method zooms by the value input in the line edit next to the zoom tools.

This method is called when the double spin box value has been changed. First we figure out what we need to scale the graphics view in order to achive the user's desired screen resolution.

Definition at line 346 of file MosaicZoomTool.cpp.

References zoomBy().

Referenced by getToolBarWidget().

◆ zoomOut2X

void Isis::MosaicZoomTool::zoomOut2X ( QPointF center = QPointF())
slot

Zoom out 2 times.

Definition at line 238 of file MosaicZoomTool.cpp.

References zoomBy().

Referenced by MosaicZoomTool().

Member Data Documentation

◆ m_zoomFitAction

QPointer<QAction> Isis::MosaicZoomTool::m_zoomFitAction
private

Definition at line 64 of file MosaicZoomTool.h.

◆ m_zoomInAction

QPointer<QAction> Isis::MosaicZoomTool::m_zoomInAction
private

Definition at line 62 of file MosaicZoomTool.h.

◆ m_zoomOutAction

QPointer<QAction> Isis::MosaicZoomTool::m_zoomOutAction
private

Definition at line 63 of file MosaicZoomTool.h.

◆ p_active

bool Isis::MosaicTool::p_active
privateinherited

Is the tool active?

Definition at line 120 of file MosaicTool.h.

Referenced by Isis::MosaicTool::isActive().

◆ p_primaryAction

QAction* Isis::MosaicTool::p_primaryAction
privateinherited

Definition at line 124 of file MosaicTool.h.

◆ p_scaleBox

QDoubleSpinBox* Isis::MosaicZoomTool::p_scaleBox
private

Definition at line 59 of file MosaicZoomTool.h.

◆ p_screenResolution

double Isis::MosaicZoomTool::p_screenResolution
private

Definition at line 60 of file MosaicZoomTool.h.

◆ p_toolBarAction

QAction* Isis::MosaicTool::p_toolBarAction
privateinherited

Definition at line 125 of file MosaicTool.h.

◆ p_widget

MosaicSceneWidget* Isis::MosaicTool::p_widget
privateinherited

Definition at line 122 of file MosaicTool.h.

◆ p_zoomLineEdit

QLineEdit* Isis::MosaicZoomTool::p_zoomLineEdit
private

Line edit for manual zoom factor.

Definition at line 58 of file MosaicZoomTool.h.


The documentation for this class was generated from the following files: