OpenWalnut  1.5.0dev
WFiberActionRemoveVertex.h
1 //---------------------------------------------------------------------------
2 //
3 // Project: OpenWalnut ( http://www.openwalnut.org )
4 //
5 // Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
6 // For more information see http://www.openwalnut.org/copying
7 //
8 // This file is part of OpenWalnut.
9 //
10 // OpenWalnut is free software: you can redistribute it and/or modify
11 // it under the terms of the GNU Lesser General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // OpenWalnut is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public License
21 // along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
22 //
23 //---------------------------------------------------------------------------
24 
25 #ifndef WFIBERACTIONREMOVEVERTEX_H
26 #define WFIBERACTIONREMOVEVERTEX_H
27 
28 #include <memory>
29 #include <string>
30 
31 #include <osg/Geode>
32 
33 #include "../WFiberHandler.h"
34 #include "WFiberAction.h"
35 
36 
37 /**
38  * The action when removing a Vertex.
39  */
41 {
42 public:
43  /**
44  * A shared_ptr to this class.
45  */
46  typedef std::shared_ptr< WFiberActionRemoveVertex > SPtr;
47 
48  /**
49  * Creates this action.
50  * \param vertex The vertex to add.
51  * \param fiberIdx The index of the fiber this vertex was added to.
52  * \param position The position of the vertex in the vertices vector.
53  * \param fiberHandler The WFiberHandler of the action.
54  */
55  WFiberActionRemoveVertex( osg::Vec3 vertex, size_t fiberIdx, size_t position, WFiberHandler* fiberHandler );
56 
57  /**
58  * Empty destructor.
59  */
61 
62  /**
63  * Undos this action.
64  */
65  virtual void undo();
66 
67  /**
68  * Redos this action.
69  */
70  virtual void redo();
71 
72 private:
73  /**
74  * The vertex to add.
75  */
76  osg::Vec3 m_vertex;
77 
78  /**
79  * The index of the fiber this vertex was added to.
80  */
81  size_t m_fiberIdx;
82 
83  /**
84  * The position of the vertex in the vertices vector.
85  */
86  size_t m_position;
87 
88  /**
89  * The WFiberHandler of the action.
90  */
92 };
93 
94 #endif // WFIBERACTIONREMOVEVERTEX_H
The action when removing a Vertex.
size_t m_position
The position of the vertex in the vertices vector.
virtual void redo()
Redos this action.
WFiberActionRemoveVertex(osg::Vec3 vertex, size_t fiberIdx, size_t position, WFiberHandler *fiberHandler)
Creates this action.
virtual void undo()
Undos this action.
std::shared_ptr< WFiberActionRemoveVertex > SPtr
A shared_ptr to this class.
WFiberHandler * m_fiberHandler
The WFiberHandler of the action.
osg::Vec3 m_vertex
The vertex to add.
size_t m_fiberIdx
The index of the fiber this vertex was added to.
~WFiberActionRemoveVertex()
Empty destructor.
Super class for the actions.
Definition: WFiberAction.h:36
Handles the fibers of the WMPointsConnector.
Definition: WFiberHandler.h:48