CheckGeomValidityAction.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/plugins/vp/CheckGeomValidityAction.cpp
22 
23  \brief This file defines the CheckGeomValidity class
24 */
25 
26 // Terralib
27 #include "../../../vp/qt/CheckGeomValidityDialog.h"
28 #include "../../af/ApplicationController.h"
29 #include "../../af/BaseApplication.h"
30 #include "../../af/events/LayerEvents.h"
32 
33 // Qt
34 #include <QObject>
35 #include <QMessageBox>
36 
37 // STL
38 #include <memory>
39 
41  : te::qt::plugins::vp::AbstractAction(menu)
42 {
43  createAction(tr("Check Geometry Validity...").toUtf8().data(), "tools-check-geom-validity");
44  m_action->setObjectName("Tools.Check Geometry Validity");
45 }
46 
48  default;
49 
51 {
54 
55  emit triggered(&e);
56  emit triggered(&ed);
57 
58  std::list<te::map::AbstractLayerPtr> layers = e.m_layers;
59  te::map::AbstractLayerPtr selectedlayer = ed.m_layer;
60 
61  QWidget* parent = te::qt::af::AppCtrlSingleton::getInstance().getMainWindow();
62 
64 
67 
68  dlg->setAttribute(Qt::WA_DeleteOnClose);
69 
70  dlg->setLayers(layers, selectedlayer);
71 
72  dlg->setMapDisplay(ba->getMapDisplay());
73 
74  dlg->show();
75 }
te::map::AbstractLayerPtr m_layer
Layer selected.
Definition: LayerEvents.h:336
This event is used to get a single layer selected in layer tree.
Definition: LayerEvents.h:325
void createAction(std::string name, std::string pixmap="")
Create and set the actions parameters.
static ApplicationController & getInstance()
It returns a reference to the singleton instance.
A dialog used to check geometries validity.
URI C++ Library.
Definition: Attributes.h:37
void setLayers(std::list< te::map::AbstractLayerPtr > layers, te::map::AbstractLayerPtr selectedLayer=0)
This file defines the check geometry validity class.
QAction * m_action
Action used to call the process.
void setMapDisplay(te::qt::widgets::MapDisplay *md)
std::list< te::map::AbstractLayerPtr > m_layers
Definition: LayerEvents.h:345
te::qt::widgets::MapDisplay * getMapDisplay()
This is an abstract class used to register actions into vp pluging.
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
void triggered(te::qt::af::evt::Event *e)