MergeDialog.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/vp/qt/MergeDialog.h
22 
23  \brief A dialog merge operation
24 */
25 
26 #ifndef __TERRALIB_VP_INTERNAL_MERGEDIALOG_H
27 #define __TERRALIB_VP_INTERNAL_MERGEDIALOG_H
28 
29 // TerraLib
30 #ifndef Q_MOC_RUN
31 #include "../../dataaccess/datasource/DataSourceInfo.h"
32 #include "../../maptools/AbstractLayer.h"
33 #endif
34 #include "../Config.h"
35 
36 // STL
37 #include <memory>
38 
39 // Qt
40 #include <QDialog>
41 
42 namespace Ui { class MergeDialogForm; }
43 
44 // Forward declarations
45 class QComboBox;
46 
47 namespace te
48 {
49  namespace dt { class Property; }
50  namespace vp
51  {
52 // Forward declarations
53  class LayerTreeModel;
54 
55  class TEVPEXPORT MergeDialog : public QDialog
56  {
57  Q_OBJECT
58 
59  public:
60 
61  MergeDialog(QWidget* parent = 0, Qt::WindowFlags f = 0);
62 
64 
65  /*!
66  \brief Set the layer that can be used
67 
68  \param layers List of AbstractLayerPtr
69  \param selectedLayer Selected AbstractLayerPtr
70  */
71  void setLayers(std::list<te::map::AbstractLayerPtr> layers);
72 
73  /*!
74  \brief Get the generated layer.
75 
76  \return the generated layer.
77  */
79 
80  private:
81 
83 
85 
87 
88  QComboBox* getPossibleAttributesComboBox(te::dt::Property* mainProp, std::vector<te::dt::Property*> props);
89 
90  QComboBox* getAllAttributesComboBox(std::vector<te::dt::Property*> props);
91 
92  std::vector<std::pair<std::string, std::string> > getTablePropertiesNames();
93 
94  protected slots:
95 
97 
99 
101 
103 
104  void onOutputGroupBoxToggled(bool on);
105 
107 
109 
110  private:
111 
112  std::unique_ptr<Ui::MergeDialogForm> m_ui;
113 
114  te::da::DataSourceInfoPtr m_outputDatasource; //!< DataSource information.
115  std::list<te::map::AbstractLayerPtr> m_layers; //!< List of layers.
117  bool m_toFile;
118 
121  };
122  } // end namespace vp
123 } // end namespace te
124 
125 #endif // __TERRALIB_VP_INTERNAL_MERGEDIALOG_H
te::vp::MergeDialog::getAllAttributesComboBox
QComboBox * getAllAttributesComboBox(std::vector< te::dt::Property * > props)
te
TerraLib.
Definition: AddressGeocodingOp.h:52
te::vp::MergeDialog::getTablePropertiesNames
std::vector< std::pair< std::string, std::string > > getTablePropertiesNames()
te::vp::MergeDialog::onTargetFileToolButtonPressed
void onTargetFileToolButtonPressed()
te::vp::MergeDialog::m_layers
std::list< te::map::AbstractLayerPtr > m_layers
List of layers.
Definition: MergeDialog.h:115
te::map::AbstractLayerPtr
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
Definition: AbstractLayer.h:626
te::vp::MergeDialog::m_outputDatasource
te::da::DataSourceInfoPtr m_outputDatasource
DataSource information.
Definition: MergeDialog.h:114
te::vp::MergeDialog::m_ui
std::unique_ptr< Ui::MergeDialogForm > m_ui
Definition: MergeDialog.h:112
te::da::DataSourceInfoPtr
boost::shared_ptr< DataSourceInfo > DataSourceInfoPtr
Definition: DataSourceInfo.h:107
te::vp::MergeDialog
Definition: MergeDialog.h:56
te::vp::MergeDialog::m_originSelectedLayer
te::map::AbstractLayerPtr m_originSelectedLayer
Second layer selected.
Definition: MergeDialog.h:120
te::vp::MergeDialog::MergeDialog
MergeDialog(QWidget *parent=0, Qt::WindowFlags f=0)
te::vp::MergeDialog::onCancelPushButtonClicked
void onCancelPushButtonClicked()
te::vp::MergeDialog::~MergeDialog
~MergeDialog()
te::vp::MergeDialog::m_toFile
bool m_toFile
Definition: MergeDialog.h:117
te::vp::MergeDialog::setLayers
void setLayers(std::list< te::map::AbstractLayerPtr > layers)
Set the layer that can be used.
Ui
Definition: ConfigInputAddressDialog.h:44
TEVPEXPORT
#define TEVPEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:61
slots
#define slots
Definition: VirtualMachine.h:48
te::vp::MergeDialog::getLayer
te::map::AbstractLayerPtr getLayer()
Get the generated layer.
te::vp::MergeDialog::m_targetSelectedLayer
te::map::AbstractLayerPtr m_targetSelectedLayer
Target layer selected.
Definition: MergeDialog.h:119
te::vp::MergeDialog::onTargetDatasourceToolButtonPressed
void onTargetDatasourceToolButtonPressed()
te::vp::MergeDialog::updateAttrTableWidget
void updateAttrTableWidget()
te::vp::MergeDialog::onOriginLayerComboBoxChanged
void onOriginLayerComboBoxChanged(int index)
te::vp::MergeDialog::m_outputLayer
te::map::AbstractLayerPtr m_outputLayer
Generated Layer.
Definition: MergeDialog.h:116
te::vp::MergeDialog::onTargetLayerComboBoxChanged
void onTargetLayerComboBoxChanged(int index)
te::vp::MergeDialog::updateOriginLayerComboBox
void updateOriginLayerComboBox()
te::vp::MergeDialog::getPossibleAttributesComboBox
QComboBox * getPossibleAttributesComboBox(te::dt::Property *mainProp, std::vector< te::dt::Property * > props)
te::dt::Property
It models a property definition.
Definition: Property.h:60
te::vp::MergeDialog::onOutputGroupBoxToggled
void onOutputGroupBoxToggled(bool on)
te::vp::MergeDialog::onOkPushButtonClicked
void onOkPushButtonClicked()
te::vp::MergeDialog::updateTargetLayerComboBox
void updateTargetLayerComboBox()