1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000-2013 by the OpenSG Forum *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, carsten_neumann@gmx.net *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
15 * This library is free software; you can redistribute it and/or modify it *
16 * under the terms of the GNU Library General Public License as published *
17 * by the Free Software Foundation, version 2. *
19 * This library is distributed in the hope that it will be useful, but *
20 * WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
22 * Library General Public License for more details. *
24 * You should have received a copy of the GNU Library General Public *
25 * License along with this library; if not, write to the Free Software *
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
37 \*---------------------------------------------------------------------------*/
39 /*****************************************************************************\
40 *****************************************************************************
42 ** This file is automatically generated. **
44 ** Any changes made to this file WILL be lost when it is **
45 ** regenerated, which can become necessary at any time. **
47 ** Do not change this file, changes should be done in the derived **
48 ** class CSMStatisticsForeground!
50 *****************************************************************************
51 \*****************************************************************************/
57 #pragma warning(disable: 4355) // turn off 'this' : used in base member initializer list warning
58 #pragma warning(disable: 4290) // disable exception specification warning
61 #include "OSGConfig.h"
66 #include "OSGCSMStatisticsForegroundBase.h"
67 #include "OSGCSMStatisticsForeground.h"
69 #include <boost/bind.hpp>
73 /***************************************************************************\
75 \***************************************************************************/
77 /*! \class OSG::CSMStatisticsForeground
81 /***************************************************************************\
82 * Field Documentation *
83 \***************************************************************************/
85 /*! \var UInt32 CSMStatisticsForegroundBase::_sfSize
89 /*! \var Color4f CSMStatisticsForegroundBase::_sfColor
93 /*! \var Color4f CSMStatisticsForegroundBase::_sfBgColor
97 /*! \var std::string CSMStatisticsForegroundBase::_mfElements
102 /***************************************************************************\
103 * FieldType/FieldTrait Instantiation *
104 \***************************************************************************/
106 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
107 PointerType FieldTraits
<CSMStatisticsForeground
*, nsOSG
>::_type(
108 "CSMStatisticsForegroundPtr",
110 CSMStatisticsForeground::getClassType(),
114 OSG_FIELDTRAITS_GETTYPE_NS(CSMStatisticsForeground
*, nsOSG
)
116 /***************************************************************************\
117 * Field Description *
118 \***************************************************************************/
120 void CSMStatisticsForegroundBase::classDescInserter(TypeObject
&oType
)
122 FieldDescriptionBase
*pDesc
= NULL
;
125 pDesc
= new SFUInt32::Description(
126 SFUInt32::getClassType(),
129 SizeFieldId
, SizeFieldMask
,
131 (Field::SFDefaultFlags
| Field::FStdAccess
),
132 static_cast<FieldEditMethodSig
>(&CSMStatisticsForeground::editHandleSize
),
133 static_cast<FieldGetMethodSig
>(&CSMStatisticsForeground::getHandleSize
));
135 oType
.addInitialDesc(pDesc
);
137 pDesc
= new SFColor4f::Description(
138 SFColor4f::getClassType(),
141 ColorFieldId
, ColorFieldMask
,
143 (Field::SFDefaultFlags
| Field::FStdAccess
),
144 static_cast<FieldEditMethodSig
>(&CSMStatisticsForeground::editHandleColor
),
145 static_cast<FieldGetMethodSig
>(&CSMStatisticsForeground::getHandleColor
));
147 oType
.addInitialDesc(pDesc
);
149 pDesc
= new SFColor4f::Description(
150 SFColor4f::getClassType(),
153 BgColorFieldId
, BgColorFieldMask
,
155 (Field::SFDefaultFlags
| Field::FStdAccess
),
156 static_cast<FieldEditMethodSig
>(&CSMStatisticsForeground::editHandleBgColor
),
157 static_cast<FieldGetMethodSig
>(&CSMStatisticsForeground::getHandleBgColor
));
159 oType
.addInitialDesc(pDesc
);
161 pDesc
= new MFString::Description(
162 MFString::getClassType(),
165 ElementsFieldId
, ElementsFieldMask
,
167 (Field::MFDefaultFlags
| Field::FStdAccess
),
168 static_cast<FieldEditMethodSig
>(&CSMStatisticsForeground::editHandleElements
),
169 static_cast<FieldGetMethodSig
>(&CSMStatisticsForeground::getHandleElements
));
171 oType
.addInitialDesc(pDesc
);
175 CSMStatisticsForegroundBase::TypeObject
CSMStatisticsForegroundBase::_type(
176 CSMStatisticsForegroundBase::getClassname(),
177 Inherited::getClassname(),
180 reinterpret_cast<PrototypeCreateF
>(&CSMStatisticsForegroundBase::createEmptyLocal
),
181 reinterpret_cast<InitContainerF
>(&CSMStatisticsForeground::initMethod
),
182 reinterpret_cast<ExitContainerF
>(&CSMStatisticsForeground::exitMethod
),
183 reinterpret_cast<InitalInsertDescFunc
>(
184 reinterpret_cast<void *>(&CSMStatisticsForeground::classDescInserter
)),
187 "<?xml version=\"1.0\"?>\n"
190 " name=\"CSMStatisticsForeground\"\n"
191 " parent=\"Foreground\"\n"
192 " library=\"ContribCSM\"\n"
193 " pointerfieldtypes=\"none\"\n"
194 " structure=\"concrete\"\n"
195 " systemcomponent=\"true\"\n"
196 " parentsystemcomponent=\"true\"\n"
197 " decoratable=\"false\"\n"
198 " useLocalIncludes=\"false\"\n"
199 " isNodeCore=\"false\"\n"
200 " isBundle=\"true\"\n"
201 " parentFields=\"none\"\n"
206 " cardinality=\"single\"\n"
207 " visibility=\"external\"\n"
208 " access=\"public\"\n"
209 " defaultValue=\"25\"\n"
214 " type=\"Color4f\"\n"
215 " cardinality=\"single\"\n"
216 " visibility=\"external\"\n"
217 " access=\"public\"\n"
218 " defaultValue=\"0.0, 1.0, 0.0, 0.7\"\n"
222 " name=\"bgColor\"\n"
223 " type=\"Color4f\"\n"
224 " cardinality=\"single\"\n"
225 " visibility=\"external\"\n"
226 " access=\"public\"\n"
227 " defaultValue=\"0.0, 0.0, 0.0, 0.0\"\n"
231 " name=\"elements\"\n"
232 " type=\"std::string\"\n"
233 " cardinality=\"multi\"\n"
234 " visibility=\"external\"\n"
235 " access=\"public\"\n"
238 "</FieldContainer>\n",
242 /*------------------------------ get -----------------------------------*/
244 FieldContainerType
&CSMStatisticsForegroundBase::getType(void)
249 const FieldContainerType
&CSMStatisticsForegroundBase::getType(void) const
254 UInt32
CSMStatisticsForegroundBase::getContainerSize(void) const
256 return sizeof(CSMStatisticsForeground
);
259 /*------------------------- decorator get ------------------------------*/
262 SFUInt32
*CSMStatisticsForegroundBase::editSFSize(void)
264 editSField(SizeFieldMask
);
269 const SFUInt32
*CSMStatisticsForegroundBase::getSFSize(void) const
275 SFColor4f
*CSMStatisticsForegroundBase::editSFColor(void)
277 editSField(ColorFieldMask
);
282 const SFColor4f
*CSMStatisticsForegroundBase::getSFColor(void) const
288 SFColor4f
*CSMStatisticsForegroundBase::editSFBgColor(void)
290 editSField(BgColorFieldMask
);
295 const SFColor4f
*CSMStatisticsForegroundBase::getSFBgColor(void) const
301 MFString
*CSMStatisticsForegroundBase::editMFElements(void)
303 editMField(ElementsFieldMask
, _mfElements
);
308 const MFString
*CSMStatisticsForegroundBase::getMFElements(void) const
318 /*------------------------------ access -----------------------------------*/
320 SizeT
CSMStatisticsForegroundBase::getBinSize(ConstFieldMaskArg whichField
)
322 SizeT returnValue
= Inherited::getBinSize(whichField
);
324 if(FieldBits::NoField
!= (SizeFieldMask
& whichField
))
326 returnValue
+= _sfSize
.getBinSize();
328 if(FieldBits::NoField
!= (ColorFieldMask
& whichField
))
330 returnValue
+= _sfColor
.getBinSize();
332 if(FieldBits::NoField
!= (BgColorFieldMask
& whichField
))
334 returnValue
+= _sfBgColor
.getBinSize();
336 if(FieldBits::NoField
!= (ElementsFieldMask
& whichField
))
338 returnValue
+= _mfElements
.getBinSize();
344 void CSMStatisticsForegroundBase::copyToBin(BinaryDataHandler
&pMem
,
345 ConstFieldMaskArg whichField
)
347 Inherited::copyToBin(pMem
, whichField
);
349 if(FieldBits::NoField
!= (SizeFieldMask
& whichField
))
351 _sfSize
.copyToBin(pMem
);
353 if(FieldBits::NoField
!= (ColorFieldMask
& whichField
))
355 _sfColor
.copyToBin(pMem
);
357 if(FieldBits::NoField
!= (BgColorFieldMask
& whichField
))
359 _sfBgColor
.copyToBin(pMem
);
361 if(FieldBits::NoField
!= (ElementsFieldMask
& whichField
))
363 _mfElements
.copyToBin(pMem
);
367 void CSMStatisticsForegroundBase::copyFromBin(BinaryDataHandler
&pMem
,
368 ConstFieldMaskArg whichField
)
370 Inherited::copyFromBin(pMem
, whichField
);
372 if(FieldBits::NoField
!= (SizeFieldMask
& whichField
))
374 editSField(SizeFieldMask
);
375 _sfSize
.copyFromBin(pMem
);
377 if(FieldBits::NoField
!= (ColorFieldMask
& whichField
))
379 editSField(ColorFieldMask
);
380 _sfColor
.copyFromBin(pMem
);
382 if(FieldBits::NoField
!= (BgColorFieldMask
& whichField
))
384 editSField(BgColorFieldMask
);
385 _sfBgColor
.copyFromBin(pMem
);
387 if(FieldBits::NoField
!= (ElementsFieldMask
& whichField
))
389 editMField(ElementsFieldMask
, _mfElements
);
390 _mfElements
.copyFromBin(pMem
);
394 //! create a new instance of the class
395 CSMStatisticsForegroundTransitPtr
CSMStatisticsForegroundBase::createLocal(BitVector bFlags
)
397 CSMStatisticsForegroundTransitPtr fc
;
399 if(getClassType().getPrototype() != NULL
)
401 FieldContainerTransitPtr tmpPtr
=
402 getClassType().getPrototype()-> shallowCopyLocal(bFlags
);
404 fc
= dynamic_pointer_cast
<CSMStatisticsForeground
>(tmpPtr
);
410 //! create a new instance of the class, copy the container flags
411 CSMStatisticsForegroundTransitPtr
CSMStatisticsForegroundBase::createDependent(BitVector bFlags
)
413 CSMStatisticsForegroundTransitPtr fc
;
415 if(getClassType().getPrototype() != NULL
)
417 FieldContainerTransitPtr tmpPtr
=
418 getClassType().getPrototype()-> shallowCopyDependent(bFlags
);
420 fc
= dynamic_pointer_cast
<CSMStatisticsForeground
>(tmpPtr
);
426 //! create a new instance of the class
427 CSMStatisticsForegroundTransitPtr
CSMStatisticsForegroundBase::create(void)
429 return createLocal();
432 CSMStatisticsForeground
*CSMStatisticsForegroundBase::createEmptyLocal(BitVector bFlags
)
434 CSMStatisticsForeground
*returnValue
;
436 newPtr
<CSMStatisticsForeground
>(returnValue
, bFlags
);
438 returnValue
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
443 //! create an empty new instance of the class, do not copy the prototype
444 CSMStatisticsForeground
*CSMStatisticsForegroundBase::createEmpty(void)
446 return createEmptyLocal();
450 FieldContainerTransitPtr
CSMStatisticsForegroundBase::shallowCopyLocal(
451 BitVector bFlags
) const
453 CSMStatisticsForeground
*tmpPtr
;
455 newPtr(tmpPtr
, dynamic_cast<const CSMStatisticsForeground
*>(this), bFlags
);
457 FieldContainerTransitPtr
returnValue(tmpPtr
);
459 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
464 FieldContainerTransitPtr
CSMStatisticsForegroundBase::shallowCopyDependent(
465 BitVector bFlags
) const
467 CSMStatisticsForeground
*tmpPtr
;
469 newPtr(tmpPtr
, dynamic_cast<const CSMStatisticsForeground
*>(this), ~bFlags
);
471 FieldContainerTransitPtr
returnValue(tmpPtr
);
473 tmpPtr
->_pFieldFlags
->_bNamespaceMask
= bFlags
;
478 FieldContainerTransitPtr
CSMStatisticsForegroundBase::shallowCopy(void) const
480 return shallowCopyLocal();
486 /*------------------------- constructors ----------------------------------*/
488 CSMStatisticsForegroundBase::CSMStatisticsForegroundBase(void) :
490 _sfSize (UInt32(25)),
491 _sfColor (Color4f(0.0, 1.0, 0.0, 0.7)),
492 _sfBgColor (Color4f(0.0, 0.0, 0.0, 0.0)),
497 CSMStatisticsForegroundBase::CSMStatisticsForegroundBase(const CSMStatisticsForegroundBase
&source
) :
499 _sfSize (source
._sfSize
),
500 _sfColor (source
._sfColor
),
501 _sfBgColor (source
._sfBgColor
),
502 _mfElements (source
._mfElements
)
507 /*-------------------------- destructors ----------------------------------*/
509 CSMStatisticsForegroundBase::~CSMStatisticsForegroundBase(void)
514 GetFieldHandlePtr
CSMStatisticsForegroundBase::getHandleSize (void) const
516 SFUInt32::GetHandlePtr
returnValue(
517 new SFUInt32::GetHandle(
519 this->getType().getFieldDesc(SizeFieldId
),
520 const_cast<CSMStatisticsForegroundBase
*>(this)));
525 EditFieldHandlePtr
CSMStatisticsForegroundBase::editHandleSize (void)
527 SFUInt32::EditHandlePtr
returnValue(
528 new SFUInt32::EditHandle(
530 this->getType().getFieldDesc(SizeFieldId
),
534 editSField(SizeFieldMask
);
539 GetFieldHandlePtr
CSMStatisticsForegroundBase::getHandleColor (void) const
541 SFColor4f::GetHandlePtr
returnValue(
542 new SFColor4f::GetHandle(
544 this->getType().getFieldDesc(ColorFieldId
),
545 const_cast<CSMStatisticsForegroundBase
*>(this)));
550 EditFieldHandlePtr
CSMStatisticsForegroundBase::editHandleColor (void)
552 SFColor4f::EditHandlePtr
returnValue(
553 new SFColor4f::EditHandle(
555 this->getType().getFieldDesc(ColorFieldId
),
559 editSField(ColorFieldMask
);
564 GetFieldHandlePtr
CSMStatisticsForegroundBase::getHandleBgColor (void) const
566 SFColor4f::GetHandlePtr
returnValue(
567 new SFColor4f::GetHandle(
569 this->getType().getFieldDesc(BgColorFieldId
),
570 const_cast<CSMStatisticsForegroundBase
*>(this)));
575 EditFieldHandlePtr
CSMStatisticsForegroundBase::editHandleBgColor (void)
577 SFColor4f::EditHandlePtr
returnValue(
578 new SFColor4f::EditHandle(
580 this->getType().getFieldDesc(BgColorFieldId
),
584 editSField(BgColorFieldMask
);
589 GetFieldHandlePtr
CSMStatisticsForegroundBase::getHandleElements (void) const
591 MFString::GetHandlePtr
returnValue(
592 new MFString::GetHandle(
594 this->getType().getFieldDesc(ElementsFieldId
),
595 const_cast<CSMStatisticsForegroundBase
*>(this)));
600 EditFieldHandlePtr
CSMStatisticsForegroundBase::editHandleElements (void)
602 MFString::EditHandlePtr
returnValue(
603 new MFString::EditHandle(
605 this->getType().getFieldDesc(ElementsFieldId
),
609 editMField(ElementsFieldMask
, _mfElements
);
615 #ifdef OSG_MT_CPTR_ASPECT
616 void CSMStatisticsForegroundBase::execSyncV( FieldContainer
&oFrom
,
617 ConstFieldMaskArg whichField
,
618 AspectOffsetStore
&oOffsets
,
619 ConstFieldMaskArg syncMode
,
620 const UInt32 uiSyncInfo
)
622 CSMStatisticsForeground
*pThis
= static_cast<CSMStatisticsForeground
*>(this);
624 pThis
->execSync(static_cast<CSMStatisticsForeground
*>(&oFrom
),
633 #ifdef OSG_MT_CPTR_ASPECT
634 FieldContainer
*CSMStatisticsForegroundBase::createAspectCopy(
635 const FieldContainer
*pRefAspect
) const
637 CSMStatisticsForeground
*returnValue
;
639 newAspectCopy(returnValue
,
640 dynamic_cast<const CSMStatisticsForeground
*>(pRefAspect
),
641 dynamic_cast<const CSMStatisticsForeground
*>(this));
647 void CSMStatisticsForegroundBase::resolveLinks(void)
649 Inherited::resolveLinks();
651 #ifdef OSG_MT_CPTR_ASPECT
652 AspectOffsetStore oOffsets
;
654 _pAspectStore
->fillOffsetArray(oOffsets
, this);
657 #ifdef OSG_MT_CPTR_ASPECT
658 _mfElements
.terminateShare(Thread::getCurrentAspect(),