MoveCommand.h
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 MoveCommand.h
22 
23 \brief Undo/Redo for moving components.
24 
25 \ingroup edit
26 */
27 
28 #ifndef __TERRALIB_EDIT_QT_INTERNAL_MOVE_COMMAND_H
29 #define __TERRALIB_EDIT_QT_INTERNAL_MOVE_COMMAND_H
30 
31 // TerraLib
32 #include "../../Config.h"
33 #include "../../../../qt/widgets/canvas/MapDisplay.h"
34 
35 // Qt
36 #include <QUndoCommand>
37 #include <QString>
38 #include <QPointF>
39 
40 namespace te
41 {
42  namespace edit
43  {
44  /*!
45  \brief Undo/Redo for add one components.
46 
47  */
48  class TEEDITQTEXPORT MoveCommand : public QUndoCommand
49  {
50  public:
51  // Pass all parameters that the command need to fulfill its task in the constructor
52  MoveCommand(std::map<std::string, QList<QPointF> > items, Feature* item, te::qt::widgets::MapDisplay* display, const te::map::AbstractLayerPtr& layer, QUndoCommand *parent = 0);
53 
54  /*!
55  \brief Destructor
56  */
57  virtual ~MoveCommand();
58 
59  /*!
60  \brief Reimplemented from QUndoCommand
61  */
62  virtual void undo();
63 
64  /*!
65  \brief Reimplemented from QUndoCommand
66  */
67  virtual void redo();
68 
69  private:
70  virtual QString createCommandString(const QPointF &pos);
71 
72  void draw(Feature* feat);
73 
75  QPointF m_oldPos;
76  QPointF m_newPos;
77  std::map<std::string, QList<QPointF> > m_moveItems;
78  QList<QPointF> m_itemsPoints;
81 
82  };
83  }
84 }
85 
86 #endif
#define TEEDITQTEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:60
std::map< std::string, QList< QPointF > > m_moveItems
Definition: MoveCommand.h:77
A widget to control the display of a set of layers.
Definition: MapDisplay.h:66
URI C++ Library.
te::qt::widgets::MapDisplay * m_display
Definition: MoveCommand.h:79
Undo/Redo for add one components.
Definition: MoveCommand.h:48
QList< QPointF > m_itemsPoints
Definition: MoveCommand.h:78
te::map::AbstractLayerPtr m_layer
Definition: MoveCommand.h:80
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr