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 af { namespace evt { struct Event; } }
55 
56  namespace plugins
57  {
58  namespace terralib4
59  {
60  class TL4ConnectorWizardPage;
61  class TL4LayerSelectionWizardPage;
62  class TL4RasterFolderSelectionWizardPage;
63  class TL4FinalPageWizardPage;
64  class TL4ThemeSelectionWizardPage;
65 
67  {
68  Q_OBJECT
69 
70  public:
71 
72  TL4ConverterWizard(QWidget* parent = 0, Qt::WindowFlags f = 0);
73 
75 
76  int nextId() const;
77 
78  bool validateCurrentPage();
79 
80  private:
81 
82  bool validTerraLib4Connection();
83 
84  bool validLayerSelection();
85 
86  bool validLayerNames();
87 
88  std::string getOriginalName(const std::string& targetName);
89 
90  std::string getNewName(const std::string& originalName);
91 
92  protected slots:
93 
94  void back();
95 
96  void next();
97 
98  void commit();
99 
100  void finish();
101 
102  void help();
103 
104  Q_SIGNALS:
105 
106  void triggered(te::qt::af::evt::Event* e);
107 
108  private:
109 
110  enum
111  {
118  PAGE_THEME_SELECTION
119  };
120 
124 
125  std::string m_rasterFolderPath;
126 
127  std::unique_ptr<te::da::DataSource> m_tl4Database;
128 
130  std::vector<std::pair<std::string, std::string> > m_rasterFiles; //TeRasterFile is external and wíll not be converted
131 
132  std::auto_ptr<Ui::TL4ConverterWizardForm> m_ui;
133  std::auto_ptr<TL4ConnectorWizardPage> m_connectorPage;
134  std::auto_ptr<te::qt::widgets::DataSourceSelectorWizardPage>m_datasourceSelectorPage;
135  std::auto_ptr<TL4LayerSelectionWizardPage> m_layerSelectionPage;
136  std::auto_ptr<TL4RasterFolderSelectionWizardPage> m_rasterFolderSelectionPage;
137  std::auto_ptr<QWizardPage> m_resolveNamePage;
138  std::auto_ptr<TL4FinalPageWizardPage> m_finalPage;
139  std::auto_ptr<TL4ThemeSelectionWizardPage> m_themeSelection;
140 
141  std::auto_ptr<QTableWidget> m_resolveNameTableWidget;
142  };
143  } // end namespace terralib4
144  } // end namespace plugins
145  } // end namespace qt
146 } // end namespace te
147 
148 #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< 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.
std::unique_ptr< te::da::DataSource > m_tl4Database
#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