fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / State / Base / OSGColorMaskChunk.h
blob2964e83dcacbba7f86975f1cdfe7bd802445c677
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 _OSGCOLORMASKCHUNK_H_
40 #define _OSGCOLORMASKCHUNK_H_
41 #ifdef __sgi
42 #pragma once
43 #endif
45 #include "OSGColorMaskChunkBase.h"
47 OSG_BEGIN_NAMESPACE
49 /*! \brief ColorMaskChunk class. See \ref PageSystemColorMaskChunk
50 for a description.
51 \ingroup GrpSystemStateBaseChunks
52 \ingroup GrpLibOSGSystem
53 \includebasedoc
56 class OSG_SYSTEM_DLLMAPPING ColorMaskChunk : public ColorMaskChunkBase
58 private:
60 /*========================== PUBLIC =================================*/
62 public:
64 typedef ColorMaskChunkBase Inherited;
66 /*---------------------------------------------------------------------*/
67 /*! \name Chunk Class Access */
68 /*! \{ */
70 virtual const StateChunkClass *getClass(void) const;
72 /*! \} */
73 /*---------------------------------------------------------------------*/
74 /*! \name Static Chunk Class Access */
75 /*! \{ */
77 static UInt32 getStaticClassId(void);
78 static const StateChunkClass *getStaticClass (void);
80 /*! \} */
81 /*---------------------------------------------------------------------*/
82 /*! \name State Commands */
83 /*! \{ */
85 virtual void activate (DrawEnv *pEnv,
86 UInt32 index = 0);
88 virtual void changeFrom (DrawEnv *pEnv,
89 StateChunk *old,
90 UInt32 index = 0);
92 virtual void deactivate (DrawEnv *pEnv,
93 UInt32 index = 0);
95 /*! \} */
96 /*---------------------------------------------------------------------*/
97 /*! \name Comparison */
98 /*! \{ */
100 virtual Real32 switchCost (StateChunk *chunk);
102 virtual bool operator < (const StateChunk &other) const;
104 virtual bool operator == (const StateChunk &other) const;
105 virtual bool operator != (const StateChunk &other) const;
107 /*! \} */
108 /*---------------------------------------------------------------------*/
109 /*! \name Sync */
110 /*! \{ */
112 virtual void changed(ConstFieldMaskArg whichField,
113 UInt32 origin,
114 BitVector details);
116 /*! \} */
117 /*---------------------------------------------------------------------*/
118 /*! \name Output */
119 /*! \{ */
121 virtual void dump( UInt32 uiIndent = 0,
122 const BitVector bvFlags = 0) const;
124 /*! \} */
125 /*---------------------------------------------------------------------*/
126 /*! \name Field Set */
127 /*! \{ */
129 void setMask(const bool &r,
130 const bool &g,
131 const bool &b,
132 const bool &a);
133 /*! \} */
134 /*========================= PROTECTED ===============================*/
136 protected:
138 // Variables should all be in ColorMaskChunkBase.
140 /*---------------------------------------------------------------------*/
141 /*! \name Constructors */
142 /*! \{ */
144 ColorMaskChunk(void);
145 ColorMaskChunk(const ColorMaskChunk &source);
147 /*! \} */
148 /*---------------------------------------------------------------------*/
149 /*! \name Destructors */
150 /*! \{ */
152 virtual ~ColorMaskChunk(void);
154 /*! \} */
155 /*---------------------------------------------------------------------*/
156 /*! \name Init */
157 /*! \{ */
159 static void initMethod(InitPhase ePhase);
161 /*! \} */
162 /*========================== PRIVATE ================================*/
164 private:
166 friend class FieldContainer;
167 friend class ColorMaskChunkBase;
169 // class. Used for indexing in State
170 static StateChunkClass _class;
172 // prohibit default functions (move to 'public' if you need one)
173 void operator =(const ColorMaskChunk &source);
176 typedef ColorMaskChunk *ColorMaskChunkP;
178 OSG_END_NAMESPACE
180 #include "OSGColorMaskChunkBase.inl"
181 #include "OSGColorMaskChunk.inl"
183 #endif /* _OSGCOLORMASKCHUNK_H_ */