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 _OSGCOLORMASKCHUNKBASE_H_
00055 #define _OSGCOLORMASKCHUNKBASE_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 <OSGBoolFields.h>
00071 #include <OSGBoolFields.h>
00072 #include <OSGBoolFields.h>
00073 #include <OSGBoolFields.h>
00074
00075 #include <OSGColorMaskChunkFields.h>
00076
00077 OSG_BEGIN_NAMESPACE
00078
00079 class ColorMaskChunk;
00080 class BinaryDataHandler;
00081
00083
00084 class OSG_SYSTEMLIB_DLLMAPPING ColorMaskChunkBase : public StateChunk
00085 {
00086 private:
00087
00088 typedef StateChunk Inherited;
00089
00090
00091 public:
00092
00093 typedef ColorMaskChunkPtr Ptr;
00094
00095 enum
00096 {
00097 MaskRFieldId = Inherited::NextFieldId,
00098 MaskGFieldId = MaskRFieldId + 1,
00099 MaskBFieldId = MaskGFieldId + 1,
00100 MaskAFieldId = MaskBFieldId + 1,
00101 NextFieldId = MaskAFieldId + 1
00102 };
00103
00104 static const OSG::BitVector MaskRFieldMask;
00105 static const OSG::BitVector MaskGFieldMask;
00106 static const OSG::BitVector MaskBFieldMask;
00107 static const OSG::BitVector MaskAFieldMask;
00108
00109
00110 static const OSG::BitVector MTInfluenceMask;
00111
00112
00116 static FieldContainerType &getClassType (void);
00117 static UInt32 getClassTypeId (void);
00118
00120
00124 virtual FieldContainerType &getType (void);
00125 virtual const FieldContainerType &getType (void) const;
00126
00127 virtual UInt32 getContainerSize(void) const;
00128
00130
00134 SFBool *getSFMaskR (void);
00135 SFBool *getSFMaskG (void);
00136 SFBool *getSFMaskB (void);
00137 SFBool *getSFMaskA (void);
00138
00139 bool &getMaskR (void);
00140 const bool &getMaskR (void) const;
00141 bool &getMaskG (void);
00142 const bool &getMaskG (void) const;
00143 bool &getMaskB (void);
00144 const bool &getMaskB (void) const;
00145 bool &getMaskA (void);
00146 const bool &getMaskA (void) const;
00147
00149
00153 void setMaskR ( const bool &value );
00154 void setMaskG ( const bool &value );
00155 void setMaskB ( const bool &value );
00156 void setMaskA ( const bool &value );
00157
00159
00164
00168 virtual UInt32 getBinSize (const BitVector &whichField);
00169 virtual void copyToBin ( BinaryDataHandler &pMem,
00170 const BitVector &whichField);
00171 virtual void copyFromBin( BinaryDataHandler &pMem,
00172 const BitVector &whichField);
00173
00174
00176
00180 static ColorMaskChunkPtr create (void);
00181 static ColorMaskChunkPtr createEmpty (void);
00182
00185
00189 virtual FieldContainerPtr shallowCopy (void) const;
00190
00192
00193 protected:
00194
00195
00199 SFBool _sfMaskR;
00200 SFBool _sfMaskG;
00201 SFBool _sfMaskB;
00202 SFBool _sfMaskA;
00203
00205
00209 ColorMaskChunkBase(void);
00210 ColorMaskChunkBase(const ColorMaskChunkBase &source);
00211
00213
00217 virtual ~ColorMaskChunkBase(void);
00218
00220
00224 #if !defined(OSG_FIXED_MFIELDSYNC)
00225 void executeSyncImpl( ColorMaskChunkBase *pOther,
00226 const BitVector &whichField);
00227
00228 virtual void executeSync( FieldContainer &other,
00229 const BitVector &whichField);
00230 #else
00231 void executeSyncImpl( ColorMaskChunkBase *pOther,
00232 const BitVector &whichField,
00233 const SyncInfo &sInfo );
00234
00235 virtual void executeSync( FieldContainer &other,
00236 const BitVector &whichField,
00237 const SyncInfo &sInfo);
00238
00239 virtual void execBeginEdit (const BitVector &whichField,
00240 UInt32 uiAspect,
00241 UInt32 uiContainerSize);
00242
00243 void execBeginEditImpl (const BitVector &whichField,
00244 UInt32 uiAspect,
00245 UInt32 uiContainerSize);
00246
00247 virtual void onDestroyAspect(UInt32 uiId, UInt32 uiAspect);
00248 #endif
00249
00251
00252 private:
00253
00254 friend class FieldContainer;
00255
00256 static FieldDescription *_desc[];
00257 static FieldContainerType _type;
00258
00259
00260
00261 void operator =(const ColorMaskChunkBase &source);
00262 };
00263
00264
00265
00266
00267
00268
00269 typedef ColorMaskChunkBase *ColorMaskChunkBaseP;
00270
00271 typedef osgIF<ColorMaskChunkBase::isNodeCore,
00272 CoredNodePtr<ColorMaskChunk>,
00273 FieldContainer::attempt_to_create_CoredNodePtr_on_non_NodeCore_FC
00274 >::_IRet ColorMaskChunkNodePtr;
00275
00276 typedef RefPtr<ColorMaskChunkPtr> ColorMaskChunkRefPtr;
00277
00278 OSG_END_NAMESPACE
00279
00280 #define OSGCOLORMASKCHUNKBASE_HEADER_CVSID "@(#)$Id: OSGColorMaskChunkBase.h,v 1.3 2005/07/20 00:09:40 vossg Exp $"
00281
00282 #endif