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  {
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 
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 
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 
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 
te::qt::plugins::pgisRaster::PostGISDataSetSelectorDialog::m_rootItem
QTreeWidgetItem * m_rootItem
Definition: PostGISDataSetSelectorDialog.h:124
te::qt::plugins::pgisRaster::PostGISDataSetSelectorDialog::m_rasterPropertyInfo
RasterPropertiesInfo * m_rasterPropertyInfo
Definition: PostGISDataSetSelectorDialog.h:127
te::qt::plugins::pgisRaster::PostGISDataSetSelectorDialog::ROOT_ITEM
@ ROOT_ITEM
Definition: PostGISDataSetSelectorDialog.h:81
te::qt::plugins::pgisRaster::PostGISRasterInfoVec
std::vector< PostGISRasterInfo > PostGISRasterInfoVec
Definition: Utils.h:50
RasterPropertiesInfo.h
te
TerraLib.
Definition: AddressGeocodingOp.h:52
te::qt::plugins::pgisRaster::PostGISDataSetSelectorDialog::set
void set(const te::da::DataSourceInfoPtr &ds)
te::da::DataSourceInfoPtr
boost::shared_ptr< DataSourceInfo > DataSourceInfoPtr
Definition: DataSourceInfo.h:107
te::qt::plugins::pgisRaster::PostGISDataSetSelectorDialog::m_propertyLayout
QGridLayout * m_propertyLayout
Definition: PostGISDataSetSelectorDialog.h:128
te::rst::Raster
An abstract class for raster data strucutures.
Definition: Raster.h:72
te::qt::plugins::pgisRaster::PostGISDataSetSelectorDialog::onItemPressed
void onItemPressed(QTreeWidgetItem *item, int column)
te::qt::plugins::pgisRaster::PostGISDataSetSelectorDialog::drawDataSet
void drawDataSet(std::string dataSetName, std::string schema)
te::qt::plugins::pgisRaster::PostGISDataSetSelectorDialog::ItemType
ItemType
Definition: PostGISDataSetSelectorDialog.h:80
te::qt::plugins::pgisRaster::PostGISDataSetSelectorDialog::PostGISDataSetSelectorDialog
PostGISDataSetSelectorDialog(QWidget *parent=0, Qt::WindowFlags f=0)
te::qt::plugins::pgisRaster::RasterPropertiesInfo
Definition: RasterPropertiesInfo.h:51
te::qt::plugins::pgisRaster::PostGISDataSetSelectorDialog::m_ui
std::unique_ptr< Ui::PostGISDataSetSelectorDialogForm > m_ui
Definition: PostGISDataSetSelectorDialog.h:119
te::qt::plugins::pgisRaster::PostGISDataSetSelectorDialog::onResizeTimeout
void onResizeTimeout()
te::qt::plugins::pgisRaster::PostGISDataSetSelectorDialog::m_timer
QTimer * m_timer
Timer to execute redraw on resize action.
Definition: PostGISDataSetSelectorDialog.h:130
Ui
Definition: ConfigInputAddressDialog.h:44
te::qt::plugins::pgisRaster::PostGISDataSetSelectorDialog::getSelecteds
void getSelecteds(PostGISRasterInfoVec &vec)
te::qt::plugins::pgisRaster::PostGISDataSetSelectorDialog::buildDataSetInfoProperties
void buildDataSetInfoProperties(te::rst::Raster *raster)
te::qt::plugins::pgisRaster::PostGISDataSetSelectorDialog::resizeEvent
void resizeEvent(QResizeEvent *e)
slots
#define slots
Definition: VirtualMachine.h:48
te::qt::plugins::pgisRaster::PostGISDataSetSelectorDialog::m_propertyBrowser
QtTreePropertyBrowser * m_propertyBrowser
Definition: PostGISDataSetSelectorDialog.h:126
te::qt::plugins::pgisRaster::PostGISDataSetSelectorDialog
....
Definition: PostGISDataSetSelectorDialog.h:76
te::qt::plugins::pgisRaster::PostGISDataSetSelectorDialog::m_mapPreview
std::unique_ptr< te::qt::widgets::DataSetDisplay > m_mapPreview
Definition: PostGISDataSetSelectorDialog.h:120
te::qt::plugins::pgisRaster::PostGISDataSetSelectorDialog::~PostGISDataSetSelectorDialog
~PostGISDataSetSelectorDialog()
te::qt::plugins::pgisRaster::PostGISDataSetSelectorDialog::getDataSetInfo
void getDataSetInfo(std::string dataSetName, std::string schema)
te::qt::plugins::pgisRaster::PostGISDataSetSelectorDialog::m_datasource
te::da::DataSourceInfoPtr m_datasource
Definition: PostGISDataSetSelectorDialog.h:122
te::qt::plugins::pgisRaster::PostGISDataSetSelectorDialog::listDataSets
void listDataSets()
te::qt::plugins::pgisRaster::PostGISDataSetSelectorDialog::onMapPreviewToggled
void onMapPreviewToggled(bool on)
te::qt::plugins::pgisRaster::PostGISDataSetSelectorDialog::TABLE_ITEM
@ TABLE_ITEM
Definition: PostGISDataSetSelectorDialog.h:82
te::qt::plugins::pgisRaster::PostGISDataSetSelectorDialog::getGDALURI
std::string getGDALURI(std::string dataSetName, std::string schema)
Utils.h