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 _OSGGRADIENTBACKGROUNDBASE_H_
00055 #define _OSGGRADIENTBACKGROUNDBASE_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 <OSGBackground.h>
00069
00070 #include <OSGColor3fFields.h>
00071 #include <OSGReal32Fields.h>
00072 #include <OSGInt32Fields.h>
00073
00074 #include <OSGGradientBackgroundFields.h>
00075
00076 OSG_BEGIN_NAMESPACE
00077
00078 class GradientBackground;
00079 class BinaryDataHandler;
00080
00082
00083 class OSG_SYSTEMLIB_DLLMAPPING GradientBackgroundBase : public Background
00084 {
00085 private:
00086
00087 typedef Background Inherited;
00088
00089
00090 public:
00091
00092 typedef GradientBackgroundPtr Ptr;
00093
00094 enum
00095 {
00096 ColorFieldId = Inherited::NextFieldId,
00097 PositionFieldId = ColorFieldId + 1,
00098 ClearStencilBitFieldId = PositionFieldId + 1,
00099 NextFieldId = ClearStencilBitFieldId + 1
00100 };
00101
00102 static const OSG::BitVector ColorFieldMask;
00103 static const OSG::BitVector PositionFieldMask;
00104 static const OSG::BitVector ClearStencilBitFieldMask;
00105
00106
00107 static const OSG::BitVector MTInfluenceMask;
00108
00109
00113 static FieldContainerType &getClassType (void);
00114 static UInt32 getClassTypeId (void);
00115
00117
00121 virtual FieldContainerType &getType (void);
00122 virtual const FieldContainerType &getType (void) const;
00123
00124 virtual UInt32 getContainerSize(void) const;
00125
00127
00131 SFInt32 *getSFClearStencilBit(void);
00132
00133 Int32 &getClearStencilBit(void);
00134 const Int32 &getClearStencilBit(void) const;
00135
00137
00141 void setClearStencilBit( const Int32 &value );
00142
00144
00149
00153 virtual UInt32 getBinSize (const BitVector &whichField);
00154 virtual void copyToBin ( BinaryDataHandler &pMem,
00155 const BitVector &whichField);
00156 virtual void copyFromBin( BinaryDataHandler &pMem,
00157 const BitVector &whichField);
00158
00159
00161
00165 static GradientBackgroundPtr create (void);
00166 static GradientBackgroundPtr createEmpty (void);
00167
00170
00174 virtual FieldContainerPtr shallowCopy (void) const;
00175
00177
00178 protected:
00179
00180
00184 MFColor3f _mfColor;
00185 MFReal32 _mfPosition;
00186 SFInt32 _sfClearStencilBit;
00187
00189
00193 GradientBackgroundBase(void);
00194 GradientBackgroundBase(const GradientBackgroundBase &source);
00195
00197
00201 virtual ~GradientBackgroundBase(void);
00202
00204
00208 MFColor3f *getMFColor (void);
00209 MFReal32 *getMFPosition (void);
00210
00211 Color3f &getColor (UInt32 index);
00212 MFColor3f &getColor (void);
00213 const MFColor3f &getColor (void) const;
00214 Real32 &getPosition (UInt32 index);
00215 MFReal32 &getPosition (void);
00216 const MFReal32 &getPosition (void) const;
00217
00219
00225
00229 #if !defined(OSG_FIXED_MFIELDSYNC)
00230 void executeSyncImpl( GradientBackgroundBase *pOther,
00231 const BitVector &whichField);
00232
00233 virtual void executeSync( FieldContainer &other,
00234 const BitVector &whichField);
00235 #else
00236 void executeSyncImpl( GradientBackgroundBase *pOther,
00237 const BitVector &whichField,
00238 const SyncInfo &sInfo );
00239
00240 virtual void executeSync( FieldContainer &other,
00241 const BitVector &whichField,
00242 const SyncInfo &sInfo);
00243
00244 virtual void execBeginEdit (const BitVector &whichField,
00245 UInt32 uiAspect,
00246 UInt32 uiContainerSize);
00247
00248 void execBeginEditImpl (const BitVector &whichField,
00249 UInt32 uiAspect,
00250 UInt32 uiContainerSize);
00251
00252 virtual void onDestroyAspect(UInt32 uiId, UInt32 uiAspect);
00253 #endif
00254
00256
00257 private:
00258
00259 friend class FieldContainer;
00260
00261 static FieldDescription *_desc[];
00262 static FieldContainerType _type;
00263
00264
00265
00266 void operator =(const GradientBackgroundBase &source);
00267 };
00268
00269
00270
00271
00272
00273
00274 typedef GradientBackgroundBase *GradientBackgroundBaseP;
00275
00276 typedef osgIF<GradientBackgroundBase::isNodeCore,
00277 CoredNodePtr<GradientBackground>,
00278 FieldContainer::attempt_to_create_CoredNodePtr_on_non_NodeCore_FC
00279 >::_IRet GradientBackgroundNodePtr;
00280
00281 typedef RefPtr<GradientBackgroundPtr> GradientBackgroundRefPtr;
00282
00283 OSG_END_NAMESPACE
00284
00285 #define OSGGRADIENTBACKGROUNDBASE_HEADER_CVSID "@(#)$Id: FCBaseTemplate_h.h,v 1.40 2005/07/20 00:10:14 vossg Exp $"
00286
00287 #endif