changed: gcc8 base update
[opensg.git] / Source / System / Dynamics / Animation / OSGAnimationBase.cpp
blob627a15d833ffc3784c5680a6eb58f839971e98f7
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2000-2013 by the OpenSG Forum *
6 * *
7 * www.opensg.org *
8 * *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, carsten_neumann@gmx.net *
10 * *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
13 * License *
14 * *
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. *
18 * *
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. *
23 * *
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. *
27 * *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
30 * Changes *
31 * *
32 * *
33 * *
34 * *
35 * *
36 * *
37 \*---------------------------------------------------------------------------*/
39 /*****************************************************************************\
40 *****************************************************************************
41 ** **
42 ** This file is automatically generated. **
43 ** **
44 ** Any changes made to this file WILL be lost when it is **
45 ** regenerated, which can become necessary at any time. **
46 ** **
47 ** Do not change this file, changes should be done in the derived **
48 ** class Animation!
49 ** **
50 *****************************************************************************
51 \*****************************************************************************/
53 #include <cstdlib>
54 #include <cstdio>
56 #ifdef WIN32
57 #pragma warning(disable: 4355) // turn off 'this' : used in base member initializer list warning
58 #pragma warning(disable: 4290) // disable exception specification warning
59 #endif
61 #include "OSGConfig.h"
65 #include "OSGAnimTimeSensor.h" // TimeSensor Class
66 #include "OSGAnimTemplate.h" // Template Class
67 #include "OSGAnimChannel.h" // Channels Class
69 #include "OSGAnimationBase.h"
70 #include "OSGAnimation.h"
72 #include <boost/bind.hpp>
74 OSG_BEGIN_NAMESPACE
76 /***************************************************************************\
77 * Description *
78 \***************************************************************************/
80 /*! \class OSG::Animation
84 /***************************************************************************\
85 * Field Documentation *
86 \***************************************************************************/
88 /*! \var AnimTimeSensor * AnimationBase::_sfTimeSensor
92 /*! \var AnimTemplate * AnimationBase::_sfTemplate
96 /*! \var AnimChannel * AnimationBase::_mfChannels
100 /*! \var bool AnimationBase::_sfEnabled
104 /*! \var Real32 AnimationBase::_sfWeight
109 /***************************************************************************\
110 * FieldType/FieldTrait Instantiation *
111 \***************************************************************************/
113 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
114 PointerType FieldTraits<Animation *, nsOSG>::_type(
115 "AnimationPtr",
116 "AttachmentContainerPtr",
117 Animation::getClassType(),
118 nsOSG);
119 #endif
121 OSG_FIELDTRAITS_GETTYPE_NS(Animation *, nsOSG)
123 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField,
124 Animation *,
125 nsOSG)
127 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField,
128 Animation *,
129 nsOSG)
131 DataType &FieldTraits<Animation *, nsOSG + 1 >::getType(void)
133 return FieldTraits<Animation *, nsOSG>::getType();
137 OSG_SFIELDTYPE_INST(ParentPointerSField,
138 Animation *,
139 NoRefCountPolicy,
140 nsOSG + 1);
142 OSG_FIELD_DLLEXPORT_DEF3(ParentPointerSField,
143 Animation *,
144 NoRefCountPolicy,
145 nsOSG + 1)
148 OSG_MFIELDTYPE_INST(ParentPointerMField,
149 Animation *,
150 NoRefCountPolicy,
153 OSG_FIELD_DLLEXPORT_DEF3(ParentPointerMField,
154 Animation *,
155 NoRefCountPolicy,
159 /***************************************************************************\
160 * Field Description *
161 \***************************************************************************/
163 void AnimationBase::classDescInserter(TypeObject &oType)
165 FieldDescriptionBase *pDesc = NULL;
168 pDesc = new SFUnrecAnimTimeSensorPtr::Description(
169 SFUnrecAnimTimeSensorPtr::getClassType(),
170 "timeSensor",
172 TimeSensorFieldId, TimeSensorFieldMask,
173 false,
174 (Field::FStdAccess | Field::FClusterLocal),
175 static_cast<FieldEditMethodSig>(&Animation::editHandleTimeSensor),
176 static_cast<FieldGetMethodSig >(&Animation::getHandleTimeSensor));
178 oType.addInitialDesc(pDesc);
180 pDesc = new SFUnrecAnimTemplatePtr::Description(
181 SFUnrecAnimTemplatePtr::getClassType(),
182 "template",
184 TemplateFieldId, TemplateFieldMask,
185 false,
186 (Field::FStdAccess | Field::FClusterLocal),
187 static_cast<FieldEditMethodSig>(&Animation::editHandleTemplate),
188 static_cast<FieldGetMethodSig >(&Animation::getHandleTemplate));
190 oType.addInitialDesc(pDesc);
192 pDesc = new MFUnrecChildAnimChannelPtr::Description(
193 MFUnrecChildAnimChannelPtr::getClassType(),
194 "channels",
196 ChannelsFieldId, ChannelsFieldMask,
197 false,
198 (Field::FStdAccess | Field::FClusterLocal),
199 static_cast<FieldEditMethodSig>(&Animation::editHandleChannels),
200 static_cast<FieldGetMethodSig >(&Animation::getHandleChannels));
202 oType.addInitialDesc(pDesc);
204 pDesc = new SFBool::Description(
205 SFBool::getClassType(),
206 "enabled",
208 EnabledFieldId, EnabledFieldMask,
209 false,
210 (Field::FClusterLocal),
211 static_cast<FieldEditMethodSig>(&Animation::editHandleEnabled),
212 static_cast<FieldGetMethodSig >(&Animation::getHandleEnabled));
214 oType.addInitialDesc(pDesc);
216 pDesc = new SFReal32::Description(
217 SFReal32::getClassType(),
218 "weight",
220 WeightFieldId, WeightFieldMask,
221 false,
222 (Field::FClusterLocal),
223 static_cast<FieldEditMethodSig>(&Animation::editHandleWeight),
224 static_cast<FieldGetMethodSig >(&Animation::getHandleWeight));
226 oType.addInitialDesc(pDesc);
230 AnimationBase::TypeObject AnimationBase::_type(
231 AnimationBase::getClassname(),
232 Inherited::getClassname(),
233 "NULL",
234 nsOSG, //Namespace
235 reinterpret_cast<PrototypeCreateF>(&AnimationBase::createEmptyLocal),
236 reinterpret_cast<InitContainerF>(&Animation::initMethod),
237 reinterpret_cast<ExitContainerF>(&Animation::exitMethod),
238 reinterpret_cast<InitalInsertDescFunc>(
239 reinterpret_cast<void *>(&Animation::classDescInserter)),
240 false,
242 "<?xml version=\"1.0\"?>\n"
243 "\n"
244 "<FieldContainer\n"
245 " name=\"Animation\"\n"
246 " parent=\"AttachmentContainer\"\n"
247 " library=\"Dynamics\"\n"
248 " pointerfieldtypes=\"both\"\n"
249 " structure=\"concrete\"\n"
250 " systemcomponent=\"true\"\n"
251 " parentsystemcomponent=\"true\"\n"
252 " decoratable=\"false\"\n"
253 " useLocalIncludes=\"false\"\n"
254 " isNodeCore=\"true\"\n"
255 " isBundle=\"false\"\n"
256 " parentFields=\"both\"\n"
257 " >\n"
258 " <Field\n"
259 " name=\"timeSensor\"\n"
260 " category=\"pointer\"\n"
261 " type=\"AnimTimeSensor\"\n"
262 " cardinality=\"single\"\n"
263 " visibility=\"external\"\n"
264 " access=\"protected\"\n"
265 " fieldFlags=\"FStdAccess, FClusterLocal\"\n"
266 " >\n"
267 " </Field>\n"
268 " <Field\n"
269 " name=\"template\"\n"
270 " category=\"pointer\"\n"
271 " type=\"AnimTemplate\"\n"
272 " cardinality=\"single\"\n"
273 " visibility=\"external\"\n"
274 " access=\"public\"\n"
275 " fieldFlags=\"FStdAccess, FClusterLocal\"\n"
276 " >\n"
277 " </Field>\n"
278 " <Field\n"
279 " name=\"channels\"\n"
280 " category=\"childpointer\"\n"
281 " linkParentField=\"Animation\"\n"
282 " type=\"AnimChannel\"\n"
283 " cardinality=\"multi\"\n"
284 " visibility=\"external\"\n"
285 " access=\"public\"\n"
286 " fieldFlags=\"FStdAccess, FClusterLocal\"\n"
287 " >\n"
288 " </Field>\n"
289 " <Field\n"
290 " name=\"enabled\"\n"
291 " type=\"bool\"\n"
292 " category=\"data\"\n"
293 " cardinality=\"single\"\n"
294 " visibility=\"external\"\n"
295 " access=\"public\"\n"
296 " defaultValue=\"false\"\n"
297 " fieldFlags=\"FClusterLocal\"\n"
298 " >\n"
299 " </Field>\n"
300 " <Field\n"
301 " name=\"weight\"\n"
302 " category=\"data\"\n"
303 " type=\"Real32\"\n"
304 " cardinality=\"single\"\n"
305 " visibility=\"external\"\n"
306 " access=\"public\"\n"
307 " defaultValue=\"1.f\"\n"
308 " fieldFlags=\"FClusterLocal\"\n"
309 " >\n"
310 " </Field>\n"
311 "</FieldContainer>\n",
315 /*------------------------------ get -----------------------------------*/
317 FieldContainerType &AnimationBase::getType(void)
319 return _type;
322 const FieldContainerType &AnimationBase::getType(void) const
324 return _type;
327 UInt32 AnimationBase::getContainerSize(void) const
329 return sizeof(Animation);
332 /*------------------------- decorator get ------------------------------*/
335 //! Get the Animation::_sfTimeSensor field.
336 const SFUnrecAnimTimeSensorPtr *AnimationBase::getSFTimeSensor(void) const
338 return &_sfTimeSensor;
341 SFUnrecAnimTimeSensorPtr *AnimationBase::editSFTimeSensor (void)
343 editSField(TimeSensorFieldMask);
345 return &_sfTimeSensor;
348 //! Get the value of the Animation::_sfTimeSensor field.
349 AnimTimeSensor * AnimationBase::getTimeSensor(void) const
351 return _sfTimeSensor.getValue();
354 //! Set the value of the Animation::_sfTimeSensor field.
355 void AnimationBase::setTimeSensor(AnimTimeSensor * const value)
357 editSField(TimeSensorFieldMask);
359 _sfTimeSensor.setValue(value);
363 //! Get the Animation::_sfTemplate field.
364 const SFUnrecAnimTemplatePtr *AnimationBase::getSFTemplate(void) const
366 return &_sfTemplate;
369 SFUnrecAnimTemplatePtr *AnimationBase::editSFTemplate (void)
371 editSField(TemplateFieldMask);
373 return &_sfTemplate;
376 //! Get the value of the Animation::_sfTemplate field.
377 AnimTemplate * AnimationBase::getTemplate(void) const
379 return _sfTemplate.getValue();
382 //! Set the value of the Animation::_sfTemplate field.
383 void AnimationBase::setTemplate(AnimTemplate * const value)
385 editSField(TemplateFieldMask);
387 _sfTemplate.setValue(value);
391 //! Get the Animation::_mfChannels field.
392 const MFUnrecChildAnimChannelPtr *AnimationBase::getMFChannels(void) const
394 return &_mfChannels;
397 MFUnrecChildAnimChannelPtr *AnimationBase::editMFChannels (void)
399 editMField(ChannelsFieldMask, _mfChannels);
401 return &_mfChannels;
403 AnimChannel * AnimationBase::getChannels(const UInt32 index) const
405 return _mfChannels[index];
408 SFBool *AnimationBase::editSFEnabled(void)
410 editSField(EnabledFieldMask);
412 return &_sfEnabled;
415 const SFBool *AnimationBase::getSFEnabled(void) const
417 return &_sfEnabled;
421 SFReal32 *AnimationBase::editSFWeight(void)
423 editSField(WeightFieldMask);
425 return &_sfWeight;
428 const SFReal32 *AnimationBase::getSFWeight(void) const
430 return &_sfWeight;
436 void AnimationBase::pushToChannels(AnimChannel * const value)
438 editMField(ChannelsFieldMask, _mfChannels);
440 _mfChannels.push_back(value);
443 void AnimationBase::assignChannels (const MFUnrecChildAnimChannelPtr &value)
445 MFUnrecChildAnimChannelPtr::const_iterator elemIt =
446 value.begin();
447 MFUnrecChildAnimChannelPtr::const_iterator elemEnd =
448 value.end ();
450 static_cast<Animation *>(this)->clearChannels();
452 while(elemIt != elemEnd)
454 this->pushToChannels(*elemIt);
456 ++elemIt;
460 void AnimationBase::removeFromChannels(UInt32 uiIndex)
462 if(uiIndex < _mfChannels.size())
464 editMField(ChannelsFieldMask, _mfChannels);
466 _mfChannels.erase(uiIndex);
470 void AnimationBase::removeObjFromChannels(AnimChannel * const value)
472 Int32 iElemIdx = _mfChannels.findIndex(value);
474 if(iElemIdx != -1)
476 editMField(ChannelsFieldMask, _mfChannels);
478 _mfChannels.erase(iElemIdx);
481 void AnimationBase::clearChannels(void)
483 editMField(ChannelsFieldMask, _mfChannels);
486 _mfChannels.clear();
491 /*------------------------------ access -----------------------------------*/
493 SizeT AnimationBase::getBinSize(ConstFieldMaskArg whichField)
495 SizeT returnValue = Inherited::getBinSize(whichField);
497 if(FieldBits::NoField != (TimeSensorFieldMask & whichField))
499 returnValue += _sfTimeSensor.getBinSize();
501 if(FieldBits::NoField != (TemplateFieldMask & whichField))
503 returnValue += _sfTemplate.getBinSize();
505 if(FieldBits::NoField != (ChannelsFieldMask & whichField))
507 returnValue += _mfChannels.getBinSize();
509 if(FieldBits::NoField != (EnabledFieldMask & whichField))
511 returnValue += _sfEnabled.getBinSize();
513 if(FieldBits::NoField != (WeightFieldMask & whichField))
515 returnValue += _sfWeight.getBinSize();
518 return returnValue;
521 void AnimationBase::copyToBin(BinaryDataHandler &pMem,
522 ConstFieldMaskArg whichField)
524 Inherited::copyToBin(pMem, whichField);
526 if(FieldBits::NoField != (TimeSensorFieldMask & whichField))
528 _sfTimeSensor.copyToBin(pMem);
530 if(FieldBits::NoField != (TemplateFieldMask & whichField))
532 _sfTemplate.copyToBin(pMem);
534 if(FieldBits::NoField != (ChannelsFieldMask & whichField))
536 _mfChannels.copyToBin(pMem);
538 if(FieldBits::NoField != (EnabledFieldMask & whichField))
540 _sfEnabled.copyToBin(pMem);
542 if(FieldBits::NoField != (WeightFieldMask & whichField))
544 _sfWeight.copyToBin(pMem);
548 void AnimationBase::copyFromBin(BinaryDataHandler &pMem,
549 ConstFieldMaskArg whichField)
551 Inherited::copyFromBin(pMem, whichField);
553 if(FieldBits::NoField != (TimeSensorFieldMask & whichField))
555 editSField(TimeSensorFieldMask);
556 _sfTimeSensor.copyFromBin(pMem);
558 if(FieldBits::NoField != (TemplateFieldMask & whichField))
560 editSField(TemplateFieldMask);
561 _sfTemplate.copyFromBin(pMem);
563 if(FieldBits::NoField != (ChannelsFieldMask & whichField))
565 editMField(ChannelsFieldMask, _mfChannels);
566 _mfChannels.copyFromBin(pMem);
568 if(FieldBits::NoField != (EnabledFieldMask & whichField))
570 editSField(EnabledFieldMask);
571 _sfEnabled.copyFromBin(pMem);
573 if(FieldBits::NoField != (WeightFieldMask & whichField))
575 editSField(WeightFieldMask);
576 _sfWeight.copyFromBin(pMem);
580 //! create a new instance of the class
581 AnimationTransitPtr AnimationBase::createLocal(BitVector bFlags)
583 AnimationTransitPtr fc;
585 if(getClassType().getPrototype() != NULL)
587 FieldContainerTransitPtr tmpPtr =
588 getClassType().getPrototype()-> shallowCopyLocal(bFlags);
590 fc = dynamic_pointer_cast<Animation>(tmpPtr);
593 return fc;
596 //! create a new instance of the class, copy the container flags
597 AnimationTransitPtr AnimationBase::createDependent(BitVector bFlags)
599 AnimationTransitPtr fc;
601 if(getClassType().getPrototype() != NULL)
603 FieldContainerTransitPtr tmpPtr =
604 getClassType().getPrototype()-> shallowCopyDependent(bFlags);
606 fc = dynamic_pointer_cast<Animation>(tmpPtr);
609 return fc;
612 //! create a new instance of the class
613 AnimationTransitPtr AnimationBase::create(void)
615 AnimationTransitPtr fc;
617 if(getClassType().getPrototype() != NULL)
619 FieldContainerTransitPtr tmpPtr =
620 getClassType().getPrototype()-> shallowCopy();
622 fc = dynamic_pointer_cast<Animation>(tmpPtr);
625 return fc;
628 Animation *AnimationBase::createEmptyLocal(BitVector bFlags)
630 Animation *returnValue;
632 newPtr<Animation>(returnValue, bFlags);
634 returnValue->_pFieldFlags->_bNamespaceMask &= ~bFlags;
636 return returnValue;
639 //! create an empty new instance of the class, do not copy the prototype
640 Animation *AnimationBase::createEmpty(void)
642 Animation *returnValue;
644 newPtr<Animation>(returnValue, Thread::getCurrentLocalFlags());
646 returnValue->_pFieldFlags->_bNamespaceMask &=
647 ~Thread::getCurrentLocalFlags();
649 return returnValue;
653 FieldContainerTransitPtr AnimationBase::shallowCopyLocal(
654 BitVector bFlags) const
656 Animation *tmpPtr;
658 newPtr(tmpPtr, dynamic_cast<const Animation *>(this), bFlags);
660 FieldContainerTransitPtr returnValue(tmpPtr);
662 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~bFlags;
664 return returnValue;
667 FieldContainerTransitPtr AnimationBase::shallowCopyDependent(
668 BitVector bFlags) const
670 Animation *tmpPtr;
672 newPtr(tmpPtr, dynamic_cast<const Animation *>(this), ~bFlags);
674 FieldContainerTransitPtr returnValue(tmpPtr);
676 tmpPtr->_pFieldFlags->_bNamespaceMask = bFlags;
678 return returnValue;
681 FieldContainerTransitPtr AnimationBase::shallowCopy(void) const
683 Animation *tmpPtr;
685 newPtr(tmpPtr,
686 dynamic_cast<const Animation *>(this),
687 Thread::getCurrentLocalFlags());
689 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~Thread::getCurrentLocalFlags();
691 FieldContainerTransitPtr returnValue(tmpPtr);
693 return returnValue;
699 /*------------------------- constructors ----------------------------------*/
701 AnimationBase::AnimationBase(void) :
702 Inherited(),
703 _sfTimeSensor (NULL),
704 _sfTemplate (NULL),
705 _mfChannels (this,
706 ChannelsFieldId,
707 AnimChannel::AnimationFieldId),
708 _sfEnabled (bool(false)),
709 _sfWeight (Real32(1.f))
713 AnimationBase::AnimationBase(const AnimationBase &source) :
714 Inherited(source),
715 _sfTimeSensor (NULL),
716 _sfTemplate (NULL),
717 _mfChannels (this,
718 ChannelsFieldId,
719 AnimChannel::AnimationFieldId),
720 _sfEnabled (source._sfEnabled ),
721 _sfWeight (source._sfWeight )
726 /*-------------------------- destructors ----------------------------------*/
728 AnimationBase::~AnimationBase(void)
732 /*-------------------------------------------------------------------------*/
733 /* Child linking */
735 bool AnimationBase::unlinkChild(
736 FieldContainer * const pChild,
737 UInt16 const childFieldId)
739 if(childFieldId == ChannelsFieldId)
741 AnimChannel * pTypedChild =
742 dynamic_cast<AnimChannel *>(pChild);
744 if(pTypedChild != NULL)
746 Int32 iChildIdx = _mfChannels.findIndex(pTypedChild);
748 if(iChildIdx != -1)
750 editMField(ChannelsFieldMask, _mfChannels);
752 _mfChannels.erase(iChildIdx);
754 return true;
757 SWARNING << "Parent ([" << this
758 << "] id [" << this->getId()
759 << "] type [" << this->getType().getCName()
760 << "] childFieldId [" << childFieldId
761 << "]) - Child ([" << pChild
762 << "] id [" << pChild->getId()
763 << "] type [" << pChild->getType().getCName()
764 << "]): link inconsistent!"
765 << std::endl;
767 return false;
770 return false;
774 return Inherited::unlinkChild(pChild, childFieldId);
777 void AnimationBase::onCreate(const Animation *source)
779 Inherited::onCreate(source);
781 if(source != NULL)
783 Animation *pThis = static_cast<Animation *>(this);
785 pThis->setTimeSensor(source->getTimeSensor());
787 pThis->setTemplate(source->getTemplate());
789 MFUnrecChildAnimChannelPtr::const_iterator ChannelsIt =
790 source->_mfChannels.begin();
791 MFUnrecChildAnimChannelPtr::const_iterator ChannelsEnd =
792 source->_mfChannels.end ();
794 while(ChannelsIt != ChannelsEnd)
796 pThis->pushToChannels(*ChannelsIt);
798 ++ChannelsIt;
803 GetFieldHandlePtr AnimationBase::getHandleTimeSensor (void) const
805 SFUnrecAnimTimeSensorPtr::GetHandlePtr returnValue(
806 new SFUnrecAnimTimeSensorPtr::GetHandle(
807 &_sfTimeSensor,
808 this->getType().getFieldDesc(TimeSensorFieldId),
809 const_cast<AnimationBase *>(this)));
811 return returnValue;
814 EditFieldHandlePtr AnimationBase::editHandleTimeSensor (void)
816 SFUnrecAnimTimeSensorPtr::EditHandlePtr returnValue(
817 new SFUnrecAnimTimeSensorPtr::EditHandle(
818 &_sfTimeSensor,
819 this->getType().getFieldDesc(TimeSensorFieldId),
820 this));
822 returnValue->setSetMethod(
823 boost::bind(&Animation::setTimeSensor,
824 static_cast<Animation *>(this), _1));
826 editSField(TimeSensorFieldMask);
828 return returnValue;
831 GetFieldHandlePtr AnimationBase::getHandleTemplate (void) const
833 SFUnrecAnimTemplatePtr::GetHandlePtr returnValue(
834 new SFUnrecAnimTemplatePtr::GetHandle(
835 &_sfTemplate,
836 this->getType().getFieldDesc(TemplateFieldId),
837 const_cast<AnimationBase *>(this)));
839 return returnValue;
842 EditFieldHandlePtr AnimationBase::editHandleTemplate (void)
844 SFUnrecAnimTemplatePtr::EditHandlePtr returnValue(
845 new SFUnrecAnimTemplatePtr::EditHandle(
846 &_sfTemplate,
847 this->getType().getFieldDesc(TemplateFieldId),
848 this));
850 returnValue->setSetMethod(
851 boost::bind(&Animation::setTemplate,
852 static_cast<Animation *>(this), _1));
854 editSField(TemplateFieldMask);
856 return returnValue;
859 GetFieldHandlePtr AnimationBase::getHandleChannels (void) const
861 MFUnrecChildAnimChannelPtr::GetHandlePtr returnValue(
862 new MFUnrecChildAnimChannelPtr::GetHandle(
863 &_mfChannels,
864 this->getType().getFieldDesc(ChannelsFieldId),
865 const_cast<AnimationBase *>(this)));
867 return returnValue;
870 EditFieldHandlePtr AnimationBase::editHandleChannels (void)
872 MFUnrecChildAnimChannelPtr::EditHandlePtr returnValue(
873 new MFUnrecChildAnimChannelPtr::EditHandle(
874 &_mfChannels,
875 this->getType().getFieldDesc(ChannelsFieldId),
876 this));
878 returnValue->setAddMethod(
879 boost::bind(&Animation::pushToChannels,
880 static_cast<Animation *>(this), _1));
881 returnValue->setRemoveMethod(
882 boost::bind(&Animation::removeFromChannels,
883 static_cast<Animation *>(this), _1));
884 returnValue->setRemoveObjMethod(
885 boost::bind(&Animation::removeObjFromChannels,
886 static_cast<Animation *>(this), _1));
887 returnValue->setClearMethod(
888 boost::bind(&Animation::clearChannels,
889 static_cast<Animation *>(this)));
891 editMField(ChannelsFieldMask, _mfChannels);
893 return returnValue;
896 GetFieldHandlePtr AnimationBase::getHandleEnabled (void) const
898 SFBool::GetHandlePtr returnValue(
899 new SFBool::GetHandle(
900 &_sfEnabled,
901 this->getType().getFieldDesc(EnabledFieldId),
902 const_cast<AnimationBase *>(this)));
904 return returnValue;
907 EditFieldHandlePtr AnimationBase::editHandleEnabled (void)
909 SFBool::EditHandlePtr returnValue(
910 new SFBool::EditHandle(
911 &_sfEnabled,
912 this->getType().getFieldDesc(EnabledFieldId),
913 this));
916 editSField(EnabledFieldMask);
918 return returnValue;
921 GetFieldHandlePtr AnimationBase::getHandleWeight (void) const
923 SFReal32::GetHandlePtr returnValue(
924 new SFReal32::GetHandle(
925 &_sfWeight,
926 this->getType().getFieldDesc(WeightFieldId),
927 const_cast<AnimationBase *>(this)));
929 return returnValue;
932 EditFieldHandlePtr AnimationBase::editHandleWeight (void)
934 SFReal32::EditHandlePtr returnValue(
935 new SFReal32::EditHandle(
936 &_sfWeight,
937 this->getType().getFieldDesc(WeightFieldId),
938 this));
941 editSField(WeightFieldMask);
943 return returnValue;
947 #ifdef OSG_MT_CPTR_ASPECT
948 void AnimationBase::execSyncV( FieldContainer &oFrom,
949 ConstFieldMaskArg whichField,
950 AspectOffsetStore &oOffsets,
951 ConstFieldMaskArg syncMode,
952 const UInt32 uiSyncInfo)
954 Animation *pThis = static_cast<Animation *>(this);
956 pThis->execSync(static_cast<Animation *>(&oFrom),
957 whichField,
958 oOffsets,
959 syncMode,
960 uiSyncInfo);
962 #endif
965 #ifdef OSG_MT_CPTR_ASPECT
966 FieldContainer *AnimationBase::createAspectCopy(
967 const FieldContainer *pRefAspect) const
969 Animation *returnValue;
971 newAspectCopy(returnValue,
972 dynamic_cast<const Animation *>(pRefAspect),
973 dynamic_cast<const Animation *>(this));
975 return returnValue;
977 #endif
979 void AnimationBase::resolveLinks(void)
981 Inherited::resolveLinks();
983 static_cast<Animation *>(this)->setTimeSensor(NULL);
985 static_cast<Animation *>(this)->setTemplate(NULL);
987 static_cast<Animation *>(this)->clearChannels();
993 OSG_END_NAMESPACE