changed: gcc8 base update
[opensg.git] / Source / System / Dynamics / Animation / OSGAnimTimeSensorBase.cpp
blob0a2a8e4cc4cc34d0890c4b880f0f405da903dc8b
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2000-2013 by the OpenSG Forum *
6 * *
7 * www.opensg.org *
8 * *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, carsten_neumann@gmx.net *
10 * *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
13 * License *
14 * *
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. *
18 * *
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. *
23 * *
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. *
27 * *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
30 * Changes *
31 * *
32 * *
33 * *
34 * *
35 * *
36 * *
37 \*---------------------------------------------------------------------------*/
39 /*****************************************************************************\
40 *****************************************************************************
41 ** **
42 ** This file is automatically generated. **
43 ** **
44 ** Any changes made to this file WILL be lost when it is **
45 ** regenerated, which can become necessary at any time. **
46 ** **
47 ** Do not change this file, changes should be done in the derived **
48 ** class AnimTimeSensor!
49 ** **
50 *****************************************************************************
51 \*****************************************************************************/
53 #include <cstdlib>
54 #include <cstdio>
56 #ifdef WIN32
57 #pragma warning(disable: 4355) // turn off 'this' : used in base member initializer list warning
58 #pragma warning(disable: 4290) // disable exception specification warning
59 #endif
61 #include "OSGConfig.h"
66 #include "OSGAnimTimeSensorBase.h"
67 #include "OSGAnimTimeSensor.h"
69 #include <boost/bind.hpp>
71 OSG_BEGIN_NAMESPACE
73 /***************************************************************************\
74 * Description *
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(
136 "AnimTimeSensorPtr",
137 "NodeCorePtr",
138 AnimTimeSensor::getClassType(),
139 nsOSG);
140 #endif
142 OSG_FIELDTRAITS_GETTYPE_NS(AnimTimeSensor *, nsOSG)
144 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField,
145 AnimTimeSensor *,
146 nsOSG)
148 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField,
149 AnimTimeSensor *,
150 nsOSG)
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(),
165 "enabled",
167 EnabledFieldId, EnabledFieldMask,
168 true,
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(),
177 "isActive",
179 IsActiveFieldId, IsActiveFieldMask,
180 true,
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(),
189 "loop",
191 LoopFieldId, LoopFieldMask,
192 true,
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(),
201 "forward",
203 ForwardFieldId, ForwardFieldMask,
204 true,
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(),
213 "startTime",
215 StartTimeFieldId, StartTimeFieldMask,
216 true,
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(),
225 "stopTime",
227 StopTimeFieldId, StopTimeFieldMask,
228 true,
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(),
237 "time",
239 TimeFieldId, TimeFieldMask,
240 true,
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(),
249 "cycleLength",
251 CycleLengthFieldId, CycleLengthFieldMask,
252 true,
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(),
261 "timeScale",
263 TimeScaleFieldId, TimeScaleFieldMask,
264 true,
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(),
273 "fraction",
275 FractionFieldId, FractionFieldMask,
276 true,
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(),
285 "animTime",
287 AnimTimeFieldId, AnimTimeFieldMask,
288 true,
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(),
300 "NULL",
301 nsOSG, //Namespace
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)),
307 false,
309 "<?xml version=\"1.0\"?>\n"
310 "\n"
311 "<FieldContainer\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"
325 ">\n"
326 " <Field\n"
327 " name=\"enabled\"\n"
328 " type=\"bool\"\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"
335 " >\n"
336 " </Field>\n"
337 " <Field\n"
338 " name=\"isActive\"\n"
339 " type=\"bool\"\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"
346 " >\n"
347 " </Field>\n"
348 " <Field\n"
349 " name=\"loop\"\n"
350 " type=\"bool\"\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"
357 " >\n"
358 " </Field>\n"
359 " <Field\n"
360 " name=\"forward\"\n"
361 " type=\"bool\"\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"
368 " >\n"
369 " </Field>\n"
370 "\n"
371 " <Field\n"
372 " name=\"startTime\"\n"
373 " type=\"Time\"\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"
380 " >\n"
381 " </Field>\n"
382 " <Field\n"
383 " name=\"stopTime\"\n"
384 " type=\"Time\"\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"
391 " >\n"
392 " </Field>\n"
393 " <Field\n"
394 " name=\"time\"\n"
395 " type=\"Time\"\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"
402 " >\n"
403 " </Field>\n"
404 " <Field\n"
405 " name=\"cycleLength\"\n"
406 " type=\"Time\"\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"
413 " >\n"
414 " </Field>\n"
415 "\n"
416 " <Field\n"
417 " name=\"timeScale\"\n"
418 " type=\"Real32\"\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"
425 " >\n"
426 " </Field>\n"
427 " <Field\n"
428 " name=\"fraction\"\n"
429 " type=\"Real32\"\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"
436 " >\n"
437 " </Field>\n"
438 " <Field\n"
439 " name=\"animTime\"\n"
440 " type=\"Real32\"\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"
447 " >\n"
448 " </Field>\n"
449 "</FieldContainer>\n",
453 /*------------------------------ get -----------------------------------*/
455 FieldContainerType &AnimTimeSensorBase::getType(void)
457 return _type;
460 const FieldContainerType &AnimTimeSensorBase::getType(void) const
462 return _type;
465 UInt32 AnimTimeSensorBase::getContainerSize(void) const
467 return sizeof(AnimTimeSensor);
470 /*------------------------- decorator get ------------------------------*/
473 SFBool *AnimTimeSensorBase::editSFEnabled(void)
475 editSField(EnabledFieldMask);
477 return &_sfEnabled;
480 const SFBool *AnimTimeSensorBase::getSFEnabled(void) const
482 return &_sfEnabled;
486 SFBool *AnimTimeSensorBase::editSFIsActive(void)
488 editSField(IsActiveFieldMask);
490 return &_sfIsActive;
493 const SFBool *AnimTimeSensorBase::getSFIsActive(void) const
495 return &_sfIsActive;
499 SFBool *AnimTimeSensorBase::editSFLoop(void)
501 editSField(LoopFieldMask);
503 return &_sfLoop;
506 const SFBool *AnimTimeSensorBase::getSFLoop(void) const
508 return &_sfLoop;
512 SFBool *AnimTimeSensorBase::editSFForward(void)
514 editSField(ForwardFieldMask);
516 return &_sfForward;
519 const SFBool *AnimTimeSensorBase::getSFForward(void) const
521 return &_sfForward;
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);
542 return &_sfStopTime;
545 const SFTime *AnimTimeSensorBase::getSFStopTime(void) const
547 return &_sfStopTime;
551 SFTime *AnimTimeSensorBase::editSFTime(void)
553 editSField(TimeFieldMask);
555 return &_sfTime;
558 const SFTime *AnimTimeSensorBase::getSFTime(void) const
560 return &_sfTime;
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);
594 return &_sfFraction;
597 const SFReal32 *AnimTimeSensorBase::getSFFraction(void) const
599 return &_sfFraction;
603 SFReal32 *AnimTimeSensorBase::editSFAnimTime(void)
605 editSField(AnimTimeFieldMask);
607 return &_sfAnimTime;
610 const SFReal32 *AnimTimeSensorBase::getSFAnimTime(void) const
612 return &_sfAnimTime;
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();
671 return returnValue;
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);
800 return fc;
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);
816 return fc;
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);
832 return fc;
835 AnimTimeSensor *AnimTimeSensorBase::createEmptyLocal(BitVector bFlags)
837 AnimTimeSensor *returnValue;
839 newPtr<AnimTimeSensor>(returnValue, bFlags);
841 returnValue->_pFieldFlags->_bNamespaceMask &= ~bFlags;
843 return returnValue;
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();
856 return returnValue;
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;
871 return returnValue;
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;
885 return returnValue;
888 FieldContainerTransitPtr AnimTimeSensorBase::shallowCopy(void) const
890 AnimTimeSensor *tmpPtr;
892 newPtr(tmpPtr,
893 dynamic_cast<const AnimTimeSensor *>(this),
894 Thread::getCurrentLocalFlags());
896 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~Thread::getCurrentLocalFlags();
898 FieldContainerTransitPtr returnValue(tmpPtr);
900 return returnValue;
906 /*------------------------- constructors ----------------------------------*/
908 AnimTimeSensorBase::AnimTimeSensorBase(void) :
909 Inherited(),
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) :
925 Inherited(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(
952 &_sfEnabled,
953 this->getType().getFieldDesc(EnabledFieldId),
954 const_cast<AnimTimeSensorBase *>(this)));
956 return returnValue;
959 EditFieldHandlePtr AnimTimeSensorBase::editHandleEnabled (void)
961 SFBool::EditHandlePtr returnValue(
962 new SFBool::EditHandle(
963 &_sfEnabled,
964 this->getType().getFieldDesc(EnabledFieldId),
965 this));
968 editSField(EnabledFieldMask);
970 return returnValue;
973 GetFieldHandlePtr AnimTimeSensorBase::getHandleIsActive (void) const
975 SFBool::GetHandlePtr returnValue(
976 new SFBool::GetHandle(
977 &_sfIsActive,
978 this->getType().getFieldDesc(IsActiveFieldId),
979 const_cast<AnimTimeSensorBase *>(this)));
981 return returnValue;
984 EditFieldHandlePtr AnimTimeSensorBase::editHandleIsActive (void)
986 SFBool::EditHandlePtr returnValue(
987 new SFBool::EditHandle(
988 &_sfIsActive,
989 this->getType().getFieldDesc(IsActiveFieldId),
990 this));
993 editSField(IsActiveFieldMask);
995 return returnValue;
998 GetFieldHandlePtr AnimTimeSensorBase::getHandleLoop (void) const
1000 SFBool::GetHandlePtr returnValue(
1001 new SFBool::GetHandle(
1002 &_sfLoop,
1003 this->getType().getFieldDesc(LoopFieldId),
1004 const_cast<AnimTimeSensorBase *>(this)));
1006 return returnValue;
1009 EditFieldHandlePtr AnimTimeSensorBase::editHandleLoop (void)
1011 SFBool::EditHandlePtr returnValue(
1012 new SFBool::EditHandle(
1013 &_sfLoop,
1014 this->getType().getFieldDesc(LoopFieldId),
1015 this));
1018 editSField(LoopFieldMask);
1020 return returnValue;
1023 GetFieldHandlePtr AnimTimeSensorBase::getHandleForward (void) const
1025 SFBool::GetHandlePtr returnValue(
1026 new SFBool::GetHandle(
1027 &_sfForward,
1028 this->getType().getFieldDesc(ForwardFieldId),
1029 const_cast<AnimTimeSensorBase *>(this)));
1031 return returnValue;
1034 EditFieldHandlePtr AnimTimeSensorBase::editHandleForward (void)
1036 SFBool::EditHandlePtr returnValue(
1037 new SFBool::EditHandle(
1038 &_sfForward,
1039 this->getType().getFieldDesc(ForwardFieldId),
1040 this));
1043 editSField(ForwardFieldMask);
1045 return returnValue;
1048 GetFieldHandlePtr AnimTimeSensorBase::getHandleStartTime (void) const
1050 SFTime::GetHandlePtr returnValue(
1051 new SFTime::GetHandle(
1052 &_sfStartTime,
1053 this->getType().getFieldDesc(StartTimeFieldId),
1054 const_cast<AnimTimeSensorBase *>(this)));
1056 return returnValue;
1059 EditFieldHandlePtr AnimTimeSensorBase::editHandleStartTime (void)
1061 SFTime::EditHandlePtr returnValue(
1062 new SFTime::EditHandle(
1063 &_sfStartTime,
1064 this->getType().getFieldDesc(StartTimeFieldId),
1065 this));
1068 editSField(StartTimeFieldMask);
1070 return returnValue;
1073 GetFieldHandlePtr AnimTimeSensorBase::getHandleStopTime (void) const
1075 SFTime::GetHandlePtr returnValue(
1076 new SFTime::GetHandle(
1077 &_sfStopTime,
1078 this->getType().getFieldDesc(StopTimeFieldId),
1079 const_cast<AnimTimeSensorBase *>(this)));
1081 return returnValue;
1084 EditFieldHandlePtr AnimTimeSensorBase::editHandleStopTime (void)
1086 SFTime::EditHandlePtr returnValue(
1087 new SFTime::EditHandle(
1088 &_sfStopTime,
1089 this->getType().getFieldDesc(StopTimeFieldId),
1090 this));
1093 editSField(StopTimeFieldMask);
1095 return returnValue;
1098 GetFieldHandlePtr AnimTimeSensorBase::getHandleTime (void) const
1100 SFTime::GetHandlePtr returnValue(
1101 new SFTime::GetHandle(
1102 &_sfTime,
1103 this->getType().getFieldDesc(TimeFieldId),
1104 const_cast<AnimTimeSensorBase *>(this)));
1106 return returnValue;
1109 EditFieldHandlePtr AnimTimeSensorBase::editHandleTime (void)
1111 SFTime::EditHandlePtr returnValue(
1112 new SFTime::EditHandle(
1113 &_sfTime,
1114 this->getType().getFieldDesc(TimeFieldId),
1115 this));
1118 editSField(TimeFieldMask);
1120 return returnValue;
1123 GetFieldHandlePtr AnimTimeSensorBase::getHandleCycleLength (void) const
1125 SFTime::GetHandlePtr returnValue(
1126 new SFTime::GetHandle(
1127 &_sfCycleLength,
1128 this->getType().getFieldDesc(CycleLengthFieldId),
1129 const_cast<AnimTimeSensorBase *>(this)));
1131 return returnValue;
1134 EditFieldHandlePtr AnimTimeSensorBase::editHandleCycleLength (void)
1136 SFTime::EditHandlePtr returnValue(
1137 new SFTime::EditHandle(
1138 &_sfCycleLength,
1139 this->getType().getFieldDesc(CycleLengthFieldId),
1140 this));
1143 editSField(CycleLengthFieldMask);
1145 return returnValue;
1148 GetFieldHandlePtr AnimTimeSensorBase::getHandleTimeScale (void) const
1150 SFReal32::GetHandlePtr returnValue(
1151 new SFReal32::GetHandle(
1152 &_sfTimeScale,
1153 this->getType().getFieldDesc(TimeScaleFieldId),
1154 const_cast<AnimTimeSensorBase *>(this)));
1156 return returnValue;
1159 EditFieldHandlePtr AnimTimeSensorBase::editHandleTimeScale (void)
1161 SFReal32::EditHandlePtr returnValue(
1162 new SFReal32::EditHandle(
1163 &_sfTimeScale,
1164 this->getType().getFieldDesc(TimeScaleFieldId),
1165 this));
1168 editSField(TimeScaleFieldMask);
1170 return returnValue;
1173 GetFieldHandlePtr AnimTimeSensorBase::getHandleFraction (void) const
1175 SFReal32::GetHandlePtr returnValue(
1176 new SFReal32::GetHandle(
1177 &_sfFraction,
1178 this->getType().getFieldDesc(FractionFieldId),
1179 const_cast<AnimTimeSensorBase *>(this)));
1181 return returnValue;
1184 EditFieldHandlePtr AnimTimeSensorBase::editHandleFraction (void)
1186 SFReal32::EditHandlePtr returnValue(
1187 new SFReal32::EditHandle(
1188 &_sfFraction,
1189 this->getType().getFieldDesc(FractionFieldId),
1190 this));
1193 editSField(FractionFieldMask);
1195 return returnValue;
1198 GetFieldHandlePtr AnimTimeSensorBase::getHandleAnimTime (void) const
1200 SFReal32::GetHandlePtr returnValue(
1201 new SFReal32::GetHandle(
1202 &_sfAnimTime,
1203 this->getType().getFieldDesc(AnimTimeFieldId),
1204 const_cast<AnimTimeSensorBase *>(this)));
1206 return returnValue;
1209 EditFieldHandlePtr AnimTimeSensorBase::editHandleAnimTime (void)
1211 SFReal32::EditHandlePtr returnValue(
1212 new SFReal32::EditHandle(
1213 &_sfAnimTime,
1214 this->getType().getFieldDesc(AnimTimeFieldId),
1215 this));
1218 editSField(AnimTimeFieldMask);
1220 return returnValue;
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),
1234 whichField,
1235 oOffsets,
1236 syncMode,
1237 uiSyncInfo);
1239 #endif
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));
1252 return returnValue;
1254 #endif
1256 void AnimTimeSensorBase::resolveLinks(void)
1258 Inherited::resolveLinks();
1264 OSG_END_NAMESPACE