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 _OSGSHLCHUNKBASE_H_
00055 #define _OSGSHLCHUNKBASE_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 <OSGShaderChunk.h>
00069
00070 #include <OSGBoolFields.h>
00071 #include <OSGBoolFields.h>
00072 #include <OSGGLenumFields.h>
00073 #include <OSGUInt32Fields.h>
00074 #include <OSGUInt32Fields.h>
00075 #include <OSGInt32Fields.h>
00076
00077 #include <OSGSHLChunkFields.h>
00078
00079 OSG_BEGIN_NAMESPACE
00080
00081 class SHLChunk;
00082 class BinaryDataHandler;
00083
00085
00086 class OSG_SYSTEMLIB_DLLMAPPING SHLChunkBase : public ShaderChunk
00087 {
00088 private:
00089
00090 typedef ShaderChunk Inherited;
00091
00092
00093 public:
00094
00095 typedef SHLChunkPtr Ptr;
00096
00097 enum
00098 {
00099 CgFrontEndFieldId = Inherited::NextFieldId,
00100 PointSizeFieldId = CgFrontEndFieldId + 1,
00101 ProgramParameterNamesFieldId = PointSizeFieldId + 1,
00102 ProgramParameterValuesFieldId = ProgramParameterNamesFieldId + 1,
00103 GLIdFieldId = ProgramParameterValuesFieldId + 1,
00104 IgnoreGLForAspectFieldId = GLIdFieldId + 1,
00105 NextFieldId = IgnoreGLForAspectFieldId + 1
00106 };
00107
00108 static const OSG::BitVector CgFrontEndFieldMask;
00109 static const OSG::BitVector PointSizeFieldMask;
00110 static const OSG::BitVector ProgramParameterNamesFieldMask;
00111 static const OSG::BitVector ProgramParameterValuesFieldMask;
00112 static const OSG::BitVector GLIdFieldMask;
00113 static const OSG::BitVector IgnoreGLForAspectFieldMask;
00114
00115
00116 static const OSG::BitVector MTInfluenceMask;
00117
00118
00122 static FieldContainerType &getClassType (void);
00123 static UInt32 getClassTypeId (void);
00124
00126
00130 virtual FieldContainerType &getType (void);
00131 virtual const FieldContainerType &getType (void) const;
00132
00133 virtual UInt32 getContainerSize(void) const;
00134
00136
00140 SFBool *getSFCgFrontEnd (void);
00141 SFBool *getSFPointSize (void);
00142 MFGLenum *getMFProgramParameterNames(void);
00143 MFUInt32 *getMFProgramParameterValues(void);
00144 SFUInt32 *getSFGLId (void);
00145 SFInt32 *getSFIgnoreGLForAspect(void);
00146
00147 bool &getCgFrontEnd (void);
00148 const bool &getCgFrontEnd (void) const;
00149 bool &getPointSize (void);
00150 const bool &getPointSize (void) const;
00151 UInt32 &getGLId (void);
00152 const UInt32 &getGLId (void) const;
00153 Int32 &getIgnoreGLForAspect(void);
00154 const Int32 &getIgnoreGLForAspect(void) const;
00155 GLenum &getProgramParameterNames(const UInt32 index);
00156 MFGLenum &getProgramParameterNames(void);
00157 const MFGLenum &getProgramParameterNames(void) const;
00158 UInt32 &getProgramParameterValues(const UInt32 index);
00159 MFUInt32 &getProgramParameterValues(void);
00160 const MFUInt32 &getProgramParameterValues(void) const;
00161
00163
00167 void setCgFrontEnd ( const bool &value );
00168 void setPointSize ( const bool &value );
00169 void setGLId ( const UInt32 &value );
00170 void setIgnoreGLForAspect( const Int32 &value );
00171
00173
00178
00182 virtual UInt32 getBinSize (const BitVector &whichField);
00183 virtual void copyToBin ( BinaryDataHandler &pMem,
00184 const BitVector &whichField);
00185 virtual void copyFromBin( BinaryDataHandler &pMem,
00186 const BitVector &whichField);
00187
00188
00190
00194 static SHLChunkPtr create (void);
00195 static SHLChunkPtr createEmpty (void);
00196
00199
00203 virtual FieldContainerPtr shallowCopy (void) const;
00204
00206
00207 protected:
00208
00209
00213 SFBool _sfCgFrontEnd;
00214 SFBool _sfPointSize;
00215 MFGLenum _mfProgramParameterNames;
00216 MFUInt32 _mfProgramParameterValues;
00217 SFUInt32 _sfGLId;
00218 SFInt32 _sfIgnoreGLForAspect;
00219
00221
00225 SHLChunkBase(void);
00226 SHLChunkBase(const SHLChunkBase &source);
00227
00229
00233 virtual ~SHLChunkBase(void);
00234
00236
00240 #if !defined(OSG_FIXED_MFIELDSYNC)
00241 void executeSyncImpl( SHLChunkBase *pOther,
00242 const BitVector &whichField);
00243
00244 virtual void executeSync( FieldContainer &other,
00245 const BitVector &whichField);
00246 #else
00247 void executeSyncImpl( SHLChunkBase *pOther,
00248 const BitVector &whichField,
00249 const SyncInfo &sInfo );
00250
00251 virtual void executeSync( FieldContainer &other,
00252 const BitVector &whichField,
00253 const SyncInfo &sInfo);
00254
00255 virtual void execBeginEdit (const BitVector &whichField,
00256 UInt32 uiAspect,
00257 UInt32 uiContainerSize);
00258
00259 void execBeginEditImpl (const BitVector &whichField,
00260 UInt32 uiAspect,
00261 UInt32 uiContainerSize);
00262
00263 virtual void onDestroyAspect(UInt32 uiId, UInt32 uiAspect);
00264 #endif
00265
00267
00268 private:
00269
00270 friend class FieldContainer;
00271
00272 static FieldDescription *_desc[];
00273 static FieldContainerType _type;
00274
00275
00276
00277 void operator =(const SHLChunkBase &source);
00278 };
00279
00280
00281
00282
00283
00284
00285 typedef SHLChunkBase *SHLChunkBaseP;
00286
00287 typedef osgIF<SHLChunkBase::isNodeCore,
00288 CoredNodePtr<SHLChunk>,
00289 FieldContainer::attempt_to_create_CoredNodePtr_on_non_NodeCore_FC
00290 >::_IRet SHLChunkNodePtr;
00291
00292 typedef RefPtr<SHLChunkPtr> SHLChunkRefPtr;
00293
00294 OSG_END_NAMESPACE
00295
00296 #define OSGSHLCHUNKBASE_HEADER_CVSID "@(#)$Id: OSGSHLChunkBase.h,v 1.14 2006/11/17 17:16:04 a-m-z Exp $"
00297
00298 #endif