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 SELECTABLE_HPP 00024 #define SELECTABLE_HPP 00025 00026 #include "Common.hpp" 00027 00028 namespace vrvis 00029 { 00030 00040 class Selectable 00041 { 00042 // ================================================================== PUBLIC 00043 00044 public: 00045 00046 // ------------------------------------------------------------- Destructor. 00047 00053 virtual ~Selectable(void) { return; } 00054 00055 // -------------------------------------------------------------- Selection. 00056 00062 void select(void) { mIsSelected = true; } 00063 00069 void deselect(void) { mIsSelected = false; } 00070 00078 bool isSelected(void) const { return mIsSelected; } 00079 00086 bool& getSelectionHandle(void) { return mIsSelected; } 00087 00088 // =============================================================== PROTECTED 00089 00090 protected: 00091 00092 // ------------------------------------------------------------ Constructor. 00093 00099 Selectable(void) : mIsSelected(false) { return; } 00100 00101 // ================================================================= PRIVATE 00102 00103 private: 00104 00105 // ---------------------------------------------------------------- Members. 00106 00110 bool mIsSelected; 00111 }; 00112 00113 } // End namespace. 00114 00115 #endif // SELECTABLE_HPP