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 _OSGDVRLOOKUPTABLEBASE_H_
00055 #define _OSGDVRLOOKUPTABLEBASE_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 <OSGAttachment.h>
00069
00070 #include <OSGUInt8Fields.h>
00071 #include <OSGUInt32Fields.h>
00072 #include <OSGUInt8Fields.h>
00073 #include <OSGUInt8Fields.h>
00074 #include <OSGReal32Fields.h>
00075 #include <OSGReal32Fields.h>
00076 #include <OSGReal32Fields.h>
00077 #include <OSGReal32Fields.h>
00078 #include <OSGBoolFields.h>
00079
00080 #include <OSGDVRLookupTableFields.h>
00081
00082 OSG_BEGIN_NAMESPACE
00083
00084 class DVRLookupTable;
00085 class BinaryDataHandler;
00086
00088
00089 class OSG_SYSTEMLIB_DLLMAPPING DVRLookupTableBase : public Attachment
00090 {
00091 private:
00092
00093 typedef Attachment Inherited;
00094
00095
00096 public:
00097
00098 typedef DVRLookupTablePtr Ptr;
00099
00100 enum
00101 {
00102 DimensionFieldId = Inherited::NextFieldId,
00103 SizeFieldId = DimensionFieldId + 1,
00104 ChannelFieldId = SizeFieldId + 1,
00105 DataFieldId = ChannelFieldId + 1,
00106 DataRFieldId = DataFieldId + 1,
00107 DataGFieldId = DataRFieldId + 1,
00108 DataBFieldId = DataGFieldId + 1,
00109 DataAFieldId = DataBFieldId + 1,
00110 TouchedFieldId = DataAFieldId + 1,
00111 NextFieldId = TouchedFieldId + 1
00112 };
00113
00114 static const OSG::BitVector DimensionFieldMask;
00115 static const OSG::BitVector SizeFieldMask;
00116 static const OSG::BitVector ChannelFieldMask;
00117 static const OSG::BitVector DataFieldMask;
00118 static const OSG::BitVector DataRFieldMask;
00119 static const OSG::BitVector DataGFieldMask;
00120 static const OSG::BitVector DataBFieldMask;
00121 static const OSG::BitVector DataAFieldMask;
00122 static const OSG::BitVector TouchedFieldMask;
00123
00124
00125 static const OSG::BitVector MTInfluenceMask;
00126
00127
00131 static FieldContainerType &getClassType (void);
00132 static UInt32 getClassTypeId (void);
00133
00135
00139 virtual FieldContainerType &getType (void);
00140 virtual const FieldContainerType &getType (void) const;
00141
00142 virtual UInt32 getContainerSize(void) const;
00143
00145
00149 SFUInt8 *getSFDimension (void);
00150 MFUInt32 *getMFSize (void);
00151 SFUInt8 *getSFChannel (void);
00152 MFUInt8 *getMFData (void);
00153 MFReal32 *getMFDataR (void);
00154 MFReal32 *getMFDataG (void);
00155 MFReal32 *getMFDataB (void);
00156 MFReal32 *getMFDataA (void);
00157 SFBool *getSFTouched (void);
00158
00159 UInt8 &getDimension (void);
00160 const UInt8 &getDimension (void) const;
00161 UInt8 &getChannel (void);
00162 const UInt8 &getChannel (void) const;
00163 bool &getTouched (void);
00164 const bool &getTouched (void) const;
00165 UInt32 &getSize (const UInt32 index);
00166 MFUInt32 &getSize (void);
00167 const MFUInt32 &getSize (void) const;
00168 UInt8 &getData (const UInt32 index);
00169 MFUInt8 &getData (void);
00170 const MFUInt8 &getData (void) const;
00171 Real32 &getDataR (const UInt32 index);
00172 MFReal32 &getDataR (void);
00173 const MFReal32 &getDataR (void) const;
00174 Real32 &getDataG (const UInt32 index);
00175 MFReal32 &getDataG (void);
00176 const MFReal32 &getDataG (void) const;
00177 Real32 &getDataB (const UInt32 index);
00178 MFReal32 &getDataB (void);
00179 const MFReal32 &getDataB (void) const;
00180 Real32 &getDataA (const UInt32 index);
00181 MFReal32 &getDataA (void);
00182 const MFReal32 &getDataA (void) const;
00183
00185
00189 void setDimension ( const UInt8 &value );
00190 void setChannel ( const UInt8 &value );
00191 void setTouched ( const bool &value );
00192
00194
00199
00203 virtual UInt32 getBinSize (const BitVector &whichField);
00204 virtual void copyToBin ( BinaryDataHandler &pMem,
00205 const BitVector &whichField);
00206 virtual void copyFromBin( BinaryDataHandler &pMem,
00207 const BitVector &whichField);
00208
00209
00211
00215 static DVRLookupTablePtr create (void);
00216 static DVRLookupTablePtr createEmpty (void);
00217
00220
00224 virtual FieldContainerPtr shallowCopy (void) const;
00225
00227
00228 protected:
00229
00230
00234 SFUInt8 _sfDimension;
00235 MFUInt32 _mfSize;
00236 SFUInt8 _sfChannel;
00237 MFUInt8 _mfData;
00238 MFReal32 _mfDataR;
00239 MFReal32 _mfDataG;
00240 MFReal32 _mfDataB;
00241 MFReal32 _mfDataA;
00242 SFBool _sfTouched;
00243
00245
00249 DVRLookupTableBase(void);
00250 DVRLookupTableBase(const DVRLookupTableBase &source);
00251
00253
00257 virtual ~DVRLookupTableBase(void);
00258
00260
00264 #if !defined(OSG_FIXED_MFIELDSYNC)
00265 void executeSyncImpl( DVRLookupTableBase *pOther,
00266 const BitVector &whichField);
00267
00268 virtual void executeSync( FieldContainer &other,
00269 const BitVector &whichField);
00270 #else
00271 void executeSyncImpl( DVRLookupTableBase *pOther,
00272 const BitVector &whichField,
00273 const SyncInfo &sInfo );
00274
00275 virtual void executeSync( FieldContainer &other,
00276 const BitVector &whichField,
00277 const SyncInfo &sInfo);
00278
00279 virtual void execBeginEdit (const BitVector &whichField,
00280 UInt32 uiAspect,
00281 UInt32 uiContainerSize);
00282
00283 void execBeginEditImpl (const BitVector &whichField,
00284 UInt32 uiAspect,
00285 UInt32 uiContainerSize);
00286
00287 virtual void onDestroyAspect(UInt32 uiId, UInt32 uiAspect);
00288 #endif
00289
00291
00292 private:
00293
00294 friend class FieldContainer;
00295
00296 static FieldDescription *_desc[];
00297 static FieldContainerType _type;
00298
00299
00300
00301 void operator =(const DVRLookupTableBase &source);
00302 };
00303
00304
00305
00306
00307
00308
00309 typedef DVRLookupTableBase *DVRLookupTableBaseP;
00310
00311 typedef osgIF<DVRLookupTableBase::isNodeCore,
00312 CoredNodePtr<DVRLookupTable>,
00313 FieldContainer::attempt_to_create_CoredNodePtr_on_non_NodeCore_FC
00314 >::_IRet DVRLookupTableNodePtr;
00315
00316 typedef RefPtr<DVRLookupTablePtr> DVRLookupTableRefPtr;
00317
00318 OSG_END_NAMESPACE
00319
00320 #define OSGDVRLOOKUPTABLEBASE_HEADER_CVSID "@(#)$Id: FCBaseTemplate_h.h,v 1.40 2005/07/20 00:10:14 vossg Exp $"
00321
00322 #endif