changed: gcc8 base update
[opensg.git] / Source / System / Dynamics / Skeleton / OSGCPUSkinningDataAttachmentBase.cpp
blob0d56bdb77e7c33997e4c307c8fce036e3155a31d
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 CPUSkinningDataAttachment!
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 "OSGGeoVectorProperty.h" // Properties Class
67 #include "OSGCPUSkinningDataAttachmentBase.h"
68 #include "OSGCPUSkinningDataAttachment.h"
70 #include <boost/bind.hpp>
72 OSG_BEGIN_NAMESPACE
74 /***************************************************************************\
75 * Description *
76 \***************************************************************************/
78 /*! \class OSG::CPUSkinningDataAttachment
82 /***************************************************************************\
83 * Field Documentation *
84 \***************************************************************************/
86 /*! \var GeoVectorProperty * CPUSkinningDataAttachmentBase::_mfProperties
90 /*! \var Matrix CPUSkinningDataAttachmentBase::_mfJointMatrices
94 /*! \var Matrix CPUSkinningDataAttachmentBase::_mfJointNormalMatrices
98 /*! \var bool CPUSkinningDataAttachmentBase::_sfDataValid
103 /***************************************************************************\
104 * FieldType/FieldTrait Instantiation *
105 \***************************************************************************/
107 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
108 PointerType FieldTraits<CPUSkinningDataAttachment *, nsOSG>::_type(
109 "CPUSkinningDataAttachmentPtr",
110 "AttachmentPtr",
111 CPUSkinningDataAttachment::getClassType(),
112 nsOSG);
113 #endif
115 OSG_FIELDTRAITS_GETTYPE_NS(CPUSkinningDataAttachment *, nsOSG)
117 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField,
118 CPUSkinningDataAttachment *,
119 nsOSG)
121 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField,
122 CPUSkinningDataAttachment *,
123 nsOSG)
125 /***************************************************************************\
126 * Field Description *
127 \***************************************************************************/
129 void CPUSkinningDataAttachmentBase::classDescInserter(TypeObject &oType)
131 FieldDescriptionBase *pDesc = NULL;
134 pDesc = new MFUnrecChildGeoVectorPropertyPtr::Description(
135 MFUnrecChildGeoVectorPropertyPtr::getClassType(),
136 "properties",
138 PropertiesFieldId, PropertiesFieldMask,
139 true,
140 (Field::MFDefaultFlags | Field::FStdAccess),
141 static_cast<FieldEditMethodSig>(&CPUSkinningDataAttachment::editHandleProperties),
142 static_cast<FieldGetMethodSig >(&CPUSkinningDataAttachment::getHandleProperties));
144 oType.addInitialDesc(pDesc);
146 pDesc = new MFMatrix::Description(
147 MFMatrix::getClassType(),
148 "jointMatrices",
150 JointMatricesFieldId, JointMatricesFieldMask,
151 true,
152 (Field::MFDefaultFlags | Field::FStdAccess),
153 static_cast<FieldEditMethodSig>(&CPUSkinningDataAttachment::editHandleJointMatrices),
154 static_cast<FieldGetMethodSig >(&CPUSkinningDataAttachment::getHandleJointMatrices));
156 oType.addInitialDesc(pDesc);
158 pDesc = new MFMatrix::Description(
159 MFMatrix::getClassType(),
160 "jointNormalMatrices",
162 JointNormalMatricesFieldId, JointNormalMatricesFieldMask,
163 true,
164 (Field::MFDefaultFlags | Field::FStdAccess),
165 static_cast<FieldEditMethodSig>(&CPUSkinningDataAttachment::editHandleJointNormalMatrices),
166 static_cast<FieldGetMethodSig >(&CPUSkinningDataAttachment::getHandleJointNormalMatrices));
168 oType.addInitialDesc(pDesc);
170 pDesc = new SFBool::Description(
171 SFBool::getClassType(),
172 "dataValid",
174 DataValidFieldId, DataValidFieldMask,
175 false,
176 (Field::SFDefaultFlags | Field::FStdAccess),
177 static_cast<FieldEditMethodSig>(&CPUSkinningDataAttachment::editHandleDataValid),
178 static_cast<FieldGetMethodSig >(&CPUSkinningDataAttachment::getHandleDataValid));
180 oType.addInitialDesc(pDesc);
184 CPUSkinningDataAttachmentBase::TypeObject CPUSkinningDataAttachmentBase::_type(
185 CPUSkinningDataAttachmentBase::getClassname(),
186 Inherited::getClassname(),
187 "CPUSkinningDataAttachment",
188 nsOSG, //Namespace
189 reinterpret_cast<PrototypeCreateF>(&CPUSkinningDataAttachmentBase::createEmptyLocal),
190 reinterpret_cast<InitContainerF>(&CPUSkinningDataAttachment::initMethod),
191 reinterpret_cast<ExitContainerF>(&CPUSkinningDataAttachment::exitMethod),
192 reinterpret_cast<InitalInsertDescFunc>(
193 reinterpret_cast<void *>(&CPUSkinningDataAttachment::classDescInserter)),
194 false,
196 "<?xml version=\"1.0\"?>\n"
197 "\n"
198 "<FieldContainer\n"
199 " name=\"CPUSkinningDataAttachment\"\n"
200 " parent=\"Attachment\"\n"
201 " library=\"Dynamics\"\n"
202 " pointerfieldtypes=\"both\"\n"
203 " structure=\"concrete\"\n"
204 " systemcomponent=\"true\"\n"
205 " parentsystemcomponent=\"true\"\n"
206 " decoratable=\"false\"\n"
207 " childFields=\"none\"\n"
208 " parentFields=\"none\"\n"
209 " >\n"
210 " <Field\n"
211 " name=\"properties\"\n"
212 " type=\"GeoVectorProperty\"\n"
213 " category=\"childpointer\"\n"
214 " cardinality=\"multi\"\n"
215 " visibility=\"internal\"\n"
216 " access=\"public\"\n"
217 " childParentType=\"FieldContainer\"\n"
218 " linkParentField=\"Parents\"\n"
219 " >\n"
220 " </Field>\n"
221 "\n"
222 " <Field\n"
223 " name=\"jointMatrices\"\n"
224 " type=\"Matrix\"\n"
225 " category=\"data\"\n"
226 " cardinality=\"multi\"\n"
227 " visibility=\"internal\"\n"
228 " access=\"public\"\n"
229 " >\n"
230 " </Field>\n"
231 "\n"
232 " <Field\n"
233 " name=\"jointNormalMatrices\"\n"
234 " type=\"Matrix\"\n"
235 " category=\"data\"\n"
236 " cardinality=\"multi\"\n"
237 " visibility=\"internal\"\n"
238 " access=\"public\"\n"
239 " >\n"
240 " </Field>\n"
241 "\n"
242 " <Field\n"
243 " name=\"dataValid\"\n"
244 " type=\"bool\"\n"
245 " category=\"data\"\n"
246 " cardinality=\"single\"\n"
247 " visibility=\"external\"\n"
248 " access=\"public\"\n"
249 " defaultValue=\"false\"\n"
250 " >\n"
251 " </Field>\n"
252 "\n"
253 "</FieldContainer>\n",
257 /*------------------------------ get -----------------------------------*/
259 FieldContainerType &CPUSkinningDataAttachmentBase::getType(void)
261 return _type;
264 const FieldContainerType &CPUSkinningDataAttachmentBase::getType(void) const
266 return _type;
269 UInt32 CPUSkinningDataAttachmentBase::getContainerSize(void) const
271 return sizeof(CPUSkinningDataAttachment);
274 /*------------------------- decorator get ------------------------------*/
277 //! Get the CPUSkinningDataAttachment::_mfProperties field.
278 const MFUnrecChildGeoVectorPropertyPtr *CPUSkinningDataAttachmentBase::getMFProperties(void) const
280 return &_mfProperties;
283 MFUnrecChildGeoVectorPropertyPtr *CPUSkinningDataAttachmentBase::editMFProperties (void)
285 editMField(PropertiesFieldMask, _mfProperties);
287 return &_mfProperties;
289 GeoVectorProperty * CPUSkinningDataAttachmentBase::getProperties(const UInt32 index) const
291 return _mfProperties[index];
294 MFMatrix *CPUSkinningDataAttachmentBase::editMFJointMatrices(void)
296 editMField(JointMatricesFieldMask, _mfJointMatrices);
298 return &_mfJointMatrices;
301 const MFMatrix *CPUSkinningDataAttachmentBase::getMFJointMatrices(void) const
303 return &_mfJointMatrices;
307 MFMatrix *CPUSkinningDataAttachmentBase::editMFJointNormalMatrices(void)
309 editMField(JointNormalMatricesFieldMask, _mfJointNormalMatrices);
311 return &_mfJointNormalMatrices;
314 const MFMatrix *CPUSkinningDataAttachmentBase::getMFJointNormalMatrices(void) const
316 return &_mfJointNormalMatrices;
320 SFBool *CPUSkinningDataAttachmentBase::editSFDataValid(void)
322 editSField(DataValidFieldMask);
324 return &_sfDataValid;
327 const SFBool *CPUSkinningDataAttachmentBase::getSFDataValid(void) const
329 return &_sfDataValid;
335 void CPUSkinningDataAttachmentBase::pushToProperties(GeoVectorProperty * const value)
337 editMField(PropertiesFieldMask, _mfProperties);
339 _mfProperties.push_back(value);
342 void CPUSkinningDataAttachmentBase::assignProperties(const MFUnrecChildGeoVectorPropertyPtr &value)
344 MFUnrecChildGeoVectorPropertyPtr::const_iterator elemIt =
345 value.begin();
346 MFUnrecChildGeoVectorPropertyPtr::const_iterator elemEnd =
347 value.end ();
349 static_cast<CPUSkinningDataAttachment *>(this)->clearProperties();
351 while(elemIt != elemEnd)
353 this->pushToProperties(*elemIt);
355 ++elemIt;
359 void CPUSkinningDataAttachmentBase::removeFromProperties(UInt32 uiIndex)
361 if(uiIndex < _mfProperties.size())
363 editMField(PropertiesFieldMask, _mfProperties);
365 _mfProperties.erase(uiIndex);
369 void CPUSkinningDataAttachmentBase::removeObjFromProperties(GeoVectorProperty * const value)
371 Int32 iElemIdx = _mfProperties.findIndex(value);
373 if(iElemIdx != -1)
375 editMField(PropertiesFieldMask, _mfProperties);
377 _mfProperties.erase(iElemIdx);
380 void CPUSkinningDataAttachmentBase::clearProperties(void)
382 editMField(PropertiesFieldMask, _mfProperties);
385 _mfProperties.clear();
390 /*------------------------------ access -----------------------------------*/
392 SizeT CPUSkinningDataAttachmentBase::getBinSize(ConstFieldMaskArg whichField)
394 SizeT returnValue = Inherited::getBinSize(whichField);
396 if(FieldBits::NoField != (PropertiesFieldMask & whichField))
398 returnValue += _mfProperties.getBinSize();
400 if(FieldBits::NoField != (JointMatricesFieldMask & whichField))
402 returnValue += _mfJointMatrices.getBinSize();
404 if(FieldBits::NoField != (JointNormalMatricesFieldMask & whichField))
406 returnValue += _mfJointNormalMatrices.getBinSize();
408 if(FieldBits::NoField != (DataValidFieldMask & whichField))
410 returnValue += _sfDataValid.getBinSize();
413 return returnValue;
416 void CPUSkinningDataAttachmentBase::copyToBin(BinaryDataHandler &pMem,
417 ConstFieldMaskArg whichField)
419 Inherited::copyToBin(pMem, whichField);
421 if(FieldBits::NoField != (PropertiesFieldMask & whichField))
423 _mfProperties.copyToBin(pMem);
425 if(FieldBits::NoField != (JointMatricesFieldMask & whichField))
427 _mfJointMatrices.copyToBin(pMem);
429 if(FieldBits::NoField != (JointNormalMatricesFieldMask & whichField))
431 _mfJointNormalMatrices.copyToBin(pMem);
433 if(FieldBits::NoField != (DataValidFieldMask & whichField))
435 _sfDataValid.copyToBin(pMem);
439 void CPUSkinningDataAttachmentBase::copyFromBin(BinaryDataHandler &pMem,
440 ConstFieldMaskArg whichField)
442 Inherited::copyFromBin(pMem, whichField);
444 if(FieldBits::NoField != (PropertiesFieldMask & whichField))
446 editMField(PropertiesFieldMask, _mfProperties);
447 _mfProperties.copyFromBin(pMem);
449 if(FieldBits::NoField != (JointMatricesFieldMask & whichField))
451 editMField(JointMatricesFieldMask, _mfJointMatrices);
452 _mfJointMatrices.copyFromBin(pMem);
454 if(FieldBits::NoField != (JointNormalMatricesFieldMask & whichField))
456 editMField(JointNormalMatricesFieldMask, _mfJointNormalMatrices);
457 _mfJointNormalMatrices.copyFromBin(pMem);
459 if(FieldBits::NoField != (DataValidFieldMask & whichField))
461 editSField(DataValidFieldMask);
462 _sfDataValid.copyFromBin(pMem);
466 //! create a new instance of the class
467 CPUSkinningDataAttachmentTransitPtr CPUSkinningDataAttachmentBase::createLocal(BitVector bFlags)
469 CPUSkinningDataAttachmentTransitPtr fc;
471 if(getClassType().getPrototype() != NULL)
473 FieldContainerTransitPtr tmpPtr =
474 getClassType().getPrototype()-> shallowCopyLocal(bFlags);
476 fc = dynamic_pointer_cast<CPUSkinningDataAttachment>(tmpPtr);
479 return fc;
482 //! create a new instance of the class, copy the container flags
483 CPUSkinningDataAttachmentTransitPtr CPUSkinningDataAttachmentBase::createDependent(BitVector bFlags)
485 CPUSkinningDataAttachmentTransitPtr fc;
487 if(getClassType().getPrototype() != NULL)
489 FieldContainerTransitPtr tmpPtr =
490 getClassType().getPrototype()-> shallowCopyDependent(bFlags);
492 fc = dynamic_pointer_cast<CPUSkinningDataAttachment>(tmpPtr);
495 return fc;
498 //! create a new instance of the class
499 CPUSkinningDataAttachmentTransitPtr CPUSkinningDataAttachmentBase::create(void)
501 CPUSkinningDataAttachmentTransitPtr fc;
503 if(getClassType().getPrototype() != NULL)
505 FieldContainerTransitPtr tmpPtr =
506 getClassType().getPrototype()-> shallowCopy();
508 fc = dynamic_pointer_cast<CPUSkinningDataAttachment>(tmpPtr);
511 return fc;
514 CPUSkinningDataAttachment *CPUSkinningDataAttachmentBase::createEmptyLocal(BitVector bFlags)
516 CPUSkinningDataAttachment *returnValue;
518 newPtr<CPUSkinningDataAttachment>(returnValue, bFlags);
520 returnValue->_pFieldFlags->_bNamespaceMask &= ~bFlags;
522 return returnValue;
525 //! create an empty new instance of the class, do not copy the prototype
526 CPUSkinningDataAttachment *CPUSkinningDataAttachmentBase::createEmpty(void)
528 CPUSkinningDataAttachment *returnValue;
530 newPtr<CPUSkinningDataAttachment>(returnValue, Thread::getCurrentLocalFlags());
532 returnValue->_pFieldFlags->_bNamespaceMask &=
533 ~Thread::getCurrentLocalFlags();
535 return returnValue;
539 FieldContainerTransitPtr CPUSkinningDataAttachmentBase::shallowCopyLocal(
540 BitVector bFlags) const
542 CPUSkinningDataAttachment *tmpPtr;
544 newPtr(tmpPtr, dynamic_cast<const CPUSkinningDataAttachment *>(this), bFlags);
546 FieldContainerTransitPtr returnValue(tmpPtr);
548 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~bFlags;
550 return returnValue;
553 FieldContainerTransitPtr CPUSkinningDataAttachmentBase::shallowCopyDependent(
554 BitVector bFlags) const
556 CPUSkinningDataAttachment *tmpPtr;
558 newPtr(tmpPtr, dynamic_cast<const CPUSkinningDataAttachment *>(this), ~bFlags);
560 FieldContainerTransitPtr returnValue(tmpPtr);
562 tmpPtr->_pFieldFlags->_bNamespaceMask = bFlags;
564 return returnValue;
567 FieldContainerTransitPtr CPUSkinningDataAttachmentBase::shallowCopy(void) const
569 CPUSkinningDataAttachment *tmpPtr;
571 newPtr(tmpPtr,
572 dynamic_cast<const CPUSkinningDataAttachment *>(this),
573 Thread::getCurrentLocalFlags());
575 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~Thread::getCurrentLocalFlags();
577 FieldContainerTransitPtr returnValue(tmpPtr);
579 return returnValue;
585 /*------------------------- constructors ----------------------------------*/
587 CPUSkinningDataAttachmentBase::CPUSkinningDataAttachmentBase(void) :
588 Inherited(),
589 _mfProperties (this,
590 PropertiesFieldId,
591 GeoVectorProperty::ParentsFieldId),
592 _mfJointMatrices (),
593 _mfJointNormalMatrices (),
594 _sfDataValid (bool(false))
598 CPUSkinningDataAttachmentBase::CPUSkinningDataAttachmentBase(const CPUSkinningDataAttachmentBase &source) :
599 Inherited(source),
600 _mfProperties (this,
601 PropertiesFieldId,
602 GeoVectorProperty::ParentsFieldId),
603 _mfJointMatrices (source._mfJointMatrices ),
604 _mfJointNormalMatrices (source._mfJointNormalMatrices ),
605 _sfDataValid (source._sfDataValid )
610 /*-------------------------- destructors ----------------------------------*/
612 CPUSkinningDataAttachmentBase::~CPUSkinningDataAttachmentBase(void)
616 /*-------------------------------------------------------------------------*/
617 /* Child linking */
619 bool CPUSkinningDataAttachmentBase::unlinkChild(
620 FieldContainer * const pChild,
621 UInt16 const childFieldId)
623 if(childFieldId == PropertiesFieldId)
625 GeoVectorProperty * pTypedChild =
626 dynamic_cast<GeoVectorProperty *>(pChild);
628 if(pTypedChild != NULL)
630 Int32 iChildIdx = _mfProperties.findIndex(pTypedChild);
632 if(iChildIdx != -1)
634 editMField(PropertiesFieldMask, _mfProperties);
636 _mfProperties.erase(iChildIdx);
638 return true;
641 SWARNING << "Parent ([" << this
642 << "] id [" << this->getId()
643 << "] type [" << this->getType().getCName()
644 << "] childFieldId [" << childFieldId
645 << "]) - Child ([" << pChild
646 << "] id [" << pChild->getId()
647 << "] type [" << pChild->getType().getCName()
648 << "]): link inconsistent!"
649 << std::endl;
651 return false;
654 return false;
658 return Inherited::unlinkChild(pChild, childFieldId);
661 void CPUSkinningDataAttachmentBase::onCreate(const CPUSkinningDataAttachment *source)
663 Inherited::onCreate(source);
665 if(source != NULL)
667 CPUSkinningDataAttachment *pThis = static_cast<CPUSkinningDataAttachment *>(this);
669 MFUnrecChildGeoVectorPropertyPtr::const_iterator PropertiesIt =
670 source->_mfProperties.begin();
671 MFUnrecChildGeoVectorPropertyPtr::const_iterator PropertiesEnd =
672 source->_mfProperties.end ();
674 while(PropertiesIt != PropertiesEnd)
676 pThis->pushToProperties(*PropertiesIt);
678 ++PropertiesIt;
683 GetFieldHandlePtr CPUSkinningDataAttachmentBase::getHandleProperties (void) const
685 MFUnrecChildGeoVectorPropertyPtr::GetHandlePtr returnValue(
686 new MFUnrecChildGeoVectorPropertyPtr::GetHandle(
687 &_mfProperties,
688 this->getType().getFieldDesc(PropertiesFieldId),
689 const_cast<CPUSkinningDataAttachmentBase *>(this)));
691 return returnValue;
694 EditFieldHandlePtr CPUSkinningDataAttachmentBase::editHandleProperties (void)
696 MFUnrecChildGeoVectorPropertyPtr::EditHandlePtr returnValue(
697 new MFUnrecChildGeoVectorPropertyPtr::EditHandle(
698 &_mfProperties,
699 this->getType().getFieldDesc(PropertiesFieldId),
700 this));
702 returnValue->setAddMethod(
703 boost::bind(&CPUSkinningDataAttachment::pushToProperties,
704 static_cast<CPUSkinningDataAttachment *>(this), _1));
705 returnValue->setRemoveMethod(
706 boost::bind(&CPUSkinningDataAttachment::removeFromProperties,
707 static_cast<CPUSkinningDataAttachment *>(this), _1));
708 returnValue->setRemoveObjMethod(
709 boost::bind(&CPUSkinningDataAttachment::removeObjFromProperties,
710 static_cast<CPUSkinningDataAttachment *>(this), _1));
711 returnValue->setClearMethod(
712 boost::bind(&CPUSkinningDataAttachment::clearProperties,
713 static_cast<CPUSkinningDataAttachment *>(this)));
715 editMField(PropertiesFieldMask, _mfProperties);
717 return returnValue;
720 GetFieldHandlePtr CPUSkinningDataAttachmentBase::getHandleJointMatrices (void) const
722 MFMatrix::GetHandlePtr returnValue(
723 new MFMatrix::GetHandle(
724 &_mfJointMatrices,
725 this->getType().getFieldDesc(JointMatricesFieldId),
726 const_cast<CPUSkinningDataAttachmentBase *>(this)));
728 return returnValue;
731 EditFieldHandlePtr CPUSkinningDataAttachmentBase::editHandleJointMatrices (void)
733 MFMatrix::EditHandlePtr returnValue(
734 new MFMatrix::EditHandle(
735 &_mfJointMatrices,
736 this->getType().getFieldDesc(JointMatricesFieldId),
737 this));
740 editMField(JointMatricesFieldMask, _mfJointMatrices);
742 return returnValue;
745 GetFieldHandlePtr CPUSkinningDataAttachmentBase::getHandleJointNormalMatrices (void) const
747 MFMatrix::GetHandlePtr returnValue(
748 new MFMatrix::GetHandle(
749 &_mfJointNormalMatrices,
750 this->getType().getFieldDesc(JointNormalMatricesFieldId),
751 const_cast<CPUSkinningDataAttachmentBase *>(this)));
753 return returnValue;
756 EditFieldHandlePtr CPUSkinningDataAttachmentBase::editHandleJointNormalMatrices(void)
758 MFMatrix::EditHandlePtr returnValue(
759 new MFMatrix::EditHandle(
760 &_mfJointNormalMatrices,
761 this->getType().getFieldDesc(JointNormalMatricesFieldId),
762 this));
765 editMField(JointNormalMatricesFieldMask, _mfJointNormalMatrices);
767 return returnValue;
770 GetFieldHandlePtr CPUSkinningDataAttachmentBase::getHandleDataValid (void) const
772 SFBool::GetHandlePtr returnValue(
773 new SFBool::GetHandle(
774 &_sfDataValid,
775 this->getType().getFieldDesc(DataValidFieldId),
776 const_cast<CPUSkinningDataAttachmentBase *>(this)));
778 return returnValue;
781 EditFieldHandlePtr CPUSkinningDataAttachmentBase::editHandleDataValid (void)
783 SFBool::EditHandlePtr returnValue(
784 new SFBool::EditHandle(
785 &_sfDataValid,
786 this->getType().getFieldDesc(DataValidFieldId),
787 this));
790 editSField(DataValidFieldMask);
792 return returnValue;
796 #ifdef OSG_MT_CPTR_ASPECT
797 void CPUSkinningDataAttachmentBase::execSyncV( FieldContainer &oFrom,
798 ConstFieldMaskArg whichField,
799 AspectOffsetStore &oOffsets,
800 ConstFieldMaskArg syncMode,
801 const UInt32 uiSyncInfo)
803 CPUSkinningDataAttachment *pThis = static_cast<CPUSkinningDataAttachment *>(this);
805 pThis->execSync(static_cast<CPUSkinningDataAttachment *>(&oFrom),
806 whichField,
807 oOffsets,
808 syncMode,
809 uiSyncInfo);
811 #endif
814 #ifdef OSG_MT_CPTR_ASPECT
815 FieldContainer *CPUSkinningDataAttachmentBase::createAspectCopy(
816 const FieldContainer *pRefAspect) const
818 CPUSkinningDataAttachment *returnValue;
820 newAspectCopy(returnValue,
821 dynamic_cast<const CPUSkinningDataAttachment *>(pRefAspect),
822 dynamic_cast<const CPUSkinningDataAttachment *>(this));
824 return returnValue;
826 #endif
828 void CPUSkinningDataAttachmentBase::resolveLinks(void)
830 Inherited::resolveLinks();
832 static_cast<CPUSkinningDataAttachment *>(this)->clearProperties();
834 #ifdef OSG_MT_CPTR_ASPECT
835 AspectOffsetStore oOffsets;
837 _pAspectStore->fillOffsetArray(oOffsets, this);
838 #endif
840 #ifdef OSG_MT_CPTR_ASPECT
841 _mfJointMatrices.terminateShare(Thread::getCurrentAspect(),
842 oOffsets);
843 #endif
844 #ifdef OSG_MT_CPTR_ASPECT
845 _mfJointNormalMatrices.terminateShare(Thread::getCurrentAspect(),
846 oOffsets);
847 #endif
851 OSG_END_NAMESPACE