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

OSGDepthChunkBase.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 DepthChunk!
00049  **                                                                         **
00050  *****************************************************************************
00051 \*****************************************************************************/
00052 
00053 
00054 #define OSG_COMPILEDEPTHCHUNKINST
00055 
00056 #include <stdlib.h>
00057 #include <stdio.h>
00058 
00059 #include <OSGConfig.h>
00060 
00061 #include "OSGDepthChunkBase.h"
00062 #include "OSGDepthChunk.h"
00063 
00064 #include <OSGGL.h>                        // Func default header
00065 
00066 OSG_USING_NAMESPACE
00067 
00068 const OSG::BitVector  DepthChunkBase::EnableFieldMask = 
00069     (TypeTraits<BitVector>::One << DepthChunkBase::EnableFieldId);
00070 
00071 const OSG::BitVector  DepthChunkBase::FuncFieldMask = 
00072     (TypeTraits<BitVector>::One << DepthChunkBase::FuncFieldId);
00073 
00074 const OSG::BitVector  DepthChunkBase::NearFieldMask = 
00075     (TypeTraits<BitVector>::One << DepthChunkBase::NearFieldId);
00076 
00077 const OSG::BitVector  DepthChunkBase::FarFieldMask = 
00078     (TypeTraits<BitVector>::One << DepthChunkBase::FarFieldId);
00079 
00080 const OSG::BitVector  DepthChunkBase::ReadOnlyFieldMask = 
00081     (TypeTraits<BitVector>::One << DepthChunkBase::ReadOnlyFieldId);
00082 
00083 const OSG::BitVector DepthChunkBase::MTInfluenceMask = 
00084     (Inherited::MTInfluenceMask) | 
00085     (static_cast<BitVector>(0x0) << Inherited::NextFieldId); 
00086 
00087 
00088 // Field descriptions
00089 
00106 
00107 
00108 FieldDescription *DepthChunkBase::_desc[] = 
00109 {
00110     new FieldDescription(SFBool::getClassType(), 
00111                      "enable", 
00112                      EnableFieldId, EnableFieldMask,
00113                      false,
00114                      (FieldAccessMethod) &DepthChunkBase::getSFEnable),
00115     new FieldDescription(SFGLenum::getClassType(), 
00116                      "func", 
00117                      FuncFieldId, FuncFieldMask,
00118                      false,
00119                      (FieldAccessMethod) &DepthChunkBase::getSFFunc),
00120     new FieldDescription(SFReal32::getClassType(), 
00121                      "near", 
00122                      NearFieldId, NearFieldMask,
00123                      false,
00124                      (FieldAccessMethod) &DepthChunkBase::getSFNear),
00125     new FieldDescription(SFReal32::getClassType(), 
00126                      "far", 
00127                      FarFieldId, FarFieldMask,
00128                      false,
00129                      (FieldAccessMethod) &DepthChunkBase::getSFFar),
00130     new FieldDescription(SFBool::getClassType(), 
00131                      "readOnly", 
00132                      ReadOnlyFieldId, ReadOnlyFieldMask,
00133                      false,
00134                      (FieldAccessMethod) &DepthChunkBase::getSFReadOnly)
00135 };
00136 
00137 
00138 FieldContainerType DepthChunkBase::_type(
00139     "DepthChunk",
00140     "StateChunk",
00141     NULL,
00142     (PrototypeCreateF) &DepthChunkBase::createEmpty,
00143     DepthChunk::initMethod,
00144     _desc,
00145     sizeof(_desc));
00146 
00147 //OSG_FIELD_CONTAINER_DEF(DepthChunkBase, DepthChunkPtr)
00148 
00149 /*------------------------------ get -----------------------------------*/
00150 
00151 FieldContainerType &DepthChunkBase::getType(void) 
00152 {
00153     return _type; 
00154 } 
00155 
00156 const FieldContainerType &DepthChunkBase::getType(void) const 
00157 {
00158     return _type;
00159 } 
00160 
00161 
00162 FieldContainerPtr DepthChunkBase::shallowCopy(void) const 
00163 { 
00164     DepthChunkPtr returnValue; 
00165 
00166     newPtr(returnValue, dynamic_cast<const DepthChunk *>(this)); 
00167 
00168     return returnValue; 
00169 }
00170 
00171 UInt32 DepthChunkBase::getContainerSize(void) const 
00172 { 
00173     return sizeof(DepthChunk); 
00174 }
00175 
00176 
00177 #if !defined(OSG_FIXED_MFIELDSYNC)
00178 void DepthChunkBase::executeSync(      FieldContainer &other,
00179                                     const BitVector      &whichField)
00180 {
00181     this->executeSyncImpl((DepthChunkBase *) &other, whichField);
00182 }
00183 #else
00184 void DepthChunkBase::executeSync(      FieldContainer &other,
00185                                     const BitVector      &whichField,                                    const SyncInfo       &sInfo     )
00186 {
00187     this->executeSyncImpl((DepthChunkBase *) &other, whichField, sInfo);
00188 }
00189 void DepthChunkBase::execBeginEdit(const BitVector &whichField, 
00190                                             UInt32     uiAspect,
00191                                             UInt32     uiContainerSize) 
00192 {
00193     this->execBeginEditImpl(whichField, uiAspect, uiContainerSize);
00194 }
00195 
00196 void DepthChunkBase::onDestroyAspect(UInt32 uiId, UInt32 uiAspect)
00197 {
00198     Inherited::onDestroyAspect(uiId, uiAspect);
00199 
00200 }
00201 #endif
00202 
00203 /*------------------------- constructors ----------------------------------*/
00204 
00205 #ifdef OSG_WIN32_ICL
00206 #pragma warning (disable : 383)
00207 #endif
00208 
00209 DepthChunkBase::DepthChunkBase(void) :
00210     _sfEnable                 (bool(true)), 
00211     _sfFunc                   (GLenum(GL_LEQUAL)), 
00212     _sfNear                   (Real32(-1.f)), 
00213     _sfFar                    (Real32(-1.f)), 
00214     _sfReadOnly               (bool(false)), 
00215     Inherited() 
00216 {
00217 }
00218 
00219 #ifdef OSG_WIN32_ICL
00220 #pragma warning (default : 383)
00221 #endif
00222 
00223 DepthChunkBase::DepthChunkBase(const DepthChunkBase &source) :
00224     _sfEnable                 (source._sfEnable                 ), 
00225     _sfFunc                   (source._sfFunc                   ), 
00226     _sfNear                   (source._sfNear                   ), 
00227     _sfFar                    (source._sfFar                    ), 
00228     _sfReadOnly               (source._sfReadOnly               ), 
00229     Inherited                 (source)
00230 {
00231 }
00232 
00233 /*-------------------------- destructors ----------------------------------*/
00234 
00235 DepthChunkBase::~DepthChunkBase(void)
00236 {
00237 }
00238 
00239 /*------------------------------ access -----------------------------------*/
00240 
00241 UInt32 DepthChunkBase::getBinSize(const BitVector &whichField)
00242 {
00243     UInt32 returnValue = Inherited::getBinSize(whichField);
00244 
00245     if(FieldBits::NoField != (EnableFieldMask & whichField))
00246     {
00247         returnValue += _sfEnable.getBinSize();
00248     }
00249 
00250     if(FieldBits::NoField != (FuncFieldMask & whichField))
00251     {
00252         returnValue += _sfFunc.getBinSize();
00253     }
00254 
00255     if(FieldBits::NoField != (NearFieldMask & whichField))
00256     {
00257         returnValue += _sfNear.getBinSize();
00258     }
00259 
00260     if(FieldBits::NoField != (FarFieldMask & whichField))
00261     {
00262         returnValue += _sfFar.getBinSize();
00263     }
00264 
00265     if(FieldBits::NoField != (ReadOnlyFieldMask & whichField))
00266     {
00267         returnValue += _sfReadOnly.getBinSize();
00268     }
00269 
00270 
00271     return returnValue;
00272 }
00273 
00274 void DepthChunkBase::copyToBin(      BinaryDataHandler &pMem,
00275                                   const BitVector         &whichField)
00276 {
00277     Inherited::copyToBin(pMem, whichField);
00278 
00279     if(FieldBits::NoField != (EnableFieldMask & whichField))
00280     {
00281         _sfEnable.copyToBin(pMem);
00282     }
00283 
00284     if(FieldBits::NoField != (FuncFieldMask & whichField))
00285     {
00286         _sfFunc.copyToBin(pMem);
00287     }
00288 
00289     if(FieldBits::NoField != (NearFieldMask & whichField))
00290     {
00291         _sfNear.copyToBin(pMem);
00292     }
00293 
00294     if(FieldBits::NoField != (FarFieldMask & whichField))
00295     {
00296         _sfFar.copyToBin(pMem);
00297     }
00298 
00299     if(FieldBits::NoField != (ReadOnlyFieldMask & whichField))
00300     {
00301         _sfReadOnly.copyToBin(pMem);
00302     }
00303 
00304 
00305 }
00306 
00307 void DepthChunkBase::copyFromBin(      BinaryDataHandler &pMem,
00308                                     const BitVector    &whichField)
00309 {
00310     Inherited::copyFromBin(pMem, whichField);
00311 
00312     if(FieldBits::NoField != (EnableFieldMask & whichField))
00313     {
00314         _sfEnable.copyFromBin(pMem);
00315     }
00316 
00317     if(FieldBits::NoField != (FuncFieldMask & whichField))
00318     {
00319         _sfFunc.copyFromBin(pMem);
00320     }
00321 
00322     if(FieldBits::NoField != (NearFieldMask & whichField))
00323     {
00324         _sfNear.copyFromBin(pMem);
00325     }
00326 
00327     if(FieldBits::NoField != (FarFieldMask & whichField))
00328     {
00329         _sfFar.copyFromBin(pMem);
00330     }
00331 
00332     if(FieldBits::NoField != (ReadOnlyFieldMask & whichField))
00333     {
00334         _sfReadOnly.copyFromBin(pMem);
00335     }
00336 
00337 
00338 }
00339 
00340 #if !defined(OSG_FIXED_MFIELDSYNC)
00341 void DepthChunkBase::executeSyncImpl(      DepthChunkBase *pOther,
00342                                         const BitVector         &whichField)
00343 {
00344 
00345     Inherited::executeSyncImpl(pOther, whichField);
00346 
00347     if(FieldBits::NoField != (EnableFieldMask & whichField))
00348         _sfEnable.syncWith(pOther->_sfEnable);
00349 
00350     if(FieldBits::NoField != (FuncFieldMask & whichField))
00351         _sfFunc.syncWith(pOther->_sfFunc);
00352 
00353     if(FieldBits::NoField != (NearFieldMask & whichField))
00354         _sfNear.syncWith(pOther->_sfNear);
00355 
00356     if(FieldBits::NoField != (FarFieldMask & whichField))
00357         _sfFar.syncWith(pOther->_sfFar);
00358 
00359     if(FieldBits::NoField != (ReadOnlyFieldMask & whichField))
00360         _sfReadOnly.syncWith(pOther->_sfReadOnly);
00361 
00362 
00363 }
00364 #else
00365 void DepthChunkBase::executeSyncImpl(      DepthChunkBase *pOther,
00366                                         const BitVector         &whichField,
00367                                         const SyncInfo          &sInfo      )
00368 {
00369 
00370     Inherited::executeSyncImpl(pOther, whichField, sInfo);
00371 
00372     if(FieldBits::NoField != (EnableFieldMask & whichField))
00373         _sfEnable.syncWith(pOther->_sfEnable);
00374 
00375     if(FieldBits::NoField != (FuncFieldMask & whichField))
00376         _sfFunc.syncWith(pOther->_sfFunc);
00377 
00378     if(FieldBits::NoField != (NearFieldMask & whichField))
00379         _sfNear.syncWith(pOther->_sfNear);
00380 
00381     if(FieldBits::NoField != (FarFieldMask & whichField))
00382         _sfFar.syncWith(pOther->_sfFar);
00383 
00384     if(FieldBits::NoField != (ReadOnlyFieldMask & whichField))
00385         _sfReadOnly.syncWith(pOther->_sfReadOnly);
00386 
00387 
00388 
00389 }
00390 
00391 void DepthChunkBase::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 #include <OSGSFieldTypeDef.inl>
00403 #include <OSGMFieldTypeDef.inl>
00404 
00405 OSG_BEGIN_NAMESPACE
00406 
00407 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
00408 DataType FieldDataTraits<DepthChunkPtr>::_type("DepthChunkPtr", "StateChunkPtr");
00409 #endif
00410 
00411 OSG_DLLEXPORT_SFIELD_DEF1(DepthChunkPtr, OSG_SYSTEMLIB_DLLTMPLMAPPING);
00412 OSG_DLLEXPORT_MFIELD_DEF1(DepthChunkPtr, OSG_SYSTEMLIB_DLLTMPLMAPPING);
00413 
00414 OSG_END_NAMESPACE
00415 
00416 
00417 /*------------------------------------------------------------------------*/
00418 /*                              cvs id's                                  */
00419 
00420 #ifdef OSG_SGI_CC
00421 #pragma set woff 1174
00422 #endif
00423 
00424 #ifdef OSG_LINUX_ICC
00425 #pragma warning( disable : 177 )
00426 #endif
00427 
00428 namespace
00429 {
00430     static Char8 cvsid_cpp       [] = "@(#)$Id: OSGDepthChunkBase.cpp,v 1.6 2005/07/20 00:09:40 vossg Exp $";
00431     static Char8 cvsid_hpp       [] = OSGDEPTHCHUNKBASE_HEADER_CVSID;
00432     static Char8 cvsid_inl       [] = OSGDEPTHCHUNKBASE_INLINE_CVSID;
00433 
00434     static Char8 cvsid_fields_hpp[] = OSGDEPTHCHUNKFIELDS_HEADER_CVSID;
00435 }
00436 

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