Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

ActionSet.hpp

Go to the documentation of this file.
00001 /****************************************************************************\ 00002 * VRVis * 00003 * http://vrvis.sourceforge.net * 00004 * (C) 2004 by Alex Loeffler * 00005 * mailto:aloeffler@users.sourceforge.net * 00006 **************************************************************************** 00007 * License * 00008 * * 00009 * This library is free software; you can redistribute it and/or modify it * 00010 * under the terms of the GNU Library General Public License as published * 00011 * by the Free Software Foundation, version 2. * 00012 * * 00013 * This library is distributed in the hope that it will be useful, but * 00014 * WITHOUT ANY WARRANTY; without even the implied warranty of * 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00016 * Library General Public License for more details. * 00017 * * 00018 * You should have received a copy of the GNU Library General Public * 00019 * License along with this library; if not, write to the Free Software * 00020 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * 00021 \****************************************************************************/ 00022 00023 #ifndef ACTIONSET_HPP 00024 #define ACTIONSET_HPP 00025 00026 #include <map> 00027 #include <string> 00028 #include <gadget/Type/AnalogInterface.h> 00029 #include <gadget/Type/DigitalInterface.h> 00030 #include "Input.hpp" 00031 #include "Common.hpp" 00032 00033 namespace vrvis 00034 { 00035 00036 class AnalogAction; 00037 class DigitalAction; 00038 //class Input; 00039 00041 class ActionSet 00042 { 00043 // ================================================================== PUBLIC 00044 00045 public: 00046 00047 // ------------------------------------------------------------- Destructor. 00048 00050 ~ActionSet(void); 00051 00052 // -------------------------------------------------------------- Accessors. 00053 00055 const std::string& getName(void); 00056 00057 // ---------------------------------------------------------------- Actions. 00058 00060 void addAnalogAction (const std::string& crDeviceName, 00061 AnalogAction* pAction); 00062 00064 void addDigitalAction(const std::string& crDeviceName, 00065 DigitalAction* pAction); 00066 00068 void activateActions(void); 00069 00071 void deactivateActions(void); 00072 00073 // ----------------------------------------------------------------- Events. 00074 00076 void triggerAnalogEvent (gadget::AnalogInterface* pAnalog); 00077 00079 void triggerDigitalEvent(gadget::DigitalInterface* pDigital); 00080 00081 // ================================================================= PRIVATE 00082 00083 private: 00084 00085 // ---------------------------------------------------------------- Friends. 00086 00088 friend ActionSet* Input::createActionSet(const std::string& crName); 00089 00090 // --------------------------------------------------------------- Typedefs. 00091 00093 typedef std::vector<gadget::AnalogInterface*> AnalogVector; 00095 typedef std::vector<gadget::DigitalInterface*> DigitalVector; 00097 typedef 00098 std::map<gadget::AnalogInterface*, AnalogAction*> AnalogActionMap; 00100 typedef 00101 std::map<gadget::DigitalInterface*, DigitalAction*> DigitalActionMap; 00102 00103 // ------------------------------------------------------------ Constructor. 00104 00106 ActionSet(const std::string& crName, 00107 const AnalogVector& crAnalogs, 00108 const DigitalVector& crDigitals, 00109 Input* pInput); 00110 00111 // ---------------------------------------------------------------- Members. 00112 00114 std::string mName; 00116 AnalogActionMap mAnalogActionMap; 00118 DigitalActionMap mDigitalActionMap; 00120 Input* mpInput; 00121 }; 00122 00123 } // End namespace. 00124 00125 #endif // ACTIONSET_HPP

Generated on Tue Sep 21 07:31:08 2004 for VRVis by doxygen 1.3.8