All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 #include "../../../maptools/AbstractLayer.h"
6 #include "../Config.h"
7 
8 // Qt
9 #include <QPointF>
10 
11 //STL
12 #include <set>
13 
14 #include "CreateLineTool.h"
15 
16 namespace te
17 {
18  namespace qt
19  {
20  namespace widgets
21  {
22  class Canvas;
23  class MapDisplay;
24  }
25  }
26 
27  namespace gm
28  {
29  class Geometry;
30  }
31 
32  namespace edit
33  {
34 
36  {
37  Q_OBJECT
38 
39  public:
40  AggregateAreaTool(te::qt::widgets::MapDisplay* display, const te::map::AbstractLayerPtr& layer, QObject* parent = 0);
41 
43 
44  //@}
45 
46  /** @name AbstractTool Methods
47  * Methods related with tool behavior.
48  */
49  //@{
50 
51  bool mousePressEvent(QMouseEvent* e);
52 
53  bool mouseMoveEvent(QMouseEvent* e);
54 
55  bool mouseDoubleClickEvent(QMouseEvent* e);
56 
57  //@}
58 
59  private:
60 
61  void drawPolygon();
62 
63  void draw();
64 
65  void reset();
66 
67  void storeEditedFeature();
68 
69  void storeUndoCommand();
70 
71  void pickFeature(const te::map::AbstractLayerPtr& layer, const QPointF& pos);
72 
73  te::gm::Envelope buildEnvelope(const QPointF& pos);
74 
75  te::gm::Geometry* buildPolygon();
76 
77  te::gm::Geometry* unionGeometry(te::gm::Geometry* g1, te::gm::Geometry* g2);
78 
79  std::set<std::string> m_oidsSet;
80 
81  private slots:
82 
83  void onExtentChanged();
84 
85  protected:
86 
87  std::vector<Feature*> m_updateWatches;
88 
89  };
90 
91  } // end namespace edit
92 } // end namespace te
93 
94 #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:66
std::set< std::string > m_oidsSet
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:51
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