All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
SummarizationDialog.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/SummarizationDialog.cpp
22 
23  \brief A dialog for summarization 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 "SummarizationDialog.h"
39 #include "ui_SummarizationDialogForm.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::SummarizationDialog::SummarizationDialog(QWidget* parent, Qt::WindowFlags f)
50  : QDialog(parent, f),
51  m_ui(new Ui::SummarizationDialogForm),
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-summarization-hint").pixmap(62,48));
60 
61 //signals
62  connect(m_ui->m_helpPushButton, SIGNAL(clicked()), this, SLOT(onHelpPushButtonClicked()));
63  connect(m_ui->m_okPushButton, SIGNAL(clicked()), this, SLOT(onOkPushButtonClicked()));
64  connect(m_ui->m_cancelPushButton, SIGNAL(clicked()), this, SLOT(onCancelPushButtonClicked()));
65 }
66 
68 {
69 }
70 
71 void te::vp::SummarizationDialog::setLayers(std::list<te::map::AbstractLayerPtr> layers)
72 {
73  m_layers = layers;
74 
75  std::list<te::map::AbstractLayerPtr>::iterator it = m_layers.begin();
76 
77  while(it != m_layers.end())
78  {
79  m_ui->m_inputLayerForComboBox->addItem(QString(it->get()->getTitle().c_str()), QVariant(it->get()->getId().c_str()));
80  m_ui->m_inputLayerFromComboBox->addItem(QString(it->get()->getTitle().c_str()), QVariant(it->get()->getId().c_str()));
81  ++it;
82  }
83 }
84 
86 {
87  QMessageBox::information(this, "Help", "Under development");
88 }
89 
91 {
92  QMessageBox::information(this, "Ok", "Under development");
93 }
94 
96 {
97  reject();
98 }
99 
100 
SummarizationDialog(QWidget *parent=0, Qt::WindowFlags f=0)
std::auto_ptr< Ui::SummarizationDialogForm > m_ui
void setLayers(std::list< te::map::AbstractLayerPtr > layers)
Set the layer that can be used.
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
A dialog summarization operation.