This class implements a concrete tool to geographic zoom operation using the mouse wheel.
More...
#include <ZoomWheel.h>
|
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 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...
|
|
virtual 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...
|
|
virtual 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...
|
|
virtual void | setCursor (const QCursor &cursor) |
| It sets the tool cursor. More...
|
|
void | setZoomType (const ZoomType &type) |
| Sets the zoom operation type. More...
|
|
|
Methods related to instantiation and destruction.
|
| ZoomWheel (MapDisplay *display, const double &zoomFactor=2.0, const bool ¢ralize=true, QObject *parent=0) |
| It constructs a zoom wheel tool associated with the given map display. More...
|
|
| ~ZoomWheel () |
| Destructor. More...
|
|
|
Methods related with tool behavior.
|
bool | eventFilter (QObject *watched, QEvent *e) |
| Filters events if this object has been installed as an event filter for the watched object. More...
|
|
|
Methods related with tool behavior.
|
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...
|
|
This class implements a concrete tool to geographic zoom operation using the mouse wheel.
Definition at line 49 of file ZoomWheel.h.
◆ ZoomType
Defines the zoom type.
Enumerator |
---|
In | Performs the zoom in operation.
|
Out | Performs the zoom out operation.
|
Definition at line 58 of file Zoom.h.
◆ ZoomWheel()
te::qt::widgets::ZoomWheel::ZoomWheel |
( |
MapDisplay * |
display, |
|
|
const double & |
zoomFactor = 2.0 , |
|
|
const bool & |
centralize = true , |
|
|
QObject * |
parent = 0 |
|
) |
| |
It constructs a zoom wheel tool associated with the given map display.
- Parameters
-
display | The map display associated with the tool. |
zoomFactor | The factor used to zoom. i.e. A factor value of 2.0 (default) will generate a new extent twice (%) bigger or smaller. |
parent | The tool's parent. |
- Note
- The tool will NOT take the ownership of the given pointers.
◆ ~ZoomWheel()
te::qt::widgets::ZoomWheel::~ZoomWheel |
( |
| ) |
|
◆ applyZoom()
void te::qt::widgets::Zoom::applyZoom |
( |
const QPointF & |
point = QPointF() , |
|
|
bool |
centralize = true |
|
) |
| |
|
inherited |
Performs the zoom operation on map display, considering the zoom factor, zoom type and the given point.
- Parameters
-
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. |
- Note
- If the given point is not null, the new extent will be centered on this point. Otherwise, the current center will be kepped.
◆ eventFilter()
bool te::qt::widgets::ZoomWheel::eventFilter |
( |
QObject * |
watched, |
|
|
QEvent * |
e |
|
) |
| |
|
virtual |
Filters events if this object has been installed as an event filter for the watched object.
- Parameters
-
watched | The watched object. |
event | The last event sent to watched object. |
- Note
- In your reimplementation of this function, if you want to filter the event out, i.e. stop it being handled further, return true; otherwise return false.
-
Here, the default implementation looks for QMouseEvents and call the pure virutal methods defined on AbstractTool class, e.g. mousePressEvent().
Reimplemented from te::qt::widgets::AbstractTool.
◆ keyPressEvent()
virtual bool te::qt::widgets::AbstractTool::keyPressEvent |
( |
QKeyEvent * |
e | ) |
|
|
virtualinherited |
This event handler can be reimplemented in a concrete tool class to receive key press events for the watched object.
- Parameters
-
- Returns
- If you want to filter the event out, i.e. stop it being handled further, return true; otherwise return false.
Reimplemented in te::qt::widgets::Measure.
◆ mouseDoubleClickEvent()
virtual bool te::qt::widgets::AbstractTool::mouseDoubleClickEvent |
( |
QMouseEvent * |
e | ) |
|
|
virtualinherited |
This event handler can be reimplemented in a concrete tool class to receive mouse double click events for the watched object.
- Parameters
-
- Returns
- If you want to filter the event out, i.e. stop it being handled further, return true; otherwise return false.
- Note
- The AbstractTool will also receive mouse press and mouse release events in addition to the double click event. It is up to the developer to ensure that the application interprets these events correctly.
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::mnt::ProfileTools, and te::edit::SubtractAreaTool.
◆ mouseMoveEvent()
virtual bool te::qt::widgets::Zoom::mouseMoveEvent |
( |
QMouseEvent * |
e | ) |
|
|
virtualinherited |
This event handler can be reimplemented in a concrete tool class to receive mouse move events for the watched object.
- Parameters
-
- Returns
- If you want to filter the event out, i.e. stop it being handled further, return true; otherwise return false.
Reimplemented from te::qt::widgets::AbstractTool.
Reimplemented in te::qt::widgets::ZoomClick.
◆ mousePressEvent()
virtual bool te::qt::widgets::Zoom::mousePressEvent |
( |
QMouseEvent * |
e | ) |
|
|
virtualinherited |
This event handler can be reimplemented in a concrete tool class to receive mouse press events for the watched object.
- Parameters
-
- Returns
- If you want to filter the event out, i.e. stop it being handled further, return true; otherwise return false.
Reimplemented from te::qt::widgets::AbstractTool.
Reimplemented in te::qt::widgets::ZoomClick.
◆ mouseReleaseEvent()
virtual bool te::qt::widgets::Zoom::mouseReleaseEvent |
( |
QMouseEvent * |
e | ) |
|
|
virtualinherited |
This event handler can be reimplemented in a concrete tool class to receive mouse release events for the watched object.
- Parameters
-
- Returns
- If you want to filter the event out, i.e. stop it being handled further, return true; otherwise return false.
Reimplemented from te::qt::widgets::AbstractTool.
Reimplemented in te::qt::widgets::ZoomClick.
◆ setCursor()
virtual void te::qt::widgets::AbstractTool::setCursor |
( |
const QCursor & |
cursor | ) |
|
|
virtualinherited |
◆ setZoomType()
void te::qt::widgets::Zoom::setZoomType |
( |
const ZoomType & |
type | ) |
|
|
inherited |
Sets the zoom operation type.
- Parameters
-
type | The zoom operation type - ZoomIn | ZoomOut; |
◆ m_centralize
bool te::qt::widgets::ZoomWheel::m_centralize |
|
protected |
If TRUE, the reference that will be used will be the center of the map display extent. If FALSE, the position of the wheel will be used as reference.
Definition at line 85 of file ZoomWheel.h.
◆ m_curCursor
QCursor te::qt::widgets::AbstractTool::m_curCursor |
|
protectedinherited |
◆ m_cursor
QCursor te::qt::widgets::AbstractTool::m_cursor |
|
protectedinherited |
◆ m_display
MapDisplay* te::qt::widgets::AbstractTool::m_display |
|
protectedinherited |
The map display associated with the tool.
Definition at line 171 of file AbstractTool.h.
◆ m_zoomFactor
double te::qt::widgets::Zoom::m_zoomFactor |
|
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.
◆ m_zoomType
ZoomType te::qt::widgets::Zoom::m_zoomType |
|
protectedinherited |
Enum that indicates the zoom type.
Definition at line 111 of file Zoom.h.
The documentation for this class was generated from the following file:
- /home/castejon/castejon_files/develop/terralib5/git_master/src/terralib/qt/widgets/tools/ZoomWheel.h