SubtractAreaTool.h
Go to the documentation of this file.
1 #ifndef __TERRALIB_EDIT_QT_INTERNAL_SUBTRACTAREATOOL_H
2 #define __TERRALIB_EDIT_QT_INTERNAL_SUBTRACTAREATOOL_H
3 
4 // TerraLib
5 #include "../../../geometry/Envelope.h"
6 #ifndef Q_MOC_RUN
7 #include "../../../maptools/AbstractLayer.h"
8 #endif
9 #include "../Config.h"
10 
11 // Qt
12 #include <QPointF>
13 
14 #ifndef Q_MOC_RUN
15 #include "CreateLineTool.h"
16 #endif
17 
18 namespace te
19 {
20  namespace qt
21  {
22  namespace widgets
23  {
24  class Canvas;
25  class MapDisplay;
26  }
27  }
28 
29  namespace edit
30  {
31 
33  {
34  Q_OBJECT
35 
36  public:
37  SubtractAreaTool(te::qt::widgets::MapDisplay* display, const te::map::AbstractLayerPtr& layer, QObject* parent = 0);
38 
40 
41  //@}
42 
43  /** @name AbstractTool Methods
44  * Methods related with tool behavior.
45  */
46  //@{
47 
48  bool mousePressEvent(QMouseEvent* e);
49 
50  bool mouseMoveEvent(QMouseEvent* e);
51 
52  bool mouseDoubleClickEvent(QMouseEvent* e);
53 
54  //@}
55 
56  private:
57 
58  void drawPolygon();
59 
60  void draw();
61 
62  void reset();
63 
64  void storeEditedFeature();
65 
66  void storeUndoCommand();
67 
68  void pickFeature(const te::map::AbstractLayerPtr& layer, const QPointF& pos);
69 
70  te::gm::Envelope buildEnvelope(const QPointF& pos);
71 
72  te::gm::Geometry* buildPolygon();
73 
74  te::gm::Geometry* differenceGeometry(te::gm::Geometry* g1, te::gm::Geometry* g2);
75 
76  std::set<std::string> m_oidsSet;
77 
78  private slots:
79 
80  void onExtentChanged();
81 
82  protected:
83 
84  std::vector<Feature*> m_updateWatches;
85 
86  };
87 
88  } // end namespace edit
89 } // end namespace te
90 
91 #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.
std::vector< Feature * > m_updateWatches
A widget to control the display of a set of layers.
Definition: MapDisplay.h:68
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::set< std::string > m_oidsSet