AddCommand.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 AddCommand.h
22 
23 \brief
24 
25 \ingroup edit
26 */
27 
28 #ifndef __TERRALIB_EDIT_QT_INTERNAL_ADD_COMMAND_H
29 #define __TERRALIB_EDIT_QT_INTERNAL_ADD_COMMAND_H
30 
31 // TerraLib
32 #include "../../../../qt/widgets/canvas/MapDisplay.h"
33 #ifndef Q_MOC_RUN
34 #include "../../../../dataaccess/dataset/ObjectId.h"
35 #include "../../../RepositoryManager.h"
36 #include "../../../Utils.h"
37 #include "../../Config.h"
38 #include "../../Renderer.h"
39 #include "../../Utils.h"
40 #include "../UndoStackManager.h"
41 #endif
42 
43 // Qt
44 #include <QUndoCommand>
45 
46 namespace te
47 {
48  namespace edit
49  {
50  /*!
51  \brief Undo/Redo for add one components.
52 
53  */
54  class TEEDITQTEXPORT AddCommand : public QObject, public QUndoCommand
55  {
56  Q_OBJECT
57 
58  public:
59  // Pass all parameters that the command need to fulfill its task in the constructor
60  AddCommand(te::qt::widgets::MapDisplay* display, const te::map::AbstractLayerPtr& layer, te::da::ObjectId* id, QUndoCommand *parent = 0);
61 
62  /*!
63  \brief Destructor
64  */
65  virtual ~AddCommand();
66 
67  /*!
68  \brief Reimplemented from QUndoCommand
69  */
70  virtual void undo();
71 
72  /*!
73  \brief Reimplemented from QUndoCommand
74  */
75  virtual void redo();
76 
77  signals:
78 
79  void undoFeedback(std::vector<te::gm::Coord2D> coords);
80 
81  private:
82 
87 
88  void draw();
89 
90  std::size_t countFeaturesById(te::da::ObjectId* id, std::size_t& lastPos);
91 
92  };
93  }
94 }
95 
96 #endif
Undo/Redo for add one components.
Definition: AddCommand.h:54
#define TEEDITQTEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:60
te::da::ObjectId * m_id
Definition: AddCommand.h:85
A widget to control the display of a set of layers.
Definition: MapDisplay.h:69
te::map::AbstractLayerPtr m_layer
Definition: AddCommand.h:84
This class represents an unique id for a data set element.
Definition: ObjectId.h:47
URI C++ Library.
te::qt::widgets::MapDisplay * m_display
Definition: AddCommand.h:83
UndoStackManager & m_stack
Definition: AddCommand.h:86
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr