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 SkeletonSkinningAlgorithm!
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 "OSGSkeletonSkinningAlgorithmBase.h"
67 #include "OSGSkeletonSkinningAlgorithm.h"
69 #include <boost/bind.hpp>
73 /***************************************************************************\
75 \***************************************************************************/
77 /*! \class OSG::SkeletonSkinningAlgorithm
81 /***************************************************************************\
82 * Field Documentation *
83 \***************************************************************************/
85 /*! \var Pnt3f SkeletonSkinningAlgorithmBase::_mfDrawPositions
89 /*! \var UInt32 SkeletonSkinningAlgorithmBase::_mfDrawIndex
94 /***************************************************************************\
95 * FieldType/FieldTrait Instantiation *
96 \***************************************************************************/
98 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
99 PointerType FieldTraits
<SkeletonSkinningAlgorithm
*, nsOSG
>::_type(
100 "SkeletonSkinningAlgorithmPtr",
101 "SkinningAlgorithmPtr",
102 SkeletonSkinningAlgorithm::getClassType(),
106 OSG_FIELDTRAITS_GETTYPE_NS(SkeletonSkinningAlgorithm
*, nsOSG
)
108 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField
,
109 SkeletonSkinningAlgorithm
*,
112 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField
,
113 SkeletonSkinningAlgorithm
*,
116 /***************************************************************************\
117 * Field Description *
118 \***************************************************************************/
120 void SkeletonSkinningAlgorithmBase::classDescInserter(TypeObject
&oType
)
122 FieldDescriptionBase
*pDesc
= NULL
;
125 pDesc
= new MFPnt3f::Description(
126 MFPnt3f::getClassType(),
129 DrawPositionsFieldId
, DrawPositionsFieldMask
,
131 (Field::MFDefaultFlags
| Field::FStdAccess
),
132 static_cast<FieldEditMethodSig
>(&SkeletonSkinningAlgorithm::editHandleDrawPositions
),
133 static_cast<FieldGetMethodSig
>(&SkeletonSkinningAlgorithm::getHandleDrawPositions
));
135 oType
.addInitialDesc(pDesc
);
137 pDesc
= new MFUInt32::Description(
138 MFUInt32::getClassType(),
141 DrawIndexFieldId
, DrawIndexFieldMask
,
143 (Field::MFDefaultFlags
| Field::FStdAccess
),
144 static_cast<FieldEditMethodSig
>(&SkeletonSkinningAlgorithm::editHandleDrawIndex
),
145 static_cast<FieldGetMethodSig
>(&SkeletonSkinningAlgorithm::getHandleDrawIndex
));
147 oType
.addInitialDesc(pDesc
);
151 SkeletonSkinningAlgorithmBase::TypeObject
SkeletonSkinningAlgorithmBase::_type(
152 SkeletonSkinningAlgorithmBase::getClassname(),
153 Inherited::getClassname(),
156 reinterpret_cast<PrototypeCreateF
>(&SkeletonSkinningAlgorithmBase::createEmptyLocal
),
157 reinterpret_cast<InitContainerF
>(&SkeletonSkinningAlgorithm::initMethod
),
158 reinterpret_cast<ExitContainerF
>(&SkeletonSkinningAlgorithm::exitMethod
),
159 reinterpret_cast<InitalInsertDescFunc
>(
160 reinterpret_cast<void *>(&SkeletonSkinningAlgorithm::classDescInserter
)),
163 "<?xml version=\"1.0\"?>\n"
166 " name=\"SkeletonSkinningAlgorithm\"\n"
167 " parent=\"SkinningAlgorithm\"\n"
168 " library=\"Dynamics\"\n"
169 " pointerfieldtypes=\"both\"\n"
170 " structure=\"concrete\"\n"
171 " systemcomponent=\"true\"\n"
172 " parentsystemcomponent=\"true\"\n"
173 " decoratable=\"false\"\n"
174 " childFields=\"none\"\n"
175 " parentFields=\"none\"\n"
178 " name=\"drawPositions\"\n"
180 " category=\"data\"\n"
181 " cardinality=\"multi\"\n"
182 " visibility=\"internal\"\n"
183 " access=\"protected\"\n"
188 " name=\"drawIndex\"\n"
190 " category=\"data\"\n"
191 " cardinality=\"multi\"\n"
192 " visibility=\"internal\"\n"
193 " access=\"protected\"\n"
197 "</FieldContainer>\n",
201 /*------------------------------ get -----------------------------------*/
203 FieldContainerType
&SkeletonSkinningAlgorithmBase::getType(void)
208 const FieldContainerType
&SkeletonSkinningAlgorithmBase::getType(void) const
213 UInt32
SkeletonSkinningAlgorithmBase::getContainerSize(void) const
215 return sizeof(SkeletonSkinningAlgorithm
);
218 /*------------------------- decorator get ------------------------------*/
221 MFPnt3f
*SkeletonSkinningAlgorithmBase::editMFDrawPositions(void)
223 editMField(DrawPositionsFieldMask
, _mfDrawPositions
);
225 return &_mfDrawPositions
;
228 const MFPnt3f
*SkeletonSkinningAlgorithmBase::getMFDrawPositions(void) const
230 return &_mfDrawPositions
;
234 MFUInt32
*SkeletonSkinningAlgorithmBase::editMFDrawIndex(void)
236 editMField(DrawIndexFieldMask
, _mfDrawIndex
);
238 return &_mfDrawIndex
;
241 const MFUInt32
*SkeletonSkinningAlgorithmBase::getMFDrawIndex(void) const
243 return &_mfDrawIndex
;
251 /*------------------------------ access -----------------------------------*/
253 SizeT
SkeletonSkinningAlgorithmBase::getBinSize(ConstFieldMaskArg whichField
)
255 SizeT returnValue
= Inherited::getBinSize(whichField
);
257 if(FieldBits::NoField
!= (DrawPositionsFieldMask
& whichField
))
259 returnValue
+= _mfDrawPositions
.getBinSize();
261 if(FieldBits::NoField
!= (DrawIndexFieldMask
& whichField
))
263 returnValue
+= _mfDrawIndex
.getBinSize();
269 void SkeletonSkinningAlgorithmBase::copyToBin(BinaryDataHandler
&pMem
,
270 ConstFieldMaskArg whichField
)
272 Inherited::copyToBin(pMem
, whichField
);
274 if(FieldBits::NoField
!= (DrawPositionsFieldMask
& whichField
))
276 _mfDrawPositions
.copyToBin(pMem
);
278 if(FieldBits::NoField
!= (DrawIndexFieldMask
& whichField
))
280 _mfDrawIndex
.copyToBin(pMem
);
284 void SkeletonSkinningAlgorithmBase::copyFromBin(BinaryDataHandler
&pMem
,
285 ConstFieldMaskArg whichField
)
287 Inherited::copyFromBin(pMem
, whichField
);
289 if(FieldBits::NoField
!= (DrawPositionsFieldMask
& whichField
))
291 editMField(DrawPositionsFieldMask
, _mfDrawPositions
);
292 _mfDrawPositions
.copyFromBin(pMem
);
294 if(FieldBits::NoField
!= (DrawIndexFieldMask
& whichField
))
296 editMField(DrawIndexFieldMask
, _mfDrawIndex
);
297 _mfDrawIndex
.copyFromBin(pMem
);
301 //! create a new instance of the class
302 SkeletonSkinningAlgorithmTransitPtr
SkeletonSkinningAlgorithmBase::createLocal(BitVector bFlags
)
304 SkeletonSkinningAlgorithmTransitPtr fc
;
306 if(getClassType().getPrototype() != NULL
)
308 FieldContainerTransitPtr tmpPtr
=
309 getClassType().getPrototype()-> shallowCopyLocal(bFlags
);
311 fc
= dynamic_pointer_cast
<SkeletonSkinningAlgorithm
>(tmpPtr
);
317 //! create a new instance of the class, copy the container flags
318 SkeletonSkinningAlgorithmTransitPtr
SkeletonSkinningAlgorithmBase::createDependent(BitVector bFlags
)
320 SkeletonSkinningAlgorithmTransitPtr fc
;
322 if(getClassType().getPrototype() != NULL
)
324 FieldContainerTransitPtr tmpPtr
=
325 getClassType().getPrototype()-> shallowCopyDependent(bFlags
);
327 fc
= dynamic_pointer_cast
<SkeletonSkinningAlgorithm
>(tmpPtr
);
333 //! create a new instance of the class
334 SkeletonSkinningAlgorithmTransitPtr
SkeletonSkinningAlgorithmBase::create(void)
336 SkeletonSkinningAlgorithmTransitPtr fc
;
338 if(getClassType().getPrototype() != NULL
)
340 FieldContainerTransitPtr tmpPtr
=
341 getClassType().getPrototype()-> shallowCopy();
343 fc
= dynamic_pointer_cast
<SkeletonSkinningAlgorithm
>(tmpPtr
);
349 SkeletonSkinningAlgorithm
*SkeletonSkinningAlgorithmBase::createEmptyLocal(BitVector bFlags
)
351 SkeletonSkinningAlgorithm
*returnValue
;
353 newPtr
<SkeletonSkinningAlgorithm
>(returnValue
, bFlags
);
355 returnValue
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
360 //! create an empty new instance of the class, do not copy the prototype
361 SkeletonSkinningAlgorithm
*SkeletonSkinningAlgorithmBase::createEmpty(void)
363 SkeletonSkinningAlgorithm
*returnValue
;
365 newPtr
<SkeletonSkinningAlgorithm
>(returnValue
, Thread::getCurrentLocalFlags());
367 returnValue
->_pFieldFlags
->_bNamespaceMask
&=
368 ~Thread::getCurrentLocalFlags();
374 FieldContainerTransitPtr
SkeletonSkinningAlgorithmBase::shallowCopyLocal(
375 BitVector bFlags
) const
377 SkeletonSkinningAlgorithm
*tmpPtr
;
379 newPtr(tmpPtr
, dynamic_cast<const SkeletonSkinningAlgorithm
*>(this), bFlags
);
381 FieldContainerTransitPtr
returnValue(tmpPtr
);
383 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
388 FieldContainerTransitPtr
SkeletonSkinningAlgorithmBase::shallowCopyDependent(
389 BitVector bFlags
) const
391 SkeletonSkinningAlgorithm
*tmpPtr
;
393 newPtr(tmpPtr
, dynamic_cast<const SkeletonSkinningAlgorithm
*>(this), ~bFlags
);
395 FieldContainerTransitPtr
returnValue(tmpPtr
);
397 tmpPtr
->_pFieldFlags
->_bNamespaceMask
= bFlags
;
402 FieldContainerTransitPtr
SkeletonSkinningAlgorithmBase::shallowCopy(void) const
404 SkeletonSkinningAlgorithm
*tmpPtr
;
407 dynamic_cast<const SkeletonSkinningAlgorithm
*>(this),
408 Thread::getCurrentLocalFlags());
410 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~Thread::getCurrentLocalFlags();
412 FieldContainerTransitPtr
returnValue(tmpPtr
);
420 /*------------------------- constructors ----------------------------------*/
422 SkeletonSkinningAlgorithmBase::SkeletonSkinningAlgorithmBase(void) :
429 SkeletonSkinningAlgorithmBase::SkeletonSkinningAlgorithmBase(const SkeletonSkinningAlgorithmBase
&source
) :
431 _mfDrawPositions (source
._mfDrawPositions
),
432 _mfDrawIndex (source
._mfDrawIndex
)
437 /*-------------------------- destructors ----------------------------------*/
439 SkeletonSkinningAlgorithmBase::~SkeletonSkinningAlgorithmBase(void)
444 GetFieldHandlePtr
SkeletonSkinningAlgorithmBase::getHandleDrawPositions (void) const
446 MFPnt3f::GetHandlePtr
returnValue(
447 new MFPnt3f::GetHandle(
449 this->getType().getFieldDesc(DrawPositionsFieldId
),
450 const_cast<SkeletonSkinningAlgorithmBase
*>(this)));
455 EditFieldHandlePtr
SkeletonSkinningAlgorithmBase::editHandleDrawPositions (void)
457 MFPnt3f::EditHandlePtr
returnValue(
458 new MFPnt3f::EditHandle(
460 this->getType().getFieldDesc(DrawPositionsFieldId
),
464 editMField(DrawPositionsFieldMask
, _mfDrawPositions
);
469 GetFieldHandlePtr
SkeletonSkinningAlgorithmBase::getHandleDrawIndex (void) const
471 MFUInt32::GetHandlePtr
returnValue(
472 new MFUInt32::GetHandle(
474 this->getType().getFieldDesc(DrawIndexFieldId
),
475 const_cast<SkeletonSkinningAlgorithmBase
*>(this)));
480 EditFieldHandlePtr
SkeletonSkinningAlgorithmBase::editHandleDrawIndex (void)
482 MFUInt32::EditHandlePtr
returnValue(
483 new MFUInt32::EditHandle(
485 this->getType().getFieldDesc(DrawIndexFieldId
),
489 editMField(DrawIndexFieldMask
, _mfDrawIndex
);
495 #ifdef OSG_MT_CPTR_ASPECT
496 void SkeletonSkinningAlgorithmBase::execSyncV( FieldContainer
&oFrom
,
497 ConstFieldMaskArg whichField
,
498 AspectOffsetStore
&oOffsets
,
499 ConstFieldMaskArg syncMode
,
500 const UInt32 uiSyncInfo
)
502 SkeletonSkinningAlgorithm
*pThis
= static_cast<SkeletonSkinningAlgorithm
*>(this);
504 pThis
->execSync(static_cast<SkeletonSkinningAlgorithm
*>(&oFrom
),
513 #ifdef OSG_MT_CPTR_ASPECT
514 FieldContainer
*SkeletonSkinningAlgorithmBase::createAspectCopy(
515 const FieldContainer
*pRefAspect
) const
517 SkeletonSkinningAlgorithm
*returnValue
;
519 newAspectCopy(returnValue
,
520 dynamic_cast<const SkeletonSkinningAlgorithm
*>(pRefAspect
),
521 dynamic_cast<const SkeletonSkinningAlgorithm
*>(this));
527 void SkeletonSkinningAlgorithmBase::resolveLinks(void)
529 Inherited::resolveLinks();
531 #ifdef OSG_MT_CPTR_ASPECT
532 AspectOffsetStore oOffsets
;
534 _pAspectStore
->fillOffsetArray(oOffsets
, this);
537 #ifdef OSG_MT_CPTR_ASPECT
538 _mfDrawPositions
.terminateShare(Thread::getCurrentAspect(),
541 #ifdef OSG_MT_CPTR_ASPECT
542 _mfDrawIndex
.terminateShare(Thread::getCurrentAspect(),