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_COMPILEIMAGEINST
00055
00056 #include <stdlib.h>
00057 #include <stdio.h>
00058
00059 #include <OSGConfig.h>
00060
00061 #include "OSGImageBase.h"
00062 #include "OSGImage.h"
00063
00064 #include <OSGGL.h>
00065
00066 OSG_BEGIN_NAMESPACE
00067
00068 const OSG::BitVector ImageBase::ParentsFieldMask =
00069 (TypeTraits<BitVector>::One << ImageBase::ParentsFieldId);
00070
00071 const OSG::BitVector ImageBase::DimensionFieldMask =
00072 (TypeTraits<BitVector>::One << ImageBase::DimensionFieldId);
00073
00074 const OSG::BitVector ImageBase::WidthFieldMask =
00075 (TypeTraits<BitVector>::One << ImageBase::WidthFieldId);
00076
00077 const OSG::BitVector ImageBase::HeightFieldMask =
00078 (TypeTraits<BitVector>::One << ImageBase::HeightFieldId);
00079
00080 const OSG::BitVector ImageBase::DepthFieldMask =
00081 (TypeTraits<BitVector>::One << ImageBase::DepthFieldId);
00082
00083 const OSG::BitVector ImageBase::BppFieldMask =
00084 (TypeTraits<BitVector>::One << ImageBase::BppFieldId);
00085
00086 const OSG::BitVector ImageBase::MipMapCountFieldMask =
00087 (TypeTraits<BitVector>::One << ImageBase::MipMapCountFieldId);
00088
00089 const OSG::BitVector ImageBase::FrameCountFieldMask =
00090 (TypeTraits<BitVector>::One << ImageBase::FrameCountFieldId);
00091
00092 const OSG::BitVector ImageBase::FrameDelayFieldMask =
00093 (TypeTraits<BitVector>::One << ImageBase::FrameDelayFieldId);
00094
00095 const OSG::BitVector ImageBase::PixelFormatFieldMask =
00096 (TypeTraits<BitVector>::One << ImageBase::PixelFormatFieldId);
00097
00098 const OSG::BitVector ImageBase::PixelFieldMask =
00099 (TypeTraits<BitVector>::One << ImageBase::PixelFieldId);
00100
00101 const OSG::BitVector ImageBase::FrameSizeFieldMask =
00102 (TypeTraits<BitVector>::One << ImageBase::FrameSizeFieldId);
00103
00104 const OSG::BitVector ImageBase::NameFieldMask =
00105 (TypeTraits<BitVector>::One << ImageBase::NameFieldId);
00106
00107 const OSG::BitVector ImageBase::DataTypeFieldMask =
00108 (TypeTraits<BitVector>::One << ImageBase::DataTypeFieldId);
00109
00110 const OSG::BitVector ImageBase::ComponentSizeFieldMask =
00111 (TypeTraits<BitVector>::One << ImageBase::ComponentSizeFieldId);
00112
00113 const OSG::BitVector ImageBase::SideCountFieldMask =
00114 (TypeTraits<BitVector>::One << ImageBase::SideCountFieldId);
00115
00116 const OSG::BitVector ImageBase::SideSizeFieldMask =
00117 (TypeTraits<BitVector>::One << ImageBase::SideSizeFieldId);
00118
00119 const OSG::BitVector ImageBase::ForceCompressedDataFieldMask =
00120 (TypeTraits<BitVector>::One << ImageBase::ForceCompressedDataFieldId);
00121
00122 const OSG::BitVector ImageBase::ForceAlphaChannelFieldMask =
00123 (TypeTraits<BitVector>::One << ImageBase::ForceAlphaChannelFieldId);
00124
00125 const OSG::BitVector ImageBase::ForceColorChannelFieldMask =
00126 (TypeTraits<BitVector>::One << ImageBase::ForceColorChannelFieldId);
00127
00128 const OSG::BitVector ImageBase::ForceAlphaBinaryFieldMask =
00129 (TypeTraits<BitVector>::One << ImageBase::ForceAlphaBinaryFieldId);
00130
00131 const OSG::BitVector ImageBase::ResXFieldMask =
00132 (TypeTraits<BitVector>::One << ImageBase::ResXFieldId);
00133
00134 const OSG::BitVector ImageBase::ResYFieldMask =
00135 (TypeTraits<BitVector>::One << ImageBase::ResYFieldId);
00136
00137 const OSG::BitVector ImageBase::ResUnitFieldMask =
00138 (TypeTraits<BitVector>::One << ImageBase::ResUnitFieldId);
00139
00140 const OSG::BitVector ImageBase::MTInfluenceMask =
00141 (Inherited::MTInfluenceMask) |
00142 (static_cast<BitVector>(0x0) << Inherited::NextFieldId);
00143
00144
00145
00146
00220
00221
00222 FieldDescription *ImageBase::_desc[] =
00223 {
00224 new FieldDescription(MFFieldContainerPtr::getClassType(),
00225 "parents",
00226 ParentsFieldId, ParentsFieldMask,
00227 false,
00228 (FieldAccessMethod) &ImageBase::getMFParents),
00229 new FieldDescription(SFInt32::getClassType(),
00230 "dimension",
00231 DimensionFieldId, DimensionFieldMask,
00232 false,
00233 (FieldAccessMethod) &ImageBase::getSFDimension),
00234 new FieldDescription(SFInt32::getClassType(),
00235 "width",
00236 WidthFieldId, WidthFieldMask,
00237 false,
00238 (FieldAccessMethod) &ImageBase::getSFWidth),
00239 new FieldDescription(SFInt32::getClassType(),
00240 "height",
00241 HeightFieldId, HeightFieldMask,
00242 false,
00243 (FieldAccessMethod) &ImageBase::getSFHeight),
00244 new FieldDescription(SFInt32::getClassType(),
00245 "depth",
00246 DepthFieldId, DepthFieldMask,
00247 false,
00248 (FieldAccessMethod) &ImageBase::getSFDepth),
00249 new FieldDescription(SFInt32::getClassType(),
00250 "bpp",
00251 BppFieldId, BppFieldMask,
00252 false,
00253 (FieldAccessMethod) &ImageBase::getSFBpp),
00254 new FieldDescription(SFInt32::getClassType(),
00255 "mipMapCount",
00256 MipMapCountFieldId, MipMapCountFieldMask,
00257 false,
00258 (FieldAccessMethod) &ImageBase::getSFMipMapCount),
00259 new FieldDescription(SFInt32::getClassType(),
00260 "frameCount",
00261 FrameCountFieldId, FrameCountFieldMask,
00262 false,
00263 (FieldAccessMethod) &ImageBase::getSFFrameCount),
00264 new FieldDescription(SFTime::getClassType(),
00265 "frameDelay",
00266 FrameDelayFieldId, FrameDelayFieldMask,
00267 false,
00268 (FieldAccessMethod) &ImageBase::getSFFrameDelay),
00269 new FieldDescription(SFUInt32::getClassType(),
00270 "pixelFormat",
00271 PixelFormatFieldId, PixelFormatFieldMask,
00272 false,
00273 (FieldAccessMethod) &ImageBase::getSFPixelFormat),
00274 new FieldDescription(MFUInt8::getClassType(),
00275 "pixel",
00276 PixelFieldId, PixelFieldMask,
00277 false,
00278 (FieldAccessMethod) &ImageBase::getMFPixel),
00279 new FieldDescription(SFInt32::getClassType(),
00280 "frameSize",
00281 FrameSizeFieldId, FrameSizeFieldMask,
00282 true,
00283 (FieldAccessMethod) &ImageBase::getSFFrameSize),
00284 new FieldDescription(SFString::getClassType(),
00285 "name",
00286 NameFieldId, NameFieldMask,
00287 false,
00288 (FieldAccessMethod) &ImageBase::getSFName),
00289 new FieldDescription(SFInt32::getClassType(),
00290 "dataType",
00291 DataTypeFieldId, DataTypeFieldMask,
00292 false,
00293 (FieldAccessMethod) &ImageBase::getSFDataType),
00294 new FieldDescription(SFInt32::getClassType(),
00295 "componentSize",
00296 ComponentSizeFieldId, ComponentSizeFieldMask,
00297 true,
00298 (FieldAccessMethod) &ImageBase::getSFComponentSize),
00299 new FieldDescription(SFInt32::getClassType(),
00300 "sideCount",
00301 SideCountFieldId, SideCountFieldMask,
00302 false,
00303 (FieldAccessMethod) &ImageBase::getSFSideCount),
00304 new FieldDescription(SFInt32::getClassType(),
00305 "sideSize",
00306 SideSizeFieldId, SideSizeFieldMask,
00307 true,
00308 (FieldAccessMethod) &ImageBase::getSFSideSize),
00309 new FieldDescription(SFBool::getClassType(),
00310 "forceCompressedData",
00311 ForceCompressedDataFieldId, ForceCompressedDataFieldMask,
00312 false,
00313 (FieldAccessMethod) &ImageBase::getSFForceCompressedData),
00314 new FieldDescription(SFBool::getClassType(),
00315 "forceAlphaChannel",
00316 ForceAlphaChannelFieldId, ForceAlphaChannelFieldMask,
00317 false,
00318 (FieldAccessMethod) &ImageBase::getSFForceAlphaChannel),
00319 new FieldDescription(SFBool::getClassType(),
00320 "forceColorChannel",
00321 ForceColorChannelFieldId, ForceColorChannelFieldMask,
00322 false,
00323 (FieldAccessMethod) &ImageBase::getSFForceColorChannel),
00324 new FieldDescription(SFBool::getClassType(),
00325 "forceAlphaBinary",
00326 ForceAlphaBinaryFieldId, ForceAlphaBinaryFieldMask,
00327 false,
00328 (FieldAccessMethod) &ImageBase::getSFForceAlphaBinary),
00329 new FieldDescription(SFReal32::getClassType(),
00330 "resX",
00331 ResXFieldId, ResXFieldMask,
00332 false,
00333 (FieldAccessMethod) &ImageBase::getSFResX),
00334 new FieldDescription(SFReal32::getClassType(),
00335 "resY",
00336 ResYFieldId, ResYFieldMask,
00337 false,
00338 (FieldAccessMethod) &ImageBase::getSFResY),
00339 new FieldDescription(SFUInt16::getClassType(),
00340 "resUnit",
00341 ResUnitFieldId, ResUnitFieldMask,
00342 false,
00343 (FieldAccessMethod) &ImageBase::getSFResUnit)
00344 };
00345
00346
00347 FieldContainerType ImageBase::_type(
00348 "Image",
00349 "AttachmentContainer",
00350 NULL,
00351 (PrototypeCreateF) &ImageBase::createEmpty,
00352 Image::initMethod,
00353 _desc,
00354 sizeof(_desc));
00355
00356
00357
00358
00359
00360 FieldContainerType &ImageBase::getType(void)
00361 {
00362 return _type;
00363 }
00364
00365 const FieldContainerType &ImageBase::getType(void) const
00366 {
00367 return _type;
00368 }
00369
00370
00371 FieldContainerPtr ImageBase::shallowCopy(void) const
00372 {
00373 ImagePtr returnValue;
00374
00375 newPtr(returnValue, dynamic_cast<const Image *>(this));
00376
00377 return returnValue;
00378 }
00379
00380 UInt32 ImageBase::getContainerSize(void) const
00381 {
00382 return sizeof(Image);
00383 }
00384
00385
00386 #if !defined(OSG_FIXED_MFIELDSYNC)
00387 void ImageBase::executeSync( FieldContainer &other,
00388 const BitVector &whichField)
00389 {
00390 this->executeSyncImpl((ImageBase *) &other, whichField);
00391 }
00392 #else
00393 void ImageBase::executeSync( FieldContainer &other,
00394 const BitVector &whichField, const SyncInfo &sInfo )
00395 {
00396 this->executeSyncImpl((ImageBase *) &other, whichField, sInfo);
00397 }
00398 void ImageBase::execBeginEdit(const BitVector &whichField,
00399 UInt32 uiAspect,
00400 UInt32 uiContainerSize)
00401 {
00402 this->execBeginEditImpl(whichField, uiAspect, uiContainerSize);
00403 }
00404
00405 void ImageBase::onDestroyAspect(UInt32 uiId, UInt32 uiAspect)
00406 {
00407 Inherited::onDestroyAspect(uiId, uiAspect);
00408
00409 _mfParents.terminateShare(uiAspect, this->getContainerSize());
00410 _mfPixel.terminateShare(uiAspect, this->getContainerSize());
00411 }
00412 #endif
00413
00414
00415
00416 #ifdef OSG_WIN32_ICL
00417 #pragma warning (disable : 383)
00418 #endif
00419
00420 ImageBase::ImageBase(void) :
00421 _mfParents (),
00422 _sfDimension (Int32(0)),
00423 _sfWidth (Int32(0)),
00424 _sfHeight (Int32(1)),
00425 _sfDepth (Int32(1)),
00426 _sfBpp (Int32(1)),
00427 _sfMipMapCount (Int32(1)),
00428 _sfFrameCount (Int32(1)),
00429 _sfFrameDelay (Time(0)),
00430 _sfPixelFormat (UInt32(0)),
00431 _mfPixel (),
00432 _sfFrameSize (Int32(0)),
00433 _sfName (),
00434 _sfDataType (Int32(GL_UNSIGNED_BYTE)),
00435 _sfComponentSize (Int32(1)),
00436 _sfSideCount (Int32(1)),
00437 _sfSideSize (Int32(0)),
00438 _sfForceCompressedData (bool(false)),
00439 _sfForceAlphaChannel (bool(false)),
00440 _sfForceColorChannel (bool(false)),
00441 _sfForceAlphaBinary (bool(false)),
00442 _sfResX (Real32(72.0f)),
00443 _sfResY (Real32(72.0f)),
00444 _sfResUnit (UInt16(2)),
00445 Inherited()
00446 {
00447 }
00448
00449 #ifdef OSG_WIN32_ICL
00450 #pragma warning (default : 383)
00451 #endif
00452
00453 ImageBase::ImageBase(const ImageBase &source) :
00454 _mfParents (source._mfParents ),
00455 _sfDimension (source._sfDimension ),
00456 _sfWidth (source._sfWidth ),
00457 _sfHeight (source._sfHeight ),
00458 _sfDepth (source._sfDepth ),
00459 _sfBpp (source._sfBpp ),
00460 _sfMipMapCount (source._sfMipMapCount ),
00461 _sfFrameCount (source._sfFrameCount ),
00462 _sfFrameDelay (source._sfFrameDelay ),
00463 _sfPixelFormat (source._sfPixelFormat ),
00464 _mfPixel (source._mfPixel ),
00465 _sfFrameSize (source._sfFrameSize ),
00466 _sfName (source._sfName ),
00467 _sfDataType (source._sfDataType ),
00468 _sfComponentSize (source._sfComponentSize ),
00469 _sfSideCount (source._sfSideCount ),
00470 _sfSideSize (source._sfSideSize ),
00471 _sfForceCompressedData (source._sfForceCompressedData ),
00472 _sfForceAlphaChannel (source._sfForceAlphaChannel ),
00473 _sfForceColorChannel (source._sfForceColorChannel ),
00474 _sfForceAlphaBinary (source._sfForceAlphaBinary ),
00475 _sfResX (source._sfResX ),
00476 _sfResY (source._sfResY ),
00477 _sfResUnit (source._sfResUnit ),
00478 Inherited (source)
00479 {
00480 }
00481
00482
00483
00484 ImageBase::~ImageBase(void)
00485 {
00486 }
00487
00488
00489
00490 UInt32 ImageBase::getBinSize(const BitVector &whichField)
00491 {
00492 UInt32 returnValue = Inherited::getBinSize(whichField);
00493
00494 if(FieldBits::NoField != (ParentsFieldMask & whichField))
00495 {
00496 returnValue += _mfParents.getBinSize();
00497 }
00498
00499 if(FieldBits::NoField != (DimensionFieldMask & whichField))
00500 {
00501 returnValue += _sfDimension.getBinSize();
00502 }
00503
00504 if(FieldBits::NoField != (WidthFieldMask & whichField))
00505 {
00506 returnValue += _sfWidth.getBinSize();
00507 }
00508
00509 if(FieldBits::NoField != (HeightFieldMask & whichField))
00510 {
00511 returnValue += _sfHeight.getBinSize();
00512 }
00513
00514 if(FieldBits::NoField != (DepthFieldMask & whichField))
00515 {
00516 returnValue += _sfDepth.getBinSize();
00517 }
00518
00519 if(FieldBits::NoField != (BppFieldMask & whichField))
00520 {
00521 returnValue += _sfBpp.getBinSize();
00522 }
00523
00524 if(FieldBits::NoField != (MipMapCountFieldMask & whichField))
00525 {
00526 returnValue += _sfMipMapCount.getBinSize();
00527 }
00528
00529 if(FieldBits::NoField != (FrameCountFieldMask & whichField))
00530 {
00531 returnValue += _sfFrameCount.getBinSize();
00532 }
00533
00534 if(FieldBits::NoField != (FrameDelayFieldMask & whichField))
00535 {
00536 returnValue += _sfFrameDelay.getBinSize();
00537 }
00538
00539 if(FieldBits::NoField != (PixelFormatFieldMask & whichField))
00540 {
00541 returnValue += _sfPixelFormat.getBinSize();
00542 }
00543
00544 if(FieldBits::NoField != (PixelFieldMask & whichField))
00545 {
00546 returnValue += _mfPixel.getBinSize();
00547 }
00548
00549 if(FieldBits::NoField != (FrameSizeFieldMask & whichField))
00550 {
00551 returnValue += _sfFrameSize.getBinSize();
00552 }
00553
00554 if(FieldBits::NoField != (NameFieldMask & whichField))
00555 {
00556 returnValue += _sfName.getBinSize();
00557 }
00558
00559 if(FieldBits::NoField != (DataTypeFieldMask & whichField))
00560 {
00561 returnValue += _sfDataType.getBinSize();
00562 }
00563
00564 if(FieldBits::NoField != (ComponentSizeFieldMask & whichField))
00565 {
00566 returnValue += _sfComponentSize.getBinSize();
00567 }
00568
00569 if(FieldBits::NoField != (SideCountFieldMask & whichField))
00570 {
00571 returnValue += _sfSideCount.getBinSize();
00572 }
00573
00574 if(FieldBits::NoField != (SideSizeFieldMask & whichField))
00575 {
00576 returnValue += _sfSideSize.getBinSize();
00577 }
00578
00579 if(FieldBits::NoField != (ForceCompressedDataFieldMask & whichField))
00580 {
00581 returnValue += _sfForceCompressedData.getBinSize();
00582 }
00583
00584 if(FieldBits::NoField != (ForceAlphaChannelFieldMask & whichField))
00585 {
00586 returnValue += _sfForceAlphaChannel.getBinSize();
00587 }
00588
00589 if(FieldBits::NoField != (ForceColorChannelFieldMask & whichField))
00590 {
00591 returnValue += _sfForceColorChannel.getBinSize();
00592 }
00593
00594 if(FieldBits::NoField != (ForceAlphaBinaryFieldMask & whichField))
00595 {
00596 returnValue += _sfForceAlphaBinary.getBinSize();
00597 }
00598
00599 if(FieldBits::NoField != (ResXFieldMask & whichField))
00600 {
00601 returnValue += _sfResX.getBinSize();
00602 }
00603
00604 if(FieldBits::NoField != (ResYFieldMask & whichField))
00605 {
00606 returnValue += _sfResY.getBinSize();
00607 }
00608
00609 if(FieldBits::NoField != (ResUnitFieldMask & whichField))
00610 {
00611 returnValue += _sfResUnit.getBinSize();
00612 }
00613
00614
00615 return returnValue;
00616 }
00617
00618 void ImageBase::copyToBin( BinaryDataHandler &pMem,
00619 const BitVector &whichField)
00620 {
00621 Inherited::copyToBin(pMem, whichField);
00622
00623 if(FieldBits::NoField != (ParentsFieldMask & whichField))
00624 {
00625 _mfParents.copyToBin(pMem);
00626 }
00627
00628 if(FieldBits::NoField != (DimensionFieldMask & whichField))
00629 {
00630 _sfDimension.copyToBin(pMem);
00631 }
00632
00633 if(FieldBits::NoField != (WidthFieldMask & whichField))
00634 {
00635 _sfWidth.copyToBin(pMem);
00636 }
00637
00638 if(FieldBits::NoField != (HeightFieldMask & whichField))
00639 {
00640 _sfHeight.copyToBin(pMem);
00641 }
00642
00643 if(FieldBits::NoField != (DepthFieldMask & whichField))
00644 {
00645 _sfDepth.copyToBin(pMem);
00646 }
00647
00648 if(FieldBits::NoField != (BppFieldMask & whichField))
00649 {
00650 _sfBpp.copyToBin(pMem);
00651 }
00652
00653 if(FieldBits::NoField != (MipMapCountFieldMask & whichField))
00654 {
00655 _sfMipMapCount.copyToBin(pMem);
00656 }
00657
00658 if(FieldBits::NoField != (FrameCountFieldMask & whichField))
00659 {
00660 _sfFrameCount.copyToBin(pMem);
00661 }
00662
00663 if(FieldBits::NoField != (FrameDelayFieldMask & whichField))
00664 {
00665 _sfFrameDelay.copyToBin(pMem);
00666 }
00667
00668 if(FieldBits::NoField != (PixelFormatFieldMask & whichField))
00669 {
00670 _sfPixelFormat.copyToBin(pMem);
00671 }
00672
00673 if(FieldBits::NoField != (PixelFieldMask & whichField))
00674 {
00675 _mfPixel.copyToBin(pMem);
00676 }
00677
00678 if(FieldBits::NoField != (FrameSizeFieldMask & whichField))
00679 {
00680 _sfFrameSize.copyToBin(pMem);
00681 }
00682
00683 if(FieldBits::NoField != (NameFieldMask & whichField))
00684 {
00685 _sfName.copyToBin(pMem);
00686 }
00687
00688 if(FieldBits::NoField != (DataTypeFieldMask & whichField))
00689 {
00690 _sfDataType.copyToBin(pMem);
00691 }
00692
00693 if(FieldBits::NoField != (ComponentSizeFieldMask & whichField))
00694 {
00695 _sfComponentSize.copyToBin(pMem);
00696 }
00697
00698 if(FieldBits::NoField != (SideCountFieldMask & whichField))
00699 {
00700 _sfSideCount.copyToBin(pMem);
00701 }
00702
00703 if(FieldBits::NoField != (SideSizeFieldMask & whichField))
00704 {
00705 _sfSideSize.copyToBin(pMem);
00706 }
00707
00708 if(FieldBits::NoField != (ForceCompressedDataFieldMask & whichField))
00709 {
00710 _sfForceCompressedData.copyToBin(pMem);
00711 }
00712
00713 if(FieldBits::NoField != (ForceAlphaChannelFieldMask & whichField))
00714 {
00715 _sfForceAlphaChannel.copyToBin(pMem);
00716 }
00717
00718 if(FieldBits::NoField != (ForceColorChannelFieldMask & whichField))
00719 {
00720 _sfForceColorChannel.copyToBin(pMem);
00721 }
00722
00723 if(FieldBits::NoField != (ForceAlphaBinaryFieldMask & whichField))
00724 {
00725 _sfForceAlphaBinary.copyToBin(pMem);
00726 }
00727
00728 if(FieldBits::NoField != (ResXFieldMask & whichField))
00729 {
00730 _sfResX.copyToBin(pMem);
00731 }
00732
00733 if(FieldBits::NoField != (ResYFieldMask & whichField))
00734 {
00735 _sfResY.copyToBin(pMem);
00736 }
00737
00738 if(FieldBits::NoField != (ResUnitFieldMask & whichField))
00739 {
00740 _sfResUnit.copyToBin(pMem);
00741 }
00742
00743
00744 }
00745
00746 void ImageBase::copyFromBin( BinaryDataHandler &pMem,
00747 const BitVector &whichField)
00748 {
00749 Inherited::copyFromBin(pMem, whichField);
00750
00751 if(FieldBits::NoField != (ParentsFieldMask & whichField))
00752 {
00753 _mfParents.copyFromBin(pMem);
00754 }
00755
00756 if(FieldBits::NoField != (DimensionFieldMask & whichField))
00757 {
00758 _sfDimension.copyFromBin(pMem);
00759 }
00760
00761 if(FieldBits::NoField != (WidthFieldMask & whichField))
00762 {
00763 _sfWidth.copyFromBin(pMem);
00764 }
00765
00766 if(FieldBits::NoField != (HeightFieldMask & whichField))
00767 {
00768 _sfHeight.copyFromBin(pMem);
00769 }
00770
00771 if(FieldBits::NoField != (DepthFieldMask & whichField))
00772 {
00773 _sfDepth.copyFromBin(pMem);
00774 }
00775
00776 if(FieldBits::NoField != (BppFieldMask & whichField))
00777 {
00778 _sfBpp.copyFromBin(pMem);
00779 }
00780
00781 if(FieldBits::NoField != (MipMapCountFieldMask & whichField))
00782 {
00783 _sfMipMapCount.copyFromBin(pMem);
00784 }
00785
00786 if(FieldBits::NoField != (FrameCountFieldMask & whichField))
00787 {
00788 _sfFrameCount.copyFromBin(pMem);
00789 }
00790
00791 if(FieldBits::NoField != (FrameDelayFieldMask & whichField))
00792 {
00793 _sfFrameDelay.copyFromBin(pMem);
00794 }
00795
00796 if(FieldBits::NoField != (PixelFormatFieldMask & whichField))
00797 {
00798 _sfPixelFormat.copyFromBin(pMem);
00799 }
00800
00801 if(FieldBits::NoField != (PixelFieldMask & whichField))
00802 {
00803 _mfPixel.copyFromBin(pMem);
00804 }
00805
00806 if(FieldBits::NoField != (FrameSizeFieldMask & whichField))
00807 {
00808 _sfFrameSize.copyFromBin(pMem);
00809 }
00810
00811 if(FieldBits::NoField != (NameFieldMask & whichField))
00812 {
00813 _sfName.copyFromBin(pMem);
00814 }
00815
00816 if(FieldBits::NoField != (DataTypeFieldMask & whichField))
00817 {
00818 _sfDataType.copyFromBin(pMem);
00819 }
00820
00821 if(FieldBits::NoField != (ComponentSizeFieldMask & whichField))
00822 {
00823 _sfComponentSize.copyFromBin(pMem);
00824 }
00825
00826 if(FieldBits::NoField != (SideCountFieldMask & whichField))
00827 {
00828 _sfSideCount.copyFromBin(pMem);
00829 }
00830
00831 if(FieldBits::NoField != (SideSizeFieldMask & whichField))
00832 {
00833 _sfSideSize.copyFromBin(pMem);
00834 }
00835
00836 if(FieldBits::NoField != (ForceCompressedDataFieldMask & whichField))
00837 {
00838 _sfForceCompressedData.copyFromBin(pMem);
00839 }
00840
00841 if(FieldBits::NoField != (ForceAlphaChannelFieldMask & whichField))
00842 {
00843 _sfForceAlphaChannel.copyFromBin(pMem);
00844 }
00845
00846 if(FieldBits::NoField != (ForceColorChannelFieldMask & whichField))
00847 {
00848 _sfForceColorChannel.copyFromBin(pMem);
00849 }
00850
00851 if(FieldBits::NoField != (ForceAlphaBinaryFieldMask & whichField))
00852 {
00853 _sfForceAlphaBinary.copyFromBin(pMem);
00854 }
00855
00856 if(FieldBits::NoField != (ResXFieldMask & whichField))
00857 {
00858 _sfResX.copyFromBin(pMem);
00859 }
00860
00861 if(FieldBits::NoField != (ResYFieldMask & whichField))
00862 {
00863 _sfResY.copyFromBin(pMem);
00864 }
00865
00866 if(FieldBits::NoField != (ResUnitFieldMask & whichField))
00867 {
00868 _sfResUnit.copyFromBin(pMem);
00869 }
00870
00871
00872 }
00873
00874 #if !defined(OSG_FIXED_MFIELDSYNC)
00875 void ImageBase::executeSyncImpl( ImageBase *pOther,
00876 const BitVector &whichField)
00877 {
00878
00879 Inherited::executeSyncImpl(pOther, whichField);
00880
00881 if(FieldBits::NoField != (ParentsFieldMask & whichField))
00882 _mfParents.syncWith(pOther->_mfParents);
00883
00884 if(FieldBits::NoField != (DimensionFieldMask & whichField))
00885 _sfDimension.syncWith(pOther->_sfDimension);
00886
00887 if(FieldBits::NoField != (WidthFieldMask & whichField))
00888 _sfWidth.syncWith(pOther->_sfWidth);
00889
00890 if(FieldBits::NoField != (HeightFieldMask & whichField))
00891 _sfHeight.syncWith(pOther->_sfHeight);
00892
00893 if(FieldBits::NoField != (DepthFieldMask & whichField))
00894 _sfDepth.syncWith(pOther->_sfDepth);
00895
00896 if(FieldBits::NoField != (BppFieldMask & whichField))
00897 _sfBpp.syncWith(pOther->_sfBpp);
00898
00899 if(FieldBits::NoField != (MipMapCountFieldMask & whichField))
00900 _sfMipMapCount.syncWith(pOther->_sfMipMapCount);
00901
00902 if(FieldBits::NoField != (FrameCountFieldMask & whichField))
00903 _sfFrameCount.syncWith(pOther->_sfFrameCount);
00904
00905 if(FieldBits::NoField != (FrameDelayFieldMask & whichField))
00906 _sfFrameDelay.syncWith(pOther->_sfFrameDelay);
00907
00908 if(FieldBits::NoField != (PixelFormatFieldMask & whichField))
00909 _sfPixelFormat.syncWith(pOther->_sfPixelFormat);
00910
00911 if(FieldBits::NoField != (PixelFieldMask & whichField))
00912 _mfPixel.syncWith(pOther->_mfPixel);
00913
00914 if(FieldBits::NoField != (FrameSizeFieldMask & whichField))
00915 _sfFrameSize.syncWith(pOther->_sfFrameSize);
00916
00917 if(FieldBits::NoField != (NameFieldMask & whichField))
00918 _sfName.syncWith(pOther->_sfName);
00919
00920 if(FieldBits::NoField != (DataTypeFieldMask & whichField))
00921 _sfDataType.syncWith(pOther->_sfDataType);
00922
00923 if(FieldBits::NoField != (ComponentSizeFieldMask & whichField))
00924 _sfComponentSize.syncWith(pOther->_sfComponentSize);
00925
00926 if(FieldBits::NoField != (SideCountFieldMask & whichField))
00927 _sfSideCount.syncWith(pOther->_sfSideCount);
00928
00929 if(FieldBits::NoField != (SideSizeFieldMask & whichField))
00930 _sfSideSize.syncWith(pOther->_sfSideSize);
00931
00932 if(FieldBits::NoField != (ForceCompressedDataFieldMask & whichField))
00933 _sfForceCompressedData.syncWith(pOther->_sfForceCompressedData);
00934
00935 if(FieldBits::NoField != (ForceAlphaChannelFieldMask & whichField))
00936 _sfForceAlphaChannel.syncWith(pOther->_sfForceAlphaChannel);
00937
00938 if(FieldBits::NoField != (ForceColorChannelFieldMask & whichField))
00939 _sfForceColorChannel.syncWith(pOther->_sfForceColorChannel);
00940
00941 if(FieldBits::NoField != (ForceAlphaBinaryFieldMask & whichField))
00942 _sfForceAlphaBinary.syncWith(pOther->_sfForceAlphaBinary);
00943
00944 if(FieldBits::NoField != (ResXFieldMask & whichField))
00945 _sfResX.syncWith(pOther->_sfResX);
00946
00947 if(FieldBits::NoField != (ResYFieldMask & whichField))
00948 _sfResY.syncWith(pOther->_sfResY);
00949
00950 if(FieldBits::NoField != (ResUnitFieldMask & whichField))
00951 _sfResUnit.syncWith(pOther->_sfResUnit);
00952
00953
00954 }
00955 #else
00956 void ImageBase::executeSyncImpl( ImageBase *pOther,
00957 const BitVector &whichField,
00958 const SyncInfo &sInfo )
00959 {
00960
00961 Inherited::executeSyncImpl(pOther, whichField, sInfo);
00962
00963 if(FieldBits::NoField != (DimensionFieldMask & whichField))
00964 _sfDimension.syncWith(pOther->_sfDimension);
00965
00966 if(FieldBits::NoField != (WidthFieldMask & whichField))
00967 _sfWidth.syncWith(pOther->_sfWidth);
00968
00969 if(FieldBits::NoField != (HeightFieldMask & whichField))
00970 _sfHeight.syncWith(pOther->_sfHeight);
00971
00972 if(FieldBits::NoField != (DepthFieldMask & whichField))
00973 _sfDepth.syncWith(pOther->_sfDepth);
00974
00975 if(FieldBits::NoField != (BppFieldMask & whichField))
00976 _sfBpp.syncWith(pOther->_sfBpp);
00977
00978 if(FieldBits::NoField != (MipMapCountFieldMask & whichField))
00979 _sfMipMapCount.syncWith(pOther->_sfMipMapCount);
00980
00981 if(FieldBits::NoField != (FrameCountFieldMask & whichField))
00982 _sfFrameCount.syncWith(pOther->_sfFrameCount);
00983
00984 if(FieldBits::NoField != (FrameDelayFieldMask & whichField))
00985 _sfFrameDelay.syncWith(pOther->_sfFrameDelay);
00986
00987 if(FieldBits::NoField != (PixelFormatFieldMask & whichField))
00988 _sfPixelFormat.syncWith(pOther->_sfPixelFormat);
00989
00990 if(FieldBits::NoField != (FrameSizeFieldMask & whichField))
00991 _sfFrameSize.syncWith(pOther->_sfFrameSize);
00992
00993 if(FieldBits::NoField != (NameFieldMask & whichField))
00994 _sfName.syncWith(pOther->_sfName);
00995
00996 if(FieldBits::NoField != (DataTypeFieldMask & whichField))
00997 _sfDataType.syncWith(pOther->_sfDataType);
00998
00999 if(FieldBits::NoField != (ComponentSizeFieldMask & whichField))
01000 _sfComponentSize.syncWith(pOther->_sfComponentSize);
01001
01002 if(FieldBits::NoField != (SideCountFieldMask & whichField))
01003 _sfSideCount.syncWith(pOther->_sfSideCount);
01004
01005 if(FieldBits::NoField != (SideSizeFieldMask & whichField))
01006 _sfSideSize.syncWith(pOther->_sfSideSize);
01007
01008 if(FieldBits::NoField != (ForceCompressedDataFieldMask & whichField))
01009 _sfForceCompressedData.syncWith(pOther->_sfForceCompressedData);
01010
01011 if(FieldBits::NoField != (ForceAlphaChannelFieldMask & whichField))
01012 _sfForceAlphaChannel.syncWith(pOther->_sfForceAlphaChannel);
01013
01014 if(FieldBits::NoField != (ForceColorChannelFieldMask & whichField))
01015 _sfForceColorChannel.syncWith(pOther->_sfForceColorChannel);
01016
01017 if(FieldBits::NoField != (ForceAlphaBinaryFieldMask & whichField))
01018 _sfForceAlphaBinary.syncWith(pOther->_sfForceAlphaBinary);
01019
01020 if(FieldBits::NoField != (ResXFieldMask & whichField))
01021 _sfResX.syncWith(pOther->_sfResX);
01022
01023 if(FieldBits::NoField != (ResYFieldMask & whichField))
01024 _sfResY.syncWith(pOther->_sfResY);
01025
01026 if(FieldBits::NoField != (ResUnitFieldMask & whichField))
01027 _sfResUnit.syncWith(pOther->_sfResUnit);
01028
01029
01030 if(FieldBits::NoField != (ParentsFieldMask & whichField))
01031 _mfParents.syncWith(pOther->_mfParents, sInfo);
01032
01033 if(FieldBits::NoField != (PixelFieldMask & whichField))
01034 _mfPixel.syncWith(pOther->_mfPixel, sInfo);
01035
01036
01037 }
01038
01039 void ImageBase::execBeginEditImpl (const BitVector &whichField,
01040 UInt32 uiAspect,
01041 UInt32 uiContainerSize)
01042 {
01043 Inherited::execBeginEditImpl(whichField, uiAspect, uiContainerSize);
01044
01045 if(FieldBits::NoField != (ParentsFieldMask & whichField))
01046 _mfParents.beginEdit(uiAspect, uiContainerSize);
01047
01048 if(FieldBits::NoField != (PixelFieldMask & whichField))
01049 _mfPixel.beginEdit(uiAspect, uiContainerSize);
01050
01051 }
01052 #endif
01053
01054
01055
01056 OSG_END_NAMESPACE
01057
01058 #include <OSGSFieldTypeDef.inl>
01059 #include <OSGMFieldTypeDef.inl>
01060
01061 OSG_BEGIN_NAMESPACE
01062
01063 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
01064 DataType FieldDataTraits<ImagePtr>::_type("ImagePtr", "AttachmentContainerPtr");
01065 #endif
01066
01067 OSG_DLLEXPORT_SFIELD_DEF1(ImagePtr, OSG_SYSTEMLIB_DLLTMPLMAPPING);
01068 OSG_DLLEXPORT_MFIELD_DEF1(ImagePtr, OSG_SYSTEMLIB_DLLTMPLMAPPING);
01069
01070
01071
01072
01073
01074 #ifdef OSG_SGI_CC
01075 #pragma set woff 1174
01076 #endif
01077
01078 #ifdef OSG_LINUX_ICC
01079 #pragma warning( disable : 177 )
01080 #endif
01081
01082 namespace
01083 {
01084 static Char8 cvsid_cpp [] = "@(#)$Id: FCBaseTemplate_cpp.h,v 1.47 2006/03/17 17:03:19 pdaehne Exp $";
01085 static Char8 cvsid_hpp [] = OSGIMAGEBASE_HEADER_CVSID;
01086 static Char8 cvsid_inl [] = OSGIMAGEBASE_INLINE_CVSID;
01087
01088 static Char8 cvsid_fields_hpp[] = OSGIMAGEFIELDS_HEADER_CVSID;
01089 }
01090
01091 OSG_END_NAMESPACE
01092