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_COMPILECLIPPLANECHUNKINST
00055
00056 #include <stdlib.h>
00057 #include <stdio.h>
00058
00059 #include <OSGConfig.h>
00060
00061 #include "OSGClipPlaneChunkBase.h"
00062 #include "OSGClipPlaneChunk.h"
00063
00064 #include <OSGGL.h>
00065
00066 OSG_USING_NAMESPACE
00067
00068 const OSG::BitVector ClipPlaneChunkBase::EquationFieldMask =
00069 (TypeTraits<BitVector>::One << ClipPlaneChunkBase::EquationFieldId);
00070
00071 const OSG::BitVector ClipPlaneChunkBase::EnableFieldMask =
00072 (TypeTraits<BitVector>::One << ClipPlaneChunkBase::EnableFieldId);
00073
00074 const OSG::BitVector ClipPlaneChunkBase::BeaconFieldMask =
00075 (TypeTraits<BitVector>::One << ClipPlaneChunkBase::BeaconFieldId);
00076
00077 const OSG::BitVector ClipPlaneChunkBase::MTInfluenceMask =
00078 (Inherited::MTInfluenceMask) |
00079 (static_cast<BitVector>(0x0) << Inherited::NextFieldId);
00080
00081
00082
00083
00094
00095
00096 FieldDescription *ClipPlaneChunkBase::_desc[] =
00097 {
00098 new FieldDescription(SFVec4f::getClassType(),
00099 "equation",
00100 EquationFieldId, EquationFieldMask,
00101 false,
00102 (FieldAccessMethod) &ClipPlaneChunkBase::getSFEquation),
00103 new FieldDescription(SFBool::getClassType(),
00104 "enable",
00105 EnableFieldId, EnableFieldMask,
00106 false,
00107 (FieldAccessMethod) &ClipPlaneChunkBase::getSFEnable),
00108 new FieldDescription(SFNodePtr::getClassType(),
00109 "beacon",
00110 BeaconFieldId, BeaconFieldMask,
00111 false,
00112 (FieldAccessMethod) &ClipPlaneChunkBase::getSFBeacon)
00113 };
00114
00115
00116 FieldContainerType ClipPlaneChunkBase::_type(
00117 "ClipPlaneChunk",
00118 "StateChunk",
00119 NULL,
00120 (PrototypeCreateF) &ClipPlaneChunkBase::createEmpty,
00121 ClipPlaneChunk::initMethod,
00122 _desc,
00123 sizeof(_desc));
00124
00125
00126
00127
00128
00129 FieldContainerType &ClipPlaneChunkBase::getType(void)
00130 {
00131 return _type;
00132 }
00133
00134 const FieldContainerType &ClipPlaneChunkBase::getType(void) const
00135 {
00136 return _type;
00137 }
00138
00139
00140 FieldContainerPtr ClipPlaneChunkBase::shallowCopy(void) const
00141 {
00142 ClipPlaneChunkPtr returnValue;
00143
00144 newPtr(returnValue, dynamic_cast<const ClipPlaneChunk *>(this));
00145
00146 return returnValue;
00147 }
00148
00149 UInt32 ClipPlaneChunkBase::getContainerSize(void) const
00150 {
00151 return sizeof(ClipPlaneChunk);
00152 }
00153
00154
00155 #if !defined(OSG_FIXED_MFIELDSYNC)
00156 void ClipPlaneChunkBase::executeSync( FieldContainer &other,
00157 const BitVector &whichField)
00158 {
00159 this->executeSyncImpl((ClipPlaneChunkBase *) &other, whichField);
00160 }
00161 #else
00162 void ClipPlaneChunkBase::executeSync( FieldContainer &other,
00163 const BitVector &whichField, const SyncInfo &sInfo )
00164 {
00165 this->executeSyncImpl((ClipPlaneChunkBase *) &other, whichField, sInfo);
00166 }
00167 void ClipPlaneChunkBase::execBeginEdit(const BitVector &whichField,
00168 UInt32 uiAspect,
00169 UInt32 uiContainerSize)
00170 {
00171 this->execBeginEditImpl(whichField, uiAspect, uiContainerSize);
00172 }
00173
00174 void ClipPlaneChunkBase::onDestroyAspect(UInt32 uiId, UInt32 uiAspect)
00175 {
00176 Inherited::onDestroyAspect(uiId, uiAspect);
00177
00178 }
00179 #endif
00180
00181
00182
00183 #ifdef OSG_WIN32_ICL
00184 #pragma warning (disable : 383)
00185 #endif
00186
00187 ClipPlaneChunkBase::ClipPlaneChunkBase(void) :
00188 _sfEquation (Vec4f(0, 0, 1, 0)),
00189 _sfEnable (bool(GL_TRUE)),
00190 _sfBeacon (NodePtr(NullFC)),
00191 Inherited()
00192 {
00193 }
00194
00195 #ifdef OSG_WIN32_ICL
00196 #pragma warning (default : 383)
00197 #endif
00198
00199 ClipPlaneChunkBase::ClipPlaneChunkBase(const ClipPlaneChunkBase &source) :
00200 _sfEquation (source._sfEquation ),
00201 _sfEnable (source._sfEnable ),
00202 _sfBeacon (source._sfBeacon ),
00203 Inherited (source)
00204 {
00205 }
00206
00207
00208
00209 ClipPlaneChunkBase::~ClipPlaneChunkBase(void)
00210 {
00211 }
00212
00213
00214
00215 UInt32 ClipPlaneChunkBase::getBinSize(const BitVector &whichField)
00216 {
00217 UInt32 returnValue = Inherited::getBinSize(whichField);
00218
00219 if(FieldBits::NoField != (EquationFieldMask & whichField))
00220 {
00221 returnValue += _sfEquation.getBinSize();
00222 }
00223
00224 if(FieldBits::NoField != (EnableFieldMask & whichField))
00225 {
00226 returnValue += _sfEnable.getBinSize();
00227 }
00228
00229 if(FieldBits::NoField != (BeaconFieldMask & whichField))
00230 {
00231 returnValue += _sfBeacon.getBinSize();
00232 }
00233
00234
00235 return returnValue;
00236 }
00237
00238 void ClipPlaneChunkBase::copyToBin( BinaryDataHandler &pMem,
00239 const BitVector &whichField)
00240 {
00241 Inherited::copyToBin(pMem, whichField);
00242
00243 if(FieldBits::NoField != (EquationFieldMask & whichField))
00244 {
00245 _sfEquation.copyToBin(pMem);
00246 }
00247
00248 if(FieldBits::NoField != (EnableFieldMask & whichField))
00249 {
00250 _sfEnable.copyToBin(pMem);
00251 }
00252
00253 if(FieldBits::NoField != (BeaconFieldMask & whichField))
00254 {
00255 _sfBeacon.copyToBin(pMem);
00256 }
00257
00258
00259 }
00260
00261 void ClipPlaneChunkBase::copyFromBin( BinaryDataHandler &pMem,
00262 const BitVector &whichField)
00263 {
00264 Inherited::copyFromBin(pMem, whichField);
00265
00266 if(FieldBits::NoField != (EquationFieldMask & whichField))
00267 {
00268 _sfEquation.copyFromBin(pMem);
00269 }
00270
00271 if(FieldBits::NoField != (EnableFieldMask & whichField))
00272 {
00273 _sfEnable.copyFromBin(pMem);
00274 }
00275
00276 if(FieldBits::NoField != (BeaconFieldMask & whichField))
00277 {
00278 _sfBeacon.copyFromBin(pMem);
00279 }
00280
00281
00282 }
00283
00284 #if !defined(OSG_FIXED_MFIELDSYNC)
00285 void ClipPlaneChunkBase::executeSyncImpl( ClipPlaneChunkBase *pOther,
00286 const BitVector &whichField)
00287 {
00288
00289 Inherited::executeSyncImpl(pOther, whichField);
00290
00291 if(FieldBits::NoField != (EquationFieldMask & whichField))
00292 _sfEquation.syncWith(pOther->_sfEquation);
00293
00294 if(FieldBits::NoField != (EnableFieldMask & whichField))
00295 _sfEnable.syncWith(pOther->_sfEnable);
00296
00297 if(FieldBits::NoField != (BeaconFieldMask & whichField))
00298 _sfBeacon.syncWith(pOther->_sfBeacon);
00299
00300
00301 }
00302 #else
00303 void ClipPlaneChunkBase::executeSyncImpl( ClipPlaneChunkBase *pOther,
00304 const BitVector &whichField,
00305 const SyncInfo &sInfo )
00306 {
00307
00308 Inherited::executeSyncImpl(pOther, whichField, sInfo);
00309
00310 if(FieldBits::NoField != (EquationFieldMask & whichField))
00311 _sfEquation.syncWith(pOther->_sfEquation);
00312
00313 if(FieldBits::NoField != (EnableFieldMask & whichField))
00314 _sfEnable.syncWith(pOther->_sfEnable);
00315
00316 if(FieldBits::NoField != (BeaconFieldMask & whichField))
00317 _sfBeacon.syncWith(pOther->_sfBeacon);
00318
00319
00320
00321 }
00322
00323 void ClipPlaneChunkBase::execBeginEditImpl (const BitVector &whichField,
00324 UInt32 uiAspect,
00325 UInt32 uiContainerSize)
00326 {
00327 Inherited::execBeginEditImpl(whichField, uiAspect, uiContainerSize);
00328
00329 }
00330 #endif
00331
00332
00333
00334 #include <OSGSFieldTypeDef.inl>
00335 #include <OSGMFieldTypeDef.inl>
00336
00337 OSG_BEGIN_NAMESPACE
00338
00339 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
00340 DataType FieldDataTraits<ClipPlaneChunkPtr>::_type("ClipPlaneChunkPtr", "StateChunkPtr");
00341 #endif
00342
00343 OSG_DLLEXPORT_SFIELD_DEF1(ClipPlaneChunkPtr, OSG_SYSTEMLIB_DLLTMPLMAPPING);
00344 OSG_DLLEXPORT_MFIELD_DEF1(ClipPlaneChunkPtr, OSG_SYSTEMLIB_DLLTMPLMAPPING);
00345
00346 OSG_END_NAMESPACE
00347
00348
00349
00350
00351
00352 #ifdef OSG_SGI_CC
00353 #pragma set woff 1174
00354 #endif
00355
00356 #ifdef OSG_LINUX_ICC
00357 #pragma warning( disable : 177 )
00358 #endif
00359
00360 namespace
00361 {
00362 static Char8 cvsid_cpp [] = "@(#)$Id: FCBaseTemplate_cpp.h,v 1.45 2005/07/20 00:10:14 vossg Exp $";
00363 static Char8 cvsid_hpp [] = OSGCLIPPLANECHUNKBASE_HEADER_CVSID;
00364 static Char8 cvsid_inl [] = OSGCLIPPLANECHUNKBASE_INLINE_CVSID;
00365
00366 static Char8 cvsid_fields_hpp[] = OSGCLIPPLANECHUNKFIELDS_HEADER_CVSID;
00367 }
00368