All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
FixGeometryWidget.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/qt/widgets/vector/FixGeometryWidget.cpp
22 
23  \brief A widget to fix geometries.
24 */
25 
26 // TerraLib
27 #include "../../../common/Translator.h"
28 #include "../../../dataaccess/datasource/DataSource.h"
29 #include "../../../dataaccess/datasource/DataSourceFactory.h"
30 #include "../../../dataaccess/utils/Utils.h"
31 #include "../Exception.h"
32 #include "FixGeometryWidget.h"
33 #include "ui_FixGeometryWidgetForm.h"
34 
35 // Qt
36 #include <QFileDialog>
37 #include <QMessageBox>
38 
40 
41 te::qt::widgets::FixGeometryWidget::FixGeometryWidget(QWidget* parent, Qt::WindowFlags f)
42  : QWidget(parent, f),
43  m_ui(new Ui::FixGeometryWidgetForm)
44 {
45 // add controls
46  m_ui->setupUi(this);
47 
48 // set button icons
49  m_ui->m_targetDatasourceToolButton->setIcon(QIcon::fromTheme("datasource"));
50 
51 //connects
52  connect(m_ui->m_targetFileToolButton, SIGNAL(clicked()), this, SLOT(onTargetFileToolButtonPressed()));
53  connect(m_ui->m_targetDatasourceToolButton, SIGNAL(clicked()), this, SLOT(onTargetDatasourceToolButtonPressed()));
54 
55  }
56 
58 {
59 }
60 
61 Ui::FixGeometryWidgetForm* te::qt::widgets::FixGeometryWidget::getForm() const
62 {
63  return m_ui.get();
64 }
65 
67 {
68  return false;
69 }
70 
71 void te::qt::widgets::FixGeometryWidget::setLayerList(std::list<te::map::AbstractLayerPtr>& layerList)
72 {
73  m_layers = layerList;
74 
75  std::list<te::map::AbstractLayerPtr>::iterator it = m_layers.begin();
76 
77  while (it != m_layers.end())
78  {
79  std::auto_ptr<te::da::DataSetType> dsType = it->get()->getSchema();
80  if (dsType->hasGeom())
81  m_ui->m_layersComboBox->addItem(QString(it->get()->getTitle().c_str()), QVariant(it->get()->getId().c_str()));
82  ++it;
83  }
84 }
85 
87 {
88 
89 }
90 
92 {
93 
94 }
95 
96 
Q_DECLARE_METATYPE(te::map::AbstractLayerPtr)
void setLayerList(std::list< te::map::AbstractLayerPtr > &layerList)
Ui::FixGeometryWidgetForm * getForm() const
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
std::auto_ptr< Ui::FixGeometryWidgetForm > m_ui
A widget to fix geometries.
FixGeometryWidget(QWidget *parent=0, Qt::WindowFlags f=0)