OpenWalnut  1.5.0dev
WFiberActionToggle.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 WFIBERACTIONTOGGLE_H
26 #define WFIBERACTIONTOGGLE_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 toggling a fiber.
39  */
41 {
42 public:
43  /**
44  * A shared_ptr to this class.
45  */
46  typedef std::shared_ptr< WFiberActionToggle > SPtr;
47 
48  /**
49  * Creates this action.
50  * \param position The position of this fiber in the fibers vector.
51  * \param fiberHandler The WFiberHandler of the action.
52  */
53  WFiberActionToggle( size_t position, 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 position of this fiber in the fibers vector.
73  */
74  size_t m_position;
75 
76  /**
77  * The WFiberHandler of the action.
78  */
80 };
81 
82 #endif // WFIBERACTIONTOGGLE_H
The action when toggling a fiber.
WFiberHandler * m_fiberHandler
The WFiberHandler of the action.
WFiberActionToggle(size_t position, WFiberHandler *fiberHandler)
Creates this action.
~WFiberActionToggle()
Empty destructor.
virtual void redo()
Redos this action.
size_t m_position
The position of this fiber in the fibers vector.
std::shared_ptr< WFiberActionToggle > SPtr
A shared_ptr to this class.
virtual void undo()
Undos this action.
Super class for the actions.
Definition: WFiberAction.h:36
Handles the fibers of the WMPointsConnector.
Definition: WFiberHandler.h:48