All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PolygonToLineDialog.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/PolygonToLineDialog.cpp
22 
23  \brief A dialog for polygon to line 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 "PolygonToLineDialog.h"
39 #include "ui_PolygonToLineDialogForm.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::PolygonToLineDialog::PolygonToLineDialog(QWidget* parent, Qt::WindowFlags f)
51  : QDialog(parent, f),
52  m_ui(new Ui::PolygonToLineDialogForm),
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-polygon-line-hint").pixmap(112,48));
61 
62 //signals
63  connect(m_ui->m_helpPushButton, SIGNAL(clicked()), this, SLOT(onHelpPushButtonClicked()));
64  connect(m_ui->m_okPushButton, SIGNAL(clicked()), this, SLOT(onOkPushButtonClicked()));
65  connect(m_ui->m_cancelPushButton, SIGNAL(clicked()), this, SLOT(onCancelPushButtonClicked()));
66 }
67 
69 {
70 }
71 
72 void te::vp::PolygonToLineDialog::setLayers(std::list<te::map::AbstractLayerPtr> layers)
73 {
74  m_layers = layers;
75 
76  std::list<te::map::AbstractLayerPtr>::iterator it = m_layers.begin();
77 
78  while(it != m_layers.end())
79  {
80  m_ui->m_layersComboBox->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 
A dialog polygon to line operation.
PolygonToLineDialog(QWidget *parent=0, Qt::WindowFlags f=0)
void setLayers(std::list< te::map::AbstractLayerPtr > layers)
Set the layer that can be used.
std::auto_ptr< Ui::PolygonToLineDialogForm > m_ui
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr