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 VRMLOrientationInterpolator!
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 "OSGVRMLOrientationInterpolatorBase.h"
67 #include "OSGVRMLOrientationInterpolator.h"
69 #include <boost/bind.hpp>
73 /***************************************************************************\
75 \***************************************************************************/
77 /*! \class OSG::VRMLOrientationInterpolator
81 /***************************************************************************\
82 * Field Documentation *
83 \***************************************************************************/
85 /*! \var Quaternion VRMLOrientationInterpolatorBase::_mfKeyValue
89 /*! \var Quaternion VRMLOrientationInterpolatorBase::_sfOutValue
90 This is VRML's value field.
94 /***************************************************************************\
95 * FieldType/FieldTrait Instantiation *
96 \***************************************************************************/
98 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
99 PointerType FieldTraits
<VRMLOrientationInterpolator
*, nsOSG
>::_type(
100 "VRMLOrientationInterpolatorPtr",
101 "VRMLInterpolatorPtr",
102 VRMLOrientationInterpolator::getClassType(),
106 OSG_FIELDTRAITS_GETTYPE_NS(VRMLOrientationInterpolator
*, nsOSG
)
108 /***************************************************************************\
109 * Field Description *
110 \***************************************************************************/
112 void VRMLOrientationInterpolatorBase::classDescInserter(TypeObject
&oType
)
114 FieldDescriptionBase
*pDesc
= NULL
;
117 pDesc
= new MFQuaternion::Description(
118 MFQuaternion::getClassType(),
121 KeyValueFieldId
, KeyValueFieldMask
,
123 (Field::FStdAccess
| Field::FThreadLocal
),
124 static_cast<FieldEditMethodSig
>(&VRMLOrientationInterpolator::editHandleKeyValue
),
125 static_cast<FieldGetMethodSig
>(&VRMLOrientationInterpolator::getHandleKeyValue
));
127 oType
.addInitialDesc(pDesc
);
129 pDesc
= new SFQuaternion::Description(
130 SFQuaternion::getClassType(),
132 "This is VRML's value field.\n",
133 OutValueFieldId
, OutValueFieldMask
,
135 (Field::FStdAccess
| Field::FThreadLocal
),
136 static_cast<FieldEditMethodSig
>(&VRMLOrientationInterpolator::editHandleOutValue
),
137 static_cast<FieldGetMethodSig
>(&VRMLOrientationInterpolator::getHandleOutValue
));
139 oType
.addInitialDesc(pDesc
);
143 VRMLOrientationInterpolatorBase::TypeObject
VRMLOrientationInterpolatorBase::_type(
144 VRMLOrientationInterpolatorBase::getClassname(),
145 Inherited::getClassname(),
148 reinterpret_cast<PrototypeCreateF
>(&VRMLOrientationInterpolatorBase::createEmptyLocal
),
149 reinterpret_cast<InitContainerF
>(&VRMLOrientationInterpolator::initMethod
),
150 reinterpret_cast<ExitContainerF
>(&VRMLOrientationInterpolator::exitMethod
),
151 reinterpret_cast<InitalInsertDescFunc
>(
152 reinterpret_cast<void *>(&VRMLOrientationInterpolator::classDescInserter
)),
155 "<?xml version=\"1.0\"?>\n"
158 " name=\"VRMLOrientationInterpolator\"\n"
159 " parent=\"VRMLInterpolator\"\n"
160 " library=\"Dynamics\"\n"
161 " pointerfieldtypes=\"none\"\n"
162 " structure=\"concrete\"\n"
163 " systemcomponent=\"true\"\n"
164 " parentsystemcomponent=\"true\"\n"
165 " decoratable=\"false\"\n"
166 " useLocalIncludes=\"false\"\n"
167 " isNodeCore=\"true\"\n"
168 " isBundle=\"false\"\n"
169 " parentFields=\"none\"\n"
170 " docGroupBase=\"GrpDynamicsVRMLAnimation\"\n"
173 " name=\"keyValue\"\n"
174 " type=\"Quaternion\"\n"
175 " cardinality=\"multi\"\n"
176 " visibility=\"external\"\n"
177 " access=\"public\"\n"
178 " defaultValue=\"\"\n"
179 " fieldFlags=\"FStdAccess, FThreadLocal\"\n"
183 " name=\"outValue\"\n"
184 " type=\"Quaternion\"\n"
185 " cardinality=\"single\"\n"
186 " visibility=\"internal\"\n"
187 " access=\"public\"\n"
188 " defaultValue=\"\"\n"
189 " fieldFlags=\"FStdAccess, FThreadLocal\"\n"
191 " This is VRML's value field.\n"
193 "</FieldContainer>\n",
197 /*------------------------------ get -----------------------------------*/
199 FieldContainerType
&VRMLOrientationInterpolatorBase::getType(void)
204 const FieldContainerType
&VRMLOrientationInterpolatorBase::getType(void) const
209 UInt32
VRMLOrientationInterpolatorBase::getContainerSize(void) const
211 return sizeof(VRMLOrientationInterpolator
);
214 /*------------------------- decorator get ------------------------------*/
217 MFQuaternion
*VRMLOrientationInterpolatorBase::editMFKeyValue(void)
219 editMField(KeyValueFieldMask
, _mfKeyValue
);
224 const MFQuaternion
*VRMLOrientationInterpolatorBase::getMFKeyValue(void) const
230 SFQuaternion
*VRMLOrientationInterpolatorBase::editSFOutValue(void)
232 editSField(OutValueFieldMask
);
237 const SFQuaternion
*VRMLOrientationInterpolatorBase::getSFOutValue(void) const
247 /*------------------------------ access -----------------------------------*/
249 SizeT
VRMLOrientationInterpolatorBase::getBinSize(ConstFieldMaskArg whichField
)
251 SizeT returnValue
= Inherited::getBinSize(whichField
);
253 if(FieldBits::NoField
!= (KeyValueFieldMask
& whichField
))
255 returnValue
+= _mfKeyValue
.getBinSize();
257 if(FieldBits::NoField
!= (OutValueFieldMask
& whichField
))
259 returnValue
+= _sfOutValue
.getBinSize();
265 void VRMLOrientationInterpolatorBase::copyToBin(BinaryDataHandler
&pMem
,
266 ConstFieldMaskArg whichField
)
268 Inherited::copyToBin(pMem
, whichField
);
270 if(FieldBits::NoField
!= (KeyValueFieldMask
& whichField
))
272 _mfKeyValue
.copyToBin(pMem
);
274 if(FieldBits::NoField
!= (OutValueFieldMask
& whichField
))
276 _sfOutValue
.copyToBin(pMem
);
280 void VRMLOrientationInterpolatorBase::copyFromBin(BinaryDataHandler
&pMem
,
281 ConstFieldMaskArg whichField
)
283 Inherited::copyFromBin(pMem
, whichField
);
285 if(FieldBits::NoField
!= (KeyValueFieldMask
& whichField
))
287 editMField(KeyValueFieldMask
, _mfKeyValue
);
288 _mfKeyValue
.copyFromBin(pMem
);
290 if(FieldBits::NoField
!= (OutValueFieldMask
& whichField
))
292 editSField(OutValueFieldMask
);
293 _sfOutValue
.copyFromBin(pMem
);
297 //! create a new instance of the class
298 VRMLOrientationInterpolatorTransitPtr
VRMLOrientationInterpolatorBase::createLocal(BitVector bFlags
)
300 VRMLOrientationInterpolatorTransitPtr fc
;
302 if(getClassType().getPrototype() != NULL
)
304 FieldContainerTransitPtr tmpPtr
=
305 getClassType().getPrototype()-> shallowCopyLocal(bFlags
);
307 fc
= dynamic_pointer_cast
<VRMLOrientationInterpolator
>(tmpPtr
);
313 //! create a new instance of the class, copy the container flags
314 VRMLOrientationInterpolatorTransitPtr
VRMLOrientationInterpolatorBase::createDependent(BitVector bFlags
)
316 VRMLOrientationInterpolatorTransitPtr fc
;
318 if(getClassType().getPrototype() != NULL
)
320 FieldContainerTransitPtr tmpPtr
=
321 getClassType().getPrototype()-> shallowCopyDependent(bFlags
);
323 fc
= dynamic_pointer_cast
<VRMLOrientationInterpolator
>(tmpPtr
);
329 //! create a new instance of the class
330 VRMLOrientationInterpolatorTransitPtr
VRMLOrientationInterpolatorBase::create(void)
332 VRMLOrientationInterpolatorTransitPtr fc
;
334 if(getClassType().getPrototype() != NULL
)
336 FieldContainerTransitPtr tmpPtr
=
337 getClassType().getPrototype()-> shallowCopy();
339 fc
= dynamic_pointer_cast
<VRMLOrientationInterpolator
>(tmpPtr
);
345 VRMLOrientationInterpolator
*VRMLOrientationInterpolatorBase::createEmptyLocal(BitVector bFlags
)
347 VRMLOrientationInterpolator
*returnValue
;
349 newPtr
<VRMLOrientationInterpolator
>(returnValue
, bFlags
);
351 returnValue
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
356 //! create an empty new instance of the class, do not copy the prototype
357 VRMLOrientationInterpolator
*VRMLOrientationInterpolatorBase::createEmpty(void)
359 VRMLOrientationInterpolator
*returnValue
;
361 newPtr
<VRMLOrientationInterpolator
>(returnValue
, Thread::getCurrentLocalFlags());
363 returnValue
->_pFieldFlags
->_bNamespaceMask
&=
364 ~Thread::getCurrentLocalFlags();
370 FieldContainerTransitPtr
VRMLOrientationInterpolatorBase::shallowCopyLocal(
371 BitVector bFlags
) const
373 VRMLOrientationInterpolator
*tmpPtr
;
375 newPtr(tmpPtr
, dynamic_cast<const VRMLOrientationInterpolator
*>(this), bFlags
);
377 FieldContainerTransitPtr
returnValue(tmpPtr
);
379 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
384 FieldContainerTransitPtr
VRMLOrientationInterpolatorBase::shallowCopyDependent(
385 BitVector bFlags
) const
387 VRMLOrientationInterpolator
*tmpPtr
;
389 newPtr(tmpPtr
, dynamic_cast<const VRMLOrientationInterpolator
*>(this), ~bFlags
);
391 FieldContainerTransitPtr
returnValue(tmpPtr
);
393 tmpPtr
->_pFieldFlags
->_bNamespaceMask
= bFlags
;
398 FieldContainerTransitPtr
VRMLOrientationInterpolatorBase::shallowCopy(void) const
400 VRMLOrientationInterpolator
*tmpPtr
;
403 dynamic_cast<const VRMLOrientationInterpolator
*>(this),
404 Thread::getCurrentLocalFlags());
406 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~Thread::getCurrentLocalFlags();
408 FieldContainerTransitPtr
returnValue(tmpPtr
);
416 /*------------------------- constructors ----------------------------------*/
418 VRMLOrientationInterpolatorBase::VRMLOrientationInterpolatorBase(void) :
425 VRMLOrientationInterpolatorBase::VRMLOrientationInterpolatorBase(const VRMLOrientationInterpolatorBase
&source
) :
427 _mfKeyValue (source
._mfKeyValue
),
428 _sfOutValue (source
._sfOutValue
)
433 /*-------------------------- destructors ----------------------------------*/
435 VRMLOrientationInterpolatorBase::~VRMLOrientationInterpolatorBase(void)
440 GetFieldHandlePtr
VRMLOrientationInterpolatorBase::getHandleKeyValue (void) const
442 MFQuaternion::GetHandlePtr
returnValue(
443 new MFQuaternion::GetHandle(
445 this->getType().getFieldDesc(KeyValueFieldId
),
446 const_cast<VRMLOrientationInterpolatorBase
*>(this)));
451 EditFieldHandlePtr
VRMLOrientationInterpolatorBase::editHandleKeyValue (void)
453 MFQuaternion::EditHandlePtr
returnValue(
454 new MFQuaternion::EditHandle(
456 this->getType().getFieldDesc(KeyValueFieldId
),
460 editMField(KeyValueFieldMask
, _mfKeyValue
);
465 GetFieldHandlePtr
VRMLOrientationInterpolatorBase::getHandleOutValue (void) const
467 SFQuaternion::GetHandlePtr
returnValue(
468 new SFQuaternion::GetHandle(
470 this->getType().getFieldDesc(OutValueFieldId
),
471 const_cast<VRMLOrientationInterpolatorBase
*>(this)));
476 EditFieldHandlePtr
VRMLOrientationInterpolatorBase::editHandleOutValue (void)
478 SFQuaternion::EditHandlePtr
returnValue(
479 new SFQuaternion::EditHandle(
481 this->getType().getFieldDesc(OutValueFieldId
),
485 editSField(OutValueFieldMask
);
491 #ifdef OSG_MT_CPTR_ASPECT
492 void VRMLOrientationInterpolatorBase::execSyncV( FieldContainer
&oFrom
,
493 ConstFieldMaskArg whichField
,
494 AspectOffsetStore
&oOffsets
,
495 ConstFieldMaskArg syncMode
,
496 const UInt32 uiSyncInfo
)
498 VRMLOrientationInterpolator
*pThis
= static_cast<VRMLOrientationInterpolator
*>(this);
500 pThis
->execSync(static_cast<VRMLOrientationInterpolator
*>(&oFrom
),
509 #ifdef OSG_MT_CPTR_ASPECT
510 FieldContainer
*VRMLOrientationInterpolatorBase::createAspectCopy(
511 const FieldContainer
*pRefAspect
) const
513 VRMLOrientationInterpolator
*returnValue
;
515 newAspectCopy(returnValue
,
516 dynamic_cast<const VRMLOrientationInterpolator
*>(pRefAspect
),
517 dynamic_cast<const VRMLOrientationInterpolator
*>(this));
523 void VRMLOrientationInterpolatorBase::resolveLinks(void)
525 Inherited::resolveLinks();
527 #ifdef OSG_MT_CPTR_ASPECT
528 AspectOffsetStore oOffsets
;
530 _pAspectStore
->fillOffsetArray(oOffsets
, this);
533 #ifdef OSG_MT_CPTR_ASPECT
534 _mfKeyValue
.terminateShare(Thread::getCurrentAspect(),