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 AnimKeyFrameDataSource!
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 "OSGAnimKeyFrameDataSourceBase.h"
67 #include "OSGAnimKeyFrameDataSource.h"
69 #include <boost/bind.hpp>
73 /***************************************************************************\
75 \***************************************************************************/
77 /*! \class OSG::AnimKeyFrameDataSource
81 /***************************************************************************\
82 * Field Documentation *
83 \***************************************************************************/
85 /*! \var Real32 AnimKeyFrameDataSourceBase::_mfInValues
89 /*! \var UInt32 AnimKeyFrameDataSourceBase::_mfInterpolationModes
94 /***************************************************************************\
95 * FieldType/FieldTrait Instantiation *
96 \***************************************************************************/
98 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
99 PointerType FieldTraits
<AnimKeyFrameDataSource
*, nsOSG
>::_type(
100 "AnimKeyFrameDataSourcePtr",
102 AnimKeyFrameDataSource::getClassType(),
106 OSG_FIELDTRAITS_GETTYPE_NS(AnimKeyFrameDataSource
*, nsOSG
)
108 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField
,
109 AnimKeyFrameDataSource
*,
112 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField
,
113 AnimKeyFrameDataSource
*,
116 /***************************************************************************\
117 * Field Description *
118 \***************************************************************************/
120 void AnimKeyFrameDataSourceBase::classDescInserter(TypeObject
&oType
)
122 FieldDescriptionBase
*pDesc
= NULL
;
125 pDesc
= new MFReal32::Description(
126 MFReal32::getClassType(),
129 InValuesFieldId
, InValuesFieldMask
,
131 (Field::FClusterLocal
),
132 static_cast<FieldEditMethodSig
>(&AnimKeyFrameDataSource::editHandleInValues
),
133 static_cast<FieldGetMethodSig
>(&AnimKeyFrameDataSource::getHandleInValues
));
135 oType
.addInitialDesc(pDesc
);
137 pDesc
= new MFUInt32::Description(
138 MFUInt32::getClassType(),
139 "interpolationModes",
141 InterpolationModesFieldId
, InterpolationModesFieldMask
,
143 (Field::FClusterLocal
),
144 static_cast<FieldEditMethodSig
>(&AnimKeyFrameDataSource::editHandleInterpolationModes
),
145 static_cast<FieldGetMethodSig
>(&AnimKeyFrameDataSource::getHandleInterpolationModes
));
147 oType
.addInitialDesc(pDesc
);
151 AnimKeyFrameDataSourceBase::TypeObject
AnimKeyFrameDataSourceBase::_type(
152 AnimKeyFrameDataSourceBase::getClassname(),
153 Inherited::getClassname(),
157 reinterpret_cast<InitContainerF
>(&AnimKeyFrameDataSource::initMethod
),
158 reinterpret_cast<ExitContainerF
>(&AnimKeyFrameDataSource::exitMethod
),
159 reinterpret_cast<InitalInsertDescFunc
>(
160 reinterpret_cast<void *>(&AnimKeyFrameDataSource::classDescInserter
)),
163 "<?xml version=\"1.0\"?>\n"
166 " name=\"AnimKeyFrameDataSource\"\n"
167 " parent=\"AnimDataSource\"\n"
168 " library=\"Dynamics\"\n"
169 " pointerfieldtypes=\"both\"\n"
170 " structure=\"abstract\"\n"
171 " systemcomponent=\"true\"\n"
172 " parentsystemcomponent=\"true\"\n"
173 " decoratable=\"false\"\n"
174 " useLocalIncludes=\"false\"\n"
175 " isNodeCore=\"false\"\n"
176 " isBundle=\"false\"\n"
177 " parentFields=\"none\"\n"
180 " name=\"inValues\"\n"
181 " category=\"data\"\n"
183 " cardinality=\"multi\"\n"
184 " visibility=\"external\"\n"
185 " access=\"public\"\n"
186 " fieldFlags=\"FClusterLocal\"\n"
190 " name=\"interpolationModes\"\n"
191 " category=\"data\"\n"
193 " cardinality=\"multi\"\n"
194 " visibility=\"external\"\n"
195 " access=\"public\"\n"
196 " fieldFlags=\"FClusterLocal\"\n"
199 "</FieldContainer>\n",
203 /*------------------------------ get -----------------------------------*/
205 FieldContainerType
&AnimKeyFrameDataSourceBase::getType(void)
210 const FieldContainerType
&AnimKeyFrameDataSourceBase::getType(void) const
215 UInt32
AnimKeyFrameDataSourceBase::getContainerSize(void) const
217 return sizeof(AnimKeyFrameDataSource
);
220 /*------------------------- decorator get ------------------------------*/
223 MFReal32
*AnimKeyFrameDataSourceBase::editMFInValues(void)
225 editMField(InValuesFieldMask
, _mfInValues
);
230 const MFReal32
*AnimKeyFrameDataSourceBase::getMFInValues(void) const
236 MFUInt32
*AnimKeyFrameDataSourceBase::editMFInterpolationModes(void)
238 editMField(InterpolationModesFieldMask
, _mfInterpolationModes
);
240 return &_mfInterpolationModes
;
243 const MFUInt32
*AnimKeyFrameDataSourceBase::getMFInterpolationModes(void) const
245 return &_mfInterpolationModes
;
253 /*------------------------------ access -----------------------------------*/
255 SizeT
AnimKeyFrameDataSourceBase::getBinSize(ConstFieldMaskArg whichField
)
257 SizeT returnValue
= Inherited::getBinSize(whichField
);
259 if(FieldBits::NoField
!= (InValuesFieldMask
& whichField
))
261 returnValue
+= _mfInValues
.getBinSize();
263 if(FieldBits::NoField
!= (InterpolationModesFieldMask
& whichField
))
265 returnValue
+= _mfInterpolationModes
.getBinSize();
271 void AnimKeyFrameDataSourceBase::copyToBin(BinaryDataHandler
&pMem
,
272 ConstFieldMaskArg whichField
)
274 Inherited::copyToBin(pMem
, whichField
);
276 if(FieldBits::NoField
!= (InValuesFieldMask
& whichField
))
278 _mfInValues
.copyToBin(pMem
);
280 if(FieldBits::NoField
!= (InterpolationModesFieldMask
& whichField
))
282 _mfInterpolationModes
.copyToBin(pMem
);
286 void AnimKeyFrameDataSourceBase::copyFromBin(BinaryDataHandler
&pMem
,
287 ConstFieldMaskArg whichField
)
289 Inherited::copyFromBin(pMem
, whichField
);
291 if(FieldBits::NoField
!= (InValuesFieldMask
& whichField
))
293 editMField(InValuesFieldMask
, _mfInValues
);
294 _mfInValues
.copyFromBin(pMem
);
296 if(FieldBits::NoField
!= (InterpolationModesFieldMask
& whichField
))
298 editMField(InterpolationModesFieldMask
, _mfInterpolationModes
);
299 _mfInterpolationModes
.copyFromBin(pMem
);
306 /*------------------------- constructors ----------------------------------*/
308 AnimKeyFrameDataSourceBase::AnimKeyFrameDataSourceBase(void) :
311 _mfInterpolationModes ()
315 AnimKeyFrameDataSourceBase::AnimKeyFrameDataSourceBase(const AnimKeyFrameDataSourceBase
&source
) :
317 _mfInValues (source
._mfInValues
),
318 _mfInterpolationModes (source
._mfInterpolationModes
)
323 /*-------------------------- destructors ----------------------------------*/
325 AnimKeyFrameDataSourceBase::~AnimKeyFrameDataSourceBase(void)
330 GetFieldHandlePtr
AnimKeyFrameDataSourceBase::getHandleInValues (void) const
332 MFReal32::GetHandlePtr
returnValue(
333 new MFReal32::GetHandle(
335 this->getType().getFieldDesc(InValuesFieldId
),
336 const_cast<AnimKeyFrameDataSourceBase
*>(this)));
341 EditFieldHandlePtr
AnimKeyFrameDataSourceBase::editHandleInValues (void)
343 MFReal32::EditHandlePtr
returnValue(
344 new MFReal32::EditHandle(
346 this->getType().getFieldDesc(InValuesFieldId
),
350 editMField(InValuesFieldMask
, _mfInValues
);
355 GetFieldHandlePtr
AnimKeyFrameDataSourceBase::getHandleInterpolationModes (void) const
357 MFUInt32::GetHandlePtr
returnValue(
358 new MFUInt32::GetHandle(
359 &_mfInterpolationModes
,
360 this->getType().getFieldDesc(InterpolationModesFieldId
),
361 const_cast<AnimKeyFrameDataSourceBase
*>(this)));
366 EditFieldHandlePtr
AnimKeyFrameDataSourceBase::editHandleInterpolationModes(void)
368 MFUInt32::EditHandlePtr
returnValue(
369 new MFUInt32::EditHandle(
370 &_mfInterpolationModes
,
371 this->getType().getFieldDesc(InterpolationModesFieldId
),
375 editMField(InterpolationModesFieldMask
, _mfInterpolationModes
);
381 #ifdef OSG_MT_CPTR_ASPECT
382 void AnimKeyFrameDataSourceBase::execSyncV( FieldContainer
&oFrom
,
383 ConstFieldMaskArg whichField
,
384 AspectOffsetStore
&oOffsets
,
385 ConstFieldMaskArg syncMode
,
386 const UInt32 uiSyncInfo
)
388 AnimKeyFrameDataSource
*pThis
= static_cast<AnimKeyFrameDataSource
*>(this);
390 pThis
->execSync(static_cast<AnimKeyFrameDataSource
*>(&oFrom
),
400 void AnimKeyFrameDataSourceBase::resolveLinks(void)
402 Inherited::resolveLinks();
404 #ifdef OSG_MT_CPTR_ASPECT
405 AspectOffsetStore oOffsets
;
407 _pAspectStore
->fillOffsetArray(oOffsets
, this);
410 #ifdef OSG_MT_CPTR_ASPECT
411 _mfInValues
.terminateShare(Thread::getCurrentAspect(),
414 #ifdef OSG_MT_CPTR_ASPECT
415 _mfInterpolationModes
.terminateShare(Thread::getCurrentAspect(),