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 #ifndef __SGL_SWITCH_HPP
00026 #define __SGL_SWITCH_HPP
00027
00028 #include <sgl.h>
00029 #include <sglGroup.hpp>
00030
00031
00032
00094
00095
00096 class SGL_DLL_API sglSwitch : public sglGroup
00097 {
00098 public:
00100 enum
00101 {
00103 eOFF = -2,
00104
00106 eON = -1
00107 };
00108
00109 public:
00111 sglSwitch();
00113 virtual ~sglSwitch();
00114
00118 void setVal(int val) {m_switch_val = val;}
00119
00123 int getVal() const {return m_switch_val;}
00124
00125
00126 virtual sglBound::IntersectResultEnum intersect(
00127 sglIntersectf &isector) const;
00128
00129
00130 virtual sglBound::IntersectResultEnum intersect(
00131 sglIntersectd &isector) const;
00132
00133
00134 virtual void pick(sglPickf &pick_state, unsigned int cull_flags) const;
00135
00136
00137 virtual void pick(sglPickd &pick_state, unsigned int cull_flags) const;
00138
00139
00140 virtual sglNode *clone(unsigned int mode) const;
00141
00142
00143 virtual void printInfo(ostream &ostrm, const char *indent_string) const;
00144
00145 protected:
00146
00147 virtual void cull(sglCull<float> &trav_state,
00148 unsigned int cull_flags) const
00149 {
00150 cull(trav_state, cull_flags, m_switch_val);
00151 }
00152
00153
00154 virtual void cull(sglCull<double> &trav_state,
00155 unsigned int cull_flags) const
00156 {
00157 cull(trav_state, cull_flags, m_switch_val);
00158 }
00159
00160
00161 void cull(sglCull<float> &trav_state,
00162 unsigned int cull_flags, int switch_val) const;
00163 void cull(sglCull<double> &trav_state,
00164 unsigned int cull_flags, int switch_val) const;
00165
00166 void copyTo(sglSwitch *dst, unsigned int mode) const;
00167
00168 private:
00169 sglSwitch(const sglSwitch &);
00170 sglSwitch &operator=(const sglSwitch &);
00171
00172 protected:
00173 int m_switch_val;
00174 };
00175
00176 #endif