EditInfoTool.h
Go to the documentation of this file.
1 #ifndef __TERRALIB_EDIT_QT_INTERNAL_EDITINFOTOOL_H
2 #define __TERRALIB_EDIT_QT_INTERNAL_EDITINFOTOOL_H
3 
4 // TerraLib
5 #include "../../../geometry/Envelope.h"
6 #include "../../../maptools/AbstractLayer.h"
7 #include "../Config.h"
8 #include "GeometriesUpdateTool.h"
9 
10 #include "../Config.h"
11 
12 // Qt
13 #include <QPointF>
14 #include <QTreeWidget>
15 #include <QTreeWidgetItem>
16 #include <QDialog>
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  EditInfoTool(te::qt::widgets::MapDisplay* display, const te::map::AbstractLayerPtr& layer, QObject* parent = 0);
38 
39  ~EditInfoTool();
40 
41  //@}
42 
43  /** @name AbstractTool Methods
44  * Methods related with tool behavior.
45  */
46  //@{
47 
48  //bool mouseReleaseEvent(QMouseEvent* e);
49  bool mousePressEvent(QMouseEvent* e);
50 
51  //@}
52 
53  void cancelEditionTool();
54 
55  private:
56 
57  void draw();
58 
59  void reset();
60 
61  void updateCursor();
62 
63  void pickFeature(const te::map::AbstractLayerPtr& layer, const QPointF& pos);
64 
65  te::gm::Envelope buildEnvelope(const QPointF& pos);
66 
67  void getInfo(const te::gm::Envelope& e);
68 
69  std::auto_ptr<te::dt::AbstractData> getValue(int type, QString value) const;
70 
71  te::da::DataSet* m_dataset; //!< The attributes dataset type.
72  std::map<std::size_t, te::dt::AbstractData*> m_data;
73  std::vector<std::size_t> m_restrictivePropertyPos;
74  QDialog* m_dialog;
75  QTreeWidget* m_infoWidget; //!< Widget used to show the informations.
77 
78  private slots:
79 
80  void onCancelPushButtonPressed();
81 
82  void onOkPushButtonPressed();
83 
84  void onAttributesTreeWidgetItemDoubleClicked(QTreeWidgetItem* item, int column);
85 
86  };
87 
88  } // end namespace edit
89 } // end namespace te
90 
91 #endif // __TERRALIB_EDIT_QT_INTERNAL_EDITINFOTOOL_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
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:51
URI C++ Library.
QTreeWidget * m_infoWidget
Widget used to show the informations.
Definition: EditInfoTool.h:75
A dataset is the unit of information manipulated by the data access module of TerraLib.
Definition: DataSet.h:112
std::vector< std::size_t > m_restrictivePropertyPos
Definition: EditInfoTool.h:73
te::da::DataSet * m_dataset
The attributes dataset type.
Definition: EditInfoTool.h:71
std::map< std::size_t, te::dt::AbstractData * > m_data
Definition: EditInfoTool.h:72
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr