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_COMPILEDVRISOSURFACEINST
00055
00056 #include <stdlib.h>
00057 #include <stdio.h>
00058
00059 #include <OSGConfig.h>
00060
00061 #include "OSGDVRIsoSurfaceBase.h"
00062 #include "OSGDVRIsoSurface.h"
00063
00064 #include <OSGGL.h>
00065
00066 OSG_USING_NAMESPACE
00067
00068 const OSG::BitVector DVRIsoSurfaceBase::IsoValueFieldMask =
00069 (TypeTraits<BitVector>::One << DVRIsoSurfaceBase::IsoValueFieldId);
00070
00071 const OSG::BitVector DVRIsoSurfaceBase::IsoThicknessFieldMask =
00072 (TypeTraits<BitVector>::One << DVRIsoSurfaceBase::IsoThicknessFieldId);
00073
00074 const OSG::BitVector DVRIsoSurfaceBase::IsoOpacityFieldMask =
00075 (TypeTraits<BitVector>::One << DVRIsoSurfaceBase::IsoOpacityFieldId);
00076
00077 const OSG::BitVector DVRIsoSurfaceBase::AlphaModeFieldMask =
00078 (TypeTraits<BitVector>::One << DVRIsoSurfaceBase::AlphaModeFieldId);
00079
00080 const OSG::BitVector DVRIsoSurfaceBase::SpecularLightingFieldMask =
00081 (TypeTraits<BitVector>::One << DVRIsoSurfaceBase::SpecularLightingFieldId);
00082
00083 const OSG::BitVector DVRIsoSurfaceBase::MTInfluenceMask =
00084 (Inherited::MTInfluenceMask) |
00085 (static_cast<BitVector>(0x0) << Inherited::NextFieldId);
00086
00087
00088
00089
00106
00107
00108 FieldDescription *DVRIsoSurfaceBase::_desc[] =
00109 {
00110 new FieldDescription(SFReal32::getClassType(),
00111 "isoValue",
00112 IsoValueFieldId, IsoValueFieldMask,
00113 false,
00114 (FieldAccessMethod) &DVRIsoSurfaceBase::getSFIsoValue),
00115 new FieldDescription(SFReal32::getClassType(),
00116 "isoThickness",
00117 IsoThicknessFieldId, IsoThicknessFieldMask,
00118 false,
00119 (FieldAccessMethod) &DVRIsoSurfaceBase::getSFIsoThickness),
00120 new FieldDescription(SFReal32::getClassType(),
00121 "isoOpacity",
00122 IsoOpacityFieldId, IsoOpacityFieldMask,
00123 false,
00124 (FieldAccessMethod) &DVRIsoSurfaceBase::getSFIsoOpacity),
00125 new FieldDescription(SFUInt32::getClassType(),
00126 "alphaMode",
00127 AlphaModeFieldId, AlphaModeFieldMask,
00128 false,
00129 (FieldAccessMethod) &DVRIsoSurfaceBase::getSFAlphaMode),
00130 new FieldDescription(SFBool::getClassType(),
00131 "specularLighting",
00132 SpecularLightingFieldId, SpecularLightingFieldMask,
00133 false,
00134 (FieldAccessMethod) &DVRIsoSurfaceBase::getSFSpecularLighting)
00135 };
00136
00137
00138 FieldContainerType DVRIsoSurfaceBase::_type(
00139 "DVRIsoSurface",
00140 "Attachment",
00141 NULL,
00142 (PrototypeCreateF) &DVRIsoSurfaceBase::createEmpty,
00143 DVRIsoSurface::initMethod,
00144 _desc,
00145 sizeof(_desc));
00146
00147
00148
00149
00150
00151 FieldContainerType &DVRIsoSurfaceBase::getType(void)
00152 {
00153 return _type;
00154 }
00155
00156 const FieldContainerType &DVRIsoSurfaceBase::getType(void) const
00157 {
00158 return _type;
00159 }
00160
00161
00162 FieldContainerPtr DVRIsoSurfaceBase::shallowCopy(void) const
00163 {
00164 DVRIsoSurfacePtr returnValue;
00165
00166 newPtr(returnValue, dynamic_cast<const DVRIsoSurface *>(this));
00167
00168 return returnValue;
00169 }
00170
00171 UInt32 DVRIsoSurfaceBase::getContainerSize(void) const
00172 {
00173 return sizeof(DVRIsoSurface);
00174 }
00175
00176
00177 #if !defined(OSG_FIXED_MFIELDSYNC)
00178 void DVRIsoSurfaceBase::executeSync( FieldContainer &other,
00179 const BitVector &whichField)
00180 {
00181 this->executeSyncImpl((DVRIsoSurfaceBase *) &other, whichField);
00182 }
00183 #else
00184 void DVRIsoSurfaceBase::executeSync( FieldContainer &other,
00185 const BitVector &whichField, const SyncInfo &sInfo )
00186 {
00187 this->executeSyncImpl((DVRIsoSurfaceBase *) &other, whichField, sInfo);
00188 }
00189 void DVRIsoSurfaceBase::execBeginEdit(const BitVector &whichField,
00190 UInt32 uiAspect,
00191 UInt32 uiContainerSize)
00192 {
00193 this->execBeginEditImpl(whichField, uiAspect, uiContainerSize);
00194 }
00195
00196 void DVRIsoSurfaceBase::onDestroyAspect(UInt32 uiId, UInt32 uiAspect)
00197 {
00198 Inherited::onDestroyAspect(uiId, uiAspect);
00199
00200 }
00201 #endif
00202
00203
00204
00205 #ifdef OSG_WIN32_ICL
00206 #pragma warning (disable : 383)
00207 #endif
00208
00209 DVRIsoSurfaceBase::DVRIsoSurfaceBase(void) :
00210 _sfIsoValue (Real32(0.1)),
00211 _sfIsoThickness (Real32(0.1)),
00212 _sfIsoOpacity (Real32(0.5)),
00213 _sfAlphaMode (UInt32(GL_GREATER)),
00214 _sfSpecularLighting (bool(true)),
00215 Inherited()
00216 {
00217 }
00218
00219 #ifdef OSG_WIN32_ICL
00220 #pragma warning (default : 383)
00221 #endif
00222
00223 DVRIsoSurfaceBase::DVRIsoSurfaceBase(const DVRIsoSurfaceBase &source) :
00224 _sfIsoValue (source._sfIsoValue ),
00225 _sfIsoThickness (source._sfIsoThickness ),
00226 _sfIsoOpacity (source._sfIsoOpacity ),
00227 _sfAlphaMode (source._sfAlphaMode ),
00228 _sfSpecularLighting (source._sfSpecularLighting ),
00229 Inherited (source)
00230 {
00231 }
00232
00233
00234
00235 DVRIsoSurfaceBase::~DVRIsoSurfaceBase(void)
00236 {
00237 }
00238
00239
00240
00241 UInt32 DVRIsoSurfaceBase::getBinSize(const BitVector &whichField)
00242 {
00243 UInt32 returnValue = Inherited::getBinSize(whichField);
00244
00245 if(FieldBits::NoField != (IsoValueFieldMask & whichField))
00246 {
00247 returnValue += _sfIsoValue.getBinSize();
00248 }
00249
00250 if(FieldBits::NoField != (IsoThicknessFieldMask & whichField))
00251 {
00252 returnValue += _sfIsoThickness.getBinSize();
00253 }
00254
00255 if(FieldBits::NoField != (IsoOpacityFieldMask & whichField))
00256 {
00257 returnValue += _sfIsoOpacity.getBinSize();
00258 }
00259
00260 if(FieldBits::NoField != (AlphaModeFieldMask & whichField))
00261 {
00262 returnValue += _sfAlphaMode.getBinSize();
00263 }
00264
00265 if(FieldBits::NoField != (SpecularLightingFieldMask & whichField))
00266 {
00267 returnValue += _sfSpecularLighting.getBinSize();
00268 }
00269
00270
00271 return returnValue;
00272 }
00273
00274 void DVRIsoSurfaceBase::copyToBin( BinaryDataHandler &pMem,
00275 const BitVector &whichField)
00276 {
00277 Inherited::copyToBin(pMem, whichField);
00278
00279 if(FieldBits::NoField != (IsoValueFieldMask & whichField))
00280 {
00281 _sfIsoValue.copyToBin(pMem);
00282 }
00283
00284 if(FieldBits::NoField != (IsoThicknessFieldMask & whichField))
00285 {
00286 _sfIsoThickness.copyToBin(pMem);
00287 }
00288
00289 if(FieldBits::NoField != (IsoOpacityFieldMask & whichField))
00290 {
00291 _sfIsoOpacity.copyToBin(pMem);
00292 }
00293
00294 if(FieldBits::NoField != (AlphaModeFieldMask & whichField))
00295 {
00296 _sfAlphaMode.copyToBin(pMem);
00297 }
00298
00299 if(FieldBits::NoField != (SpecularLightingFieldMask & whichField))
00300 {
00301 _sfSpecularLighting.copyToBin(pMem);
00302 }
00303
00304
00305 }
00306
00307 void DVRIsoSurfaceBase::copyFromBin( BinaryDataHandler &pMem,
00308 const BitVector &whichField)
00309 {
00310 Inherited::copyFromBin(pMem, whichField);
00311
00312 if(FieldBits::NoField != (IsoValueFieldMask & whichField))
00313 {
00314 _sfIsoValue.copyFromBin(pMem);
00315 }
00316
00317 if(FieldBits::NoField != (IsoThicknessFieldMask & whichField))
00318 {
00319 _sfIsoThickness.copyFromBin(pMem);
00320 }
00321
00322 if(FieldBits::NoField != (IsoOpacityFieldMask & whichField))
00323 {
00324 _sfIsoOpacity.copyFromBin(pMem);
00325 }
00326
00327 if(FieldBits::NoField != (AlphaModeFieldMask & whichField))
00328 {
00329 _sfAlphaMode.copyFromBin(pMem);
00330 }
00331
00332 if(FieldBits::NoField != (SpecularLightingFieldMask & whichField))
00333 {
00334 _sfSpecularLighting.copyFromBin(pMem);
00335 }
00336
00337
00338 }
00339
00340 #if !defined(OSG_FIXED_MFIELDSYNC)
00341 void DVRIsoSurfaceBase::executeSyncImpl( DVRIsoSurfaceBase *pOther,
00342 const BitVector &whichField)
00343 {
00344
00345 Inherited::executeSyncImpl(pOther, whichField);
00346
00347 if(FieldBits::NoField != (IsoValueFieldMask & whichField))
00348 _sfIsoValue.syncWith(pOther->_sfIsoValue);
00349
00350 if(FieldBits::NoField != (IsoThicknessFieldMask & whichField))
00351 _sfIsoThickness.syncWith(pOther->_sfIsoThickness);
00352
00353 if(FieldBits::NoField != (IsoOpacityFieldMask & whichField))
00354 _sfIsoOpacity.syncWith(pOther->_sfIsoOpacity);
00355
00356 if(FieldBits::NoField != (AlphaModeFieldMask & whichField))
00357 _sfAlphaMode.syncWith(pOther->_sfAlphaMode);
00358
00359 if(FieldBits::NoField != (SpecularLightingFieldMask & whichField))
00360 _sfSpecularLighting.syncWith(pOther->_sfSpecularLighting);
00361
00362
00363 }
00364 #else
00365 void DVRIsoSurfaceBase::executeSyncImpl( DVRIsoSurfaceBase *pOther,
00366 const BitVector &whichField,
00367 const SyncInfo &sInfo )
00368 {
00369
00370 Inherited::executeSyncImpl(pOther, whichField, sInfo);
00371
00372 if(FieldBits::NoField != (IsoValueFieldMask & whichField))
00373 _sfIsoValue.syncWith(pOther->_sfIsoValue);
00374
00375 if(FieldBits::NoField != (IsoThicknessFieldMask & whichField))
00376 _sfIsoThickness.syncWith(pOther->_sfIsoThickness);
00377
00378 if(FieldBits::NoField != (IsoOpacityFieldMask & whichField))
00379 _sfIsoOpacity.syncWith(pOther->_sfIsoOpacity);
00380
00381 if(FieldBits::NoField != (AlphaModeFieldMask & whichField))
00382 _sfAlphaMode.syncWith(pOther->_sfAlphaMode);
00383
00384 if(FieldBits::NoField != (SpecularLightingFieldMask & whichField))
00385 _sfSpecularLighting.syncWith(pOther->_sfSpecularLighting);
00386
00387
00388
00389 }
00390
00391 void DVRIsoSurfaceBase::execBeginEditImpl (const BitVector &whichField,
00392 UInt32 uiAspect,
00393 UInt32 uiContainerSize)
00394 {
00395 Inherited::execBeginEditImpl(whichField, uiAspect, uiContainerSize);
00396
00397 }
00398 #endif
00399
00400
00401
00402 OSG_BEGIN_NAMESPACE
00403
00404 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
00405 DataType FieldDataTraits<DVRIsoSurfacePtr>::_type("DVRIsoSurfacePtr", "AttachmentPtr");
00406 #endif
00407
00408
00409 OSG_END_NAMESPACE
00410
00411
00412
00413
00414
00415 #ifdef OSG_SGI_CC
00416 #pragma set woff 1174
00417 #endif
00418
00419 #ifdef OSG_LINUX_ICC
00420 #pragma warning( disable : 177 )
00421 #endif
00422
00423 namespace
00424 {
00425 static Char8 cvsid_cpp [] = "@(#)$Id: FCBaseTemplate_cpp.h,v 1.45 2005/07/20 00:10:14 vossg Exp $";
00426 static Char8 cvsid_hpp [] = OSGDVRISOSURFACEBASE_HEADER_CVSID;
00427 static Char8 cvsid_inl [] = OSGDVRISOSURFACEBASE_INLINE_CVSID;
00428
00429 static Char8 cvsid_fields_hpp[] = OSGDVRISOSURFACEFIELDS_HEADER_CVSID;
00430 }
00431