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_BIT_MASK_SWITCH_HPP
00027 #define __SGL_BIT_MASK_SWITCH_HPP
00028
00029 #include <sgl.h>
00030 #include <sglGroup.hpp>
00031
00032
00033
00073
00074
00075 class SGL_DLL_API sglBitMaskSwitch : public sglGroup
00076 {
00077 public:
00079 sglBitMaskSwitch();
00081 virtual ~sglBitMaskSwitch();
00082
00086 void setMask(unsigned int mask) { m_switch_mask = mask; }
00087
00091 unsigned int getMask() { return m_switch_mask; }
00092
00093
00094 virtual sglBound::IntersectResultEnum intersect(
00095 sglIntersectf &isector) const;
00096
00097
00098 virtual sglBound::IntersectResultEnum intersect(
00099 sglIntersectd &isector) const;
00100
00101
00102 virtual void pick(sglPickf &pick_state, unsigned int cull_flags) const;
00103
00104
00105 virtual void pick(sglPickd &pick_state, unsigned int cull_flags) const;
00106
00107
00108 virtual sglNode *clone(unsigned int mode) const;
00109
00110
00111 virtual void printInfo(ostream &ostrm, const char *indent_string) const;
00112
00113 protected:
00114
00115 virtual void cull(sglCull<float> &trav_state,
00116 unsigned int cull_flags) const
00117 {
00118 cull(trav_state, cull_flags, m_switch_mask);
00119 }
00120
00121
00122 virtual void cull(sglCull<double> &trav_state,
00123 unsigned int cull_flags) const
00124 {
00125 cull(trav_state, cull_flags, m_switch_mask);
00126 }
00127
00128
00129 void cull(sglCull<float> &trav_state,
00130 unsigned int cull_flags, unsigned int switch_mask) const;
00131 void cull(sglCull<double> &trav_state,
00132 unsigned int cull_flags, unsigned int switch_mask) const;
00133
00134 void copyTo(sglBitMaskSwitch *dst, unsigned int mode) const;
00135
00136 private:
00137 sglBitMaskSwitch(const sglBitMaskSwitch &);
00138 sglBitMaskSwitch &operator=(const sglBitMaskSwitch &);
00139
00140 protected:
00141 unsigned int m_switch_mask;
00142 };
00143
00144 #endif