Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages  

sglBitMaskSwitch.hpp

00001 /*****************************************************************************
00002  * SGL: A Scene Graph Library
00003  *
00004  * Copyright (C) 1997-2001  Scott McMillan   All Rights Reserved.
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Library General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2 of the License, or (at your option) any later version.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Library General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Library General Public
00017  * License along with this library; if not, write to the Free
00018  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00019  *****************************************************************************
00020  *     File: sglBitMaskSwitch.hpp
00021  *   Author: Scott McMillan
00022  *  Created: 18 May 2001
00023  *  Summary: select (or not) the children to be traversed
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    // See sglNode::intersect(f) for details.
00094    virtual sglBound::IntersectResultEnum intersect(
00095       sglIntersectf &isector) const;
00096 
00097    // See sglNode::intersect(d) for details.
00098    virtual sglBound::IntersectResultEnum intersect(
00099       sglIntersectd &isector) const;
00100 
00101    // See sglNode::pick(f) for details.
00102    virtual void pick(sglPickf &pick_state, unsigned int cull_flags) const;
00103 
00104    // See sglNode::pick(d) for details.
00105    virtual void pick(sglPickd &pick_state, unsigned int cull_flags) const;
00106 
00107    // See sglNode::clone() for details.
00108    virtual sglNode *clone(unsigned int mode) const;
00109 
00110    // See sglObject::printInfo() for details.
00111    virtual void printInfo(ostream &ostrm, const char *indent_string) const;
00112 
00113 protected:
00114    // See sglNode::cull(f) for details
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    // See sglNode::cull(d) for details
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    // reentrant versions of the cull functions for multithreading
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 &);            // not implemented
00138    sglBitMaskSwitch &operator=(const sglBitMaskSwitch &); // not implemented
00139 
00140 protected:
00141    unsigned int m_switch_mask;
00142 };
00143 
00144 #endif

Generated at Mon Jul 1 18:00:04 2002 for SGL by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001