EditInfoTool.h
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18 */
19 
20 /*!
21  \file terralib/edit/qt/tools/EditInfoTool.h
22 
23  \brief This class implements a concrete tool for edit attributes of geometry.
24 */
25 
26 #ifndef __TERRALIB_EDIT_QT_INTERNAL_EDITINFOTOOL_H
27 #define __TERRALIB_EDIT_QT_INTERNAL_EDITINFOTOOL_H
28 
29 // TerraLib
30 #include "../../../geometry/Envelope.h"
31 #ifndef Q_MOC_RUN
32 #include "../../../maptools/AbstractLayer.h"
33 #endif
34 #include "../Config.h"
35 #include "GeometriesUpdateTool.h"
36 
37 // Qt
38 #include <QPointF>
39 #include <QTreeWidget>
40 #include <QTreeWidgetItem>
41 #include <QDialog>
42 
43 namespace te
44 {
45  namespace qt
46  {
47  namespace widgets
48  {
49  class Canvas;
50  class MapDisplay;
51  }
52  }
53 
54  namespace edit
55  {
56 
58  {
59  Q_OBJECT
60 
61  public:
62  EditInfoTool(te::qt::widgets::MapDisplay* display, const te::map::AbstractLayerPtr& layer, QObject* parent = 0);
63 
65 
66  //@}
67 
68  /** @name AbstractTool Methods
69  * Methods related with tool behavior.
70  */
71  //@{
72 
73  //bool mouseReleaseEvent(QMouseEvent* e);
74  bool mousePressEvent(QMouseEvent* e);
75 
76  //@}
77 
78  private:
79 
80  void draw();
81 
82  void updateCursor();
83 
84  void pickFeature(const te::map::AbstractLayerPtr& layer, const QPointF& pos);
85 
86  te::gm::Envelope buildEnvelope(const QPointF& pos);
87 
88  void getInfo(const te::gm::Envelope& e);
89 
90  std::unique_ptr<te::dt::AbstractData> getValue(int type, QString value) const;
91 
92  void storeFeature();
93 
94  te::da::DataSet* m_dataset; //!< The attributes dataset type.
95  std::map<std::string, te::dt::AbstractData*> m_data;
96  std::vector<std::size_t> m_restrictivePropertyPos;
97  QDialog* m_dialog;
98  QTreeWidget* m_infoWidget; //!< Widget used to show the informations.
99 
100  private slots:
101 
103 
105 
106  void onAttributesTreeWidgetItemDoubleClicked(QTreeWidgetItem* item, int column);
107 
108  };
109 
110  } // end namespace edit
111 } // end namespace te
112 
113 #endif // __TERRALIB_EDIT_QT_INTERNAL_EDITINFOTOOL_H
te::edit::EditInfoTool::m_restrictivePropertyPos
std::vector< std::size_t > m_restrictivePropertyPos
Definition: EditInfoTool.h:96
te::gm::Envelope
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:52
te
TerraLib.
Definition: AddressGeocodingOp.h:52
te::edit::EditInfoTool::m_infoWidget
QTreeWidget * m_infoWidget
Widget used to show the informations.
Definition: EditInfoTool.h:98
te::qt::widgets::MapDisplay
A widget to control the display of a set of layers.
Definition: MapDisplay.h:72
te::map::AbstractLayerPtr
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
Definition: AbstractLayer.h:626
TEEDITQTEXPORT
#define TEEDITQTEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:60
te::edit::EditInfoTool::storeFeature
void storeFeature()
te::edit::EditInfoTool
Definition: EditInfoTool.h:58
te::edit::EditInfoTool::onAttributesTreeWidgetItemDoubleClicked
void onAttributesTreeWidgetItemDoubleClicked(QTreeWidgetItem *item, int column)
te::edit::EditInfoTool::buildEnvelope
te::gm::Envelope buildEnvelope(const QPointF &pos)
te::edit::EditInfoTool::m_dialog
QDialog * m_dialog
Definition: EditInfoTool.h:97
te::edit::EditInfoTool::~EditInfoTool
~EditInfoTool()
te::edit::EditInfoTool::getInfo
void getInfo(const te::gm::Envelope &e)
te::edit::EditInfoTool::getValue
std::unique_ptr< te::dt::AbstractData > getValue(int type, QString value) const
te::edit::EditInfoTool::draw
void draw()
te::edit::EditInfoTool::updateCursor
void updateCursor()
te::edit::EditInfoTool::mousePressEvent
bool mousePressEvent(QMouseEvent *e)
This event handler can be reimplemented in a concrete tool class to receive mouse press events for th...
te::edit::EditInfoTool::onCancelPushButtonPressed
void onCancelPushButtonPressed()
te::edit::EditInfoTool::m_dataset
te::da::DataSet * m_dataset
The attributes dataset type.
Definition: EditInfoTool.h:94
slots
#define slots
Definition: VirtualMachine.h:48
te::edit::EditInfoTool::onOkPushButtonPressed
void onOkPushButtonPressed()
te::edit::EditInfoTool::pickFeature
void pickFeature(const te::map::AbstractLayerPtr &layer, const QPointF &pos)
te::edit::EditInfoTool::m_data
std::map< std::string, te::dt::AbstractData * > m_data
Definition: EditInfoTool.h:95
te::edit::EditInfoTool::EditInfoTool
EditInfoTool(te::qt::widgets::MapDisplay *display, const te::map::AbstractLayerPtr &layer, QObject *parent=0)
GeometriesUpdateTool.h
te::da::DataSet
A dataset is the unit of information manipulated by the data access module of TerraLib.
Definition: DataSet.h:114
te::edit::GeometriesUpdateTool
Definition: GeometriesUpdateTool.h:60