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 AnimMatrixDataSource!
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 "OSGAnimMatrixDataSourceBase.h"
67 #include "OSGAnimMatrixDataSource.h"
69 #include <boost/bind.hpp>
73 /***************************************************************************\
75 \***************************************************************************/
77 /*! \class OSG::AnimMatrixDataSource
81 /***************************************************************************\
82 * Field Documentation *
83 \***************************************************************************/
85 /*! \var Matrix AnimMatrixDataSourceBase::_mfValues
90 /***************************************************************************\
91 * FieldType/FieldTrait Instantiation *
92 \***************************************************************************/
94 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
95 PointerType FieldTraits
<AnimMatrixDataSource
*, nsOSG
>::_type(
96 "AnimMatrixDataSourcePtr",
97 "AnimKeyFrameDataSourcePtr",
98 AnimMatrixDataSource::getClassType(),
102 OSG_FIELDTRAITS_GETTYPE_NS(AnimMatrixDataSource
*, nsOSG
)
104 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField
,
105 AnimMatrixDataSource
*,
108 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField
,
109 AnimMatrixDataSource
*,
112 /***************************************************************************\
113 * Field Description *
114 \***************************************************************************/
116 void AnimMatrixDataSourceBase::classDescInserter(TypeObject
&oType
)
118 FieldDescriptionBase
*pDesc
= NULL
;
121 pDesc
= new MFMatrix::Description(
122 MFMatrix::getClassType(),
125 ValuesFieldId
, ValuesFieldMask
,
127 (Field::FClusterLocal
),
128 static_cast<FieldEditMethodSig
>(&AnimMatrixDataSource::editHandleValues
),
129 static_cast<FieldGetMethodSig
>(&AnimMatrixDataSource::getHandleValues
));
131 oType
.addInitialDesc(pDesc
);
135 AnimMatrixDataSourceBase::TypeObject
AnimMatrixDataSourceBase::_type(
136 AnimMatrixDataSourceBase::getClassname(),
137 Inherited::getClassname(),
140 reinterpret_cast<PrototypeCreateF
>(&AnimMatrixDataSourceBase::createEmptyLocal
),
141 reinterpret_cast<InitContainerF
>(&AnimMatrixDataSource::initMethod
),
142 reinterpret_cast<ExitContainerF
>(&AnimMatrixDataSource::exitMethod
),
143 reinterpret_cast<InitalInsertDescFunc
>(
144 reinterpret_cast<void *>(&AnimMatrixDataSource::classDescInserter
)),
147 "<?xml version=\"1.0\"?>\n"
150 " name=\"AnimMatrixDataSource\"\n"
151 " parent=\"AnimKeyFrameDataSource\"\n"
152 " library=\"Dynamics\"\n"
153 " pointerfieldtypes=\"both\"\n"
154 " structure=\"concrete\"\n"
155 " systemcomponent=\"true\"\n"
156 " parentsystemcomponent=\"true\"\n"
157 " decoratable=\"false\"\n"
158 " useLocalIncludes=\"false\"\n"
159 " isNodeCore=\"false\"\n"
160 " isBundle=\"false\"\n"
161 " parentFields=\"none\"\n"
165 " category=\"data\"\n"
167 " cardinality=\"multi\"\n"
168 " visibility=\"external\"\n"
169 " access=\"public\"\n"
170 " fieldFlags=\"FClusterLocal\"\n"
173 "</FieldContainer>\n",
177 /*------------------------------ get -----------------------------------*/
179 FieldContainerType
&AnimMatrixDataSourceBase::getType(void)
184 const FieldContainerType
&AnimMatrixDataSourceBase::getType(void) const
189 UInt32
AnimMatrixDataSourceBase::getContainerSize(void) const
191 return sizeof(AnimMatrixDataSource
);
194 /*------------------------- decorator get ------------------------------*/
197 MFMatrix
*AnimMatrixDataSourceBase::editMFValues(void)
199 editMField(ValuesFieldMask
, _mfValues
);
204 const MFMatrix
*AnimMatrixDataSourceBase::getMFValues(void) const
214 /*------------------------------ access -----------------------------------*/
216 SizeT
AnimMatrixDataSourceBase::getBinSize(ConstFieldMaskArg whichField
)
218 SizeT returnValue
= Inherited::getBinSize(whichField
);
220 if(FieldBits::NoField
!= (ValuesFieldMask
& whichField
))
222 returnValue
+= _mfValues
.getBinSize();
228 void AnimMatrixDataSourceBase::copyToBin(BinaryDataHandler
&pMem
,
229 ConstFieldMaskArg whichField
)
231 Inherited::copyToBin(pMem
, whichField
);
233 if(FieldBits::NoField
!= (ValuesFieldMask
& whichField
))
235 _mfValues
.copyToBin(pMem
);
239 void AnimMatrixDataSourceBase::copyFromBin(BinaryDataHandler
&pMem
,
240 ConstFieldMaskArg whichField
)
242 Inherited::copyFromBin(pMem
, whichField
);
244 if(FieldBits::NoField
!= (ValuesFieldMask
& whichField
))
246 editMField(ValuesFieldMask
, _mfValues
);
247 _mfValues
.copyFromBin(pMem
);
251 //! create a new instance of the class
252 AnimMatrixDataSourceTransitPtr
AnimMatrixDataSourceBase::createLocal(BitVector bFlags
)
254 AnimMatrixDataSourceTransitPtr fc
;
256 if(getClassType().getPrototype() != NULL
)
258 FieldContainerTransitPtr tmpPtr
=
259 getClassType().getPrototype()-> shallowCopyLocal(bFlags
);
261 fc
= dynamic_pointer_cast
<AnimMatrixDataSource
>(tmpPtr
);
267 //! create a new instance of the class, copy the container flags
268 AnimMatrixDataSourceTransitPtr
AnimMatrixDataSourceBase::createDependent(BitVector bFlags
)
270 AnimMatrixDataSourceTransitPtr fc
;
272 if(getClassType().getPrototype() != NULL
)
274 FieldContainerTransitPtr tmpPtr
=
275 getClassType().getPrototype()-> shallowCopyDependent(bFlags
);
277 fc
= dynamic_pointer_cast
<AnimMatrixDataSource
>(tmpPtr
);
283 //! create a new instance of the class
284 AnimMatrixDataSourceTransitPtr
AnimMatrixDataSourceBase::create(void)
286 AnimMatrixDataSourceTransitPtr fc
;
288 if(getClassType().getPrototype() != NULL
)
290 FieldContainerTransitPtr tmpPtr
=
291 getClassType().getPrototype()-> shallowCopy();
293 fc
= dynamic_pointer_cast
<AnimMatrixDataSource
>(tmpPtr
);
299 AnimMatrixDataSource
*AnimMatrixDataSourceBase::createEmptyLocal(BitVector bFlags
)
301 AnimMatrixDataSource
*returnValue
;
303 newPtr
<AnimMatrixDataSource
>(returnValue
, bFlags
);
305 returnValue
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
310 //! create an empty new instance of the class, do not copy the prototype
311 AnimMatrixDataSource
*AnimMatrixDataSourceBase::createEmpty(void)
313 AnimMatrixDataSource
*returnValue
;
315 newPtr
<AnimMatrixDataSource
>(returnValue
, Thread::getCurrentLocalFlags());
317 returnValue
->_pFieldFlags
->_bNamespaceMask
&=
318 ~Thread::getCurrentLocalFlags();
324 FieldContainerTransitPtr
AnimMatrixDataSourceBase::shallowCopyLocal(
325 BitVector bFlags
) const
327 AnimMatrixDataSource
*tmpPtr
;
329 newPtr(tmpPtr
, dynamic_cast<const AnimMatrixDataSource
*>(this), bFlags
);
331 FieldContainerTransitPtr
returnValue(tmpPtr
);
333 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
338 FieldContainerTransitPtr
AnimMatrixDataSourceBase::shallowCopyDependent(
339 BitVector bFlags
) const
341 AnimMatrixDataSource
*tmpPtr
;
343 newPtr(tmpPtr
, dynamic_cast<const AnimMatrixDataSource
*>(this), ~bFlags
);
345 FieldContainerTransitPtr
returnValue(tmpPtr
);
347 tmpPtr
->_pFieldFlags
->_bNamespaceMask
= bFlags
;
352 FieldContainerTransitPtr
AnimMatrixDataSourceBase::shallowCopy(void) const
354 AnimMatrixDataSource
*tmpPtr
;
357 dynamic_cast<const AnimMatrixDataSource
*>(this),
358 Thread::getCurrentLocalFlags());
360 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~Thread::getCurrentLocalFlags();
362 FieldContainerTransitPtr
returnValue(tmpPtr
);
370 /*------------------------- constructors ----------------------------------*/
372 AnimMatrixDataSourceBase::AnimMatrixDataSourceBase(void) :
378 AnimMatrixDataSourceBase::AnimMatrixDataSourceBase(const AnimMatrixDataSourceBase
&source
) :
380 _mfValues (source
._mfValues
)
385 /*-------------------------- destructors ----------------------------------*/
387 AnimMatrixDataSourceBase::~AnimMatrixDataSourceBase(void)
392 GetFieldHandlePtr
AnimMatrixDataSourceBase::getHandleValues (void) const
394 MFMatrix::GetHandlePtr
returnValue(
395 new MFMatrix::GetHandle(
397 this->getType().getFieldDesc(ValuesFieldId
),
398 const_cast<AnimMatrixDataSourceBase
*>(this)));
403 EditFieldHandlePtr
AnimMatrixDataSourceBase::editHandleValues (void)
405 MFMatrix::EditHandlePtr
returnValue(
406 new MFMatrix::EditHandle(
408 this->getType().getFieldDesc(ValuesFieldId
),
412 editMField(ValuesFieldMask
, _mfValues
);
418 #ifdef OSG_MT_CPTR_ASPECT
419 void AnimMatrixDataSourceBase::execSyncV( FieldContainer
&oFrom
,
420 ConstFieldMaskArg whichField
,
421 AspectOffsetStore
&oOffsets
,
422 ConstFieldMaskArg syncMode
,
423 const UInt32 uiSyncInfo
)
425 AnimMatrixDataSource
*pThis
= static_cast<AnimMatrixDataSource
*>(this);
427 pThis
->execSync(static_cast<AnimMatrixDataSource
*>(&oFrom
),
436 #ifdef OSG_MT_CPTR_ASPECT
437 FieldContainer
*AnimMatrixDataSourceBase::createAspectCopy(
438 const FieldContainer
*pRefAspect
) const
440 AnimMatrixDataSource
*returnValue
;
442 newAspectCopy(returnValue
,
443 dynamic_cast<const AnimMatrixDataSource
*>(pRefAspect
),
444 dynamic_cast<const AnimMatrixDataSource
*>(this));
450 void AnimMatrixDataSourceBase::resolveLinks(void)
452 Inherited::resolveLinks();
454 #ifdef OSG_MT_CPTR_ASPECT
455 AspectOffsetStore oOffsets
;
457 _pAspectStore
->fillOffsetArray(oOffsets
, this);
460 #ifdef OSG_MT_CPTR_ASPECT
461 _mfValues
.terminateShare(Thread::getCurrentAspect(),