Loading...
Searching...
No Matches
RotateGeometryTool.h
Go to the documentation of this file.
1/* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2
3 This file is part of the TerraLib - a Framework for building GIS enabled applications.
4
5 TerraLib is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version.
9
10 TerraLib is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public License
16 along with TerraLib. See COPYING. If not, write to
17 TerraLib Team at <terralib-team@terralib.org>.
18 */
19
20/*!
21 \file terralib/edit/qt/tools/RotateGeometryTool.h
22
23 \brief This class implements a concrete tool to rotate geometries.
24*/
25
26#ifndef __TERRALIB_EDIT_QT_INTERNAL_ROTATEGEOMETRYTOOL_H
27#define __TERRALIB_EDIT_QT_INTERNAL_ROTATEGEOMETRYTOOL_H
28
29// TerraLib
30#include "../../../geometry/Envelope.h"
31#ifndef Q_MOC_RUN
32#include "../../../maptools/AbstractLayer.h"
33#endif
34#include "../Config.h"
36
37namespace te
38{
39 namespace qt
40 {
41 namespace widgets
42 {
43 class Canvas;
44 class MapDisplay;
45 }
46 }
47
48 namespace edit
49 {
50// Forward declaration
51 class Feature;
52
53 /*!
54 \class MoveGeometryTool
55
56 \brief This class implements a concrete tool to rotate geometries.
57 */
59 {
60 Q_OBJECT
61
62 public:
63
64 /** @name Initializer Methods
65 * Methods related to instantiation and destruction.
66 */
67 //@{
68
69 /*!
70 \brief It constructs a rotate geometry tool associated with the given map display.
71
72 \param display The map display associated with the tool.
73 \param parent The tool's parent.
74
75 \note The tool will NOT take the ownership of the given pointers.
76 */
77 RotateGeometryTool(te::qt::widgets::MapDisplay* display, const te::map::AbstractLayerPtr& layer, QObject *parent = 0);
78 /*! \brief Destructor. */
80
81 //@}
82
83 /** @name AbstractTool Methods
84 * Methods related with tool behavior.
85 */
86 //@{
87
88 bool mousePressEvent(QMouseEvent* e);
89
90 bool mouseMoveEvent(QMouseEvent* e);
91
92 bool mouseReleaseEvent(QMouseEvent* e);
93
94 private:
95
96 void reset();
97
98 void pickFeature(const QPointF& pos);
99
100 te::gm::Envelope buildEnvelope(const QPointF& pos);
101
102 void draw();
103
105
107
108 protected:
109
110 bool m_rotateStarted; //!< Flag that indicates if move operation was started.
111 QPointF m_origin; //!< Origin point on mouse pressed.
112 double m_axisX;
114 };
115
116 } // end namespace edit
117} // end namespace te
118
119#endif // __TERRALIB_EDIT_QT_INTERNAL_ROTATEGEOMETRYTOOL_H
te::gm::Envelope buildEnvelope(const QPointF &pos)
RotateGeometryTool(te::qt::widgets::MapDisplay *display, const te::map::AbstractLayerPtr &layer, QObject *parent=0)
It constructs a rotate geometry tool associated with the given map display.
bool mousePressEvent(QMouseEvent *e)
This event handler can be reimplemented in a concrete tool class to receive mouse press events for th...
QPointF m_origin
Origin point on mouse pressed.
void pickFeature(const QPointF &pos)
bool mouseMoveEvent(QMouseEvent *e)
This event handler can be reimplemented in a concrete tool class to receive mouse move events for the...
bool m_rotateStarted
Flag that indicates if move operation was started.
bool mouseReleaseEvent(QMouseEvent *e)
This event handler can be reimplemented in a concrete tool class to receive mouse release events for ...
An Envelope defines a 2D rectangular region.
Definition Envelope.h:52
A widget to control the display of a set of layers.
Definition MapDisplay.h:72
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
TerraLib.
#define TEEDITQTEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition Config.h:60