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 AnimQuaternionChannel!
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"
65 #include "OSGAnimQuaternionDataSource.h" // Data Class
67 #include "OSGAnimQuaternionChannelBase.h"
68 #include "OSGAnimQuaternionChannel.h"
70 #include <boost/bind.hpp>
74 /***************************************************************************\
76 \***************************************************************************/
78 /*! \class OSG::AnimQuaternionChannel
82 /***************************************************************************\
83 * Field Documentation *
84 \***************************************************************************/
86 /*! \var AnimQuaternionDataSource * AnimQuaternionChannelBase::_sfData
90 /*! \var Quaternion AnimQuaternionChannelBase::_sfOutValue
95 /***************************************************************************\
96 * FieldType/FieldTrait Instantiation *
97 \***************************************************************************/
99 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
100 PointerType FieldTraits
<AnimQuaternionChannel
*, nsOSG
>::_type(
101 "AnimQuaternionChannelPtr",
103 AnimQuaternionChannel::getClassType(),
107 OSG_FIELDTRAITS_GETTYPE_NS(AnimQuaternionChannel
*, nsOSG
)
109 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField
,
110 AnimQuaternionChannel
*,
113 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField
,
114 AnimQuaternionChannel
*,
117 /***************************************************************************\
118 * Field Description *
119 \***************************************************************************/
121 void AnimQuaternionChannelBase::classDescInserter(TypeObject
&oType
)
123 FieldDescriptionBase
*pDesc
= NULL
;
126 pDesc
= new SFUnrecAnimQuaternionDataSourcePtr::Description(
127 SFUnrecAnimQuaternionDataSourcePtr::getClassType(),
130 DataFieldId
, DataFieldMask
,
132 (Field::FStdAccess
| Field::FClusterLocal
),
133 static_cast<FieldEditMethodSig
>(&AnimQuaternionChannel::editHandleData
),
134 static_cast<FieldGetMethodSig
>(&AnimQuaternionChannel::getHandleData
));
136 oType
.addInitialDesc(pDesc
);
138 pDesc
= new SFQuaternion::Description(
139 SFQuaternion::getClassType(),
142 OutValueFieldId
, OutValueFieldMask
,
144 (Field::FClusterLocal
),
145 static_cast<FieldEditMethodSig
>(&AnimQuaternionChannel::editHandleOutValue
),
146 static_cast<FieldGetMethodSig
>(&AnimQuaternionChannel::getHandleOutValue
));
148 oType
.addInitialDesc(pDesc
);
152 AnimQuaternionChannelBase::TypeObject
AnimQuaternionChannelBase::_type(
153 AnimQuaternionChannelBase::getClassname(),
154 Inherited::getClassname(),
157 reinterpret_cast<PrototypeCreateF
>(&AnimQuaternionChannelBase::createEmptyLocal
),
158 reinterpret_cast<InitContainerF
>(&AnimQuaternionChannel::initMethod
),
159 reinterpret_cast<ExitContainerF
>(&AnimQuaternionChannel::exitMethod
),
160 reinterpret_cast<InitalInsertDescFunc
>(
161 reinterpret_cast<void *>(&AnimQuaternionChannel::classDescInserter
)),
164 "<?xml version=\"1.0\"?>\n"
167 " name=\"AnimQuaternionChannel\"\n"
168 " parent=\"AnimChannel\"\n"
169 " library=\"Dynamics\"\n"
170 " pointerfieldtypes=\"both\"\n"
171 " structure=\"concrete\"\n"
172 " systemcomponent=\"true\"\n"
173 " parentsystemcomponent=\"true\"\n"
174 " decoratable=\"false\"\n"
175 " useLocalIncludes=\"false\"\n"
176 " isNodeCore=\"true\"\n"
177 " isBundle=\"false\"\n"
178 " parentFields=\"none\"\n"
182 " category=\"pointer\"\n"
183 " type=\"AnimQuaternionDataSource\"\n"
184 " cardinality=\"single\"\n"
185 " visibility=\"internal\"\n"
186 " access=\"public\"\n"
187 " defaultValue=\"NULL\"\n"
188 " fieldFlags=\"FStdAccess, FClusterLocal\"\n"
192 " name=\"outValue\"\n"
193 " category=\"data\"\n"
194 " type=\"Quaternion\"\n"
195 " cardinality=\"single\"\n"
196 " visibility=\"internal\"\n"
197 " access=\"public\"\n"
198 " fieldFlags=\"FClusterLocal\"\n"
201 "</FieldContainer>\n",
205 /*------------------------------ get -----------------------------------*/
207 FieldContainerType
&AnimQuaternionChannelBase::getType(void)
212 const FieldContainerType
&AnimQuaternionChannelBase::getType(void) const
217 UInt32
AnimQuaternionChannelBase::getContainerSize(void) const
219 return sizeof(AnimQuaternionChannel
);
222 /*------------------------- decorator get ------------------------------*/
225 //! Get the AnimQuaternionChannel::_sfData field.
226 const SFUnrecAnimQuaternionDataSourcePtr
*AnimQuaternionChannelBase::getSFData(void) const
231 SFUnrecAnimQuaternionDataSourcePtr
*AnimQuaternionChannelBase::editSFData (void)
233 editSField(DataFieldMask
);
238 //! Get the value of the AnimQuaternionChannel::_sfData field.
239 AnimQuaternionDataSource
* AnimQuaternionChannelBase::getData(void) const
241 return _sfData
.getValue();
244 //! Set the value of the AnimQuaternionChannel::_sfData field.
245 void AnimQuaternionChannelBase::setData(AnimQuaternionDataSource
* const value
)
247 editSField(DataFieldMask
);
249 _sfData
.setValue(value
);
253 SFQuaternion
*AnimQuaternionChannelBase::editSFOutValue(void)
255 editSField(OutValueFieldMask
);
260 const SFQuaternion
*AnimQuaternionChannelBase::getSFOutValue(void) const
270 /*------------------------------ access -----------------------------------*/
272 SizeT
AnimQuaternionChannelBase::getBinSize(ConstFieldMaskArg whichField
)
274 SizeT returnValue
= Inherited::getBinSize(whichField
);
276 if(FieldBits::NoField
!= (DataFieldMask
& whichField
))
278 returnValue
+= _sfData
.getBinSize();
280 if(FieldBits::NoField
!= (OutValueFieldMask
& whichField
))
282 returnValue
+= _sfOutValue
.getBinSize();
288 void AnimQuaternionChannelBase::copyToBin(BinaryDataHandler
&pMem
,
289 ConstFieldMaskArg whichField
)
291 Inherited::copyToBin(pMem
, whichField
);
293 if(FieldBits::NoField
!= (DataFieldMask
& whichField
))
295 _sfData
.copyToBin(pMem
);
297 if(FieldBits::NoField
!= (OutValueFieldMask
& whichField
))
299 _sfOutValue
.copyToBin(pMem
);
303 void AnimQuaternionChannelBase::copyFromBin(BinaryDataHandler
&pMem
,
304 ConstFieldMaskArg whichField
)
306 Inherited::copyFromBin(pMem
, whichField
);
308 if(FieldBits::NoField
!= (DataFieldMask
& whichField
))
310 editSField(DataFieldMask
);
311 _sfData
.copyFromBin(pMem
);
313 if(FieldBits::NoField
!= (OutValueFieldMask
& whichField
))
315 editSField(OutValueFieldMask
);
316 _sfOutValue
.copyFromBin(pMem
);
320 //! create a new instance of the class
321 AnimQuaternionChannelTransitPtr
AnimQuaternionChannelBase::createLocal(BitVector bFlags
)
323 AnimQuaternionChannelTransitPtr fc
;
325 if(getClassType().getPrototype() != NULL
)
327 FieldContainerTransitPtr tmpPtr
=
328 getClassType().getPrototype()-> shallowCopyLocal(bFlags
);
330 fc
= dynamic_pointer_cast
<AnimQuaternionChannel
>(tmpPtr
);
336 //! create a new instance of the class, copy the container flags
337 AnimQuaternionChannelTransitPtr
AnimQuaternionChannelBase::createDependent(BitVector bFlags
)
339 AnimQuaternionChannelTransitPtr fc
;
341 if(getClassType().getPrototype() != NULL
)
343 FieldContainerTransitPtr tmpPtr
=
344 getClassType().getPrototype()-> shallowCopyDependent(bFlags
);
346 fc
= dynamic_pointer_cast
<AnimQuaternionChannel
>(tmpPtr
);
352 //! create a new instance of the class
353 AnimQuaternionChannelTransitPtr
AnimQuaternionChannelBase::create(void)
355 AnimQuaternionChannelTransitPtr fc
;
357 if(getClassType().getPrototype() != NULL
)
359 FieldContainerTransitPtr tmpPtr
=
360 getClassType().getPrototype()-> shallowCopy();
362 fc
= dynamic_pointer_cast
<AnimQuaternionChannel
>(tmpPtr
);
368 AnimQuaternionChannel
*AnimQuaternionChannelBase::createEmptyLocal(BitVector bFlags
)
370 AnimQuaternionChannel
*returnValue
;
372 newPtr
<AnimQuaternionChannel
>(returnValue
, bFlags
);
374 returnValue
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
379 //! create an empty new instance of the class, do not copy the prototype
380 AnimQuaternionChannel
*AnimQuaternionChannelBase::createEmpty(void)
382 AnimQuaternionChannel
*returnValue
;
384 newPtr
<AnimQuaternionChannel
>(returnValue
, Thread::getCurrentLocalFlags());
386 returnValue
->_pFieldFlags
->_bNamespaceMask
&=
387 ~Thread::getCurrentLocalFlags();
393 FieldContainerTransitPtr
AnimQuaternionChannelBase::shallowCopyLocal(
394 BitVector bFlags
) const
396 AnimQuaternionChannel
*tmpPtr
;
398 newPtr(tmpPtr
, dynamic_cast<const AnimQuaternionChannel
*>(this), bFlags
);
400 FieldContainerTransitPtr
returnValue(tmpPtr
);
402 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
407 FieldContainerTransitPtr
AnimQuaternionChannelBase::shallowCopyDependent(
408 BitVector bFlags
) const
410 AnimQuaternionChannel
*tmpPtr
;
412 newPtr(tmpPtr
, dynamic_cast<const AnimQuaternionChannel
*>(this), ~bFlags
);
414 FieldContainerTransitPtr
returnValue(tmpPtr
);
416 tmpPtr
->_pFieldFlags
->_bNamespaceMask
= bFlags
;
421 FieldContainerTransitPtr
AnimQuaternionChannelBase::shallowCopy(void) const
423 AnimQuaternionChannel
*tmpPtr
;
426 dynamic_cast<const AnimQuaternionChannel
*>(this),
427 Thread::getCurrentLocalFlags());
429 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~Thread::getCurrentLocalFlags();
431 FieldContainerTransitPtr
returnValue(tmpPtr
);
439 /*------------------------- constructors ----------------------------------*/
441 AnimQuaternionChannelBase::AnimQuaternionChannelBase(void) :
448 AnimQuaternionChannelBase::AnimQuaternionChannelBase(const AnimQuaternionChannelBase
&source
) :
451 _sfOutValue (source
._sfOutValue
)
456 /*-------------------------- destructors ----------------------------------*/
458 AnimQuaternionChannelBase::~AnimQuaternionChannelBase(void)
462 void AnimQuaternionChannelBase::onCreate(const AnimQuaternionChannel
*source
)
464 Inherited::onCreate(source
);
468 AnimQuaternionChannel
*pThis
= static_cast<AnimQuaternionChannel
*>(this);
470 pThis
->setData(source
->getData());
474 GetFieldHandlePtr
AnimQuaternionChannelBase::getHandleData (void) const
476 SFUnrecAnimQuaternionDataSourcePtr::GetHandlePtr
returnValue(
477 new SFUnrecAnimQuaternionDataSourcePtr::GetHandle(
479 this->getType().getFieldDesc(DataFieldId
),
480 const_cast<AnimQuaternionChannelBase
*>(this)));
485 EditFieldHandlePtr
AnimQuaternionChannelBase::editHandleData (void)
487 SFUnrecAnimQuaternionDataSourcePtr::EditHandlePtr
returnValue(
488 new SFUnrecAnimQuaternionDataSourcePtr::EditHandle(
490 this->getType().getFieldDesc(DataFieldId
),
493 returnValue
->setSetMethod(
494 boost::bind(&AnimQuaternionChannel::setData
,
495 static_cast<AnimQuaternionChannel
*>(this), _1
));
497 editSField(DataFieldMask
);
502 GetFieldHandlePtr
AnimQuaternionChannelBase::getHandleOutValue (void) const
504 SFQuaternion::GetHandlePtr
returnValue(
505 new SFQuaternion::GetHandle(
507 this->getType().getFieldDesc(OutValueFieldId
),
508 const_cast<AnimQuaternionChannelBase
*>(this)));
513 EditFieldHandlePtr
AnimQuaternionChannelBase::editHandleOutValue (void)
515 SFQuaternion::EditHandlePtr
returnValue(
516 new SFQuaternion::EditHandle(
518 this->getType().getFieldDesc(OutValueFieldId
),
522 editSField(OutValueFieldMask
);
528 #ifdef OSG_MT_CPTR_ASPECT
529 void AnimQuaternionChannelBase::execSyncV( FieldContainer
&oFrom
,
530 ConstFieldMaskArg whichField
,
531 AspectOffsetStore
&oOffsets
,
532 ConstFieldMaskArg syncMode
,
533 const UInt32 uiSyncInfo
)
535 AnimQuaternionChannel
*pThis
= static_cast<AnimQuaternionChannel
*>(this);
537 pThis
->execSync(static_cast<AnimQuaternionChannel
*>(&oFrom
),
546 #ifdef OSG_MT_CPTR_ASPECT
547 FieldContainer
*AnimQuaternionChannelBase::createAspectCopy(
548 const FieldContainer
*pRefAspect
) const
550 AnimQuaternionChannel
*returnValue
;
552 newAspectCopy(returnValue
,
553 dynamic_cast<const AnimQuaternionChannel
*>(pRefAspect
),
554 dynamic_cast<const AnimQuaternionChannel
*>(this));
560 void AnimQuaternionChannelBase::resolveLinks(void)
562 Inherited::resolveLinks();
564 static_cast<AnimQuaternionChannel
*>(this)->setData(NULL
);