All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TransformationDialog.cpp
Go to the documentation of this file.
1 /* Copyright (C) 2011-2012 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/TransformationDialog.cpp
22 
23  \brief A dialog for transformation operation
24 */
25 
26 // TerraLib
27 #include "../../common/Translator.h"
28 #include "../../common/STLUtils.h"
29 #include "../../dataaccess/dataset/DataSetType.h"
30 #include "../../dataaccess/datasource/DataSourceInfo.h"
31 #include "../../dataaccess/datasource/DataSourceInfoManager.h"
32 #include "../../qt/widgets/datasource/selector/DataSourceSelectorDialog.h"
33 #include "../../datatype/Enums.h"
34 #include "../../datatype/Property.h"
35 #include "../../maptools/AbstractLayer.h"
36 #include "../Config.h"
37 #include "../Exception.h"
38 #include "TransformationDialog.h"
39 #include "ui_TransformationDialogForm.h"
40 #include "VectorProcessingConfig.h"
41 
42 // Qt
43 #include <QtCore/QList>
44 #include <QtCore/QSize>
45 #include <QtGui/QFileDialog>
46 #include <QtGui/QListWidget>
47 #include <QtGui/QListWidgetItem>
48 #include <QtGui/QMessageBox>
49 
50 te::vp::TransformationDialog::TransformationDialog(QWidget* parent, Qt::WindowFlags f)
51  : QDialog(parent, f),
52  m_ui(new Ui::TransformationDialogForm),
53  m_layers(std::list<te::map::AbstractLayerPtr>()),
54  m_selectedLayer(0)
55 {
56 // add controls
57  m_ui->setupUi(this);
58 
59 // add icons
60  //m_ui->m_imgLabel->setPixmap(QIcon::fromTheme(VP_IMAGES"/vp-transformation-hint").pixmap(112,48));
61 
62  QSize iconSize(112,48);
63 
64  m_ui->m_multToSimpleRadioButton->setIconSize(iconSize);
65  m_ui->m_multToSimpleRadioButton->setIcon(QIcon::fromTheme("transformation-multi-single"));
66 
67  m_ui->m_simpleToMultRadioButton->setIconSize(iconSize);
68  m_ui->m_simpleToMultRadioButton->setIcon(QIcon::fromTheme("transformation-single-multi"));
69 
70  m_ui->m_targetDatasourceToolButton->setIcon(QIcon::fromTheme("datasource"));
71 
72 //signals
73  connect(m_ui->m_helpPushButton, SIGNAL(clicked()), this, SLOT(onHelpPushButtonClicked()));
74  connect(m_ui->m_okPushButton, SIGNAL(clicked()), this, SLOT(onOkPushButtonClicked()));
75  connect(m_ui->m_cancelPushButton, SIGNAL(clicked()), this, SLOT(onCancelPushButtonClicked()));
76 }
77 
79 {
80 }
81 
82 void te::vp::TransformationDialog::setLayers(std::list<te::map::AbstractLayerPtr> layers)
83 {
84  m_layers = layers;
85 
86  std::list<te::map::AbstractLayerPtr>::iterator it = m_layers.begin();
87 
88  while(it != m_layers.end())
89  {
90  m_ui->m_layersComboBox->addItem(QString(it->get()->getTitle().c_str()), QVariant(it->get()->getId().c_str()));
91  ++it;
92  }
93 }
94 
96 {
97  QMessageBox::information(this, "Help", "Under development");
98 }
99 
101 {
102  QMessageBox::information(this, "Ok", "Under development");
103 }
104 
106 {
107  reject();
108 }
109 
110 
std::auto_ptr< Ui::TransformationDialogForm > m_ui
TransformationDialog(QWidget *parent=0, Qt::WindowFlags f=0)
void setLayers(std::list< te::map::AbstractLayerPtr > layers)
Set the layer that can be used.
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
A dialog transformation operation.