00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054 #ifndef _OSGBLENDCHUNKBASE_H_
00055 #define _OSGBLENDCHUNKBASE_H_
00056 #ifdef __sgi
00057 #pragma once
00058 #endif
00059
00060
00061 #include <OSGConfig.h>
00062 #include <OSGSystemDef.h>
00063
00064 #include <OSGBaseTypes.h>
00065 #include <OSGRefPtr.h>
00066 #include <OSGCoredNodePtr.h>
00067
00068 #include <OSGStateChunk.h>
00069
00070 #include <OSGGLenumFields.h>
00071 #include <OSGGLenumFields.h>
00072 #include <OSGGLenumFields.h>
00073 #include <OSGColor4fFields.h>
00074 #include <OSGGLenumFields.h>
00075 #include <OSGReal32Fields.h>
00076 #include <OSGGLenumFields.h>
00077 #include <OSGGLenumFields.h>
00078
00079 #include <OSGBlendChunkFields.h>
00080
00081 OSG_BEGIN_NAMESPACE
00082
00083 class BlendChunk;
00084 class BinaryDataHandler;
00085
00087
00088 class OSG_SYSTEMLIB_DLLMAPPING BlendChunkBase : public StateChunk
00089 {
00090 private:
00091
00092 typedef StateChunk Inherited;
00093
00094
00095 public:
00096
00097 typedef BlendChunkPtr Ptr;
00098
00099 enum
00100 {
00101 SrcFactorFieldId = Inherited::NextFieldId,
00102 DestFactorFieldId = SrcFactorFieldId + 1,
00103 EquationFieldId = DestFactorFieldId + 1,
00104 ColorFieldId = EquationFieldId + 1,
00105 AlphaFuncFieldId = ColorFieldId + 1,
00106 AlphaValueFieldId = AlphaFuncFieldId + 1,
00107 AlphaSrcFactorFieldId = AlphaValueFieldId + 1,
00108 AlphaDestFactorFieldId = AlphaSrcFactorFieldId + 1,
00109 NextFieldId = AlphaDestFactorFieldId + 1
00110 };
00111
00112 static const OSG::BitVector SrcFactorFieldMask;
00113 static const OSG::BitVector DestFactorFieldMask;
00114 static const OSG::BitVector EquationFieldMask;
00115 static const OSG::BitVector ColorFieldMask;
00116 static const OSG::BitVector AlphaFuncFieldMask;
00117 static const OSG::BitVector AlphaValueFieldMask;
00118 static const OSG::BitVector AlphaSrcFactorFieldMask;
00119 static const OSG::BitVector AlphaDestFactorFieldMask;
00120
00121
00122 static const OSG::BitVector MTInfluenceMask;
00123
00124
00128 static FieldContainerType &getClassType (void);
00129 static UInt32 getClassTypeId (void);
00130
00132
00136 virtual FieldContainerType &getType (void);
00137 virtual const FieldContainerType &getType (void) const;
00138
00139 virtual UInt32 getContainerSize(void) const;
00140
00142
00146 SFGLenum *getSFSrcFactor (void);
00147 SFGLenum *getSFDestFactor (void);
00148 SFGLenum *getSFEquation (void);
00149 SFColor4f *getSFColor (void);
00150 SFGLenum *getSFAlphaFunc (void);
00151 SFReal32 *getSFAlphaValue (void);
00152 SFGLenum *getSFAlphaSrcFactor (void);
00153 SFGLenum *getSFAlphaDestFactor(void);
00154
00155 GLenum &getSrcFactor (void);
00156 const GLenum &getSrcFactor (void) const;
00157 GLenum &getDestFactor (void);
00158 const GLenum &getDestFactor (void) const;
00159 GLenum &getEquation (void);
00160 const GLenum &getEquation (void) const;
00161 Color4f &getColor (void);
00162 const Color4f &getColor (void) const;
00163 GLenum &getAlphaFunc (void);
00164 const GLenum &getAlphaFunc (void) const;
00165 Real32 &getAlphaValue (void);
00166 const Real32 &getAlphaValue (void) const;
00167 GLenum &getAlphaSrcFactor (void);
00168 const GLenum &getAlphaSrcFactor (void) const;
00169 GLenum &getAlphaDestFactor(void);
00170 const GLenum &getAlphaDestFactor(void) const;
00171
00173
00177 void setSrcFactor ( const GLenum &value );
00178 void setDestFactor ( const GLenum &value );
00179 void setEquation ( const GLenum &value );
00180 void setColor ( const Color4f &value );
00181 void setAlphaFunc ( const GLenum &value );
00182 void setAlphaValue ( const Real32 &value );
00183 void setAlphaSrcFactor ( const GLenum &value );
00184 void setAlphaDestFactor( const GLenum &value );
00185
00187
00192
00196 virtual UInt32 getBinSize (const BitVector &whichField);
00197 virtual void copyToBin ( BinaryDataHandler &pMem,
00198 const BitVector &whichField);
00199 virtual void copyFromBin( BinaryDataHandler &pMem,
00200 const BitVector &whichField);
00201
00202
00204
00208 static BlendChunkPtr create (void);
00209 static BlendChunkPtr createEmpty (void);
00210
00213
00217 virtual FieldContainerPtr shallowCopy (void) const;
00218
00220
00221 protected:
00222
00223
00227 SFGLenum _sfSrcFactor;
00228 SFGLenum _sfDestFactor;
00229 SFGLenum _sfEquation;
00230 SFColor4f _sfColor;
00231 SFGLenum _sfAlphaFunc;
00232 SFReal32 _sfAlphaValue;
00233 SFGLenum _sfAlphaSrcFactor;
00234 SFGLenum _sfAlphaDestFactor;
00235
00237
00241 BlendChunkBase(void);
00242 BlendChunkBase(const BlendChunkBase &source);
00243
00245
00249 virtual ~BlendChunkBase(void);
00250
00252
00256 #if !defined(OSG_FIXED_MFIELDSYNC)
00257 void executeSyncImpl( BlendChunkBase *pOther,
00258 const BitVector &whichField);
00259
00260 virtual void executeSync( FieldContainer &other,
00261 const BitVector &whichField);
00262 #else
00263 void executeSyncImpl( BlendChunkBase *pOther,
00264 const BitVector &whichField,
00265 const SyncInfo &sInfo );
00266
00267 virtual void executeSync( FieldContainer &other,
00268 const BitVector &whichField,
00269 const SyncInfo &sInfo);
00270
00271 virtual void execBeginEdit (const BitVector &whichField,
00272 UInt32 uiAspect,
00273 UInt32 uiContainerSize);
00274
00275 void execBeginEditImpl (const BitVector &whichField,
00276 UInt32 uiAspect,
00277 UInt32 uiContainerSize);
00278
00279 virtual void onDestroyAspect(UInt32 uiId, UInt32 uiAspect);
00280 #endif
00281
00283
00284 private:
00285
00286 friend class FieldContainer;
00287
00288 static FieldDescription *_desc[];
00289 static FieldContainerType _type;
00290
00291
00292
00293 void operator =(const BlendChunkBase &source);
00294 };
00295
00296
00297
00298
00299
00300
00301 typedef BlendChunkBase *BlendChunkBaseP;
00302
00303 typedef osgIF<BlendChunkBase::isNodeCore,
00304 CoredNodePtr<BlendChunk>,
00305 FieldContainer::attempt_to_create_CoredNodePtr_on_non_NodeCore_FC
00306 >::_IRet BlendChunkNodePtr;
00307
00308 typedef RefPtr<BlendChunkPtr> BlendChunkRefPtr;
00309
00310 OSG_END_NAMESPACE
00311
00312 #define OSGBLENDCHUNKBASE_HEADER_CVSID "@(#)$Id: FCBaseTemplate_h.h,v 1.40 2005/07/20 00:10:14 vossg Exp $"
00313
00314 #endif