OpenWalnut  1.5.0dev
WFiberActionAddFiber.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 WFIBERACTIONADDFIBER_H
26 #define WFIBERACTIONADDFIBER_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 adding a fiber.
39  */
41 {
42 public:
43  /**
44  * A shared_ptr to this class.
45  */
46  typedef std::shared_ptr< WFiberActionAddFiber > SPtr;
47 
48  /**
49  * Creates this action.
50  * \param name The name of the fiber.
51  * \param position The position of this fiber in the fibers vector.
52  * \param fiberHandler The WFiberHandler of the action.
53  */
54  WFiberActionAddFiber( std::string name, size_t position, WFiberHandler* fiberHandler );
55 
56  /**
57  * Empty destructor.
58  */
60 
61  /**
62  * Undos this action.
63  */
64  virtual void undo();
65 
66  /**
67  * Redos this action.
68  */
69  virtual void redo();
70 
71 private:
72  /**
73  * The name of the fiber.
74  */
75  std::string m_name;
76 
77  /**
78  * The position of this fiber in the fibers vector.
79  */
80  size_t m_position;
81 
82  /**
83  * The WFiberHandler of the action.
84  */
86 };
87 
88 #endif // WFIBERACTIONADDFIBER_H
The action when adding a fiber.
size_t m_position
The position of this fiber in the fibers vector.
~WFiberActionAddFiber()
Empty destructor.
virtual void undo()
Undos this action.
WFiberHandler * m_fiberHandler
The WFiberHandler of the action.
std::string m_name
The name of the fiber.
std::shared_ptr< WFiberActionAddFiber > SPtr
A shared_ptr to this class.
WFiberActionAddFiber(std::string name, size_t position, WFiberHandler *fiberHandler)
Creates this action.
virtual void redo()
Redos this action.
Super class for the actions.
Definition: WFiberAction.h:36
Handles the fibers of the WMPointsConnector.
Definition: WFiberHandler.h:48