PostGISDataSetSelectorDialog.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/qt/plugins/datasource/pgis/PostGISDataSetSelectorDialog.h
22 
23 \brief A dialog window for showing the PostGIS data set selector widget.
24 */
25 
26 #ifndef __TERRALIB_QT_PLUGINS_DATASOURCE_PGISRASTER_INTERNAL_POSTGISDATASETSELECTORDIALOG_H
27 #define __TERRALIB_QT_PLUGINS_DATASOURCE_PGISRASTER_INTERNAL_POSTGISDATASETSELECTORDIALOG_H
28 
29 // TerraLib
30 #ifndef Q_MOC_RUN
31 #include "../../../../dataaccess/dataset/DataSetType.h"
32 #include "../../../../dataaccess/datasource/DataSourceInfo.h"
33 #endif
34 
35 #include "RasterPropertiesInfo.h"
36 #include "Utils.h"
37 
38 // Qt
39 #include <QDialog>
40 #include <QGridLayout>
41 #include <QTimer>
42 #include <QTreeWidgetItem>
43 
44 // QtPropertyBrowser
45 #include <QtPropertyBrowser/QtTreePropertyBrowser>
46 
47 namespace Ui { class PostGISDataSetSelectorDialogForm; }
48 
49 namespace te
50 {
51  namespace rst
52  {
53  class Raster;
54  }
55 
56  namespace qt
57  {
58  namespace widgets
59  {
60  class DataSetDisplay;
61  }
62 
63  namespace plugins
64  {
65  namespace pgisRaster
66  {
67 
68  /*!
69  \class PostGISDataSetSelectorDialog
70 
71  \brief ....
72 
73  \ingroup plugins
74  */
75  class PostGISDataSetSelectorDialog : public QDialog
76  {
77  Q_OBJECT
78 
79  enum ItemType
80  {
82  TABLE_ITEM
83  };
84 
85  public:
86 
87  PostGISDataSetSelectorDialog(QWidget* parent = 0, Qt::WindowFlags f = 0);
88 
90 
91  void set(const te::da::DataSourceInfoPtr& ds);
92 
93  void getSelecteds(PostGISRasterInfoVec& vec);
94 
95  protected:
96 
97  void listDataSets();
98 
99  void drawDataSet(std::string dataSetName, std::string schema);
100 
101  void getDataSetInfo(std::string dataSetName, std::string schema);
102 
103  void buildDataSetInfoProperties(te::rst::Raster* raster);
104 
105  void resizeEvent(QResizeEvent* e);
106 
107  std::string getGDALURI(std::string dataSetName, std::string schema);
108 
109  protected slots:
110 
111  void onMapPreviewToggled(bool on);
112 
113  void onItemPressed(QTreeWidgetItem* item, int column);
114 
115  void onResizeTimeout();
116 
117  private:
118 
119  std::unique_ptr<Ui::PostGISDataSetSelectorDialogForm> m_ui;
120  std::unique_ptr<te::qt::widgets::DataSetDisplay> m_mapPreview;
121 
123 
124  QTreeWidgetItem* m_rootItem;
125 
126  QtTreePropertyBrowser* m_propertyBrowser;
128  QGridLayout* m_propertyLayout;
129 
130  QTimer* m_timer; //!< Timer to execute redraw on resize action.
131  };
132 
133  } // end namespace pgis
134  } // end namespace plugins
135  } // end namespace qt
136 } // end namespace te
137 
138 #endif // __TERRALIB_QT_PLUGINS_DATASOURCE_PGISRASTER_INTERNAL_POSTGISDATASETSELECTORDIALOG_H
139 
#define slots
Utility functions for the PgisRaster data source widget plugin.
std::unique_ptr< Ui::PostGISDataSetSelectorDialogForm > m_ui
QTimer * m_timer
Timer to execute redraw on resize action.
An abstract class for raster data strucutures.
Definition: Raster.h:71
URI C++ Library.
std::vector< PostGISRasterInfo > PostGISRasterInfoVec
Definition: Utils.h:50
std::unique_ptr< te::qt::widgets::DataSetDisplay > m_mapPreview
boost::shared_ptr< DataSourceInfo > DataSourceInfoPtr