fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / State / OpenGL / OSGTwoSidedLightingChunk.h
blob6c53e3b9874f75215a4d6b66a6284157f3e58003
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2000-2002 by the OpenSG Forum *
6 * *
7 * www.opensg.org *
8 * *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
10 * *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
13 * License *
14 * *
15 * This library is free software; you can redistribute it and/or modify it *
16 * under the terms of the GNU Library General Public License as published *
17 * by the Free Software Foundation, version 2. *
18 * *
19 * This library is distributed in the hope that it will be useful, but *
20 * WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
22 * Library General Public License for more details. *
23 * *
24 * You should have received a copy of the GNU Library General Public *
25 * License along with this library; if not, write to the Free Software *
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
27 * *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
30 * Changes *
31 * *
32 * *
33 * *
34 * *
35 * *
36 * *
37 \*---------------------------------------------------------------------------*/
39 #ifndef _OSGTWOSIDEDLIGHTINGCHUNK_H_
40 #define _OSGTWOSIDEDLIGHTINGCHUNK_H_
41 #ifdef __sgi
42 # pragma once
43 #endif
45 //----------------------------------------------------------------------------
46 // Includes
47 //----------------------------------------------------------------------------
49 #include "OSGTwoSidedLightingChunkBase.h"
51 //----------------------------------------------------------------------------
52 // namespaces
53 //----------------------------------------------------------------------------
55 OSG_BEGIN_NAMESPACE
57 /*! \brief State chunk for automatic cubetexture coordinate transformations.
58 \ingroup GrpStateOpenGLObj
59 \ingroup GrpLibOSGState
60 \includebasedoc
63 class OSG_STATE_DLLMAPPING TwoSidedLightingChunk :
64 public TwoSidedLightingChunkBase
66 /*========================== PUBLIC =================================*/
68 public:
70 typedef TwoSidedLightingChunkBase Inherited;
72 /*---------------------------------------------------------------------*/
73 /*! \name Chunk Class Access */
74 /*! \{ */
76 virtual const StateChunkClass *getClass(void) const;
78 /*! \} */
79 /*---------------------------------------------------------------------*/
80 /*! \name Static Chunk Class Access */
81 /*! \{ */
83 static UInt32 getStaticClassId(void);
84 static const StateChunkClass *getStaticClass (void);
86 /*! \} */
87 /*---------------------------------------------------------------------*/
88 /*! \name Sync */
89 /*! \{ */
91 virtual void changed(ConstFieldMaskArg whichField,
92 UInt32 origin,
93 BitVector details);
95 /*! \} */
96 /*---------------------------------------------------------------------*/
97 /*! \name State */
98 /*! \{ */
100 virtual void activate (DrawEnv *pEnv,
101 UInt32 index = 0);
103 virtual void changeFrom(DrawEnv *pEnv,
104 StateChunk *old,
105 UInt32 index = 0);
107 virtual void deactivate(DrawEnv *pEnv,
108 UInt32 index = 0);
110 /*! \} */
111 /*---------------------------------------------------------------------*/
112 /*! \name Comparison */
113 /*! \{ */
115 virtual Real32 switchCost(StateChunk *chunk);
117 virtual bool operator < (const StateChunk &other) const;
119 virtual bool operator == (const StateChunk &other) const;
120 virtual bool operator != (const StateChunk &other) const;
122 /*! \} */
123 /*---------------------------------------------------------------------*/
124 /*! \name Output */
125 /*! \{ */
127 virtual void dump( UInt32 uiIndent = 0,
128 const BitVector bvFlags = 0) const;
130 /*! \} */
131 /*========================= PROTECTED ===============================*/
133 protected:
135 // Variables should all be in CubeTextureTransformChunkBase.
137 /*---------------------------------------------------------------------*/
138 /*! \name Constructors */
139 /*! \{ */
141 TwoSidedLightingChunk(void);
142 TwoSidedLightingChunk(const TwoSidedLightingChunk &source);
144 /*! \} */
145 /*---------------------------------------------------------------------*/
146 /*! \name Destructors */
147 /*! \{ */
149 virtual ~TwoSidedLightingChunk(void);
151 /*! \} */
152 /*---------------------------------------------------------------------*/
153 /*! \name Init */
154 /*! \{ */
156 static void initMethod(InitPhase ePhase);
158 /*! \} */
159 /*========================== PRIVATE ================================*/
161 private:
163 friend class FieldContainer;
164 friend class TwoSidedLightingChunkBase;
167 // class. Used for indexing in State
168 static StateChunkClass _class;
170 // prohibit default functions (move to 'public' if you need one)
171 void operator =(const TwoSidedLightingChunk &source);
173 GLboolean _state;
176 typedef TwoSidedLightingChunk *TwoSidedLightingChunkP;
178 OSG_END_NAMESPACE
180 #include "OSGTwoSidedLightingChunkBase.inl"
181 #include "OSGTwoSidedLightingChunk.inl"
183 #endif /* _OSGTWOSIDEDLIGHTINGCHUNK_H_ */