00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef __SGL_INDEXED_BIT_MASK_SWITCH_HPP
00027 #define __SGL_INDEXED_BIT_MASK_SWITCH_HPP
00028
00029 #include <sgl.h>
00030 #include <sglGroup.hpp>
00031 #include <sglBitMaskSwitch.hpp>
00032 #include <vector>
00033
00034
00035
00079
00080
00081 class SGL_DLL_API sglIndexedBitMaskSwitch : public sglBitMaskSwitch
00082 {
00083 public:
00085 sglIndexedBitMaskSwitch();
00087 virtual ~sglIndexedBitMaskSwitch();
00088
00092 void setIndex(unsigned int index)
00093 {
00094 if (index >= m_index.size())
00095 return;
00096
00097 m_switch_index = index;
00098 setMask( m_index[ m_switch_index ] );
00099 }
00100
00104 unsigned int getIndex() const { return m_switch_index; }
00105
00109 void addMask( unsigned int mask) { m_index.push_back( mask ); }
00110
00111
00112 virtual sglNode *clone(unsigned int mode) const;
00113
00114
00115 virtual void printInfo(ostream &ostrm, const char *indent_string) const;
00116
00117 protected:
00118 void copyTo(sglIndexedBitMaskSwitch *dst, unsigned int mode) const;
00119
00120 private:
00121 sglIndexedBitMaskSwitch(const sglIndexedBitMaskSwitch &);
00122 sglIndexedBitMaskSwitch &operator=(const sglIndexedBitMaskSwitch &);
00123
00124 protected:
00125 unsigned int m_switch_index;
00126 vector<unsigned int> m_index;
00127 };
00128
00129 #endif