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_USING_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::MTInfluenceMask =
00129 (Inherited::MTInfluenceMask) |
00130 (static_cast<BitVector>(0x0) << Inherited::NextFieldId);
00131
00132
00133
00134
00196
00197
00198 FieldDescription *ImageBase::_desc[] =
00199 {
00200 new FieldDescription(MFFieldContainerPtr::getClassType(),
00201 "parents",
00202 ParentsFieldId, ParentsFieldMask,
00203 false,
00204 (FieldAccessMethod) &ImageBase::getMFParents),
00205 new FieldDescription(SFInt32::getClassType(),
00206 "dimension",
00207 DimensionFieldId, DimensionFieldMask,
00208 false,
00209 (FieldAccessMethod) &ImageBase::getSFDimension),
00210 new FieldDescription(SFInt32::getClassType(),
00211 "width",
00212 WidthFieldId, WidthFieldMask,
00213 false,
00214 (FieldAccessMethod) &ImageBase::getSFWidth),
00215 new FieldDescription(SFInt32::getClassType(),
00216 "height",
00217 HeightFieldId, HeightFieldMask,
00218 false,
00219 (FieldAccessMethod) &ImageBase::getSFHeight),
00220 new FieldDescription(SFInt32::getClassType(),
00221 "depth",
00222 DepthFieldId, DepthFieldMask,
00223 false,
00224 (FieldAccessMethod) &ImageBase::getSFDepth),
00225 new FieldDescription(SFInt32::getClassType(),
00226 "bpp",
00227 BppFieldId, BppFieldMask,
00228 false,
00229 (FieldAccessMethod) &ImageBase::getSFBpp),
00230 new FieldDescription(SFInt32::getClassType(),
00231 "mipMapCount",
00232 MipMapCountFieldId, MipMapCountFieldMask,
00233 false,
00234 (FieldAccessMethod) &ImageBase::getSFMipMapCount),
00235 new FieldDescription(SFInt32::getClassType(),
00236 "frameCount",
00237 FrameCountFieldId, FrameCountFieldMask,
00238 false,
00239 (FieldAccessMethod) &ImageBase::getSFFrameCount),
00240 new FieldDescription(SFTime::getClassType(),
00241 "frameDelay",
00242 FrameDelayFieldId, FrameDelayFieldMask,
00243 false,
00244 (FieldAccessMethod) &ImageBase::getSFFrameDelay),
00245 new FieldDescription(SFUInt32::getClassType(),
00246 "pixelFormat",
00247 PixelFormatFieldId, PixelFormatFieldMask,
00248 false,
00249 (FieldAccessMethod) &ImageBase::getSFPixelFormat),
00250 new FieldDescription(MFUInt8::getClassType(),
00251 "pixel",
00252 PixelFieldId, PixelFieldMask,
00253 false,
00254 (FieldAccessMethod) &ImageBase::getMFPixel),
00255 new FieldDescription(SFInt32::getClassType(),
00256 "frameSize",
00257 FrameSizeFieldId, FrameSizeFieldMask,
00258 true,
00259 (FieldAccessMethod) &ImageBase::getSFFrameSize),
00260 new FieldDescription(SFString::getClassType(),
00261 "name",
00262 NameFieldId, NameFieldMask,
00263 false,
00264 (FieldAccessMethod) &ImageBase::getSFName),
00265 new FieldDescription(SFInt32::getClassType(),
00266 "dataType",
00267 DataTypeFieldId, DataTypeFieldMask,
00268 false,
00269 (FieldAccessMethod) &ImageBase::getSFDataType),
00270 new FieldDescription(SFInt32::getClassType(),
00271 "componentSize",
00272 ComponentSizeFieldId, ComponentSizeFieldMask,
00273 true,
00274 (FieldAccessMethod) &ImageBase::getSFComponentSize),
00275 new FieldDescription(SFInt32::getClassType(),
00276 "sideCount",
00277 SideCountFieldId, SideCountFieldMask,
00278 false,
00279 (FieldAccessMethod) &ImageBase::getSFSideCount),
00280 new FieldDescription(SFInt32::getClassType(),
00281 "sideSize",
00282 SideSizeFieldId, SideSizeFieldMask,
00283 true,
00284 (FieldAccessMethod) &ImageBase::getSFSideSize),
00285 new FieldDescription(SFBool::getClassType(),
00286 "forceCompressedData",
00287 ForceCompressedDataFieldId, ForceCompressedDataFieldMask,
00288 false,
00289 (FieldAccessMethod) &ImageBase::getSFForceCompressedData),
00290 new FieldDescription(SFBool::getClassType(),
00291 "forceAlphaChannel",
00292 ForceAlphaChannelFieldId, ForceAlphaChannelFieldMask,
00293 false,
00294 (FieldAccessMethod) &ImageBase::getSFForceAlphaChannel),
00295 new FieldDescription(SFBool::getClassType(),
00296 "forceColorChannel",
00297 ForceColorChannelFieldId, ForceColorChannelFieldMask,
00298 false,
00299 (FieldAccessMethod) &ImageBase::getSFForceColorChannel)
00300 };
00301
00302
00303 FieldContainerType ImageBase::_type(
00304 "Image",
00305 "AttachmentContainer",
00306 NULL,
00307 (PrototypeCreateF) &ImageBase::createEmpty,
00308 Image::initMethod,
00309 _desc,
00310 sizeof(_desc));
00311
00312
00313
00314
00315
00316 FieldContainerType &ImageBase::getType(void)
00317 {
00318 return _type;
00319 }
00320
00321 const FieldContainerType &ImageBase::getType(void) const
00322 {
00323 return _type;
00324 }
00325
00326
00327 FieldContainerPtr ImageBase::shallowCopy(void) const
00328 {
00329 ImagePtr returnValue;
00330
00331 newPtr(returnValue, dynamic_cast<const Image *>(this));
00332
00333 return returnValue;
00334 }
00335
00336 UInt32 ImageBase::getContainerSize(void) const
00337 {
00338 return sizeof(Image);
00339 }
00340
00341
00342 #if !defined(OSG_FIXED_MFIELDSYNC)
00343 void ImageBase::executeSync( FieldContainer &other,
00344 const BitVector &whichField)
00345 {
00346 this->executeSyncImpl((ImageBase *) &other, whichField);
00347 }
00348 #else
00349 void ImageBase::executeSync( FieldContainer &other,
00350 const BitVector &whichField, const SyncInfo &sInfo )
00351 {
00352 this->executeSyncImpl((ImageBase *) &other, whichField, sInfo);
00353 }
00354 void ImageBase::execBeginEdit(const BitVector &whichField,
00355 UInt32 uiAspect,
00356 UInt32 uiContainerSize)
00357 {
00358 this->execBeginEditImpl(whichField, uiAspect, uiContainerSize);
00359 }
00360
00361 void ImageBase::onDestroyAspect(UInt32 uiId, UInt32 uiAspect)
00362 {
00363 Inherited::onDestroyAspect(uiId, uiAspect);
00364
00365 _mfParents.terminateShare(uiAspect, this->getContainerSize());
00366 _mfPixel.terminateShare(uiAspect, this->getContainerSize());
00367 }
00368 #endif
00369
00370
00371
00372 #ifdef OSG_WIN32_ICL
00373 #pragma warning (disable : 383)
00374 #endif
00375
00376 ImageBase::ImageBase(void) :
00377 _mfParents (),
00378 _sfDimension (Int32(0)),
00379 _sfWidth (Int32(0)),
00380 _sfHeight (Int32(1)),
00381 _sfDepth (Int32(1)),
00382 _sfBpp (Int32(1)),
00383 _sfMipMapCount (Int32(1)),
00384 _sfFrameCount (Int32(1)),
00385 _sfFrameDelay (Time(0)),
00386 _sfPixelFormat (UInt32(0)),
00387 _mfPixel (),
00388 _sfFrameSize (Int32(0)),
00389 _sfName (),
00390 _sfDataType (Int32(GL_UNSIGNED_BYTE)),
00391 _sfComponentSize (Int32(1)),
00392 _sfSideCount (Int32(1)),
00393 _sfSideSize (Int32(0)),
00394 _sfForceCompressedData (bool(false)),
00395 _sfForceAlphaChannel (bool(false)),
00396 _sfForceColorChannel (bool(false)),
00397 Inherited()
00398 {
00399 }
00400
00401 #ifdef OSG_WIN32_ICL
00402 #pragma warning (default : 383)
00403 #endif
00404
00405 ImageBase::ImageBase(const ImageBase &source) :
00406 _mfParents (source._mfParents ),
00407 _sfDimension (source._sfDimension ),
00408 _sfWidth (source._sfWidth ),
00409 _sfHeight (source._sfHeight ),
00410 _sfDepth (source._sfDepth ),
00411 _sfBpp (source._sfBpp ),
00412 _sfMipMapCount (source._sfMipMapCount ),
00413 _sfFrameCount (source._sfFrameCount ),
00414 _sfFrameDelay (source._sfFrameDelay ),
00415 _sfPixelFormat (source._sfPixelFormat ),
00416 _mfPixel (source._mfPixel ),
00417 _sfFrameSize (source._sfFrameSize ),
00418 _sfName (source._sfName ),
00419 _sfDataType (source._sfDataType ),
00420 _sfComponentSize (source._sfComponentSize ),
00421 _sfSideCount (source._sfSideCount ),
00422 _sfSideSize (source._sfSideSize ),
00423 _sfForceCompressedData (source._sfForceCompressedData ),
00424 _sfForceAlphaChannel (source._sfForceAlphaChannel ),
00425 _sfForceColorChannel (source._sfForceColorChannel ),
00426 Inherited (source)
00427 {
00428 }
00429
00430
00431
00432 ImageBase::~ImageBase(void)
00433 {
00434 }
00435
00436
00437
00438 UInt32 ImageBase::getBinSize(const BitVector &whichField)
00439 {
00440 UInt32 returnValue = Inherited::getBinSize(whichField);
00441
00442 if(FieldBits::NoField != (ParentsFieldMask & whichField))
00443 {
00444 returnValue += _mfParents.getBinSize();
00445 }
00446
00447 if(FieldBits::NoField != (DimensionFieldMask & whichField))
00448 {
00449 returnValue += _sfDimension.getBinSize();
00450 }
00451
00452 if(FieldBits::NoField != (WidthFieldMask & whichField))
00453 {
00454 returnValue += _sfWidth.getBinSize();
00455 }
00456
00457 if(FieldBits::NoField != (HeightFieldMask & whichField))
00458 {
00459 returnValue += _sfHeight.getBinSize();
00460 }
00461
00462 if(FieldBits::NoField != (DepthFieldMask & whichField))
00463 {
00464 returnValue += _sfDepth.getBinSize();
00465 }
00466
00467 if(FieldBits::NoField != (BppFieldMask & whichField))
00468 {
00469 returnValue += _sfBpp.getBinSize();
00470 }
00471
00472 if(FieldBits::NoField != (MipMapCountFieldMask & whichField))
00473 {
00474 returnValue += _sfMipMapCount.getBinSize();
00475 }
00476
00477 if(FieldBits::NoField != (FrameCountFieldMask & whichField))
00478 {
00479 returnValue += _sfFrameCount.getBinSize();
00480 }
00481
00482 if(FieldBits::NoField != (FrameDelayFieldMask & whichField))
00483 {
00484 returnValue += _sfFrameDelay.getBinSize();
00485 }
00486
00487 if(FieldBits::NoField != (PixelFormatFieldMask & whichField))
00488 {
00489 returnValue += _sfPixelFormat.getBinSize();
00490 }
00491
00492 if(FieldBits::NoField != (PixelFieldMask & whichField))
00493 {
00494 returnValue += _mfPixel.getBinSize();
00495 }
00496
00497 if(FieldBits::NoField != (FrameSizeFieldMask & whichField))
00498 {
00499 returnValue += _sfFrameSize.getBinSize();
00500 }
00501
00502 if(FieldBits::NoField != (NameFieldMask & whichField))
00503 {
00504 returnValue += _sfName.getBinSize();
00505 }
00506
00507 if(FieldBits::NoField != (DataTypeFieldMask & whichField))
00508 {
00509 returnValue += _sfDataType.getBinSize();
00510 }
00511
00512 if(FieldBits::NoField != (ComponentSizeFieldMask & whichField))
00513 {
00514 returnValue += _sfComponentSize.getBinSize();
00515 }
00516
00517 if(FieldBits::NoField != (SideCountFieldMask & whichField))
00518 {
00519 returnValue += _sfSideCount.getBinSize();
00520 }
00521
00522 if(FieldBits::NoField != (SideSizeFieldMask & whichField))
00523 {
00524 returnValue += _sfSideSize.getBinSize();
00525 }
00526
00527 if(FieldBits::NoField != (ForceCompressedDataFieldMask & whichField))
00528 {
00529 returnValue += _sfForceCompressedData.getBinSize();
00530 }
00531
00532 if(FieldBits::NoField != (ForceAlphaChannelFieldMask & whichField))
00533 {
00534 returnValue += _sfForceAlphaChannel.getBinSize();
00535 }
00536
00537 if(FieldBits::NoField != (ForceColorChannelFieldMask & whichField))
00538 {
00539 returnValue += _sfForceColorChannel.getBinSize();
00540 }
00541
00542
00543 return returnValue;
00544 }
00545
00546 void ImageBase::copyToBin( BinaryDataHandler &pMem,
00547 const BitVector &whichField)
00548 {
00549 Inherited::copyToBin(pMem, whichField);
00550
00551 if(FieldBits::NoField != (ParentsFieldMask & whichField))
00552 {
00553 _mfParents.copyToBin(pMem);
00554 }
00555
00556 if(FieldBits::NoField != (DimensionFieldMask & whichField))
00557 {
00558 _sfDimension.copyToBin(pMem);
00559 }
00560
00561 if(FieldBits::NoField != (WidthFieldMask & whichField))
00562 {
00563 _sfWidth.copyToBin(pMem);
00564 }
00565
00566 if(FieldBits::NoField != (HeightFieldMask & whichField))
00567 {
00568 _sfHeight.copyToBin(pMem);
00569 }
00570
00571 if(FieldBits::NoField != (DepthFieldMask & whichField))
00572 {
00573 _sfDepth.copyToBin(pMem);
00574 }
00575
00576 if(FieldBits::NoField != (BppFieldMask & whichField))
00577 {
00578 _sfBpp.copyToBin(pMem);
00579 }
00580
00581 if(FieldBits::NoField != (MipMapCountFieldMask & whichField))
00582 {
00583 _sfMipMapCount.copyToBin(pMem);
00584 }
00585
00586 if(FieldBits::NoField != (FrameCountFieldMask & whichField))
00587 {
00588 _sfFrameCount.copyToBin(pMem);
00589 }
00590
00591 if(FieldBits::NoField != (FrameDelayFieldMask & whichField))
00592 {
00593 _sfFrameDelay.copyToBin(pMem);
00594 }
00595
00596 if(FieldBits::NoField != (PixelFormatFieldMask & whichField))
00597 {
00598 _sfPixelFormat.copyToBin(pMem);
00599 }
00600
00601 if(FieldBits::NoField != (PixelFieldMask & whichField))
00602 {
00603 _mfPixel.copyToBin(pMem);
00604 }
00605
00606 if(FieldBits::NoField != (FrameSizeFieldMask & whichField))
00607 {
00608 _sfFrameSize.copyToBin(pMem);
00609 }
00610
00611 if(FieldBits::NoField != (NameFieldMask & whichField))
00612 {
00613 _sfName.copyToBin(pMem);
00614 }
00615
00616 if(FieldBits::NoField != (DataTypeFieldMask & whichField))
00617 {
00618 _sfDataType.copyToBin(pMem);
00619 }
00620
00621 if(FieldBits::NoField != (ComponentSizeFieldMask & whichField))
00622 {
00623 _sfComponentSize.copyToBin(pMem);
00624 }
00625
00626 if(FieldBits::NoField != (SideCountFieldMask & whichField))
00627 {
00628 _sfSideCount.copyToBin(pMem);
00629 }
00630
00631 if(FieldBits::NoField != (SideSizeFieldMask & whichField))
00632 {
00633 _sfSideSize.copyToBin(pMem);
00634 }
00635
00636 if(FieldBits::NoField != (ForceCompressedDataFieldMask & whichField))
00637 {
00638 _sfForceCompressedData.copyToBin(pMem);
00639 }
00640
00641 if(FieldBits::NoField != (ForceAlphaChannelFieldMask & whichField))
00642 {
00643 _sfForceAlphaChannel.copyToBin(pMem);
00644 }
00645
00646 if(FieldBits::NoField != (ForceColorChannelFieldMask & whichField))
00647 {
00648 _sfForceColorChannel.copyToBin(pMem);
00649 }
00650
00651
00652 }
00653
00654 void ImageBase::copyFromBin( BinaryDataHandler &pMem,
00655 const BitVector &whichField)
00656 {
00657 Inherited::copyFromBin(pMem, whichField);
00658
00659 if(FieldBits::NoField != (ParentsFieldMask & whichField))
00660 {
00661 _mfParents.copyFromBin(pMem);
00662 }
00663
00664 if(FieldBits::NoField != (DimensionFieldMask & whichField))
00665 {
00666 _sfDimension.copyFromBin(pMem);
00667 }
00668
00669 if(FieldBits::NoField != (WidthFieldMask & whichField))
00670 {
00671 _sfWidth.copyFromBin(pMem);
00672 }
00673
00674 if(FieldBits::NoField != (HeightFieldMask & whichField))
00675 {
00676 _sfHeight.copyFromBin(pMem);
00677 }
00678
00679 if(FieldBits::NoField != (DepthFieldMask & whichField))
00680 {
00681 _sfDepth.copyFromBin(pMem);
00682 }
00683
00684 if(FieldBits::NoField != (BppFieldMask & whichField))
00685 {
00686 _sfBpp.copyFromBin(pMem);
00687 }
00688
00689 if(FieldBits::NoField != (MipMapCountFieldMask & whichField))
00690 {
00691 _sfMipMapCount.copyFromBin(pMem);
00692 }
00693
00694 if(FieldBits::NoField != (FrameCountFieldMask & whichField))
00695 {
00696 _sfFrameCount.copyFromBin(pMem);
00697 }
00698
00699 if(FieldBits::NoField != (FrameDelayFieldMask & whichField))
00700 {
00701 _sfFrameDelay.copyFromBin(pMem);
00702 }
00703
00704 if(FieldBits::NoField != (PixelFormatFieldMask & whichField))
00705 {
00706 _sfPixelFormat.copyFromBin(pMem);
00707 }
00708
00709 if(FieldBits::NoField != (PixelFieldMask & whichField))
00710 {
00711 _mfPixel.copyFromBin(pMem);
00712 }
00713
00714 if(FieldBits::NoField != (FrameSizeFieldMask & whichField))
00715 {
00716 _sfFrameSize.copyFromBin(pMem);
00717 }
00718
00719 if(FieldBits::NoField != (NameFieldMask & whichField))
00720 {
00721 _sfName.copyFromBin(pMem);
00722 }
00723
00724 if(FieldBits::NoField != (DataTypeFieldMask & whichField))
00725 {
00726 _sfDataType.copyFromBin(pMem);
00727 }
00728
00729 if(FieldBits::NoField != (ComponentSizeFieldMask & whichField))
00730 {
00731 _sfComponentSize.copyFromBin(pMem);
00732 }
00733
00734 if(FieldBits::NoField != (SideCountFieldMask & whichField))
00735 {
00736 _sfSideCount.copyFromBin(pMem);
00737 }
00738
00739 if(FieldBits::NoField != (SideSizeFieldMask & whichField))
00740 {
00741 _sfSideSize.copyFromBin(pMem);
00742 }
00743
00744 if(FieldBits::NoField != (ForceCompressedDataFieldMask & whichField))
00745 {
00746 _sfForceCompressedData.copyFromBin(pMem);
00747 }
00748
00749 if(FieldBits::NoField != (ForceAlphaChannelFieldMask & whichField))
00750 {
00751 _sfForceAlphaChannel.copyFromBin(pMem);
00752 }
00753
00754 if(FieldBits::NoField != (ForceColorChannelFieldMask & whichField))
00755 {
00756 _sfForceColorChannel.copyFromBin(pMem);
00757 }
00758
00759
00760 }
00761
00762 #if !defined(OSG_FIXED_MFIELDSYNC)
00763 void ImageBase::executeSyncImpl( ImageBase *pOther,
00764 const BitVector &whichField)
00765 {
00766
00767 Inherited::executeSyncImpl(pOther, whichField);
00768
00769 if(FieldBits::NoField != (ParentsFieldMask & whichField))
00770 _mfParents.syncWith(pOther->_mfParents);
00771
00772 if(FieldBits::NoField != (DimensionFieldMask & whichField))
00773 _sfDimension.syncWith(pOther->_sfDimension);
00774
00775 if(FieldBits::NoField != (WidthFieldMask & whichField))
00776 _sfWidth.syncWith(pOther->_sfWidth);
00777
00778 if(FieldBits::NoField != (HeightFieldMask & whichField))
00779 _sfHeight.syncWith(pOther->_sfHeight);
00780
00781 if(FieldBits::NoField != (DepthFieldMask & whichField))
00782 _sfDepth.syncWith(pOther->_sfDepth);
00783
00784 if(FieldBits::NoField != (BppFieldMask & whichField))
00785 _sfBpp.syncWith(pOther->_sfBpp);
00786
00787 if(FieldBits::NoField != (MipMapCountFieldMask & whichField))
00788 _sfMipMapCount.syncWith(pOther->_sfMipMapCount);
00789
00790 if(FieldBits::NoField != (FrameCountFieldMask & whichField))
00791 _sfFrameCount.syncWith(pOther->_sfFrameCount);
00792
00793 if(FieldBits::NoField != (FrameDelayFieldMask & whichField))
00794 _sfFrameDelay.syncWith(pOther->_sfFrameDelay);
00795
00796 if(FieldBits::NoField != (PixelFormatFieldMask & whichField))
00797 _sfPixelFormat.syncWith(pOther->_sfPixelFormat);
00798
00799 if(FieldBits::NoField != (PixelFieldMask & whichField))
00800 _mfPixel.syncWith(pOther->_mfPixel);
00801
00802 if(FieldBits::NoField != (FrameSizeFieldMask & whichField))
00803 _sfFrameSize.syncWith(pOther->_sfFrameSize);
00804
00805 if(FieldBits::NoField != (NameFieldMask & whichField))
00806 _sfName.syncWith(pOther->_sfName);
00807
00808 if(FieldBits::NoField != (DataTypeFieldMask & whichField))
00809 _sfDataType.syncWith(pOther->_sfDataType);
00810
00811 if(FieldBits::NoField != (ComponentSizeFieldMask & whichField))
00812 _sfComponentSize.syncWith(pOther->_sfComponentSize);
00813
00814 if(FieldBits::NoField != (SideCountFieldMask & whichField))
00815 _sfSideCount.syncWith(pOther->_sfSideCount);
00816
00817 if(FieldBits::NoField != (SideSizeFieldMask & whichField))
00818 _sfSideSize.syncWith(pOther->_sfSideSize);
00819
00820 if(FieldBits::NoField != (ForceCompressedDataFieldMask & whichField))
00821 _sfForceCompressedData.syncWith(pOther->_sfForceCompressedData);
00822
00823 if(FieldBits::NoField != (ForceAlphaChannelFieldMask & whichField))
00824 _sfForceAlphaChannel.syncWith(pOther->_sfForceAlphaChannel);
00825
00826 if(FieldBits::NoField != (ForceColorChannelFieldMask & whichField))
00827 _sfForceColorChannel.syncWith(pOther->_sfForceColorChannel);
00828
00829
00830 }
00831 #else
00832 void ImageBase::executeSyncImpl( ImageBase *pOther,
00833 const BitVector &whichField,
00834 const SyncInfo &sInfo )
00835 {
00836
00837 Inherited::executeSyncImpl(pOther, whichField, sInfo);
00838
00839 if(FieldBits::NoField != (DimensionFieldMask & whichField))
00840 _sfDimension.syncWith(pOther->_sfDimension);
00841
00842 if(FieldBits::NoField != (WidthFieldMask & whichField))
00843 _sfWidth.syncWith(pOther->_sfWidth);
00844
00845 if(FieldBits::NoField != (HeightFieldMask & whichField))
00846 _sfHeight.syncWith(pOther->_sfHeight);
00847
00848 if(FieldBits::NoField != (DepthFieldMask & whichField))
00849 _sfDepth.syncWith(pOther->_sfDepth);
00850
00851 if(FieldBits::NoField != (BppFieldMask & whichField))
00852 _sfBpp.syncWith(pOther->_sfBpp);
00853
00854 if(FieldBits::NoField != (MipMapCountFieldMask & whichField))
00855 _sfMipMapCount.syncWith(pOther->_sfMipMapCount);
00856
00857 if(FieldBits::NoField != (FrameCountFieldMask & whichField))
00858 _sfFrameCount.syncWith(pOther->_sfFrameCount);
00859
00860 if(FieldBits::NoField != (FrameDelayFieldMask & whichField))
00861 _sfFrameDelay.syncWith(pOther->_sfFrameDelay);
00862
00863 if(FieldBits::NoField != (PixelFormatFieldMask & whichField))
00864 _sfPixelFormat.syncWith(pOther->_sfPixelFormat);
00865
00866 if(FieldBits::NoField != (FrameSizeFieldMask & whichField))
00867 _sfFrameSize.syncWith(pOther->_sfFrameSize);
00868
00869 if(FieldBits::NoField != (NameFieldMask & whichField))
00870 _sfName.syncWith(pOther->_sfName);
00871
00872 if(FieldBits::NoField != (DataTypeFieldMask & whichField))
00873 _sfDataType.syncWith(pOther->_sfDataType);
00874
00875 if(FieldBits::NoField != (ComponentSizeFieldMask & whichField))
00876 _sfComponentSize.syncWith(pOther->_sfComponentSize);
00877
00878 if(FieldBits::NoField != (SideCountFieldMask & whichField))
00879 _sfSideCount.syncWith(pOther->_sfSideCount);
00880
00881 if(FieldBits::NoField != (SideSizeFieldMask & whichField))
00882 _sfSideSize.syncWith(pOther->_sfSideSize);
00883
00884 if(FieldBits::NoField != (ForceCompressedDataFieldMask & whichField))
00885 _sfForceCompressedData.syncWith(pOther->_sfForceCompressedData);
00886
00887 if(FieldBits::NoField != (ForceAlphaChannelFieldMask & whichField))
00888 _sfForceAlphaChannel.syncWith(pOther->_sfForceAlphaChannel);
00889
00890 if(FieldBits::NoField != (ForceColorChannelFieldMask & whichField))
00891 _sfForceColorChannel.syncWith(pOther->_sfForceColorChannel);
00892
00893
00894 if(FieldBits::NoField != (ParentsFieldMask & whichField))
00895 _mfParents.syncWith(pOther->_mfParents, sInfo);
00896
00897 if(FieldBits::NoField != (PixelFieldMask & whichField))
00898 _mfPixel.syncWith(pOther->_mfPixel, sInfo);
00899
00900
00901 }
00902
00903 void ImageBase::execBeginEditImpl (const BitVector &whichField,
00904 UInt32 uiAspect,
00905 UInt32 uiContainerSize)
00906 {
00907 Inherited::execBeginEditImpl(whichField, uiAspect, uiContainerSize);
00908
00909 if(FieldBits::NoField != (ParentsFieldMask & whichField))
00910 _mfParents.beginEdit(uiAspect, uiContainerSize);
00911
00912 if(FieldBits::NoField != (PixelFieldMask & whichField))
00913 _mfPixel.beginEdit(uiAspect, uiContainerSize);
00914
00915 }
00916 #endif
00917
00918
00919
00920 #include <OSGSFieldTypeDef.inl>
00921 #include <OSGMFieldTypeDef.inl>
00922
00923 OSG_BEGIN_NAMESPACE
00924
00925 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
00926 DataType FieldDataTraits<ImagePtr>::_type("ImagePtr", "AttachmentContainerPtr");
00927 #endif
00928
00929 OSG_DLLEXPORT_SFIELD_DEF1(ImagePtr, OSG_SYSTEMLIB_DLLTMPLMAPPING);
00930 OSG_DLLEXPORT_MFIELD_DEF1(ImagePtr, OSG_SYSTEMLIB_DLLTMPLMAPPING);
00931
00932 OSG_END_NAMESPACE
00933
00934
00935
00936
00937
00938 #ifdef OSG_SGI_CC
00939 #pragma set woff 1174
00940 #endif
00941
00942 #ifdef OSG_LINUX_ICC
00943 #pragma warning( disable : 177 )
00944 #endif
00945
00946 namespace
00947 {
00948 static Char8 cvsid_cpp [] = "@(#)$Id: FCBaseTemplate_cpp.h,v 1.42 2004/08/03 05:53:03 dirk Exp $";
00949 static Char8 cvsid_hpp [] = OSGIMAGEBASE_HEADER_CVSID;
00950 static Char8 cvsid_inl [] = OSGIMAGEBASE_INLINE_CVSID;
00951
00952 static Char8 cvsid_fields_hpp[] = OSGIMAGEFIELDS_HEADER_CVSID;
00953 }
00954