AggregateAreaTool.h
Go to the documentation of this file.
1 #ifndef __TERRALIB_EDIT_QT_INTERNAL_AGGREGATEAREATOOL_H
2 #define __TERRALIB_EDIT_QT_INTERNAL_AGGREGATEAREATOOL_H
3 
4 // TerraLib
5 #ifndef Q_MOC_RUN
6 #include "../../../maptools/AbstractLayer.h"
7 #endif
8 #include "../Config.h"
9 
10 // Qt
11 #include <QPointF>
12 
13 //STL
14 #include <set>
15 
16 #ifndef Q_MOC_RUN
17 #include "CreateLineTool.h"
18 #endif
19 
20 namespace te
21 {
22  namespace qt
23  {
24  namespace widgets
25  {
26  class Canvas;
27  class MapDisplay;
28  }
29  }
30 
31  namespace gm
32  {
33  class Geometry;
34  }
35 
36  namespace edit
37  {
38 
40  {
41  Q_OBJECT
42 
43  public:
44  AggregateAreaTool(te::qt::widgets::MapDisplay* display, const te::map::AbstractLayerPtr& layer, QObject* parent = 0);
45 
47 
48  //@}
49 
50  /** @name AbstractTool Methods
51  * Methods related with tool behavior.
52  */
53  //@{
54 
55  bool mousePressEvent(QMouseEvent* e);
56 
57  bool mouseMoveEvent(QMouseEvent* e);
58 
59  bool mouseDoubleClickEvent(QMouseEvent* e);
60 
61  //@}
62 
63  private:
64 
65  void drawPolygon();
66 
67  void draw();
68 
69  void reset();
70 
71  void storeEditedFeature();
72 
73  void storeUndoCommand();
74 
75  void pickFeature(const te::map::AbstractLayerPtr& layer, const QPointF& pos);
76 
77  te::gm::Envelope buildEnvelope(const QPointF& pos);
78 
79  te::gm::Geometry* buildPolygon();
80 
81  te::gm::Geometry* unionGeometry(te::gm::Geometry* g1, te::gm::Geometry* g2);
82 
83  std::set<std::string> m_oidsSet;
84 
85  private slots:
86 
87  void onExtentChanged();
88 
89  protected:
90 
91  std::vector<Feature*> m_updateWatches;
92 
93  };
94 
95  } // end namespace edit
96 } // end namespace te
97 
98 #endif // __TERRALIB_EDIT_QT_INTERNAL_AGGREGATEAREATOOL_H
#define TEEDITQTEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:60
This class implements a concrete tool to create lines.
This class implements a concrete tool to create lines.
A widget to control the display of a set of layers.
Definition: MapDisplay.h:68
std::set< std::string > m_oidsSet
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:51
URI C++ Library.
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
Definition: Geometry.h:73
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
std::vector< Feature * > m_updateWatches