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 
79 
80  private:
81 
83 
85 
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 
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::unique_ptr<Ui::TL4ConverterWizardForm> m_ui;
133  std::unique_ptr<TL4ConnectorWizardPage> m_connectorPage;
134  std::unique_ptr<te::qt::widgets::DataSourceSelectorWizardPage>m_datasourceSelectorPage;
135  std::unique_ptr<TL4LayerSelectionWizardPage> m_layerSelectionPage;
136  std::unique_ptr<TL4RasterFolderSelectionWizardPage> m_rasterFolderSelectionPage;
137  std::unique_ptr<QWizardPage> m_resolveNamePage;
138  std::unique_ptr<TL4FinalPageWizardPage> m_finalPage;
139  std::unique_ptr<TL4ThemeSelectionWizardPage> m_themeSelection;
140 
141  std::unique_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
te::qt::plugins::terralib4::TL4ConverterWizard::next
void next()
te::qt::plugins::terralib4::TL4ConverterWizard::m_tl4Database
std::unique_ptr< te::da::DataSource > m_tl4Database
Definition: TL4ConverterWizard.h:127
te::qt::plugins::terralib4::TL4ConverterWizard::m_resolveNamePage
std::unique_ptr< QWizardPage > m_resolveNamePage
Definition: TL4ConverterWizard.h:137
te
TerraLib.
Definition: AddressGeocodingOp.h:52
te::qt::plugins::terralib4::TL4ConverterWizard
Definition: TL4ConverterWizard.h:67
te::qt::plugins::terralib4::TL4ConverterWizard::m_hasRaster
bool m_hasRaster
Definition: TL4ConverterWizard.h:122
te::qt::plugins::terralib4::TL4ConverterWizard::m_ui
std::unique_ptr< Ui::TL4ConverterWizardForm > m_ui
Definition: TL4ConverterWizard.h:132
te::da::DataSourceInfoPtr
boost::shared_ptr< DataSourceInfo > DataSourceInfoPtr
Definition: DataSourceInfo.h:107
te::qt::plugins::terralib4::TL4ConverterWizard::help
void help()
te::qt::plugins::terralib4::TL4ConverterWizard::PAGE_TERRALIB4_CONNECTOR
@ PAGE_TERRALIB4_CONNECTOR
Definition: TL4ConverterWizard.h:112
te::qt::plugins::terralib4::TL4ConverterWizard::getNewName
std::string getNewName(const std::string &originalName)
te::qt::plugins::terralib4::TL4ConverterWizard::m_rasterFiles
std::vector< std::pair< std::string, std::string > > m_rasterFiles
Definition: TL4ConverterWizard.h:130
te::qt::plugins::terralib4::TL4ConverterWizard::PAGE_LAYER_SELECTION
@ PAGE_LAYER_SELECTION
Definition: TL4ConverterWizard.h:113
te::qt::plugins::terralib4::TL4ConverterWizard::m_rollback
bool m_rollback
Definition: TL4ConverterWizard.h:123
TEQTPLUGINTERRALIB4EXPORT
#define TEQTPLUGINTERRALIB4EXPORT
You can use this macro in order to export/import classes and functions from all plug-ins files.
Definition: Config.h:50
te::qt::plugins::terralib4::TL4ConverterWizard::m_resolveNameTableWidget
std::unique_ptr< QTableWidget > m_resolveNameTableWidget
Definition: TL4ConverterWizard.h:141
te::qt::plugins::terralib4::TL4ConverterWizard::back
void back()
te::qt::plugins::terralib4::TL4ConverterWizard::~TL4ConverterWizard
~TL4ConverterWizard()
te::qt::plugins::terralib4::TL4ConverterWizard::finish
void finish()
te::qt::plugins::terralib4::TL4ConverterWizard::m_datasourceSelectorPage
std::unique_ptr< te::qt::widgets::DataSourceSelectorWizardPage > m_datasourceSelectorPage
Definition: TL4ConverterWizard.h:134
te::qt::plugins::terralib4::TL4ConverterWizard::nextId
int nextId() const
te::qt::plugins::terralib4::TL4ConverterWizard::m_layerSelectionPage
std::unique_ptr< TL4LayerSelectionWizardPage > m_layerSelectionPage
Definition: TL4ConverterWizard.h:135
te::qt::plugins::terralib4::TL4ConverterWizard::m_rasterFolderSelectionPage
std::unique_ptr< TL4RasterFolderSelectionWizardPage > m_rasterFolderSelectionPage
Definition: TL4ConverterWizard.h:136
te::qt::plugins::terralib4::TL4ConverterWizard::getOriginalName
std::string getOriginalName(const std::string &targetName)
te::qt::plugins::terralib4::TL4ConverterWizard::TL4ConverterWizard
TL4ConverterWizard(QWidget *parent=0, Qt::WindowFlags f=0)
te::qt::plugins::terralib4::TL4ConverterWizard::PAGE_RASTERFOLDER_SELECTOR
@ PAGE_RASTERFOLDER_SELECTOR
Definition: TL4ConverterWizard.h:115
te::qt::plugins::terralib4::TL4ConverterWizard::PAGE_DATASOURCE_SELECTOR
@ PAGE_DATASOURCE_SELECTOR
Definition: TL4ConverterWizard.h:114
Ui
Definition: ConfigInputAddressDialog.h:44
te::qt::plugins::terralib4::TL4ConverterWizard::triggered
void triggered(te::qt::af::evt::Event *e)
te::qt::af::evt::Event
A base class for application events.
Definition: Event.h:60
slots
#define slots
Definition: VirtualMachine.h:48
te::qt::plugins::terralib4::TL4ConverterWizard::m_hasNonRaster
bool m_hasNonRaster
Definition: TL4ConverterWizard.h:121
terralib4
Definition: Band.h:35
te::qt::plugins::terralib4::TL4ConverterWizard::m_finalPage
std::unique_ptr< TL4FinalPageWizardPage > m_finalPage
Definition: TL4ConverterWizard.h:138
te::qt::plugins::terralib4::TL4ConverterWizard::m_targetDataSource
te::da::DataSourceInfoPtr m_targetDataSource
Definition: TL4ConverterWizard.h:129
te::qt::plugins::terralib4::TL4ConverterWizard::validateCurrentPage
bool validateCurrentPage()
te::qt::plugins::terralib4::TL4ConverterWizard::m_themeSelection
std::unique_ptr< TL4ThemeSelectionWizardPage > m_themeSelection
Definition: TL4ConverterWizard.h:139
te::qt::plugins::terralib4::TL4ConverterWizard::validLayerSelection
bool validLayerSelection()
Config.h
Proxy configuration file for TerraView (see terraview_config.h).
te::qt::plugins::terralib4::TL4ConverterWizard::m_rasterFolderPath
std::string m_rasterFolderPath
Definition: TL4ConverterWizard.h:125
te::qt::plugins::terralib4::TL4ConverterWizard::validLayerNames
bool validLayerNames()
te::qt::plugins::terralib4::TL4ConverterWizard::PAGE_NAME_RESOLVE_SELECTOR
@ PAGE_NAME_RESOLVE_SELECTOR
Definition: TL4ConverterWizard.h:116
te::qt::plugins::terralib4::TL4ConverterWizard::PAGE_FINALPAGE
@ PAGE_FINALPAGE
Definition: TL4ConverterWizard.h:117
te::qt::plugins::terralib4::TL4ConverterWizard::validTerraLib4Connection
bool validTerraLib4Connection()
te::qt::plugins::terralib4::TL4ConverterWizard::commit
void commit()
te::qt::plugins::terralib4::TL4ConverterWizard::m_connectorPage
std::unique_ptr< TL4ConnectorWizardPage > m_connectorPage
Definition: TL4ConverterWizard.h:133