Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

OSGColorMaskChunkBase.cpp

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002  *                                OpenSG                                     *
00003  *                                                                           *
00004  *                                                                           *
00005  *               Copyright (C) 2000-2002 by the OpenSG Forum                 *
00006  *                                                                           *
00007  *                            www.opensg.org                                 *
00008  *                                                                           *
00009  *   contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de          *
00010  *                                                                           *
00011 \*---------------------------------------------------------------------------*/
00012 /*---------------------------------------------------------------------------*\
00013  *                                License                                    *
00014  *                                                                           *
00015  * This library is free software; you can redistribute it and/or modify it   *
00016  * under the terms of the GNU Library General Public License as published    *
00017  * by the Free Software Foundation, version 2.                               *
00018  *                                                                           *
00019  * This library is distributed in the hope that it will be useful, but       *
00020  * WITHOUT ANY WARRANTY; without even the implied warranty of                *
00021  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         *
00022  * Library General Public License for more details.                          *
00023  *                                                                           *
00024  * You should have received a copy of the GNU Library General Public         *
00025  * License along with this library; if not, write to the Free Software       *
00026  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.                 *
00027  *                                                                           *
00028 \*---------------------------------------------------------------------------*/
00029 /*---------------------------------------------------------------------------*\
00030  *                                Changes                                    *
00031  *                                                                           *
00032  *                                                                           *
00033  *                                                                           *
00034  *                                                                           *
00035  *                                                                           *
00036  *                                                                           *
00037 \*---------------------------------------------------------------------------*/
00038 
00039 /*****************************************************************************\
00040  *****************************************************************************
00041  **                                                                         **
00042  **                  This file is automatically generated.                  **
00043  **                                                                         **
00044  **          Any changes made to this file WILL be lost when it is          **
00045  **           regenerated, which can become necessary at any time.          **
00046  **                                                                         **
00047  **     Do not change this file, changes should be done in the derived      **
00048  **     class ColorMaskChunk!
00049  **                                                                         **
00050  *****************************************************************************
00051 \*****************************************************************************/
00052 
00053 
00054 #define OSG_COMPILECOLORMASKCHUNKINST
00055 
00056 #include <stdlib.h>
00057 #include <stdio.h>
00058 
00059 #include <OSGConfig.h>
00060 
00061 #include "OSGColorMaskChunkBase.h"
00062 #include "OSGColorMaskChunk.h"
00063 
00064 
00065 OSG_USING_NAMESPACE
00066 
00067 const OSG::BitVector  ColorMaskChunkBase::MaskRFieldMask = 
00068     (TypeTraits<BitVector>::One << ColorMaskChunkBase::MaskRFieldId);
00069 
00070 const OSG::BitVector  ColorMaskChunkBase::MaskGFieldMask = 
00071     (TypeTraits<BitVector>::One << ColorMaskChunkBase::MaskGFieldId);
00072 
00073 const OSG::BitVector  ColorMaskChunkBase::MaskBFieldMask = 
00074     (TypeTraits<BitVector>::One << ColorMaskChunkBase::MaskBFieldId);
00075 
00076 const OSG::BitVector  ColorMaskChunkBase::MaskAFieldMask = 
00077     (TypeTraits<BitVector>::One << ColorMaskChunkBase::MaskAFieldId);
00078 
00079 const OSG::BitVector ColorMaskChunkBase::MTInfluenceMask = 
00080     (Inherited::MTInfluenceMask) | 
00081     (static_cast<BitVector>(0x0) << Inherited::NextFieldId); 
00082 
00083 
00084 // Field descriptions
00085 
00099 
00100 
00101 FieldDescription *ColorMaskChunkBase::_desc[] = 
00102 {
00103     new FieldDescription(SFBool::getClassType(), 
00104                      "maskR", 
00105                      MaskRFieldId, MaskRFieldMask,
00106                      false,
00107                      (FieldAccessMethod) &ColorMaskChunkBase::getSFMaskR),
00108     new FieldDescription(SFBool::getClassType(), 
00109                      "maskG", 
00110                      MaskGFieldId, MaskGFieldMask,
00111                      false,
00112                      (FieldAccessMethod) &ColorMaskChunkBase::getSFMaskG),
00113     new FieldDescription(SFBool::getClassType(), 
00114                      "maskB", 
00115                      MaskBFieldId, MaskBFieldMask,
00116                      false,
00117                      (FieldAccessMethod) &ColorMaskChunkBase::getSFMaskB),
00118     new FieldDescription(SFBool::getClassType(), 
00119                      "maskA", 
00120                      MaskAFieldId, MaskAFieldMask,
00121                      false,
00122                      (FieldAccessMethod) &ColorMaskChunkBase::getSFMaskA)
00123 };
00124 
00125 
00126 FieldContainerType ColorMaskChunkBase::_type(
00127     "ColorMaskChunk",
00128     "StateChunk",
00129     NULL,
00130     (PrototypeCreateF) &ColorMaskChunkBase::createEmpty,
00131     ColorMaskChunk::initMethod,
00132     _desc,
00133     sizeof(_desc));
00134 
00135 //OSG_FIELD_CONTAINER_DEF(ColorMaskChunkBase, ColorMaskChunkPtr)
00136 
00137 /*------------------------------ get -----------------------------------*/
00138 
00139 FieldContainerType &ColorMaskChunkBase::getType(void) 
00140 {
00141     return _type; 
00142 } 
00143 
00144 const FieldContainerType &ColorMaskChunkBase::getType(void) const 
00145 {
00146     return _type;
00147 } 
00148 
00149 
00150 FieldContainerPtr ColorMaskChunkBase::shallowCopy(void) const 
00151 { 
00152     ColorMaskChunkPtr returnValue; 
00153 
00154     newPtr(returnValue, dynamic_cast<const ColorMaskChunk *>(this)); 
00155 
00156     return returnValue; 
00157 }
00158 
00159 UInt32 ColorMaskChunkBase::getContainerSize(void) const 
00160 { 
00161     return sizeof(ColorMaskChunk); 
00162 }
00163 
00164 
00165 #if !defined(OSG_FIXED_MFIELDSYNC)
00166 void ColorMaskChunkBase::executeSync(      FieldContainer &other,
00167                                     const BitVector      &whichField)
00168 {
00169     this->executeSyncImpl((ColorMaskChunkBase *) &other, whichField);
00170 }
00171 #else
00172 void ColorMaskChunkBase::executeSync(      FieldContainer &other,
00173                                     const BitVector      &whichField,                                    const SyncInfo       &sInfo     )
00174 {
00175     this->executeSyncImpl((ColorMaskChunkBase *) &other, whichField, sInfo);
00176 }
00177 void ColorMaskChunkBase::execBeginEdit(const BitVector &whichField, 
00178                                             UInt32     uiAspect,
00179                                             UInt32     uiContainerSize) 
00180 {
00181     this->execBeginEditImpl(whichField, uiAspect, uiContainerSize);
00182 }
00183 
00184 void ColorMaskChunkBase::onDestroyAspect(UInt32 uiId, UInt32 uiAspect)
00185 {
00186     Inherited::onDestroyAspect(uiId, uiAspect);
00187 
00188 }
00189 #endif
00190 
00191 /*------------------------- constructors ----------------------------------*/
00192 
00193 #ifdef OSG_WIN32_ICL
00194 #pragma warning (disable : 383)
00195 #endif
00196 
00197 ColorMaskChunkBase::ColorMaskChunkBase(void) :
00198     _sfMaskR                  (bool(true)), 
00199     _sfMaskG                  (bool(true)), 
00200     _sfMaskB                  (bool(true)), 
00201     _sfMaskA                  (bool(true)), 
00202     Inherited() 
00203 {
00204 }
00205 
00206 #ifdef OSG_WIN32_ICL
00207 #pragma warning (default : 383)
00208 #endif
00209 
00210 ColorMaskChunkBase::ColorMaskChunkBase(const ColorMaskChunkBase &source) :
00211     _sfMaskR                  (source._sfMaskR                  ), 
00212     _sfMaskG                  (source._sfMaskG                  ), 
00213     _sfMaskB                  (source._sfMaskB                  ), 
00214     _sfMaskA                  (source._sfMaskA                  ), 
00215     Inherited                 (source)
00216 {
00217 }
00218 
00219 /*-------------------------- destructors ----------------------------------*/
00220 
00221 ColorMaskChunkBase::~ColorMaskChunkBase(void)
00222 {
00223 }
00224 
00225 /*------------------------------ access -----------------------------------*/
00226 
00227 UInt32 ColorMaskChunkBase::getBinSize(const BitVector &whichField)
00228 {
00229     UInt32 returnValue = Inherited::getBinSize(whichField);
00230 
00231     if(FieldBits::NoField != (MaskRFieldMask & whichField))
00232     {
00233         returnValue += _sfMaskR.getBinSize();
00234     }
00235 
00236     if(FieldBits::NoField != (MaskGFieldMask & whichField))
00237     {
00238         returnValue += _sfMaskG.getBinSize();
00239     }
00240 
00241     if(FieldBits::NoField != (MaskBFieldMask & whichField))
00242     {
00243         returnValue += _sfMaskB.getBinSize();
00244     }
00245 
00246     if(FieldBits::NoField != (MaskAFieldMask & whichField))
00247     {
00248         returnValue += _sfMaskA.getBinSize();
00249     }
00250 
00251 
00252     return returnValue;
00253 }
00254 
00255 void ColorMaskChunkBase::copyToBin(      BinaryDataHandler &pMem,
00256                                   const BitVector         &whichField)
00257 {
00258     Inherited::copyToBin(pMem, whichField);
00259 
00260     if(FieldBits::NoField != (MaskRFieldMask & whichField))
00261     {
00262         _sfMaskR.copyToBin(pMem);
00263     }
00264 
00265     if(FieldBits::NoField != (MaskGFieldMask & whichField))
00266     {
00267         _sfMaskG.copyToBin(pMem);
00268     }
00269 
00270     if(FieldBits::NoField != (MaskBFieldMask & whichField))
00271     {
00272         _sfMaskB.copyToBin(pMem);
00273     }
00274 
00275     if(FieldBits::NoField != (MaskAFieldMask & whichField))
00276     {
00277         _sfMaskA.copyToBin(pMem);
00278     }
00279 
00280 
00281 }
00282 
00283 void ColorMaskChunkBase::copyFromBin(      BinaryDataHandler &pMem,
00284                                     const BitVector    &whichField)
00285 {
00286     Inherited::copyFromBin(pMem, whichField);
00287 
00288     if(FieldBits::NoField != (MaskRFieldMask & whichField))
00289     {
00290         _sfMaskR.copyFromBin(pMem);
00291     }
00292 
00293     if(FieldBits::NoField != (MaskGFieldMask & whichField))
00294     {
00295         _sfMaskG.copyFromBin(pMem);
00296     }
00297 
00298     if(FieldBits::NoField != (MaskBFieldMask & whichField))
00299     {
00300         _sfMaskB.copyFromBin(pMem);
00301     }
00302 
00303     if(FieldBits::NoField != (MaskAFieldMask & whichField))
00304     {
00305         _sfMaskA.copyFromBin(pMem);
00306     }
00307 
00308 
00309 }
00310 
00311 #if !defined(OSG_FIXED_MFIELDSYNC)
00312 void ColorMaskChunkBase::executeSyncImpl(      ColorMaskChunkBase *pOther,
00313                                         const BitVector         &whichField)
00314 {
00315 
00316     Inherited::executeSyncImpl(pOther, whichField);
00317 
00318     if(FieldBits::NoField != (MaskRFieldMask & whichField))
00319         _sfMaskR.syncWith(pOther->_sfMaskR);
00320 
00321     if(FieldBits::NoField != (MaskGFieldMask & whichField))
00322         _sfMaskG.syncWith(pOther->_sfMaskG);
00323 
00324     if(FieldBits::NoField != (MaskBFieldMask & whichField))
00325         _sfMaskB.syncWith(pOther->_sfMaskB);
00326 
00327     if(FieldBits::NoField != (MaskAFieldMask & whichField))
00328         _sfMaskA.syncWith(pOther->_sfMaskA);
00329 
00330 
00331 }
00332 #else
00333 void ColorMaskChunkBase::executeSyncImpl(      ColorMaskChunkBase *pOther,
00334                                         const BitVector         &whichField,
00335                                         const SyncInfo          &sInfo      )
00336 {
00337 
00338     Inherited::executeSyncImpl(pOther, whichField, sInfo);
00339 
00340     if(FieldBits::NoField != (MaskRFieldMask & whichField))
00341         _sfMaskR.syncWith(pOther->_sfMaskR);
00342 
00343     if(FieldBits::NoField != (MaskGFieldMask & whichField))
00344         _sfMaskG.syncWith(pOther->_sfMaskG);
00345 
00346     if(FieldBits::NoField != (MaskBFieldMask & whichField))
00347         _sfMaskB.syncWith(pOther->_sfMaskB);
00348 
00349     if(FieldBits::NoField != (MaskAFieldMask & whichField))
00350         _sfMaskA.syncWith(pOther->_sfMaskA);
00351 
00352 
00353 
00354 }
00355 
00356 void ColorMaskChunkBase::execBeginEditImpl (const BitVector &whichField, 
00357                                                  UInt32     uiAspect,
00358                                                  UInt32     uiContainerSize)
00359 {
00360     Inherited::execBeginEditImpl(whichField, uiAspect, uiContainerSize);
00361 
00362 }
00363 #endif
00364 
00365 
00366 
00367 #include <OSGSFieldTypeDef.inl>
00368 #include <OSGMFieldTypeDef.inl>
00369 
00370 OSG_BEGIN_NAMESPACE
00371 
00372 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
00373 DataType FieldDataTraits<ColorMaskChunkPtr>::_type("ColorMaskChunkPtr", "StateChunkPtr");
00374 #endif
00375 
00376 OSG_DLLEXPORT_SFIELD_DEF1(ColorMaskChunkPtr, OSG_SYSTEMLIB_DLLTMPLMAPPING);
00377 OSG_DLLEXPORT_MFIELD_DEF1(ColorMaskChunkPtr, OSG_SYSTEMLIB_DLLTMPLMAPPING);
00378 
00379 OSG_END_NAMESPACE
00380 
00381 
00382 /*------------------------------------------------------------------------*/
00383 /*                              cvs id's                                  */
00384 
00385 #ifdef OSG_SGI_CC
00386 #pragma set woff 1174
00387 #endif
00388 
00389 #ifdef OSG_LINUX_ICC
00390 #pragma warning( disable : 177 )
00391 #endif
00392 
00393 namespace
00394 {
00395     static Char8 cvsid_cpp       [] = "@(#)$Id: OSGColorMaskChunkBase.cpp,v 1.3 2005/07/20 00:09:40 vossg Exp $";
00396     static Char8 cvsid_hpp       [] = OSGCOLORMASKCHUNKBASE_HEADER_CVSID;
00397     static Char8 cvsid_inl       [] = OSGCOLORMASKCHUNKBASE_INLINE_CVSID;
00398 
00399     static Char8 cvsid_fields_hpp[] = OSGCOLORMASKCHUNKFIELDS_HEADER_CVSID;
00400 }
00401 

Generated on Thu Aug 25 04:02:15 2005 for OpenSG by  doxygen 1.4.3