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

OSGSimpleStatisticsForegroundBase.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 SimpleStatisticsForeground!
00049  **                                                                         **
00050  *****************************************************************************
00051 \*****************************************************************************/
00052 
00053 
00054 #define OSG_COMPILESIMPLESTATISTICSFOREGROUNDINST
00055 
00056 #include <stdlib.h>
00057 #include <stdio.h>
00058 
00059 #include <OSGConfig.h>
00060 
00061 #include "OSGSimpleStatisticsForegroundBase.h"
00062 #include "OSGSimpleStatisticsForeground.h"
00063 
00064 
00065 OSG_USING_NAMESPACE
00066 
00067 const OSG::BitVector  SimpleStatisticsForegroundBase::FormatsFieldMask = 
00068     (TypeTraits<BitVector>::One << SimpleStatisticsForegroundBase::FormatsFieldId);
00069 
00070 const OSG::BitVector  SimpleStatisticsForegroundBase::SizeFieldMask = 
00071     (TypeTraits<BitVector>::One << SimpleStatisticsForegroundBase::SizeFieldId);
00072 
00073 const OSG::BitVector  SimpleStatisticsForegroundBase::ColorFieldMask = 
00074     (TypeTraits<BitVector>::One << SimpleStatisticsForegroundBase::ColorFieldId);
00075 
00076 const OSG::BitVector SimpleStatisticsForegroundBase::MTInfluenceMask = 
00077     (Inherited::MTInfluenceMask) | 
00078     (static_cast<BitVector>(0x0) << Inherited::NextFieldId); 
00079 
00080 
00081 // Field descriptions
00082 
00093 
00094 
00095 FieldDescription *SimpleStatisticsForegroundBase::_desc[] = 
00096 {
00097     new FieldDescription(MFString::getClassType(), 
00098                      "formats", 
00099                      FormatsFieldId, FormatsFieldMask,
00100                      false,
00101                      (FieldAccessMethod) &SimpleStatisticsForegroundBase::getMFFormats),
00102     new FieldDescription(SFReal32::getClassType(), 
00103                      "size", 
00104                      SizeFieldId, SizeFieldMask,
00105                      false,
00106                      (FieldAccessMethod) &SimpleStatisticsForegroundBase::getSFSize),
00107     new FieldDescription(SFColor4f::getClassType(), 
00108                      "color", 
00109                      ColorFieldId, ColorFieldMask,
00110                      false,
00111                      (FieldAccessMethod) &SimpleStatisticsForegroundBase::getSFColor)
00112 };
00113 
00114 
00115 FieldContainerType SimpleStatisticsForegroundBase::_type(
00116     "SimpleStatisticsForeground",
00117     "StatisticsForeground",
00118     NULL,
00119     (PrototypeCreateF) &SimpleStatisticsForegroundBase::createEmpty,
00120     SimpleStatisticsForeground::initMethod,
00121     _desc,
00122     sizeof(_desc));
00123 
00124 //OSG_FIELD_CONTAINER_DEF(SimpleStatisticsForegroundBase, SimpleStatisticsForegroundPtr)
00125 
00126 /*------------------------------ get -----------------------------------*/
00127 
00128 FieldContainerType &SimpleStatisticsForegroundBase::getType(void) 
00129 {
00130     return _type; 
00131 } 
00132 
00133 const FieldContainerType &SimpleStatisticsForegroundBase::getType(void) const 
00134 {
00135     return _type;
00136 } 
00137 
00138 
00139 FieldContainerPtr SimpleStatisticsForegroundBase::shallowCopy(void) const 
00140 { 
00141     SimpleStatisticsForegroundPtr returnValue; 
00142 
00143     newPtr(returnValue, dynamic_cast<const SimpleStatisticsForeground *>(this)); 
00144 
00145     return returnValue; 
00146 }
00147 
00148 UInt32 SimpleStatisticsForegroundBase::getContainerSize(void) const 
00149 { 
00150     return sizeof(SimpleStatisticsForeground); 
00151 }
00152 
00153 
00154 #if !defined(OSG_FIXED_MFIELDSYNC)
00155 void SimpleStatisticsForegroundBase::executeSync(      FieldContainer &other,
00156                                     const BitVector      &whichField)
00157 {
00158     this->executeSyncImpl((SimpleStatisticsForegroundBase *) &other, whichField);
00159 }
00160 #else
00161 void SimpleStatisticsForegroundBase::executeSync(      FieldContainer &other,
00162                                     const BitVector      &whichField,                                    const SyncInfo       &sInfo     )
00163 {
00164     this->executeSyncImpl((SimpleStatisticsForegroundBase *) &other, whichField, sInfo);
00165 }
00166 void SimpleStatisticsForegroundBase::execBeginEdit(const BitVector &whichField, 
00167                                             UInt32     uiAspect,
00168                                             UInt32     uiContainerSize) 
00169 {
00170     this->execBeginEditImpl(whichField, uiAspect, uiContainerSize);
00171 }
00172 
00173 void SimpleStatisticsForegroundBase::onDestroyAspect(UInt32 uiId, UInt32 uiAspect)
00174 {
00175     Inherited::onDestroyAspect(uiId, uiAspect);
00176 
00177     _mfFormats.terminateShare(uiAspect, this->getContainerSize());
00178 }
00179 #endif
00180 
00181 /*------------------------- constructors ----------------------------------*/
00182 
00183 #ifdef OSG_WIN32_ICL
00184 #pragma warning (disable : 383)
00185 #endif
00186 
00187 SimpleStatisticsForegroundBase::SimpleStatisticsForegroundBase(void) :
00188     _mfFormats                (), 
00189     _sfSize                   (Real32(25)), 
00190     _sfColor                  (Color4f(1,1,1,1)), 
00191     Inherited() 
00192 {
00193 }
00194 
00195 #ifdef OSG_WIN32_ICL
00196 #pragma warning (default : 383)
00197 #endif
00198 
00199 SimpleStatisticsForegroundBase::SimpleStatisticsForegroundBase(const SimpleStatisticsForegroundBase &source) :
00200     _mfFormats                (source._mfFormats                ), 
00201     _sfSize                   (source._sfSize                   ), 
00202     _sfColor                  (source._sfColor                  ), 
00203     Inherited                 (source)
00204 {
00205 }
00206 
00207 /*-------------------------- destructors ----------------------------------*/
00208 
00209 SimpleStatisticsForegroundBase::~SimpleStatisticsForegroundBase(void)
00210 {
00211 }
00212 
00213 /*------------------------------ access -----------------------------------*/
00214 
00215 UInt32 SimpleStatisticsForegroundBase::getBinSize(const BitVector &whichField)
00216 {
00217     UInt32 returnValue = Inherited::getBinSize(whichField);
00218 
00219     if(FieldBits::NoField != (FormatsFieldMask & whichField))
00220     {
00221         returnValue += _mfFormats.getBinSize();
00222     }
00223 
00224     if(FieldBits::NoField != (SizeFieldMask & whichField))
00225     {
00226         returnValue += _sfSize.getBinSize();
00227     }
00228 
00229     if(FieldBits::NoField != (ColorFieldMask & whichField))
00230     {
00231         returnValue += _sfColor.getBinSize();
00232     }
00233 
00234 
00235     return returnValue;
00236 }
00237 
00238 void SimpleStatisticsForegroundBase::copyToBin(      BinaryDataHandler &pMem,
00239                                   const BitVector         &whichField)
00240 {
00241     Inherited::copyToBin(pMem, whichField);
00242 
00243     if(FieldBits::NoField != (FormatsFieldMask & whichField))
00244     {
00245         _mfFormats.copyToBin(pMem);
00246     }
00247 
00248     if(FieldBits::NoField != (SizeFieldMask & whichField))
00249     {
00250         _sfSize.copyToBin(pMem);
00251     }
00252 
00253     if(FieldBits::NoField != (ColorFieldMask & whichField))
00254     {
00255         _sfColor.copyToBin(pMem);
00256     }
00257 
00258 
00259 }
00260 
00261 void SimpleStatisticsForegroundBase::copyFromBin(      BinaryDataHandler &pMem,
00262                                     const BitVector    &whichField)
00263 {
00264     Inherited::copyFromBin(pMem, whichField);
00265 
00266     if(FieldBits::NoField != (FormatsFieldMask & whichField))
00267     {
00268         _mfFormats.copyFromBin(pMem);
00269     }
00270 
00271     if(FieldBits::NoField != (SizeFieldMask & whichField))
00272     {
00273         _sfSize.copyFromBin(pMem);
00274     }
00275 
00276     if(FieldBits::NoField != (ColorFieldMask & whichField))
00277     {
00278         _sfColor.copyFromBin(pMem);
00279     }
00280 
00281 
00282 }
00283 
00284 #if !defined(OSG_FIXED_MFIELDSYNC)
00285 void SimpleStatisticsForegroundBase::executeSyncImpl(      SimpleStatisticsForegroundBase *pOther,
00286                                         const BitVector         &whichField)
00287 {
00288 
00289     Inherited::executeSyncImpl(pOther, whichField);
00290 
00291     if(FieldBits::NoField != (FormatsFieldMask & whichField))
00292         _mfFormats.syncWith(pOther->_mfFormats);
00293 
00294     if(FieldBits::NoField != (SizeFieldMask & whichField))
00295         _sfSize.syncWith(pOther->_sfSize);
00296 
00297     if(FieldBits::NoField != (ColorFieldMask & whichField))
00298         _sfColor.syncWith(pOther->_sfColor);
00299 
00300 
00301 }
00302 #else
00303 void SimpleStatisticsForegroundBase::executeSyncImpl(      SimpleStatisticsForegroundBase *pOther,
00304                                         const BitVector         &whichField,
00305                                         const SyncInfo          &sInfo      )
00306 {
00307 
00308     Inherited::executeSyncImpl(pOther, whichField, sInfo);
00309 
00310     if(FieldBits::NoField != (SizeFieldMask & whichField))
00311         _sfSize.syncWith(pOther->_sfSize);
00312 
00313     if(FieldBits::NoField != (ColorFieldMask & whichField))
00314         _sfColor.syncWith(pOther->_sfColor);
00315 
00316 
00317     if(FieldBits::NoField != (FormatsFieldMask & whichField))
00318         _mfFormats.syncWith(pOther->_mfFormats, sInfo);
00319 
00320 
00321 }
00322 
00323 void SimpleStatisticsForegroundBase::execBeginEditImpl (const BitVector &whichField, 
00324                                                  UInt32     uiAspect,
00325                                                  UInt32     uiContainerSize)
00326 {
00327     Inherited::execBeginEditImpl(whichField, uiAspect, uiContainerSize);
00328 
00329     if(FieldBits::NoField != (FormatsFieldMask & whichField))
00330         _mfFormats.beginEdit(uiAspect, uiContainerSize);
00331 
00332 }
00333 #endif
00334 
00335 
00336 
00337 #include <OSGSFieldTypeDef.inl>
00338 #include <OSGMFieldTypeDef.inl>
00339 
00340 OSG_BEGIN_NAMESPACE
00341 
00342 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
00343 DataType FieldDataTraits<SimpleStatisticsForegroundPtr>::_type("SimpleStatisticsForegroundPtr", "StatisticsForegroundPtr");
00344 #endif
00345 
00346 OSG_DLLEXPORT_SFIELD_DEF1(SimpleStatisticsForegroundPtr, OSG_SYSTEMLIB_DLLTMPLMAPPING);
00347 OSG_DLLEXPORT_MFIELD_DEF1(SimpleStatisticsForegroundPtr, OSG_SYSTEMLIB_DLLTMPLMAPPING);
00348 
00349 OSG_END_NAMESPACE
00350 
00351 
00352 /*------------------------------------------------------------------------*/
00353 /*                              cvs id's                                  */
00354 
00355 #ifdef OSG_SGI_CC
00356 #pragma set woff 1174
00357 #endif
00358 
00359 #ifdef OSG_LINUX_ICC
00360 #pragma warning( disable : 177 )
00361 #endif
00362 
00363 namespace
00364 {
00365     static Char8 cvsid_cpp       [] = "@(#)$Id: FCBaseTemplate_cpp.h,v 1.42 2004/08/03 05:53:03 dirk Exp $";
00366     static Char8 cvsid_hpp       [] = OSGSIMPLESTATISTICSFOREGROUNDBASE_HEADER_CVSID;
00367     static Char8 cvsid_inl       [] = OSGSIMPLESTATISTICSFOREGROUNDBASE_INLINE_CVSID;
00368 
00369     static Char8 cvsid_fields_hpp[] = OSGSIMPLESTATISTICSFOREGROUNDFIELDS_HEADER_CVSID;
00370 }
00371 

Generated on Thu Aug 25 04:10:13 2005 for OpenSG by  doxygen 1.4.3