This class implements a concrete tool to geographic zoom operation using the mouse click. More...
#include <ZoomClick.h>
Public Types | |
| enum | ZoomType { In, Out } |
| Defines the zoom type. More... | |
Public Member Functions | |
| void | applyZoom (const QPointF &point=QPointF(), bool centralize=true) |
| Performs the zoom operation on map display, considering the zoom factor, zoom type and the given point. More... | |
| virtual void | setCursor (const QCursor &cursor) |
| It sets the tool cursor. More... | |
| void | setZoomType (const ZoomType &type) |
| Sets the zoom operation type. More... | |
Initializer Methods | |
Methods related to instantiation and destruction. | |
| ZoomClick (MapDisplay *display, const QCursor &cursor, const double &zoomFactor=2.0, const ZoomType &type=In, QObject *parent=0) | |
| It constructs a zoom click tool associated with the given map display. More... | |
| ~ZoomClick () | |
| Destructor. More... | |
AbstractTool Methods | |
Methods related with tool behavior. | |
| bool | mousePressEvent (QMouseEvent *e) |
| This event handler can be reimplemented in a concrete tool class to receive mouse press events for the watched object. More... | |
| bool | mouseMoveEvent (QMouseEvent *e) |
| This event handler can be reimplemented in a concrete tool class to receive mouse move events for the watched object. More... | |
| bool | mouseReleaseEvent (QMouseEvent *e) |
| This event handler can be reimplemented in a concrete tool class to receive mouse release events for the watched object. More... | |
AbstractTool Methods | |
Methods related with tool behavior. | |
| virtual bool | eventFilter (QObject *watched, QEvent *e) |
| Filters events if this object has been installed as an event filter for the watched object. More... | |
| virtual bool | mouseDoubleClickEvent (QMouseEvent *e) |
| This event handler can be reimplemented in a concrete tool class to receive mouse double click events for the watched object. More... | |
| virtual bool | keyPressEvent (QKeyEvent *e) |
| This event handler can be reimplemented in a concrete tool class to receive key press events for the watched object. More... | |
Protected Attributes | |
| QCursor | m_curCursor |
| The current mapdisplay cursor. More... | |
| QCursor | m_cursor |
| The default tool cursor. More... | |
| MapDisplay * | m_display |
| The map display associated with the tool. More... | |
| double | m_zoomFactor |
| Factor used to zoom. i.e. A factor value of 2.0 (default) will generate a new extent twice (%) bigger or smaller, depending of ZoomType. More... | |
| ZoomType | m_zoomType |
| Enum that indicates the zoom type. More... | |
Private Attributes | |
| bool | m_zoomStarted |
This class implements a concrete tool to geographic zoom operation using the mouse click.
Definition at line 49 of file ZoomClick.h.
|
inherited |
| te::qt::widgets::ZoomClick::ZoomClick | ( | MapDisplay * | display, |
| const QCursor & | cursor, | ||
| const double & | zoomFactor = 2.0, |
||
| const ZoomType & | type = In, |
||
| QObject * | parent = 0 |
||
| ) |
It constructs a zoom click tool associated with the given map display.
| display | The map display associated with the tool. |
| cursor | The tool cursor. |
| zoomFactor | The factor used to zoom. i.e. A factor value of 2.0 (default) will generate a new extent twice (%) bigger or smaller. zoomType The zoom operation type - ZoomIn | ZoomOut. |
| parent | The tool's parent. |
Definition at line 34 of file ZoomClick.cpp.
References te::qt::widgets::AbstractTool::setCursor(), and ~ZoomClick().
|
default |
Destructor.
Referenced by ZoomClick().
|
inherited |
Performs the zoom operation on map display, considering the zoom factor, zoom type and the given point.
| point | A point in world coordinates. |
| centralize | If the reference point is given, its possible to choose between centering this reference point or keeping it in the same position that it was. |
Definition at line 49 of file Zoom.cpp.
References te::gm::Envelope::getCenter(), te::map::MapDisplay::getExtent(), te::gm::Envelope::getHeight(), te::gm::Envelope::getLowerLeftX(), te::gm::Envelope::getLowerLeftY(), te::gm::Envelope::getWidth(), te::qt::widgets::Zoom::In, te::gm::Envelope::init(), te::gm::Envelope::isValid(), te::qt::widgets::AbstractTool::m_display, te::qt::widgets::Zoom::m_zoomFactor, te::qt::widgets::Zoom::m_zoomType, te::qt::widgets::MapDisplay::setExtent(), te::gm::Coord2D::x, and te::gm::Coord2D::y.
Referenced by te::qt::widgets::ZoomKeyboard::eventFilter(), te::qt::widgets::ZoomWheel::eventFilter(), and mousePressEvent().
Filters events if this object has been installed as an event filter for the watched object.
| watched | The watched object. |
| event | The last event sent to watched object. |
Reimplemented in te::edit::GeometriesUpdateTool, te::qt::widgets::ZoomKeyboard, and te::qt::widgets::ZoomWheel.
Definition at line 50 of file AbstractTool.cpp.
References te::qt::widgets::AbstractTool::keyPressEvent(), te::qt::widgets::AbstractTool::m_cursor, te::qt::widgets::AbstractTool::m_display, te::qt::widgets::AbstractTool::mouseDoubleClickEvent(), te::qt::widgets::AbstractTool::mouseMoveEvent(), te::qt::widgets::AbstractTool::mousePressEvent(), and te::qt::widgets::AbstractTool::mouseReleaseEvent().
Referenced by te::qt::widgets::ZoomKeyboard::eventFilter(), te::qt::widgets::ZoomWheel::eventFilter(), and te::edit::GeometriesUpdateTool::eventFilter().
|
virtualinherited |
This event handler can be reimplemented in a concrete tool class to receive key press events for the watched object.
| e | The key event. |
Reimplemented in te::qt::widgets::Measure.
Definition at line 101 of file AbstractTool.cpp.
Referenced by te::qt::widgets::AbstractTool::eventFilter().
|
virtualinherited |
This event handler can be reimplemented in a concrete tool class to receive mouse double click events for the watched object.
| e | The mouse event. |
Reimplemented in te::edit::VertexTool, te::qt::widgets::Measure, te::edit::SplitPolygonTool, te::edit::CreatePolygonTool, te::edit::CreateLineTool, te::edit::CreatePointTool, te::qt::widgets::PolygonAcquire, te::edit::AggregateAreaTool, te::edit::SubtractAreaTool, and te::mnt::ProfileTools.
Definition at line 96 of file AbstractTool.cpp.
Referenced by te::qt::widgets::AbstractTool::eventFilter().
|
virtual |
This event handler can be reimplemented in a concrete tool class to receive mouse move events for the watched object.
| e | The mouse event. |
Reimplemented from te::qt::widgets::Zoom.
Definition at line 59 of file ZoomClick.cpp.
References te::qt::widgets::AbstractTool::m_display, m_zoomStarted, and te::qt::widgets::Zoom::mouseMoveEvent().
|
virtual |
This event handler can be reimplemented in a concrete tool class to receive mouse press events for the watched object.
| e | The mouse event. |
Reimplemented from te::qt::widgets::Zoom.
Definition at line 43 of file ZoomClick.cpp.
References te::qt::widgets::Zoom::applyZoom(), te::qt::widgets::AbstractTool::m_display, m_zoomStarted, te::qt::widgets::Zoom::mousePressEvent(), and te::qt::widgets::MapDisplay::transform().
|
virtual |
This event handler can be reimplemented in a concrete tool class to receive mouse release events for the watched object.
| e | The mouse event. |
Reimplemented from te::qt::widgets::Zoom.
Definition at line 70 of file ZoomClick.cpp.
References te::qt::widgets::AbstractTool::m_display, m_zoomStarted, and te::qt::widgets::Zoom::mouseReleaseEvent().
|
virtualinherited |
It sets the tool cursor.
| cursor | The cursor that will be used during the tool operation. |
Reimplemented in te::edit::GeometriesUpdateTool.
Definition at line 106 of file AbstractTool.cpp.
References te::qt::widgets::AbstractTool::m_curCursor, te::qt::widgets::AbstractTool::m_cursor, and te::qt::widgets::AbstractTool::m_display.
Referenced by te::qt::widgets::ExtentAcquire::ExtentAcquire(), te::qt::widgets::Info::Info(), te::qt::widgets::Measure::Measure(), te::qt::widgets::Pan::Pan(), te::qt::widgets::PanExtent::PanExtent(), te::qt::widgets::PointMove::PointMove(), te::qt::widgets::PointPicker::PointPicker(), te::qt::widgets::PolygonAcquire::PolygonAcquire(), te::qt::widgets::Selection::Selection(), te::qt::widgets::ZoomArea::ZoomArea(), and ZoomClick().
|
inherited |
Sets the zoom operation type.
| type | The zoom operation type - ZoomIn | ZoomOut; |
Definition at line 44 of file Zoom.cpp.
References te::qt::widgets::Zoom::m_zoomType.
Referenced by te::qt::widgets::ZoomKeyboard::eventFilter(), and te::qt::widgets::ZoomWheel::eventFilter().
|
protectedinherited |
The current mapdisplay cursor.
Definition at line 173 of file AbstractTool.h.
Referenced by te::edit::GeometriesUpdateTool::setCursor(), te::qt::widgets::AbstractTool::setCursor(), and te::qt::widgets::AbstractTool::~AbstractTool().
|
protectedinherited |
The default tool cursor.
Definition at line 172 of file AbstractTool.h.
Referenced by te::qt::widgets::AbstractTool::eventFilter(), te::qt::widgets::Pan::mouseReleaseEvent(), te::edit::GeometriesUpdateTool::setCursor(), and te::qt::widgets::AbstractTool::setCursor().
|
protectedinherited |
The map display associated with the tool.
Definition at line 171 of file AbstractTool.h.
Referenced by te::qt::widgets::AbstractTool::AbstractTool(), te::qt::widgets::Zoom::applyZoom(), te::edit::MergeGeometriesTool::buildEnvelope(), te::edit::EditInfoTool::buildEnvelope(), te::qt::widgets::PointMove::buildEnvelope(), te::edit::SubtractAreaTool::buildEnvelope(), te::edit::RotateGeometryTool::buildEnvelope(), te::edit::DeleteGeometryTool::buildEnvelope(), te::edit::DeletePartTool::buildEnvelope(), te::edit::AggregateAreaTool::buildEnvelope(), te::edit::MoveGeometryTool::buildEnvelope(), te::edit::DeleteGeometryByAreaTool::buildEnvelope(), te::edit::VertexTool::buildEnvelope(), te::edit::CreateLineTool::buildLine(), te::edit::CreatePointTool::buildPoint(), te::edit::SubtractAreaTool::buildPolygon(), te::edit::AggregateAreaTool::buildPolygon(), te::edit::DeleteGeometryByAreaTool::buildPolygon(), te::edit::CreatePolygonTool::buildPolygon(), te::qt::widgets::PolygonAcquire::clear(), te::qt::widgets::Measure::clear(), te::qt::widgets::CoordTracking::CoordTracking(), te::edit::CreateLineTool::CreateLineTool(), te::edit::CreatePolygonTool::CreatePolygonTool(), te::edit::MergeGeometriesTool::draw(), te::edit::EditInfoTool::draw(), te::edit::SubtractAreaTool::draw(), te::qt::widgets::PointMove::draw(), te::edit::AggregateAreaTool::draw(), te::edit::RotateGeometryTool::draw(), te::edit::CreatePointTool::draw(), te::edit::DeleteGeometryByAreaTool::draw(), te::edit::CreateLineTool::draw(), te::edit::CreatePolygonTool::draw(), te::edit::MoveGeometryTool::draw(), te::edit::SplitPolygonTool::draw(), te::edit::VertexTool::draw(), te::qt::widgets::PanExtent::drawCurrentExtent(), SelectionTool::drawGeometries(), te::qt::widgets::PolygonAcquire::drawGeometry(), te::qt::widgets::Measure::drawGeometry(), te::edit::MergeGeometriesTool::editingFinished(), te::edit::SubtractAreaTool::editingFinished(), te::edit::AggregateAreaTool::editingFinished(), te::qt::widgets::ZoomKeyboard::eventFilter(), te::qt::widgets::ZoomWheel::eventFilter(), te::qt::widgets::AbstractTool::eventFilter(), te::qt::widgets::Selection::executeSelection(), te::edit::DeleteGeometryByAreaTool::executeSelection(), te::edit::MergeGeometriesTool::getBaseOID(), te::edit::MergeGeometriesTool::getRefEnvelope(), te::qt::widgets::Measure::Measure(), te::edit::SubtractAreaTool::mouseDoubleClickEvent(), te::edit::AggregateAreaTool::mouseDoubleClickEvent(), te::qt::widgets::PolygonAcquire::mouseDoubleClickEvent(), te::edit::CreatePolygonTool::mouseDoubleClickEvent(), te::edit::VertexTool::mouseDoubleClickEvent(), te::qt::plugins::mnt::ShowValuesTool::mouseMoveEvent(), te::qt::widgets::PanMiddleClick::mouseMoveEvent(), mouseMoveEvent(), te::qt::widgets::Pan::mouseMoveEvent(), te::qt::widgets::CoordTracking::mouseMoveEvent(), te::qt::widgets::RubberBand::mouseMoveEvent(), te::qt::widgets::PointMove::mouseMoveEvent(), te::qt::widgets::PointPicker::mouseMoveEvent(), te::qt::widgets::Zoom::mouseMoveEvent(), te::qt::widgets::PanExtent::mouseMoveEvent(), te::qt::widgets::PolygonAcquire::mouseMoveEvent(), te::edit::CreateLineTool::mouseMoveEvent(), te::edit::DeleteGeometryByAreaTool::mouseMoveEvent(), te::edit::CreatePolygonTool::mouseMoveEvent(), te::edit::MoveGeometryTool::mouseMoveEvent(), te::qt::widgets::Measure::mouseMoveEvent(), te::edit::VertexTool::mouseMoveEvent(), te::edit::EditInfoTool::mousePressEvent(), te::qt::widgets::ZoomLeftAndRightClick::mousePressEvent(), te::qt::widgets::PanMiddleClick::mousePressEvent(), te::qt::widgets::Pan::mousePressEvent(), mousePressEvent(), te::qt::widgets::PointPicker::mousePressEvent(), te::qt::widgets::PanExtent::mousePressEvent(), te::qt::widgets::PolygonAcquire::mousePressEvent(), te::edit::CreateLineTool::mousePressEvent(), te::edit::CreatePointTool::mousePressEvent(), te::edit::DeleteGeometryTool::mousePressEvent(), te::edit::DeletePartTool::mousePressEvent(), te::edit::CreatePolygonTool::mousePressEvent(), te::edit::MoveGeometryTool::mousePressEvent(), te::edit::DeleteGeometryByAreaTool::mousePressEvent(), te::qt::widgets::Measure::mousePressEvent(), te::qt::widgets::ReadPixelTool::mouseReleaseEvent(), SelectionTool::mouseReleaseEvent(), ReadPixelTool::mouseReleaseEvent(), te::mnt::ProfileTools::mouseReleaseEvent(), te::edit::SubtractAreaTool::mouseReleaseEvent(), te::qt::widgets::PanMiddleClick::mouseReleaseEvent(), te::qt::widgets::ZoomArea::mouseReleaseEvent(), te::qt::widgets::Pan::mouseReleaseEvent(), mouseReleaseEvent(), te::qt::widgets::PointPicker::mouseReleaseEvent(), te::qt::widgets::PointMove::mouseReleaseEvent(), te::qt::widgets::RubberBand::mouseReleaseEvent(), te::qt::widgets::ExtentAcquire::mouseReleaseEvent(), te::qt::widgets::Zoom::mouseReleaseEvent(), te::edit::AggregateAreaTool::mouseReleaseEvent(), te::edit::CreatePolygonTool::mouseReleaseEvent(), te::qt::widgets::Selection::mouseReleaseEvent(), te::qt::widgets::Info::mouseReleaseEvent(), te::qt::widgets::Measure::onExtentChanged(), te::edit::MergeGeometriesTool::pickFeature(), te::edit::EditInfoTool::pickFeature(), te::edit::SubtractAreaTool::pickFeature(), te::edit::RotateGeometryTool::pickFeature(), te::edit::AggregateAreaTool::pickFeature(), te::edit::MoveGeometryTool::pickFeature(), te::edit::VertexTool::pickFeature(), te::edit::SplitPolygonTool::pickFeatures(), te::qt::widgets::PolygonAcquire::PolygonAcquire(), SelectionTool::SelectionTool(), te::edit::GeometriesUpdateTool::setCursor(), te::qt::widgets::AbstractTool::setCursor(), te::edit::SplitPolygonTool::splitPolygon(), te::edit::SubtractAreaTool::storeUndoCommand(), te::edit::AggregateAreaTool::storeUndoCommand(), te::edit::MoveGeometryTool::storeUndoCommand(), te::edit::CreatePolygonTool::storeUndoCommand(), te::edit::VertexTool::storeUndoCommand(), te::qt::widgets::ZoomKeyboard::ZoomKeyboard(), te::qt::widgets::AbstractTool::~AbstractTool(), te::qt::widgets::Info::~Info(), te::qt::widgets::Measure::~Measure(), te::qt::widgets::PolygonAcquire::~PolygonAcquire(), and SelectionTool::~SelectionTool().
|
protectedinherited |
Factor used to zoom. i.e. A factor value of 2.0 (default) will generate a new extent twice (%) bigger or smaller, depending of ZoomType.
Definition at line 110 of file Zoom.h.
Referenced by te::qt::widgets::Zoom::applyZoom().
|
private |
Definition at line 91 of file ZoomClick.h.
Referenced by mouseMoveEvent(), mousePressEvent(), and mouseReleaseEvent().
|
protectedinherited |
Enum that indicates the zoom type.
Definition at line 111 of file Zoom.h.
Referenced by te::qt::widgets::Zoom::applyZoom(), and te::qt::widgets::Zoom::setZoomType().