OpenWalnut  1.5.0dev
WFiberActionAddVertex.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 WFIBERACTIONADDVERTEX_H
26 #define WFIBERACTIONADDVERTEX_H
27 
28 #include <memory>
29 
30 #include <osg/Geode>
31 
32 #include "../WFiberHandler.h"
33 #include "WFiberAction.h"
34 
35 
36 /**
37  * The action when adding a Vertex.
38  */
40 {
41 public:
42  /**
43  * A shared_ptr to this class.
44  */
45  typedef std::shared_ptr< WFiberActionAddVertex > SPtr;
46 
47  /**
48  * Creates this action.
49  * \param vertex The vertex to add.
50  * \param fiberIdx The index of the fiber this vertex was added to.
51  * \param fiberHandler The WFiberHandler of the action.
52  */
53  WFiberActionAddVertex( osg::Vec3 vertex, size_t fiberIdx, WFiberHandler* fiberHandler );
54 
55  /**
56  * Empty destructor.
57  */
59 
60  /**
61  * Undos this action.
62  */
63  virtual void undo();
64 
65  /**
66  * Redos this action.
67  */
68  virtual void redo();
69 
70 private:
71  /**
72  * The vertex to add.
73  */
74  osg::Vec3 m_vertex;
75 
76  /**
77  * The index of the fiber this vertex was added to.
78  */
79  size_t m_fiberIdx;
80 
81  /**
82  * The WFiberHandler of the action.
83  */
85 };
86 
87 #endif // WFIBERACTIONADDVERTEX_H
The action when adding a Vertex.
std::shared_ptr< WFiberActionAddVertex > SPtr
A shared_ptr to this class.
virtual void redo()
Redos this action.
virtual void undo()
Undos this action.
WFiberHandler * m_fiberHandler
The WFiberHandler of the action.
osg::Vec3 m_vertex
The vertex to add.
WFiberActionAddVertex(osg::Vec3 vertex, size_t fiberIdx, WFiberHandler *fiberHandler)
Creates this action.
size_t m_fiberIdx
The index of the fiber this vertex was added to.
~WFiberActionAddVertex()
Empty destructor.
Super class for the actions.
Definition: WFiberAction.h:36
Handles the fibers of the WMPointsConnector.
Definition: WFiberHandler.h:48