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