DeleteGeometryTool.h
Go to the documentation of this file.
1 /* Copyright (C) 2001-2009 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/MoveGeometryTool.h
22 
23  \brief This class implements a concrete tool to move geometries.
24 */
25 
26 #ifndef __TERRALIB_EDIT_QT_INTERNAL_DELETEGEOMETRYTOOL_H
27 #define __TERRALIB_EDIT_QT_INTERNAL_DELETEGEOMETRYTOOL_H
28 
29 // TerraLib
30 #include "../../../dataaccess/dataset/ObjectId.h"
31 #include "../../../geometry/Envelope.h"
32 #include "../../../geometry/Geometry.h"
33 #include "../../../maptools/AbstractLayer.h"
34 #include "../../Utils.h"
35 #include "../Config.h"
36 
37 #include "GeometriesUpdateTool.h"
38 
39 // Qt
40 #include <QPointF>
41 
42 namespace te
43 {
44  namespace qt
45  {
46  namespace widgets
47  {
48  class Canvas;
49  class MapDisplay;
50  }
51  }
52 
53  namespace edit
54  {
55 // Forward declaration
56  class Feature;
57 
58  /*!
59  \class DeleteGeometryTool
60 
61  \brief This class implements a concrete tool to move geometries.
62  */
64  {
65  Q_OBJECT
66 
67  public:
68 
69  /** @name Initializer Methods
70  * Methods related to instantiation and destruction.
71  */
72  //@{
73 
74  /*!
75  \brief It constructs a move geometry tool associated with the given map display.
76 
77  \param display The map display associated with the tool.
78  \param parent The tool's parent.
79 
80  \note The tool will NOT take the ownership of the given pointers.
81  */
82  DeleteGeometryTool(te::qt::widgets::MapDisplay* display, const te::map::AbstractLayerPtr& layer, QObject* parent = 0);
83 
84  /*! \brief Destructor. */
86 
87  //@}
88 
89  /** @name AbstractTool Methods
90  * Methods related with tool behavior.
91  */
92  //@{
93 
94  bool mousePressEvent(QMouseEvent* e);
95 
96  //@}
97 
98  void cancelEditionTool();
99 
100  private:
101 
102  void reset();
103 
104  te::gm::Envelope buildEnvelope(const QPointF& pos);
105 
106  void storeFeature(te::edit::OperationType op);
107 
108  void updateCursor();
109 
110  };
111  } // end namespace edit
112 } // end namespace te
113 
114 #endif // __TERRALIB_EDIT_QT_INTERNAL_DELETEGEOMETRYTOOL_H
#define TEEDITQTEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:60
A widget to control the display of a set of layers.
Definition: MapDisplay.h:66
This class implements a concrete tool to move geometries.
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:51
URI C++ Library.
OperationType
Definition: Utils.h:88
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr