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

sglLayer.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: sglLayer.hpp
00021  *  Created: 5 January 2001
00022  *  Summary: Group that aids in rendering coplaner polygons without
00023  *           visual artifacts caused by the depth buffer.
00024  *****************************************************************************/
00025 
00026 #ifndef __SGL_LAYER_HPP
00027 #define __SGL_LAYER_HPP
00028 
00029 #include <sgl.h>
00030 #include <sglGroup.hpp>
00031 
00032 
00033 class sglStencilLayerBegin;
00034 class sglStencilLayerMiddle;
00035 class sglStencilLayerEnd;
00036 class sglDepthMask;
00037 class sglDepthTest;
00038 class sglColorMask;
00039 
00040 //----------------------------------------------------------------------------
00041 
00097 class SGL_DLL_API sglLayer : public sglGroup
00098 {
00099 public:
00101    enum LayerMethodEnum
00102    {
00104       eMULTIPASS,
00106       eSTENCIL
00107    };
00108 
00109 public:
00114    sglLayer(LayerMethodEnum method = eMULTIPASS);
00116    virtual ~sglLayer();
00117 
00121    void setMethod(LayerMethodEnum method);
00122 
00126    LayerMethodEnum getMethod() const { return m_method; }
00127 
00132    void setStencilMask(GLuint mask);
00133 
00137    GLuint getStencilMask() { return m_stencil_mask; }
00138 
00139    // See sglNode::clone() for details.
00140    virtual sglNode *clone(unsigned int mode) const;
00141 
00142    // See sglObject::printInfo() for details.
00143    virtual void printInfo(ostream &ostrm, const char *indent_string) const;
00144 
00145 protected:
00146    // See sglNode::cull(f) for details
00147    virtual void cull(sglCull<float> &trav_state,
00148                      unsigned int cull_flags) const;
00149 
00150    // See sglNode::cull(d) for details
00151    virtual void cull(sglCull<double> &trav_state,
00152                      unsigned int cull_flags) const;
00153 
00154    void copyTo(sglLayer *dst, unsigned int mode) const;
00155 
00156 private:  // not implemented
00157    sglLayer(const sglLayer &);
00158    sglLayer &operator=(const sglLayer &);
00159 
00160 private:
00161    LayerMethodEnum          m_method;
00162    GLuint                   m_stencil_mask;
00163 
00164    sglStencilLayerBegin    *m_stencil_begin;
00165    sglStencilLayerMiddle   *m_stencil_middle;
00166    sglStencilLayerEnd      *m_stencil_end;
00167 
00168    static sglDepthMask     *s_depth_mask;
00169    static sglDepthTest     *s_depth_test;
00170    static sglColorMask     *s_color_mask;
00171 };
00172 
00173 #endif

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