TL4ConverterWizard.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/terralib5/TL4ConverterWizard.h
22 
23  \brief A wizard for guiding the conversion of a TerraLib 4.x database to a OGC SFS compliant format or any other format known by OGR and GDAL.
24 */
25 
26 #ifndef __TERRALIB_PLUGINS_TERRALIB4_INTERNAL_TL4CONVERTERWIZARD_H
27 #define __TERRALIB_PLUGINS_TERRALIB4_INTERNAL_TL4CONVERTERWIZARD_H
28 
29 // TerraLib
30 #include "../../../../dataaccess/datasource/DataSourceInfo.h"
31 #include "Config.h"
32 
33 // STL
34 #include <map>
35 #include <memory>
36 #include <string>
37 
38 // Qt
39 #include <QTableWidget>
40 #include <QWizard>
41 #include <QWizardPage>
42 
43 // Forward declaration
44 namespace Ui { class TL4ConverterWizardForm; }
45 
46 namespace te
47 {
48  namespace da { class DataSource; }
49 
50  namespace qt
51  {
52  namespace widgets{class DataSourceSelectorWizardPage;}
53 
54  namespace plugins
55  {
56  namespace terralib4
57  {
58  class TL4ConnectorWizardPage;
59  class TL4LayerSelectionWizardPage;
60  class TL4RasterFolderSelectionWizardPage;
61  class TL4FinalPageWizardPage;
62  class TL4ThemeSelectionWizardPage;
63 
65  {
66  Q_OBJECT
67 
68  public:
69 
70  TL4ConverterWizard(QWidget* parent = 0, Qt::WindowFlags f = 0);
71 
73 
74  int nextId() const;
75 
76  bool validateCurrentPage();
77 
78  private:
79 
80  bool validTerraLib4Connection();
81 
82  bool validLayerSelection();
83 
84  bool validLayerNames();
85 
86  std::string getOriginalName(const std::string& targetName);
87 
88  std::string getNewName(const std::string& originalName);
89 
90  protected slots:
91 
92  void back();
93 
94  void next();
95 
96  void commit();
97 
98  void finish();
99 
100  void help();
101 
102  Q_SIGNALS:
103 
104  void triggered(te::qt::af::evt::Event* e);
105 
106  private:
107 
108  enum
109  {
116  PAGE_THEME_SELECTION
117  };
118 
122 
123  std::string m_rasterFolderPath;
124 
125  std::auto_ptr<te::da::DataSource> m_tl4Database;
126 
128  std::vector<std::pair<std::string, std::string> > m_rasterFiles; //TeRasterFile is external and wíll not be converted
129 
130  std::auto_ptr<Ui::TL4ConverterWizardForm> m_ui;
131  std::auto_ptr<TL4ConnectorWizardPage> m_connectorPage;
132  std::auto_ptr<te::qt::widgets::DataSourceSelectorWizardPage>m_datasourceSelectorPage;
133  std::auto_ptr<TL4LayerSelectionWizardPage> m_layerSelectionPage;
134  std::auto_ptr<TL4RasterFolderSelectionWizardPage> m_rasterFolderSelectionPage;
135  std::auto_ptr<QWizardPage> m_resolveNamePage;
136  std::auto_ptr<TL4FinalPageWizardPage> m_finalPage;
137  std::auto_ptr<TL4ThemeSelectionWizardPage> m_themeSelection;
138 
139  std::auto_ptr<QTableWidget> m_resolveNameTableWidget;
140  };
141  } // end namespace terralib4
142  } // end namespace plugins
143  } // end namespace qt
144 } // end namespace te
145 
146 #endif // __TERRALIB_PLUGINS_TERRALIB4_INTERNAL_TL4CONVERTERWIZARD_H
std::auto_ptr< te::qt::widgets::DataSourceSelectorWizardPage > m_datasourceSelectorPage
std::auto_ptr< TL4ThemeSelectionWizardPage > m_themeSelection
std::auto_ptr< te::da::DataSource > m_tl4Database
std::auto_ptr< Ui::TL4ConverterWizardForm > m_ui
A base class for application events.
Definition: Event.h:59
std::vector< std::pair< std::string, std::string > > m_rasterFiles
Definition: Band.h:34
URI C++ Library.
#define TEQTPLUGINTERRALIB4EXPORT
You can use this macro in order to export/import classes and functions from all plug-ins files...
Definition: Config.h:50
std::auto_ptr< TL4ConnectorWizardPage > m_connectorPage
std::auto_ptr< QTableWidget > m_resolveNameTableWidget
std::auto_ptr< TL4FinalPageWizardPage > m_finalPage
std::auto_ptr< TL4LayerSelectionWizardPage > m_layerSelectionPage
std::auto_ptr< TL4RasterFolderSelectionWizardPage > m_rasterFolderSelectionPage
boost::shared_ptr< DataSourceInfo > DataSourceInfoPtr