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 AnimTimeSensor!
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 "OSGAnimTimeSensorBase.h"
67 #include "OSGAnimTimeSensor.h"
69 #include <boost/bind.hpp>
73 /***************************************************************************\
75 \***************************************************************************/
77 /*! \class OSG::AnimTimeSensor
81 /***************************************************************************\
82 * Field Documentation *
83 \***************************************************************************/
85 /*! \var bool AnimTimeSensorBase::_sfEnabled
89 /*! \var bool AnimTimeSensorBase::_sfIsActive
93 /*! \var bool AnimTimeSensorBase::_sfLoop
97 /*! \var bool AnimTimeSensorBase::_sfForward
101 /*! \var Time AnimTimeSensorBase::_sfStartTime
105 /*! \var Time AnimTimeSensorBase::_sfStopTime
109 /*! \var Time AnimTimeSensorBase::_sfTime
113 /*! \var Time AnimTimeSensorBase::_sfCycleLength
117 /*! \var Real32 AnimTimeSensorBase::_sfTimeScale
121 /*! \var Real32 AnimTimeSensorBase::_sfFraction
125 /*! \var Real32 AnimTimeSensorBase::_sfAnimTime
130 /***************************************************************************\
131 * FieldType/FieldTrait Instantiation *
132 \***************************************************************************/
134 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
135 PointerType FieldTraits
<AnimTimeSensor
*, nsOSG
>::_type(
138 AnimTimeSensor::getClassType(),
142 OSG_FIELDTRAITS_GETTYPE_NS(AnimTimeSensor
*, nsOSG
)
144 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField
,
148 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField
,
152 /***************************************************************************\
153 * Field Description *
154 \***************************************************************************/
156 void AnimTimeSensorBase::classDescInserter(TypeObject
&oType
)
158 Inherited::classDescInserter(oType
);
160 FieldDescriptionBase
*pDesc
= NULL
;
163 pDesc
= new SFBool::Description(
164 SFBool::getClassType(),
167 EnabledFieldId
, EnabledFieldMask
,
169 (Field::FClusterLocal
),
170 static_cast<FieldEditMethodSig
>(&AnimTimeSensor::editHandleEnabled
),
171 static_cast<FieldGetMethodSig
>(&AnimTimeSensor::getHandleEnabled
));
173 oType
.addInitialDesc(pDesc
);
175 pDesc
= new SFBool::Description(
176 SFBool::getClassType(),
179 IsActiveFieldId
, IsActiveFieldMask
,
181 (Field::FClusterLocal
),
182 static_cast<FieldEditMethodSig
>(&AnimTimeSensor::editHandleIsActive
),
183 static_cast<FieldGetMethodSig
>(&AnimTimeSensor::getHandleIsActive
));
185 oType
.addInitialDesc(pDesc
);
187 pDesc
= new SFBool::Description(
188 SFBool::getClassType(),
191 LoopFieldId
, LoopFieldMask
,
193 (Field::FClusterLocal
),
194 static_cast<FieldEditMethodSig
>(&AnimTimeSensor::editHandleLoop
),
195 static_cast<FieldGetMethodSig
>(&AnimTimeSensor::getHandleLoop
));
197 oType
.addInitialDesc(pDesc
);
199 pDesc
= new SFBool::Description(
200 SFBool::getClassType(),
203 ForwardFieldId
, ForwardFieldMask
,
205 (Field::FClusterLocal
),
206 static_cast<FieldEditMethodSig
>(&AnimTimeSensor::editHandleForward
),
207 static_cast<FieldGetMethodSig
>(&AnimTimeSensor::getHandleForward
));
209 oType
.addInitialDesc(pDesc
);
211 pDesc
= new SFTime::Description(
212 SFTime::getClassType(),
215 StartTimeFieldId
, StartTimeFieldMask
,
217 (Field::FClusterLocal
),
218 static_cast<FieldEditMethodSig
>(&AnimTimeSensor::editHandleStartTime
),
219 static_cast<FieldGetMethodSig
>(&AnimTimeSensor::getHandleStartTime
));
221 oType
.addInitialDesc(pDesc
);
223 pDesc
= new SFTime::Description(
224 SFTime::getClassType(),
227 StopTimeFieldId
, StopTimeFieldMask
,
229 (Field::FClusterLocal
),
230 static_cast<FieldEditMethodSig
>(&AnimTimeSensor::editHandleStopTime
),
231 static_cast<FieldGetMethodSig
>(&AnimTimeSensor::getHandleStopTime
));
233 oType
.addInitialDesc(pDesc
);
235 pDesc
= new SFTime::Description(
236 SFTime::getClassType(),
239 TimeFieldId
, TimeFieldMask
,
241 (Field::FClusterLocal
),
242 static_cast<FieldEditMethodSig
>(&AnimTimeSensor::editHandleTime
),
243 static_cast<FieldGetMethodSig
>(&AnimTimeSensor::getHandleTime
));
245 oType
.addInitialDesc(pDesc
);
247 pDesc
= new SFTime::Description(
248 SFTime::getClassType(),
251 CycleLengthFieldId
, CycleLengthFieldMask
,
253 (Field::FClusterLocal
),
254 static_cast<FieldEditMethodSig
>(&AnimTimeSensor::editHandleCycleLength
),
255 static_cast<FieldGetMethodSig
>(&AnimTimeSensor::getHandleCycleLength
));
257 oType
.addInitialDesc(pDesc
);
259 pDesc
= new SFReal32::Description(
260 SFReal32::getClassType(),
263 TimeScaleFieldId
, TimeScaleFieldMask
,
265 (Field::FClusterLocal
),
266 static_cast<FieldEditMethodSig
>(&AnimTimeSensor::editHandleTimeScale
),
267 static_cast<FieldGetMethodSig
>(&AnimTimeSensor::getHandleTimeScale
));
269 oType
.addInitialDesc(pDesc
);
271 pDesc
= new SFReal32::Description(
272 SFReal32::getClassType(),
275 FractionFieldId
, FractionFieldMask
,
277 (Field::FClusterLocal
),
278 static_cast<FieldEditMethodSig
>(&AnimTimeSensor::editHandleFraction
),
279 static_cast<FieldGetMethodSig
>(&AnimTimeSensor::getHandleFraction
));
281 oType
.addInitialDesc(pDesc
);
283 pDesc
= new SFReal32::Description(
284 SFReal32::getClassType(),
287 AnimTimeFieldId
, AnimTimeFieldMask
,
289 (Field::FClusterLocal
),
290 static_cast<FieldEditMethodSig
>(&AnimTimeSensor::editHandleAnimTime
),
291 static_cast<FieldGetMethodSig
>(&AnimTimeSensor::getHandleAnimTime
));
293 oType
.addInitialDesc(pDesc
);
297 AnimTimeSensorBase::TypeObject
AnimTimeSensorBase::_type(
298 AnimTimeSensorBase::getClassname(),
299 Inherited::getClassname(),
302 reinterpret_cast<PrototypeCreateF
>(&AnimTimeSensorBase::createEmptyLocal
),
303 reinterpret_cast<InitContainerF
>(&AnimTimeSensor::initMethod
),
304 reinterpret_cast<ExitContainerF
>(&AnimTimeSensor::exitMethod
),
305 reinterpret_cast<InitalInsertDescFunc
>(
306 reinterpret_cast<void *>(&AnimTimeSensor::classDescInserter
)),
309 "<?xml version=\"1.0\"?>\n"
312 " name=\"AnimTimeSensor\"\n"
313 " parent=\"NodeCore\"\n"
314 " mixinparent=\"NodeCoreSensorParent\"\n"
315 " library=\"Dynamics\"\n"
316 " pointerfieldtypes=\"both\"\n"
317 " structure=\"concrete\"\n"
318 " systemcomponent=\"true\"\n"
319 " parentsystemcomponent=\"true\"\n"
320 " decoratable=\"false\"\n"
321 " useLocalIncludes=\"false\"\n"
322 " isNodeCore=\"true\"\n"
323 " isBundle=\"false\"\n"
324 " parentFields=\"none\"\n"
327 " name=\"enabled\"\n"
329 " category=\"data\"\n"
330 " cardinality=\"single\"\n"
331 " visibility=\"internal\"\n"
332 " access=\"public\"\n"
333 " defaultValue=\"true\"\n"
334 " fieldFlags=\"FClusterLocal\"\n"
338 " name=\"isActive\"\n"
340 " category=\"data\"\n"
341 " cardinality=\"single\"\n"
342 " visibility=\"internal\"\n"
343 " access=\"public\"\n"
344 " defaultValue=\"false\"\n"
345 " fieldFlags=\"FClusterLocal\"\n"
351 " category=\"data\"\n"
352 " cardinality=\"single\"\n"
353 " visibility=\"internal\"\n"
354 " access=\"public\"\n"
355 " defaultValue=\"false\"\n"
356 " fieldFlags=\"FClusterLocal\"\n"
360 " name=\"forward\"\n"
362 " category=\"data\"\n"
363 " cardinality=\"single\"\n"
364 " visibility=\"internal\"\n"
365 " access=\"public\"\n"
366 " defaultValue=\"true\"\n"
367 " fieldFlags=\"FClusterLocal\"\n"
372 " name=\"startTime\"\n"
374 " category=\"data\"\n"
375 " cardinality=\"single\"\n"
376 " visibility=\"internal\"\n"
377 " access=\"public\"\n"
378 " defaultValue=\"0.0\"\n"
379 " fieldFlags=\"FClusterLocal\"\n"
383 " name=\"stopTime\"\n"
385 " category=\"data\"\n"
386 " cardinality=\"single\"\n"
387 " visibility=\"internal\"\n"
388 " access=\"public\"\n"
389 " defaultValue=\"0.0\"\n"
390 " fieldFlags=\"FClusterLocal\"\n"
396 " category=\"data\"\n"
397 " cardinality=\"single\"\n"
398 " visibility=\"internal\"\n"
399 " access=\"public\"\n"
400 " defaultValue=\"-1.0\"\n"
401 " fieldFlags=\"FClusterLocal\"\n"
405 " name=\"cycleLength\"\n"
407 " category=\"data\"\n"
408 " cardinality=\"single\"\n"
409 " visibility=\"internal\"\n"
410 " access=\"public\"\n"
411 " defaultValue=\"0.0\"\n"
412 " fieldFlags=\"FClusterLocal\"\n"
417 " name=\"timeScale\"\n"
419 " category=\"data\"\n"
420 " cardinality=\"single\"\n"
421 " visibility=\"internal\"\n"
422 " access=\"public\"\n"
423 " defaultValue=\"1.f\"\n"
424 " fieldFlags=\"FClusterLocal\"\n"
428 " name=\"fraction\"\n"
430 " category=\"data\"\n"
431 " cardinality=\"single\"\n"
432 " visibility=\"internal\"\n"
433 " access=\"public\"\n"
434 " defaultValue=\"0.f\"\n"
435 " fieldFlags=\"FClusterLocal\"\n"
439 " name=\"animTime\"\n"
441 " category=\"data\"\n"
442 " cardinality=\"single\"\n"
443 " visibility=\"internal\"\n"
444 " access=\"public\"\n"
445 " defaultValue=\"0.f\"\n"
446 " fieldFlags=\"FClusterLocal\"\n"
449 "</FieldContainer>\n",
453 /*------------------------------ get -----------------------------------*/
455 FieldContainerType
&AnimTimeSensorBase::getType(void)
460 const FieldContainerType
&AnimTimeSensorBase::getType(void) const
465 UInt32
AnimTimeSensorBase::getContainerSize(void) const
467 return sizeof(AnimTimeSensor
);
470 /*------------------------- decorator get ------------------------------*/
473 SFBool
*AnimTimeSensorBase::editSFEnabled(void)
475 editSField(EnabledFieldMask
);
480 const SFBool
*AnimTimeSensorBase::getSFEnabled(void) const
486 SFBool
*AnimTimeSensorBase::editSFIsActive(void)
488 editSField(IsActiveFieldMask
);
493 const SFBool
*AnimTimeSensorBase::getSFIsActive(void) const
499 SFBool
*AnimTimeSensorBase::editSFLoop(void)
501 editSField(LoopFieldMask
);
506 const SFBool
*AnimTimeSensorBase::getSFLoop(void) const
512 SFBool
*AnimTimeSensorBase::editSFForward(void)
514 editSField(ForwardFieldMask
);
519 const SFBool
*AnimTimeSensorBase::getSFForward(void) const
525 SFTime
*AnimTimeSensorBase::editSFStartTime(void)
527 editSField(StartTimeFieldMask
);
529 return &_sfStartTime
;
532 const SFTime
*AnimTimeSensorBase::getSFStartTime(void) const
534 return &_sfStartTime
;
538 SFTime
*AnimTimeSensorBase::editSFStopTime(void)
540 editSField(StopTimeFieldMask
);
545 const SFTime
*AnimTimeSensorBase::getSFStopTime(void) const
551 SFTime
*AnimTimeSensorBase::editSFTime(void)
553 editSField(TimeFieldMask
);
558 const SFTime
*AnimTimeSensorBase::getSFTime(void) const
564 SFTime
*AnimTimeSensorBase::editSFCycleLength(void)
566 editSField(CycleLengthFieldMask
);
568 return &_sfCycleLength
;
571 const SFTime
*AnimTimeSensorBase::getSFCycleLength(void) const
573 return &_sfCycleLength
;
577 SFReal32
*AnimTimeSensorBase::editSFTimeScale(void)
579 editSField(TimeScaleFieldMask
);
581 return &_sfTimeScale
;
584 const SFReal32
*AnimTimeSensorBase::getSFTimeScale(void) const
586 return &_sfTimeScale
;
590 SFReal32
*AnimTimeSensorBase::editSFFraction(void)
592 editSField(FractionFieldMask
);
597 const SFReal32
*AnimTimeSensorBase::getSFFraction(void) const
603 SFReal32
*AnimTimeSensorBase::editSFAnimTime(void)
605 editSField(AnimTimeFieldMask
);
610 const SFReal32
*AnimTimeSensorBase::getSFAnimTime(void) const
620 /*------------------------------ access -----------------------------------*/
622 SizeT
AnimTimeSensorBase::getBinSize(ConstFieldMaskArg whichField
)
624 SizeT returnValue
= Inherited::getBinSize(whichField
);
626 if(FieldBits::NoField
!= (EnabledFieldMask
& whichField
))
628 returnValue
+= _sfEnabled
.getBinSize();
630 if(FieldBits::NoField
!= (IsActiveFieldMask
& whichField
))
632 returnValue
+= _sfIsActive
.getBinSize();
634 if(FieldBits::NoField
!= (LoopFieldMask
& whichField
))
636 returnValue
+= _sfLoop
.getBinSize();
638 if(FieldBits::NoField
!= (ForwardFieldMask
& whichField
))
640 returnValue
+= _sfForward
.getBinSize();
642 if(FieldBits::NoField
!= (StartTimeFieldMask
& whichField
))
644 returnValue
+= _sfStartTime
.getBinSize();
646 if(FieldBits::NoField
!= (StopTimeFieldMask
& whichField
))
648 returnValue
+= _sfStopTime
.getBinSize();
650 if(FieldBits::NoField
!= (TimeFieldMask
& whichField
))
652 returnValue
+= _sfTime
.getBinSize();
654 if(FieldBits::NoField
!= (CycleLengthFieldMask
& whichField
))
656 returnValue
+= _sfCycleLength
.getBinSize();
658 if(FieldBits::NoField
!= (TimeScaleFieldMask
& whichField
))
660 returnValue
+= _sfTimeScale
.getBinSize();
662 if(FieldBits::NoField
!= (FractionFieldMask
& whichField
))
664 returnValue
+= _sfFraction
.getBinSize();
666 if(FieldBits::NoField
!= (AnimTimeFieldMask
& whichField
))
668 returnValue
+= _sfAnimTime
.getBinSize();
674 void AnimTimeSensorBase::copyToBin(BinaryDataHandler
&pMem
,
675 ConstFieldMaskArg whichField
)
677 Inherited::copyToBin(pMem
, whichField
);
679 if(FieldBits::NoField
!= (EnabledFieldMask
& whichField
))
681 _sfEnabled
.copyToBin(pMem
);
683 if(FieldBits::NoField
!= (IsActiveFieldMask
& whichField
))
685 _sfIsActive
.copyToBin(pMem
);
687 if(FieldBits::NoField
!= (LoopFieldMask
& whichField
))
689 _sfLoop
.copyToBin(pMem
);
691 if(FieldBits::NoField
!= (ForwardFieldMask
& whichField
))
693 _sfForward
.copyToBin(pMem
);
695 if(FieldBits::NoField
!= (StartTimeFieldMask
& whichField
))
697 _sfStartTime
.copyToBin(pMem
);
699 if(FieldBits::NoField
!= (StopTimeFieldMask
& whichField
))
701 _sfStopTime
.copyToBin(pMem
);
703 if(FieldBits::NoField
!= (TimeFieldMask
& whichField
))
705 _sfTime
.copyToBin(pMem
);
707 if(FieldBits::NoField
!= (CycleLengthFieldMask
& whichField
))
709 _sfCycleLength
.copyToBin(pMem
);
711 if(FieldBits::NoField
!= (TimeScaleFieldMask
& whichField
))
713 _sfTimeScale
.copyToBin(pMem
);
715 if(FieldBits::NoField
!= (FractionFieldMask
& whichField
))
717 _sfFraction
.copyToBin(pMem
);
719 if(FieldBits::NoField
!= (AnimTimeFieldMask
& whichField
))
721 _sfAnimTime
.copyToBin(pMem
);
725 void AnimTimeSensorBase::copyFromBin(BinaryDataHandler
&pMem
,
726 ConstFieldMaskArg whichField
)
728 Inherited::copyFromBin(pMem
, whichField
);
730 if(FieldBits::NoField
!= (EnabledFieldMask
& whichField
))
732 editSField(EnabledFieldMask
);
733 _sfEnabled
.copyFromBin(pMem
);
735 if(FieldBits::NoField
!= (IsActiveFieldMask
& whichField
))
737 editSField(IsActiveFieldMask
);
738 _sfIsActive
.copyFromBin(pMem
);
740 if(FieldBits::NoField
!= (LoopFieldMask
& whichField
))
742 editSField(LoopFieldMask
);
743 _sfLoop
.copyFromBin(pMem
);
745 if(FieldBits::NoField
!= (ForwardFieldMask
& whichField
))
747 editSField(ForwardFieldMask
);
748 _sfForward
.copyFromBin(pMem
);
750 if(FieldBits::NoField
!= (StartTimeFieldMask
& whichField
))
752 editSField(StartTimeFieldMask
);
753 _sfStartTime
.copyFromBin(pMem
);
755 if(FieldBits::NoField
!= (StopTimeFieldMask
& whichField
))
757 editSField(StopTimeFieldMask
);
758 _sfStopTime
.copyFromBin(pMem
);
760 if(FieldBits::NoField
!= (TimeFieldMask
& whichField
))
762 editSField(TimeFieldMask
);
763 _sfTime
.copyFromBin(pMem
);
765 if(FieldBits::NoField
!= (CycleLengthFieldMask
& whichField
))
767 editSField(CycleLengthFieldMask
);
768 _sfCycleLength
.copyFromBin(pMem
);
770 if(FieldBits::NoField
!= (TimeScaleFieldMask
& whichField
))
772 editSField(TimeScaleFieldMask
);
773 _sfTimeScale
.copyFromBin(pMem
);
775 if(FieldBits::NoField
!= (FractionFieldMask
& whichField
))
777 editSField(FractionFieldMask
);
778 _sfFraction
.copyFromBin(pMem
);
780 if(FieldBits::NoField
!= (AnimTimeFieldMask
& whichField
))
782 editSField(AnimTimeFieldMask
);
783 _sfAnimTime
.copyFromBin(pMem
);
787 //! create a new instance of the class
788 AnimTimeSensorTransitPtr
AnimTimeSensorBase::createLocal(BitVector bFlags
)
790 AnimTimeSensorTransitPtr fc
;
792 if(getClassType().getPrototype() != NULL
)
794 FieldContainerTransitPtr tmpPtr
=
795 getClassType().getPrototype()-> shallowCopyLocal(bFlags
);
797 fc
= dynamic_pointer_cast
<AnimTimeSensor
>(tmpPtr
);
803 //! create a new instance of the class, copy the container flags
804 AnimTimeSensorTransitPtr
AnimTimeSensorBase::createDependent(BitVector bFlags
)
806 AnimTimeSensorTransitPtr fc
;
808 if(getClassType().getPrototype() != NULL
)
810 FieldContainerTransitPtr tmpPtr
=
811 getClassType().getPrototype()-> shallowCopyDependent(bFlags
);
813 fc
= dynamic_pointer_cast
<AnimTimeSensor
>(tmpPtr
);
819 //! create a new instance of the class
820 AnimTimeSensorTransitPtr
AnimTimeSensorBase::create(void)
822 AnimTimeSensorTransitPtr fc
;
824 if(getClassType().getPrototype() != NULL
)
826 FieldContainerTransitPtr tmpPtr
=
827 getClassType().getPrototype()-> shallowCopy();
829 fc
= dynamic_pointer_cast
<AnimTimeSensor
>(tmpPtr
);
835 AnimTimeSensor
*AnimTimeSensorBase::createEmptyLocal(BitVector bFlags
)
837 AnimTimeSensor
*returnValue
;
839 newPtr
<AnimTimeSensor
>(returnValue
, bFlags
);
841 returnValue
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
846 //! create an empty new instance of the class, do not copy the prototype
847 AnimTimeSensor
*AnimTimeSensorBase::createEmpty(void)
849 AnimTimeSensor
*returnValue
;
851 newPtr
<AnimTimeSensor
>(returnValue
, Thread::getCurrentLocalFlags());
853 returnValue
->_pFieldFlags
->_bNamespaceMask
&=
854 ~Thread::getCurrentLocalFlags();
860 FieldContainerTransitPtr
AnimTimeSensorBase::shallowCopyLocal(
861 BitVector bFlags
) const
863 AnimTimeSensor
*tmpPtr
;
865 newPtr(tmpPtr
, dynamic_cast<const AnimTimeSensor
*>(this), bFlags
);
867 FieldContainerTransitPtr
returnValue(tmpPtr
);
869 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
874 FieldContainerTransitPtr
AnimTimeSensorBase::shallowCopyDependent(
875 BitVector bFlags
) const
877 AnimTimeSensor
*tmpPtr
;
879 newPtr(tmpPtr
, dynamic_cast<const AnimTimeSensor
*>(this), ~bFlags
);
881 FieldContainerTransitPtr
returnValue(tmpPtr
);
883 tmpPtr
->_pFieldFlags
->_bNamespaceMask
= bFlags
;
888 FieldContainerTransitPtr
AnimTimeSensorBase::shallowCopy(void) const
890 AnimTimeSensor
*tmpPtr
;
893 dynamic_cast<const AnimTimeSensor
*>(this),
894 Thread::getCurrentLocalFlags());
896 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~Thread::getCurrentLocalFlags();
898 FieldContainerTransitPtr
returnValue(tmpPtr
);
906 /*------------------------- constructors ----------------------------------*/
908 AnimTimeSensorBase::AnimTimeSensorBase(void) :
910 _sfEnabled (bool(true)),
911 _sfIsActive (bool(false)),
912 _sfLoop (bool(false)),
913 _sfForward (bool(true)),
914 _sfStartTime (Time(0.0)),
915 _sfStopTime (Time(0.0)),
916 _sfTime (Time(-1.0)),
917 _sfCycleLength (Time(0.0)),
918 _sfTimeScale (Real32(1.f
)),
919 _sfFraction (Real32(0.f
)),
920 _sfAnimTime (Real32(0.f
))
924 AnimTimeSensorBase::AnimTimeSensorBase(const AnimTimeSensorBase
&source
) :
926 _sfEnabled (source
._sfEnabled
),
927 _sfIsActive (source
._sfIsActive
),
928 _sfLoop (source
._sfLoop
),
929 _sfForward (source
._sfForward
),
930 _sfStartTime (source
._sfStartTime
),
931 _sfStopTime (source
._sfStopTime
),
932 _sfTime (source
._sfTime
),
933 _sfCycleLength (source
._sfCycleLength
),
934 _sfTimeScale (source
._sfTimeScale
),
935 _sfFraction (source
._sfFraction
),
936 _sfAnimTime (source
._sfAnimTime
)
941 /*-------------------------- destructors ----------------------------------*/
943 AnimTimeSensorBase::~AnimTimeSensorBase(void)
948 GetFieldHandlePtr
AnimTimeSensorBase::getHandleEnabled (void) const
950 SFBool::GetHandlePtr
returnValue(
951 new SFBool::GetHandle(
953 this->getType().getFieldDesc(EnabledFieldId
),
954 const_cast<AnimTimeSensorBase
*>(this)));
959 EditFieldHandlePtr
AnimTimeSensorBase::editHandleEnabled (void)
961 SFBool::EditHandlePtr
returnValue(
962 new SFBool::EditHandle(
964 this->getType().getFieldDesc(EnabledFieldId
),
968 editSField(EnabledFieldMask
);
973 GetFieldHandlePtr
AnimTimeSensorBase::getHandleIsActive (void) const
975 SFBool::GetHandlePtr
returnValue(
976 new SFBool::GetHandle(
978 this->getType().getFieldDesc(IsActiveFieldId
),
979 const_cast<AnimTimeSensorBase
*>(this)));
984 EditFieldHandlePtr
AnimTimeSensorBase::editHandleIsActive (void)
986 SFBool::EditHandlePtr
returnValue(
987 new SFBool::EditHandle(
989 this->getType().getFieldDesc(IsActiveFieldId
),
993 editSField(IsActiveFieldMask
);
998 GetFieldHandlePtr
AnimTimeSensorBase::getHandleLoop (void) const
1000 SFBool::GetHandlePtr
returnValue(
1001 new SFBool::GetHandle(
1003 this->getType().getFieldDesc(LoopFieldId
),
1004 const_cast<AnimTimeSensorBase
*>(this)));
1009 EditFieldHandlePtr
AnimTimeSensorBase::editHandleLoop (void)
1011 SFBool::EditHandlePtr
returnValue(
1012 new SFBool::EditHandle(
1014 this->getType().getFieldDesc(LoopFieldId
),
1018 editSField(LoopFieldMask
);
1023 GetFieldHandlePtr
AnimTimeSensorBase::getHandleForward (void) const
1025 SFBool::GetHandlePtr
returnValue(
1026 new SFBool::GetHandle(
1028 this->getType().getFieldDesc(ForwardFieldId
),
1029 const_cast<AnimTimeSensorBase
*>(this)));
1034 EditFieldHandlePtr
AnimTimeSensorBase::editHandleForward (void)
1036 SFBool::EditHandlePtr
returnValue(
1037 new SFBool::EditHandle(
1039 this->getType().getFieldDesc(ForwardFieldId
),
1043 editSField(ForwardFieldMask
);
1048 GetFieldHandlePtr
AnimTimeSensorBase::getHandleStartTime (void) const
1050 SFTime::GetHandlePtr
returnValue(
1051 new SFTime::GetHandle(
1053 this->getType().getFieldDesc(StartTimeFieldId
),
1054 const_cast<AnimTimeSensorBase
*>(this)));
1059 EditFieldHandlePtr
AnimTimeSensorBase::editHandleStartTime (void)
1061 SFTime::EditHandlePtr
returnValue(
1062 new SFTime::EditHandle(
1064 this->getType().getFieldDesc(StartTimeFieldId
),
1068 editSField(StartTimeFieldMask
);
1073 GetFieldHandlePtr
AnimTimeSensorBase::getHandleStopTime (void) const
1075 SFTime::GetHandlePtr
returnValue(
1076 new SFTime::GetHandle(
1078 this->getType().getFieldDesc(StopTimeFieldId
),
1079 const_cast<AnimTimeSensorBase
*>(this)));
1084 EditFieldHandlePtr
AnimTimeSensorBase::editHandleStopTime (void)
1086 SFTime::EditHandlePtr
returnValue(
1087 new SFTime::EditHandle(
1089 this->getType().getFieldDesc(StopTimeFieldId
),
1093 editSField(StopTimeFieldMask
);
1098 GetFieldHandlePtr
AnimTimeSensorBase::getHandleTime (void) const
1100 SFTime::GetHandlePtr
returnValue(
1101 new SFTime::GetHandle(
1103 this->getType().getFieldDesc(TimeFieldId
),
1104 const_cast<AnimTimeSensorBase
*>(this)));
1109 EditFieldHandlePtr
AnimTimeSensorBase::editHandleTime (void)
1111 SFTime::EditHandlePtr
returnValue(
1112 new SFTime::EditHandle(
1114 this->getType().getFieldDesc(TimeFieldId
),
1118 editSField(TimeFieldMask
);
1123 GetFieldHandlePtr
AnimTimeSensorBase::getHandleCycleLength (void) const
1125 SFTime::GetHandlePtr
returnValue(
1126 new SFTime::GetHandle(
1128 this->getType().getFieldDesc(CycleLengthFieldId
),
1129 const_cast<AnimTimeSensorBase
*>(this)));
1134 EditFieldHandlePtr
AnimTimeSensorBase::editHandleCycleLength (void)
1136 SFTime::EditHandlePtr
returnValue(
1137 new SFTime::EditHandle(
1139 this->getType().getFieldDesc(CycleLengthFieldId
),
1143 editSField(CycleLengthFieldMask
);
1148 GetFieldHandlePtr
AnimTimeSensorBase::getHandleTimeScale (void) const
1150 SFReal32::GetHandlePtr
returnValue(
1151 new SFReal32::GetHandle(
1153 this->getType().getFieldDesc(TimeScaleFieldId
),
1154 const_cast<AnimTimeSensorBase
*>(this)));
1159 EditFieldHandlePtr
AnimTimeSensorBase::editHandleTimeScale (void)
1161 SFReal32::EditHandlePtr
returnValue(
1162 new SFReal32::EditHandle(
1164 this->getType().getFieldDesc(TimeScaleFieldId
),
1168 editSField(TimeScaleFieldMask
);
1173 GetFieldHandlePtr
AnimTimeSensorBase::getHandleFraction (void) const
1175 SFReal32::GetHandlePtr
returnValue(
1176 new SFReal32::GetHandle(
1178 this->getType().getFieldDesc(FractionFieldId
),
1179 const_cast<AnimTimeSensorBase
*>(this)));
1184 EditFieldHandlePtr
AnimTimeSensorBase::editHandleFraction (void)
1186 SFReal32::EditHandlePtr
returnValue(
1187 new SFReal32::EditHandle(
1189 this->getType().getFieldDesc(FractionFieldId
),
1193 editSField(FractionFieldMask
);
1198 GetFieldHandlePtr
AnimTimeSensorBase::getHandleAnimTime (void) const
1200 SFReal32::GetHandlePtr
returnValue(
1201 new SFReal32::GetHandle(
1203 this->getType().getFieldDesc(AnimTimeFieldId
),
1204 const_cast<AnimTimeSensorBase
*>(this)));
1209 EditFieldHandlePtr
AnimTimeSensorBase::editHandleAnimTime (void)
1211 SFReal32::EditHandlePtr
returnValue(
1212 new SFReal32::EditHandle(
1214 this->getType().getFieldDesc(AnimTimeFieldId
),
1218 editSField(AnimTimeFieldMask
);
1224 #ifdef OSG_MT_CPTR_ASPECT
1225 void AnimTimeSensorBase::execSyncV( FieldContainer
&oFrom
,
1226 ConstFieldMaskArg whichField
,
1227 AspectOffsetStore
&oOffsets
,
1228 ConstFieldMaskArg syncMode
,
1229 const UInt32 uiSyncInfo
)
1231 AnimTimeSensor
*pThis
= static_cast<AnimTimeSensor
*>(this);
1233 pThis
->execSync(static_cast<AnimTimeSensor
*>(&oFrom
),
1242 #ifdef OSG_MT_CPTR_ASPECT
1243 FieldContainer
*AnimTimeSensorBase::createAspectCopy(
1244 const FieldContainer
*pRefAspect
) const
1246 AnimTimeSensor
*returnValue
;
1248 newAspectCopy(returnValue
,
1249 dynamic_cast<const AnimTimeSensor
*>(pRefAspect
),
1250 dynamic_cast<const AnimTimeSensor
*>(this));
1256 void AnimTimeSensorBase::resolveLinks(void)
1258 Inherited::resolveLinks();