1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000-2002 by the OpenSG Forum *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
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. *
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. *
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. *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
37 \*---------------------------------------------------------------------------*/
39 #ifndef _OSGCGFXPASSCHUNK_H_
40 #define _OSGCGFXPASSCHUNK_H_
51 #include "OSGCgFXPassChunkBase.h"
57 /*! \brief CgFXPassChunk class. See \ref
58 PageKernelCgFXPassChunk for a description.
61 class OSG_CONTRIBCGFX_DLLMAPPING CgFXPassChunk
: public CgFXPassChunkBase
65 typedef CgFXPassChunkBase Inherited
;
67 /*========================== PUBLIC =================================*/
71 /*---------------------------------------------------------------------*/
72 /*! \name Chunk Class Access */
76 /*---------------------------------------------------------------------*/
77 /*! \name Static Chunk Class Access */
81 /*---------------------------------------------------------------------*/
85 virtual void changed(ConstFieldMaskArg whichField
,
90 /*---------------------------------------------------------------------*/
94 virtual void dump( UInt32 uiIndent
= 0,
95 const BitVector bvFlags
= 0) const;
99 /*---------------------------------------------------------------------*/
100 /*! \name Parameter Callbacks */
103 virtual void activate (DrawEnv
*pEnv
,
105 StateOverride
*pOverride
);
107 virtual void deactivate(DrawEnv
*pEnv
,
109 StateOverride
*pOverride
);
111 virtual void changeFrom(DrawEnv
*,
113 StateOverride
*pNewOverride
,
115 StateOverride
*pOldOverride
);
117 /*---------------------------------------------------------------------*/
118 /*! \name Parameters */
122 /*---------------------------------------------------------------------*/
126 virtual bool isTransparent(void) const;
129 /*---------------------------------------------------------------------*/
130 /*! \name Comparison */
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;
141 /*========================= PROTECTED ===============================*/
145 // Variables should all be in CGFXPassChunkBase.
149 /*---------------------------------------------------------------------*/
150 /*! \name Constructors */
154 CgFXPassChunk(const CgFXPassChunk
&source
);
157 /*---------------------------------------------------------------------*/
158 /*! \name Destructors */
161 virtual ~CgFXPassChunk(void);
164 /*---------------------------------------------------------------------*/
168 void setPass (CGpass pPass
);
170 void updateStateUniforms(DrawEnv
*pEnv
);
173 /*---------------------------------------------------------------------*/
177 static void initMethod(InitPhase ePhase
);
180 /*========================== 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
;
196 #include "OSGCgFXPassChunkBase.inl"
197 #include "OSGCgFXPassChunk.inl"
199 #endif /* _OSGCGFXPASSCHUNK_H_ */