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

SelectAction.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 SELECTACTION_HPP 00024 #define SELECTACTION_HPP 00025 00026 #include <queue> 00027 #include "Action.hpp" 00028 #include "Common.hpp" 00029 #include "Selectable.hpp" 00030 00031 namespace vrvis 00032 { 00033 00036 template <class SelectableT = Selectable> 00037 class SelectAction : public DigitalAction 00038 { 00039 // ================================================================== PUBLIC 00040 00041 public: 00042 00043 // ---------------------------------------------- Constructors & Destructor. 00044 00046 SelectAction(const std::vector<SelectableT*>& crSelectableVec); 00048 ~SelectAction(void); 00049 00050 // -------------------------------------------------------------- Selection. 00051 00053 SelectableT* getSelected(void); 00054 00055 // --------------------------------- Activation (Reimplemented from Action). 00056 00058 virtual void activate(void); 00060 virtual void deactivate(void); 00061 00062 // ------------------------------- Execution (Inherited from DigitalAction). 00063 00065 virtual void execute(const gadget::Digital::State cButtonState); 00066 00067 // ================================================================= PRIVATE 00068 00069 private: 00070 00071 // --------------------------------------------------------------- Typedefs. 00072 00074 typedef std::queue<SelectableT*> SelectableQueue; 00076 typedef std::vector<SelectableT*> SelectableVector; 00077 00078 // --------------------------------------------------------- Selection Init. 00079 00081 void deselectAll(void); 00082 00083 // ---------------------------------------------------------------- Members. 00084 00086 SelectableQueue mSelectableQueue; 00087 }; 00088 00089 } // End namespace. 00090 00091 // Include template implementation. 00092 #include "SelectAction.inl" 00093 00094 #endif // SELECTACTION_HPP

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