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 #define OSG_COMPILESTATECHUNKINST
00055
00056 #include <stdlib.h>
00057 #include <stdio.h>
00058
00059 #include <OSGConfig.h>
00060
00061 #include "OSGStateChunkBase.h"
00062 #include "OSGStateChunk.h"
00063
00064
00065 OSG_BEGIN_NAMESPACE
00066
00067 const OSG::BitVector StateChunkBase::IgnoreFieldMask =
00068 (TypeTraits<BitVector>::One << StateChunkBase::IgnoreFieldId);
00069
00070 const OSG::BitVector StateChunkBase::MTInfluenceMask =
00071 (Inherited::MTInfluenceMask) |
00072 (static_cast<BitVector>(0x0) << Inherited::NextFieldId);
00073
00074
00075
00076
00081
00082
00083 FieldDescription *StateChunkBase::_desc[] =
00084 {
00085 new FieldDescription(SFBool::getClassType(),
00086 "ignore",
00087 IgnoreFieldId, IgnoreFieldMask,
00088 false,
00089 reinterpret_cast<FieldAccessMethod>(&StateChunkBase::editSFIgnore))
00090 };
00091
00092
00093 FieldContainerType StateChunkBase::_type(
00094 "StateChunk",
00095 "Attachment",
00096 NULL,
00097 NULL,
00098 StateChunk::initMethod,
00099 _desc,
00100 sizeof(_desc));
00101
00102
00103
00104
00105
00106 FieldContainerType &StateChunkBase::getType(void)
00107 {
00108 return _type;
00109 }
00110
00111 const FieldContainerType &StateChunkBase::getType(void) const
00112 {
00113 return _type;
00114 }
00115
00116
00117 UInt32 StateChunkBase::getContainerSize(void) const
00118 {
00119 return sizeof(StateChunk);
00120 }
00121
00122
00123 #if !defined(OSG_FIXED_MFIELDSYNC)
00124 void StateChunkBase::executeSync( FieldContainer &other,
00125 const BitVector &whichField)
00126 {
00127 this->executeSyncImpl(static_cast<StateChunkBase *>(&other),
00128 whichField);
00129 }
00130 #else
00131 void StateChunkBase::executeSync( FieldContainer &other,
00132 const BitVector &whichField, const SyncInfo &sInfo )
00133 {
00134 this->executeSyncImpl((StateChunkBase *) &other, whichField, sInfo);
00135 }
00136 void StateChunkBase::execBeginEdit(const BitVector &whichField,
00137 UInt32 uiAspect,
00138 UInt32 uiContainerSize)
00139 {
00140 this->execBeginEditImpl(whichField, uiAspect, uiContainerSize);
00141 }
00142
00143 void StateChunkBase::onDestroyAspect(UInt32 uiId, UInt32 uiAspect)
00144 {
00145 Inherited::onDestroyAspect(uiId, uiAspect);
00146
00147 }
00148 #endif
00149
00150
00151
00152 #ifdef OSG_WIN32_ICL
00153 #pragma warning (disable : 383)
00154 #endif
00155
00156 StateChunkBase::StateChunkBase(void) :
00157 _sfIgnore (bool(false)),
00158 Inherited()
00159 {
00160 }
00161
00162 #ifdef OSG_WIN32_ICL
00163 #pragma warning (default : 383)
00164 #endif
00165
00166 StateChunkBase::StateChunkBase(const StateChunkBase &source) :
00167 _sfIgnore (source._sfIgnore ),
00168 Inherited (source)
00169 {
00170 }
00171
00172
00173
00174 StateChunkBase::~StateChunkBase(void)
00175 {
00176 }
00177
00178
00179
00180 UInt32 StateChunkBase::getBinSize(const BitVector &whichField)
00181 {
00182 UInt32 returnValue = Inherited::getBinSize(whichField);
00183
00184 if(FieldBits::NoField != (IgnoreFieldMask & whichField))
00185 {
00186 returnValue += _sfIgnore.getBinSize();
00187 }
00188
00189
00190 return returnValue;
00191 }
00192
00193 void StateChunkBase::copyToBin( BinaryDataHandler &pMem,
00194 const BitVector &whichField)
00195 {
00196 Inherited::copyToBin(pMem, whichField);
00197
00198 if(FieldBits::NoField != (IgnoreFieldMask & whichField))
00199 {
00200 _sfIgnore.copyToBin(pMem);
00201 }
00202
00203
00204 }
00205
00206 void StateChunkBase::copyFromBin( BinaryDataHandler &pMem,
00207 const BitVector &whichField)
00208 {
00209 Inherited::copyFromBin(pMem, whichField);
00210
00211 if(FieldBits::NoField != (IgnoreFieldMask & whichField))
00212 {
00213 _sfIgnore.copyFromBin(pMem);
00214 }
00215
00216
00217 }
00218
00219 #if !defined(OSG_FIXED_MFIELDSYNC)
00220 void StateChunkBase::executeSyncImpl( StateChunkBase *pOther,
00221 const BitVector &whichField)
00222 {
00223
00224 Inherited::executeSyncImpl(pOther, whichField);
00225
00226 if(FieldBits::NoField != (IgnoreFieldMask & whichField))
00227 _sfIgnore.syncWith(pOther->_sfIgnore);
00228
00229
00230 }
00231 #else
00232 void StateChunkBase::executeSyncImpl( StateChunkBase *pOther,
00233 const BitVector &whichField,
00234 const SyncInfo &sInfo )
00235 {
00236
00237 Inherited::executeSyncImpl(pOther, whichField, sInfo);
00238
00239 if(FieldBits::NoField != (IgnoreFieldMask & whichField))
00240 _sfIgnore.syncWith(pOther->_sfIgnore);
00241
00242
00243
00244 }
00245
00246 void StateChunkBase::execBeginEditImpl (const BitVector &whichField,
00247 UInt32 uiAspect,
00248 UInt32 uiContainerSize)
00249 {
00250 Inherited::execBeginEditImpl(whichField, uiAspect, uiContainerSize);
00251
00252 }
00253 #endif
00254
00255
00256
00257 OSG_END_NAMESPACE
00258
00259 #include <OSGSFieldTypeDef.inl>
00260 #include <OSGMFieldTypeDef.inl>
00261
00262 OSG_BEGIN_NAMESPACE
00263
00264 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
00265 DataType FieldDataTraits<StateChunkPtr>::_type("StateChunkPtr", "AttachmentPtr");
00266 #endif
00267
00268 OSG_DLLEXPORT_SFIELD_DEF1(StateChunkPtr, OSG_SYSTEMLIB_DLLTMPLMAPPING);
00269 OSG_DLLEXPORT_MFIELD_DEF1(StateChunkPtr, OSG_SYSTEMLIB_DLLTMPLMAPPING);
00270
00271
00272
00273
00274
00275 #ifdef OSG_SGI_CC
00276 #pragma set woff 1174
00277 #endif
00278
00279 #ifdef OSG_LINUX_ICC
00280 #pragma warning( disable : 177 )
00281 #endif
00282
00283 namespace
00284 {
00285 static Char8 cvsid_cpp [] = "@(#)$Id: FCBaseTemplate_cpp.h,v 1.49 2008/06/09 07:30:44 vossg Exp $";
00286 static Char8 cvsid_hpp [] = OSGSTATECHUNKBASE_HEADER_CVSID;
00287 static Char8 cvsid_inl [] = OSGSTATECHUNKBASE_INLINE_CVSID;
00288
00289 static Char8 cvsid_fields_hpp[] = OSGSTATECHUNKFIELDS_HEADER_CVSID;
00290 }
00291
00292 OSG_END_NAMESPACE
00293