GeometriesUpdateTool.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 them_initialPosition
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 GeometriesUpdateTool.cpp
22 
23 \brief
24 
25 */
26 
27 // TerraLib
28 #include "../../../qt/widgets/canvas/MapDisplay.h"
29 #include "../../../dataaccess/dataset/ObjectId.h"
30 #include "../../../geometry/Geometry.h"
31 #include "../../../maptools/AbstractLayer.h"
32 #include "../../Feature.h"
33 #include "../../RepositoryManager.h"
34 #include "../core/UndoStackManager.h"
35 #include "GeometriesUpdateTool.h"
36 
38  te::qt::widgets::AbstractTool(display, parent),
39  m_isInUse(true),
40  m_feature(nullptr),
41  m_layer(layer)
42 {}
43 
45 {
46  emit toolDeleted();
47 }
48 
50 {
51  m_layer = layer;
52 }
53 
55 {
56  return m_layer->getId();
57 }
58 
60 {
61  return m_isInUse;
62 }
63 
65 {
66  m_isInUse = status;
67 }
68 
70 {
71  m_feature = nullptr;
72 }
73 
75 {
76  if (e->type() == m_mEvent)
77  return false;
78 
80 }
81 
83 {
84  m_mEvent = mEvent;
85 }
86 
87 void te::edit::GeometriesUpdateTool::setCursor(const QCursor& cursor)
88 {
89  m_curCursor = m_display->cursor();
90  m_cursor = cursor;
91  m_display->setCursor(m_cursor);
92 }
virtual const std::string & getId() const
It returns the layer id.
This is the base class for layers.
Definition: AbstractLayer.h:77
GeometriesUpdateTool(te::qt::widgets::MapDisplay *display, te::map::AbstractLayer *layer, QObject *parent=0)
A widget to control the display of a set of layers.
QCursor m_cursor
The default tool cursor.
Definition: AbstractTool.h:172
void setInUse(const bool &status)
virtual bool eventFilter(QObject *watched, QEvent *e)
Filters events if this object has been installed as an event filter for the watched object...
void setLayer(te::map::AbstractLayer *layer)
URI C++ Library.
Definition: Attributes.h:37
QCursor m_curCursor
The current mapdisplay cursor.
Definition: AbstractTool.h:173
te::map::AbstractLayer * m_layer
void disableMouseEvent(QMouseEvent::Type mEvent)
void setCursor(const QCursor &cursor)
It sets the tool cursor.
MapDisplay * m_display
The map display associated with the tool.
Definition: AbstractTool.h:171
bool eventFilter(QObject *watched, QEvent *e)
Filters events if this object has been installed as an event filter for the watched object...