All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TransformationDialog.cpp
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/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 
41 // Qt
42 #include <QFileDialog>
43 #include <QList>
44 #include <QListWidget>
45 #include <QListWidgetItem>
46 #include <QMessageBox>
47 #include <QSize>
48 
49 te::vp::TransformationDialog::TransformationDialog(QWidget* parent, Qt::WindowFlags f)
50  : QDialog(parent, f),
51  m_ui(new Ui::TransformationDialogForm),
52  m_layers(std::list<te::map::AbstractLayerPtr>()),
53  m_selectedLayer(0)
54 {
55 // add controls
56  m_ui->setupUi(this);
57 
58 // add icons
59  //m_ui->m_imgLabel->setPixmap(QIcon::fromTheme(VP_IMAGES"/vp-transformation-hint").pixmap(112,48));
60 
61  QSize iconSize(112,48);
62 
63  m_ui->m_multToSimpleRadioButton->setIconSize(iconSize);
64  m_ui->m_multToSimpleRadioButton->setIcon(QIcon::fromTheme("transformation-multi-single"));
65 
66  m_ui->m_simpleToMultRadioButton->setIconSize(iconSize);
67  m_ui->m_simpleToMultRadioButton->setIcon(QIcon::fromTheme("transformation-single-multi"));
68 
69  m_ui->m_targetDatasourceToolButton->setIcon(QIcon::fromTheme("datasource"));
70 
71 //signals
72  connect(m_ui->m_helpPushButton, SIGNAL(clicked()), this, SLOT(onHelpPushButtonClicked()));
73  connect(m_ui->m_okPushButton, SIGNAL(clicked()), this, SLOT(onOkPushButtonClicked()));
74  connect(m_ui->m_cancelPushButton, SIGNAL(clicked()), this, SLOT(onCancelPushButtonClicked()));
75 }
76 
78 {
79 }
80 
81 void te::vp::TransformationDialog::setLayers(std::list<te::map::AbstractLayerPtr> layers)
82 {
83  m_layers = layers;
84 
85  std::list<te::map::AbstractLayerPtr>::iterator it = m_layers.begin();
86 
87  while(it != m_layers.end())
88  {
89  m_ui->m_layersComboBox->addItem(QString(it->get()->getTitle().c_str()), QVariant(it->get()->getId().c_str()));
90  ++it;
91  }
92 }
93 
95 {
96  QMessageBox::information(this, "Help", "Under development");
97 }
98 
100 {
101  QMessageBox::information(this, "Ok", "Under development");
102 }
103 
105 {
106  reject();
107 }
108 
109 
std::auto_ptr< Ui::TransformationDialogForm > m_ui
void setLayers(std::list< te::map::AbstractLayerPtr > layers)
Set the layer that can be used.
TransformationDialog(QWidget *parent=0, Qt::WindowFlags f=0)
A dialog transformation operation.
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr