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 #ifndef Q_MOC_RUN
7 #include "../../../maptools/AbstractLayer.h"
8 #endif
9 #include "../Config.h"
10 #include "GeometriesUpdateTool.h"
11 
12 #include "../Config.h"
13 
14 // Qt
15 #include <QPointF>
16 #include <QTreeWidget>
17 #include <QTreeWidgetItem>
18 #include <QDialog>
19 
20 namespace te
21 {
22  namespace qt
23  {
24  namespace widgets
25  {
26  class Canvas;
27  class MapDisplay;
28  }
29  }
30 
31  namespace edit
32  {
33 
35  {
36  Q_OBJECT
37 
38  public:
39  EditInfoTool(te::qt::widgets::MapDisplay* display, const te::map::AbstractLayerPtr& layer, QObject* parent = 0);
40 
41  ~EditInfoTool();
42 
43  //@}
44 
45  /** @name AbstractTool Methods
46  * Methods related with tool behavior.
47  */
48  //@{
49 
50  //bool mouseReleaseEvent(QMouseEvent* e);
51  bool mousePressEvent(QMouseEvent* e);
52 
53  //@}
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:68
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