27 #include "../../../geometry/Coord2D.h"
28 #include "../../../geometry/Envelope.h"
29 #include "../canvas/MapDisplay.h"
33 #include <QMouseEvent>
38 :
AbstractTool(display, parent), m_zoomFactor( zoomFactor )
48 if(e->button() == Qt::LeftButton)
57 #if QT_VERSION >= 0x050000
58 QPointF point( m_display->transform( e->localPos() ) );
60 QPointF point( m_display->transform( e->posF() ) );
65 double w = currentExtent.
getWidth() * ( 1.0 / m_zoomFactor ) * 0.5;
66 double h = currentExtent.
getHeight() * ( 1.0 / m_zoomFactor ) * 0.5;
71 m_display->setExtent(e);
73 else if( e->button() == Qt::RightButton)
82 #if QT_VERSION >= 0x050000
83 QPointF point( m_display->transform( e->localPos() ) );
85 QPointF point( m_display->transform( e->posF() ) );
90 double w = currentExtent.
getWidth() * m_zoomFactor * 0.5;
91 double h = currentExtent.
getHeight() * m_zoomFactor * 0.5;
96 m_display->setExtent(e);
double getWidth() const
It returns the envelope width.
An utility struct for representing 2D coordinates.
Coord2D getCenter() const
It returns the rectangle's center coordinate.
An Envelope defines a 2D rectangular region.
This class implements a concrete tool to geographic zoom operation using the left and right mouse cli...
double getHeight() const
It returns the envelope height.
bool isValid() const
It tells if the rectangle is valid or not.