changed: gcc8 base update
[opensg.git] / Source / Contrib / CgFXMaterial / OSGCgFXPassChunk.h
blob5022b70eb87031adf29eee22795740d3f5e333c6
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 _OSGCGFXPASSCHUNK_H_
40 #define _OSGCGFXPASSCHUNK_H_
41 #ifdef __sgi
42 #pragma once
43 #endif
45 #include <string>
46 #include <vector>
47 #include <map>
49 #include "OSGCG.h"
51 #include "OSGCgFXPassChunkBase.h"
53 OSG_BEGIN_NAMESPACE
55 class CgFXTechnique;
57 /*! \brief CgFXPassChunk class. See \ref
58 PageKernelCgFXPassChunk for a description.
61 class OSG_CONTRIBCGFX_DLLMAPPING CgFXPassChunk : public CgFXPassChunkBase
63 private:
65 typedef CgFXPassChunkBase Inherited;
67 /*========================== PUBLIC =================================*/
69 public:
71 /*---------------------------------------------------------------------*/
72 /*! \name Chunk Class Access */
73 /*! \{ */
75 /*! \} */
76 /*---------------------------------------------------------------------*/
77 /*! \name Static Chunk Class Access */
78 /*! \{ */
80 /*! \} */
81 /*---------------------------------------------------------------------*/
82 /*! \name Sync */
83 /*! \{ */
85 virtual void changed(ConstFieldMaskArg whichField,
86 UInt32 origin,
87 BitVector detail );
89 /*! \} */
90 /*---------------------------------------------------------------------*/
91 /*! \name Output */
92 /*! \{ */
94 virtual void dump( UInt32 uiIndent = 0,
95 const BitVector bvFlags = 0) const;
98 /*! \} */
99 /*---------------------------------------------------------------------*/
100 /*! \name Parameter Callbacks */
101 /*! \{ */
103 virtual void activate (DrawEnv *pEnv,
104 State *pState,
105 StateOverride *pOverride );
107 virtual void deactivate(DrawEnv *pEnv,
108 State *pState,
109 StateOverride *pOverride );
111 virtual void changeFrom(DrawEnv *,
112 State *pNewState,
113 StateOverride *pNewOverride,
114 State *pOldState,
115 StateOverride *pOldOverride);
116 /*! \} */
117 /*---------------------------------------------------------------------*/
118 /*! \name Parameters */
119 /*! \{ */
121 /*! \} */
122 /*---------------------------------------------------------------------*/
123 /*! \name State */
124 /*! \{ */
126 virtual bool isTransparent(void) const;
128 /*! \} */
129 /*---------------------------------------------------------------------*/
130 /*! \name Comparison */
131 /*! \{ */
133 virtual Real32 switchCost ( StateChunk *chunk);
135 virtual bool operator < (const StateChunk &other) const;
137 virtual bool operator == (const StateChunk &other) const;
138 virtual bool operator != (const StateChunk &other) const;
140 /*! \} */
141 /*========================= PROTECTED ===============================*/
143 protected:
145 // Variables should all be in CGFXPassChunkBase.
147 CGpass _pCGPass;
149 /*---------------------------------------------------------------------*/
150 /*! \name Constructors */
151 /*! \{ */
153 CgFXPassChunk(void);
154 CgFXPassChunk(const CgFXPassChunk &source);
156 /*! \} */
157 /*---------------------------------------------------------------------*/
158 /*! \name Destructors */
159 /*! \{ */
161 virtual ~CgFXPassChunk(void);
163 /*! \} */
164 /*---------------------------------------------------------------------*/
165 /*! \name Init */
166 /*! \{ */
168 void setPass (CGpass pPass );
170 void updateStateUniforms(DrawEnv *pEnv );
172 /*! \} */
173 /*---------------------------------------------------------------------*/
174 /*! \name Init */
175 /*! \{ */
177 static void initMethod(InitPhase ePhase);
179 /*! \} */
180 /*========================== PRIVATE ================================*/
182 private:
184 friend class FieldContainer;
185 friend class CgFXPassChunkBase;
186 friend class CgFXTechnique;
188 // prohibit default functions (move to 'public' if you need one)
189 void operator =(const CgFXPassChunk &source);
192 typedef CgFXPassChunk *CgFXPassChunkP;
194 OSG_END_NAMESPACE
196 #include "OSGCgFXPassChunkBase.inl"
197 #include "OSGCgFXPassChunk.inl"
199 #endif /* _OSGCGFXPASSCHUNK_H_ */