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 ComplexSceneManager!
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 "OSGFieldContainer.h" // Globals Class
66 #include "OSGCSMDrawManager.h" // DrawManager Class
68 #include "OSGComplexSceneManagerBase.h"
69 #include "OSGComplexSceneManager.h"
71 #include <boost/bind.hpp>
75 /***************************************************************************\
77 \***************************************************************************/
79 /*! \class OSG::ComplexSceneManager
83 /***************************************************************************\
84 * Field Documentation *
85 \***************************************************************************/
87 /*! \var FieldContainer * ComplexSceneManagerBase::_mfGlobals
91 /*! \var CSMDrawManager * ComplexSceneManagerBase::_sfDrawManager
95 /*! \var Time ComplexSceneManagerBase::_sfStartTime
99 /*! \var Time ComplexSceneManagerBase::_sfTimeScale
103 /*! \var Time ComplexSceneManagerBase::_sfConstantTimeStep
107 /*! \var bool ComplexSceneManagerBase::_sfConstantTime
111 /*! \var bool ComplexSceneManagerBase::_sfPaused
115 /*! \var bool ComplexSceneManagerBase::_sfDumpFrameStart
119 /*! \var bool ComplexSceneManagerBase::_sfEnableWebService
123 /*! \var UInt32 ComplexSceneManagerBase::_sfWebServicePort
127 /*! \var std::string ComplexSceneManagerBase::_sfWebServiceRoot
131 /*! \var bool ComplexSceneManagerBase::_sfWaitKeyAfterFrame
136 /***************************************************************************\
137 * FieldType/FieldTrait Instantiation *
138 \***************************************************************************/
140 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
141 PointerType FieldTraits
<ComplexSceneManager
*, nsOSG
>::_type(
142 "ComplexSceneManagerPtr",
144 ComplexSceneManager::getClassType(),
148 OSG_FIELDTRAITS_GETTYPE_NS(ComplexSceneManager
*, nsOSG
)
150 /***************************************************************************\
151 * Field Description *
152 \***************************************************************************/
154 void ComplexSceneManagerBase::classDescInserter(TypeObject
&oType
)
156 FieldDescriptionBase
*pDesc
= NULL
;
159 pDesc
= new MFRecFieldContainerPtr::Description(
160 MFRecFieldContainerPtr::getClassType(),
163 GlobalsFieldId
, GlobalsFieldMask
,
165 (Field::MFDefaultFlags
| Field::FStdAccess
),
166 static_cast<FieldEditMethodSig
>(&ComplexSceneManager::editHandleGlobals
),
167 static_cast<FieldGetMethodSig
>(&ComplexSceneManager::getHandleGlobals
));
169 oType
.addInitialDesc(pDesc
);
171 pDesc
= new SFUnrecCSMDrawManagerPtr::Description(
172 SFUnrecCSMDrawManagerPtr::getClassType(),
175 DrawManagerFieldId
, DrawManagerFieldMask
,
177 (Field::SFDefaultFlags
| Field::FStdAccess
),
178 static_cast<FieldEditMethodSig
>(&ComplexSceneManager::editHandleDrawManager
),
179 static_cast<FieldGetMethodSig
>(&ComplexSceneManager::getHandleDrawManager
));
181 oType
.addInitialDesc(pDesc
);
183 pDesc
= new SFTime::Description(
184 SFTime::getClassType(),
187 StartTimeFieldId
, StartTimeFieldMask
,
189 (Field::SFDefaultFlags
| Field::FStdAccess
),
190 static_cast<FieldEditMethodSig
>(&ComplexSceneManager::editHandleStartTime
),
191 static_cast<FieldGetMethodSig
>(&ComplexSceneManager::getHandleStartTime
));
193 oType
.addInitialDesc(pDesc
);
195 pDesc
= new SFTime::Description(
196 SFTime::getClassType(),
199 TimeScaleFieldId
, TimeScaleFieldMask
,
201 (Field::SFDefaultFlags
| Field::FStdAccess
),
202 static_cast<FieldEditMethodSig
>(&ComplexSceneManager::editHandleTimeScale
),
203 static_cast<FieldGetMethodSig
>(&ComplexSceneManager::getHandleTimeScale
));
205 oType
.addInitialDesc(pDesc
);
207 pDesc
= new SFTime::Description(
208 SFTime::getClassType(),
211 ConstantTimeStepFieldId
, ConstantTimeStepFieldMask
,
213 (Field::SFDefaultFlags
| Field::FStdAccess
),
214 static_cast<FieldEditMethodSig
>(&ComplexSceneManager::editHandleConstantTimeStep
),
215 static_cast<FieldGetMethodSig
>(&ComplexSceneManager::getHandleConstantTimeStep
));
217 oType
.addInitialDesc(pDesc
);
219 pDesc
= new SFBool::Description(
220 SFBool::getClassType(),
223 ConstantTimeFieldId
, ConstantTimeFieldMask
,
225 (Field::SFDefaultFlags
| Field::FStdAccess
),
226 static_cast<FieldEditMethodSig
>(&ComplexSceneManager::editHandleConstantTime
),
227 static_cast<FieldGetMethodSig
>(&ComplexSceneManager::getHandleConstantTime
));
229 oType
.addInitialDesc(pDesc
);
231 pDesc
= new SFBool::Description(
232 SFBool::getClassType(),
235 PausedFieldId
, PausedFieldMask
,
237 (Field::SFDefaultFlags
| Field::FStdAccess
),
238 static_cast<FieldEditMethodSig
>(&ComplexSceneManager::editHandlePaused
),
239 static_cast<FieldGetMethodSig
>(&ComplexSceneManager::getHandlePaused
));
241 oType
.addInitialDesc(pDesc
);
243 pDesc
= new SFBool::Description(
244 SFBool::getClassType(),
247 DumpFrameStartFieldId
, DumpFrameStartFieldMask
,
249 (Field::SFDefaultFlags
| Field::FStdAccess
),
250 static_cast<FieldEditMethodSig
>(&ComplexSceneManager::editHandleDumpFrameStart
),
251 static_cast<FieldGetMethodSig
>(&ComplexSceneManager::getHandleDumpFrameStart
));
253 oType
.addInitialDesc(pDesc
);
255 pDesc
= new SFBool::Description(
256 SFBool::getClassType(),
259 EnableWebServiceFieldId
, EnableWebServiceFieldMask
,
261 (Field::SFDefaultFlags
| Field::FStdAccess
),
262 static_cast<FieldEditMethodSig
>(&ComplexSceneManager::editHandleEnableWebService
),
263 static_cast<FieldGetMethodSig
>(&ComplexSceneManager::getHandleEnableWebService
));
265 oType
.addInitialDesc(pDesc
);
267 pDesc
= new SFUInt32::Description(
268 SFUInt32::getClassType(),
271 WebServicePortFieldId
, WebServicePortFieldMask
,
273 (Field::SFDefaultFlags
| Field::FStdAccess
),
274 static_cast<FieldEditMethodSig
>(&ComplexSceneManager::editHandleWebServicePort
),
275 static_cast<FieldGetMethodSig
>(&ComplexSceneManager::getHandleWebServicePort
));
277 oType
.addInitialDesc(pDesc
);
279 pDesc
= new SFString::Description(
280 SFString::getClassType(),
283 WebServiceRootFieldId
, WebServiceRootFieldMask
,
285 (Field::SFDefaultFlags
| Field::FStdAccess
),
286 static_cast<FieldEditMethodSig
>(&ComplexSceneManager::editHandleWebServiceRoot
),
287 static_cast<FieldGetMethodSig
>(&ComplexSceneManager::getHandleWebServiceRoot
));
289 oType
.addInitialDesc(pDesc
);
291 pDesc
= new SFBool::Description(
292 SFBool::getClassType(),
295 WaitKeyAfterFrameFieldId
, WaitKeyAfterFrameFieldMask
,
297 (Field::SFDefaultFlags
| Field::FStdAccess
),
298 static_cast<FieldEditMethodSig
>(&ComplexSceneManager::editHandleWaitKeyAfterFrame
),
299 static_cast<FieldGetMethodSig
>(&ComplexSceneManager::getHandleWaitKeyAfterFrame
));
301 oType
.addInitialDesc(pDesc
);
305 ComplexSceneManagerBase::TypeObject
ComplexSceneManagerBase::_type(
306 ComplexSceneManagerBase::getClassname(),
307 Inherited::getClassname(),
310 reinterpret_cast<PrototypeCreateF
>(&ComplexSceneManagerBase::createEmptyLocal
),
311 reinterpret_cast<InitContainerF
>(&ComplexSceneManager::initMethod
),
312 reinterpret_cast<ExitContainerF
>(&ComplexSceneManager::exitMethod
),
313 reinterpret_cast<InitalInsertDescFunc
>(&ComplexSceneManager::classDescInserter
),
316 "<?xml version=\"1.0\"?>\n"
319 " name=\"ComplexSceneManager\"\n"
320 " parent=\"FieldContainer\"\n"
321 " library=\"ContribCSM\"\n"
322 " pointerfieldtypes=\"none\"\n"
323 " structure=\"concrete\"\n"
324 " systemcomponent=\"true\"\n"
325 " parentsystemcomponent=\"true\"\n"
326 " decoratable=\"false\"\n"
327 " useLocalIncludes=\"false\"\n"
328 " isNodeCore=\"false\"\n"
329 " isBundle=\"true\"\n"
333 "\t\tname=\"globals\"\n"
334 "\t\ttype=\"FieldContainer\"\n"
335 "\t\tcardinality=\"multi\"\n"
336 "\t\tvisibility=\"external\"\n"
337 "\t\taccess=\"public\"\n"
338 " category=\"recpointer\"\n"
342 "\t\tname=\"drawManager\"\n"
343 "\t\ttype=\"CSMDrawManager\"\n"
344 "\t\tcardinality=\"single\"\n"
345 "\t\tvisibility=\"external\"\n"
346 "\t\tdefaultValue=\"NULL\"\n"
347 "\t\taccess=\"public\"\n"
348 " category=\"pointer\"\n"
354 "\t\tname=\"sensorTask\"\n"
355 "\t\ttype=\"SensorTask\"\n"
356 "\t\tcardinality=\"single\"\n"
357 "\t\tvisibility=\"external\"\n"
358 "\t\tdefaultValue=\"NULL\"\n"
359 "\t\taccess=\"public\"\n"
360 " category=\"pointer\"\n"
365 "\t\tname=\"startTime\"\n"
366 "\t\ttype=\"Time\"\n"
367 "\t\tcardinality=\"single\"\n"
368 "\t\tvisibility=\"internal\"\n"
369 "\t\taccess=\"public\"\n"
370 " defaultValue=\"0.0\"\n"
374 "\t\tname=\"timeScale\"\n"
375 "\t\ttype=\"Time\"\n"
376 "\t\tcardinality=\"single\"\n"
377 "\t\tvisibility=\"internal\"\n"
378 "\t\taccess=\"public\"\n"
379 " defaultValue=\"1.0\"\n"
383 "\t\tname=\"constantTimeStep\"\n"
384 "\t\ttype=\"Time\"\n"
385 "\t\tcardinality=\"single\"\n"
386 "\t\tvisibility=\"internal\"\n"
387 "\t\taccess=\"public\"\n"
388 " defaultValue=\"0.0\"\n"
392 "\t\tname=\"constantTime\"\n"
393 "\t\ttype=\"bool\"\n"
394 "\t\tcardinality=\"single\"\n"
395 "\t\tvisibility=\"internal\"\n"
396 "\t\taccess=\"public\"\n"
397 " defaultValue=\"false\"\n"
401 "\t\tname=\"paused\"\n"
402 "\t\ttype=\"bool\"\n"
403 "\t\tcardinality=\"single\"\n"
404 "\t\tvisibility=\"internal\"\n"
405 "\t\taccess=\"public\"\n"
406 " defaultValue=\"false\"\n"
411 "\t\tname=\"dumpFrameStart\"\n"
412 "\t\ttype=\"bool\"\n"
413 "\t\tcardinality=\"single\"\n"
414 "\t\tvisibility=\"internal\"\n"
415 "\t\taccess=\"public\"\n"
416 " defaultValue=\"false\"\n"
421 "\t\tname=\"enableWebService\"\n"
422 "\t\ttype=\"bool\"\n"
423 "\t\tcardinality=\"single\"\n"
424 "\t\tvisibility=\"internal\"\n"
425 "\t\taccess=\"public\"\n"
426 " defaultValue=\"false\"\n"
430 "\t\tname=\"webServicePort\"\n"
431 "\t\ttype=\"UInt32\"\n"
432 "\t\tcardinality=\"single\"\n"
433 "\t\tvisibility=\"internal\"\n"
434 "\t\taccess=\"public\"\n"
435 " defaultValue=\"8080\"\n"
439 "\t\tname=\"webServiceRoot\"\n"
440 "\t\ttype=\"std::string\"\n"
441 "\t\tcardinality=\"single\"\n"
442 "\t\tvisibility=\"internal\"\n"
443 "\t\taccess=\"public\"\n"
444 " defaultValue='\"RootNode\"'\n"
448 "\t\tname=\"waitKeyAfterFrame\"\n"
449 "\t\ttype=\"bool\"\n"
450 "\t\tcardinality=\"single\"\n"
451 "\t\tvisibility=\"internal\"\n"
452 "\t\taccess=\"public\"\n"
453 " defaultValue=\"false\"\n"
457 "</FieldContainer>\n",
461 /*------------------------------ get -----------------------------------*/
463 FieldContainerType
&ComplexSceneManagerBase::getType(void)
468 const FieldContainerType
&ComplexSceneManagerBase::getType(void) const
473 UInt32
ComplexSceneManagerBase::getContainerSize(void) const
475 return sizeof(ComplexSceneManager
);
478 /*------------------------- decorator get ------------------------------*/
481 //! Get the ComplexSceneManager::_mfGlobals field.
482 const MFRecFieldContainerPtr
*ComplexSceneManagerBase::getMFGlobals(void) const
487 MFRecFieldContainerPtr
*ComplexSceneManagerBase::editMFGlobals (void)
489 editMField(GlobalsFieldMask
, _mfGlobals
);
493 FieldContainer
* ComplexSceneManagerBase::getGlobals(const UInt32 index
) const
495 return _mfGlobals
[index
];
498 //! Get the ComplexSceneManager::_sfDrawManager field.
499 const SFUnrecCSMDrawManagerPtr
*ComplexSceneManagerBase::getSFDrawManager(void) const
501 return &_sfDrawManager
;
504 SFUnrecCSMDrawManagerPtr
*ComplexSceneManagerBase::editSFDrawManager (void)
506 editSField(DrawManagerFieldMask
);
508 return &_sfDrawManager
;
511 //! Get the value of the ComplexSceneManager::_sfDrawManager field.
512 CSMDrawManager
* ComplexSceneManagerBase::getDrawManager(void) const
514 return _sfDrawManager
.getValue();
517 //! Set the value of the ComplexSceneManager::_sfDrawManager field.
518 void ComplexSceneManagerBase::setDrawManager(CSMDrawManager
* const value
)
520 editSField(DrawManagerFieldMask
);
522 _sfDrawManager
.setValue(value
);
526 SFTime
*ComplexSceneManagerBase::editSFStartTime(void)
528 editSField(StartTimeFieldMask
);
530 return &_sfStartTime
;
533 const SFTime
*ComplexSceneManagerBase::getSFStartTime(void) const
535 return &_sfStartTime
;
539 SFTime
*ComplexSceneManagerBase::editSFTimeScale(void)
541 editSField(TimeScaleFieldMask
);
543 return &_sfTimeScale
;
546 const SFTime
*ComplexSceneManagerBase::getSFTimeScale(void) const
548 return &_sfTimeScale
;
552 SFTime
*ComplexSceneManagerBase::editSFConstantTimeStep(void)
554 editSField(ConstantTimeStepFieldMask
);
556 return &_sfConstantTimeStep
;
559 const SFTime
*ComplexSceneManagerBase::getSFConstantTimeStep(void) const
561 return &_sfConstantTimeStep
;
565 SFBool
*ComplexSceneManagerBase::editSFConstantTime(void)
567 editSField(ConstantTimeFieldMask
);
569 return &_sfConstantTime
;
572 const SFBool
*ComplexSceneManagerBase::getSFConstantTime(void) const
574 return &_sfConstantTime
;
578 SFBool
*ComplexSceneManagerBase::editSFPaused(void)
580 editSField(PausedFieldMask
);
585 const SFBool
*ComplexSceneManagerBase::getSFPaused(void) const
591 SFBool
*ComplexSceneManagerBase::editSFDumpFrameStart(void)
593 editSField(DumpFrameStartFieldMask
);
595 return &_sfDumpFrameStart
;
598 const SFBool
*ComplexSceneManagerBase::getSFDumpFrameStart(void) const
600 return &_sfDumpFrameStart
;
604 SFBool
*ComplexSceneManagerBase::editSFEnableWebService(void)
606 editSField(EnableWebServiceFieldMask
);
608 return &_sfEnableWebService
;
611 const SFBool
*ComplexSceneManagerBase::getSFEnableWebService(void) const
613 return &_sfEnableWebService
;
617 SFUInt32
*ComplexSceneManagerBase::editSFWebServicePort(void)
619 editSField(WebServicePortFieldMask
);
621 return &_sfWebServicePort
;
624 const SFUInt32
*ComplexSceneManagerBase::getSFWebServicePort(void) const
626 return &_sfWebServicePort
;
630 SFString
*ComplexSceneManagerBase::editSFWebServiceRoot(void)
632 editSField(WebServiceRootFieldMask
);
634 return &_sfWebServiceRoot
;
637 const SFString
*ComplexSceneManagerBase::getSFWebServiceRoot(void) const
639 return &_sfWebServiceRoot
;
643 SFBool
*ComplexSceneManagerBase::editSFWaitKeyAfterFrame(void)
645 editSField(WaitKeyAfterFrameFieldMask
);
647 return &_sfWaitKeyAfterFrame
;
650 const SFBool
*ComplexSceneManagerBase::getSFWaitKeyAfterFrame(void) const
652 return &_sfWaitKeyAfterFrame
;
658 void ComplexSceneManagerBase::pushToGlobals(FieldContainer
* const value
)
660 editMField(GlobalsFieldMask
, _mfGlobals
);
662 _mfGlobals
.push_back(value
);
665 void ComplexSceneManagerBase::assignGlobals (const MFRecFieldContainerPtr
&value
)
667 MFRecFieldContainerPtr::const_iterator elemIt
=
669 MFRecFieldContainerPtr::const_iterator elemEnd
=
672 static_cast<ComplexSceneManager
*>(this)->clearGlobals();
674 while(elemIt
!= elemEnd
)
676 this->pushToGlobals(*elemIt
);
682 void ComplexSceneManagerBase::removeFromGlobals(UInt32 uiIndex
)
684 if(uiIndex
< _mfGlobals
.size())
686 editMField(GlobalsFieldMask
, _mfGlobals
);
688 _mfGlobals
.erase(uiIndex
);
692 void ComplexSceneManagerBase::removeObjFromGlobals(FieldContainer
* const value
)
694 Int32 iElemIdx
= _mfGlobals
.findIndex(value
);
698 editMField(GlobalsFieldMask
, _mfGlobals
);
700 _mfGlobals
.erase(iElemIdx
);
703 void ComplexSceneManagerBase::clearGlobals(void)
705 editMField(GlobalsFieldMask
, _mfGlobals
);
713 /*------------------------------ access -----------------------------------*/
715 SizeT
ComplexSceneManagerBase::getBinSize(ConstFieldMaskArg whichField
)
717 SizeT returnValue
= Inherited::getBinSize(whichField
);
719 if(FieldBits::NoField
!= (GlobalsFieldMask
& whichField
))
721 returnValue
+= _mfGlobals
.getBinSize();
723 if(FieldBits::NoField
!= (DrawManagerFieldMask
& whichField
))
725 returnValue
+= _sfDrawManager
.getBinSize();
727 if(FieldBits::NoField
!= (StartTimeFieldMask
& whichField
))
729 returnValue
+= _sfStartTime
.getBinSize();
731 if(FieldBits::NoField
!= (TimeScaleFieldMask
& whichField
))
733 returnValue
+= _sfTimeScale
.getBinSize();
735 if(FieldBits::NoField
!= (ConstantTimeStepFieldMask
& whichField
))
737 returnValue
+= _sfConstantTimeStep
.getBinSize();
739 if(FieldBits::NoField
!= (ConstantTimeFieldMask
& whichField
))
741 returnValue
+= _sfConstantTime
.getBinSize();
743 if(FieldBits::NoField
!= (PausedFieldMask
& whichField
))
745 returnValue
+= _sfPaused
.getBinSize();
747 if(FieldBits::NoField
!= (DumpFrameStartFieldMask
& whichField
))
749 returnValue
+= _sfDumpFrameStart
.getBinSize();
751 if(FieldBits::NoField
!= (EnableWebServiceFieldMask
& whichField
))
753 returnValue
+= _sfEnableWebService
.getBinSize();
755 if(FieldBits::NoField
!= (WebServicePortFieldMask
& whichField
))
757 returnValue
+= _sfWebServicePort
.getBinSize();
759 if(FieldBits::NoField
!= (WebServiceRootFieldMask
& whichField
))
761 returnValue
+= _sfWebServiceRoot
.getBinSize();
763 if(FieldBits::NoField
!= (WaitKeyAfterFrameFieldMask
& whichField
))
765 returnValue
+= _sfWaitKeyAfterFrame
.getBinSize();
771 void ComplexSceneManagerBase::copyToBin(BinaryDataHandler
&pMem
,
772 ConstFieldMaskArg whichField
)
774 Inherited::copyToBin(pMem
, whichField
);
776 if(FieldBits::NoField
!= (GlobalsFieldMask
& whichField
))
778 _mfGlobals
.copyToBin(pMem
);
780 if(FieldBits::NoField
!= (DrawManagerFieldMask
& whichField
))
782 _sfDrawManager
.copyToBin(pMem
);
784 if(FieldBits::NoField
!= (StartTimeFieldMask
& whichField
))
786 _sfStartTime
.copyToBin(pMem
);
788 if(FieldBits::NoField
!= (TimeScaleFieldMask
& whichField
))
790 _sfTimeScale
.copyToBin(pMem
);
792 if(FieldBits::NoField
!= (ConstantTimeStepFieldMask
& whichField
))
794 _sfConstantTimeStep
.copyToBin(pMem
);
796 if(FieldBits::NoField
!= (ConstantTimeFieldMask
& whichField
))
798 _sfConstantTime
.copyToBin(pMem
);
800 if(FieldBits::NoField
!= (PausedFieldMask
& whichField
))
802 _sfPaused
.copyToBin(pMem
);
804 if(FieldBits::NoField
!= (DumpFrameStartFieldMask
& whichField
))
806 _sfDumpFrameStart
.copyToBin(pMem
);
808 if(FieldBits::NoField
!= (EnableWebServiceFieldMask
& whichField
))
810 _sfEnableWebService
.copyToBin(pMem
);
812 if(FieldBits::NoField
!= (WebServicePortFieldMask
& whichField
))
814 _sfWebServicePort
.copyToBin(pMem
);
816 if(FieldBits::NoField
!= (WebServiceRootFieldMask
& whichField
))
818 _sfWebServiceRoot
.copyToBin(pMem
);
820 if(FieldBits::NoField
!= (WaitKeyAfterFrameFieldMask
& whichField
))
822 _sfWaitKeyAfterFrame
.copyToBin(pMem
);
826 void ComplexSceneManagerBase::copyFromBin(BinaryDataHandler
&pMem
,
827 ConstFieldMaskArg whichField
)
829 Inherited::copyFromBin(pMem
, whichField
);
831 if(FieldBits::NoField
!= (GlobalsFieldMask
& whichField
))
833 editMField(GlobalsFieldMask
, _mfGlobals
);
834 _mfGlobals
.copyFromBin(pMem
);
836 if(FieldBits::NoField
!= (DrawManagerFieldMask
& whichField
))
838 editSField(DrawManagerFieldMask
);
839 _sfDrawManager
.copyFromBin(pMem
);
841 if(FieldBits::NoField
!= (StartTimeFieldMask
& whichField
))
843 editSField(StartTimeFieldMask
);
844 _sfStartTime
.copyFromBin(pMem
);
846 if(FieldBits::NoField
!= (TimeScaleFieldMask
& whichField
))
848 editSField(TimeScaleFieldMask
);
849 _sfTimeScale
.copyFromBin(pMem
);
851 if(FieldBits::NoField
!= (ConstantTimeStepFieldMask
& whichField
))
853 editSField(ConstantTimeStepFieldMask
);
854 _sfConstantTimeStep
.copyFromBin(pMem
);
856 if(FieldBits::NoField
!= (ConstantTimeFieldMask
& whichField
))
858 editSField(ConstantTimeFieldMask
);
859 _sfConstantTime
.copyFromBin(pMem
);
861 if(FieldBits::NoField
!= (PausedFieldMask
& whichField
))
863 editSField(PausedFieldMask
);
864 _sfPaused
.copyFromBin(pMem
);
866 if(FieldBits::NoField
!= (DumpFrameStartFieldMask
& whichField
))
868 editSField(DumpFrameStartFieldMask
);
869 _sfDumpFrameStart
.copyFromBin(pMem
);
871 if(FieldBits::NoField
!= (EnableWebServiceFieldMask
& whichField
))
873 editSField(EnableWebServiceFieldMask
);
874 _sfEnableWebService
.copyFromBin(pMem
);
876 if(FieldBits::NoField
!= (WebServicePortFieldMask
& whichField
))
878 editSField(WebServicePortFieldMask
);
879 _sfWebServicePort
.copyFromBin(pMem
);
881 if(FieldBits::NoField
!= (WebServiceRootFieldMask
& whichField
))
883 editSField(WebServiceRootFieldMask
);
884 _sfWebServiceRoot
.copyFromBin(pMem
);
886 if(FieldBits::NoField
!= (WaitKeyAfterFrameFieldMask
& whichField
))
888 editSField(WaitKeyAfterFrameFieldMask
);
889 _sfWaitKeyAfterFrame
.copyFromBin(pMem
);
893 //! create a new instance of the class
894 ComplexSceneManagerTransitPtr
ComplexSceneManagerBase::createLocal(BitVector bFlags
)
896 ComplexSceneManagerTransitPtr fc
;
898 if(getClassType().getPrototype() != NULL
)
900 FieldContainerTransitPtr tmpPtr
=
901 getClassType().getPrototype()-> shallowCopyLocal(bFlags
);
903 fc
= dynamic_pointer_cast
<ComplexSceneManager
>(tmpPtr
);
909 //! create a new instance of the class, copy the container flags
910 ComplexSceneManagerTransitPtr
ComplexSceneManagerBase::createDependent(BitVector bFlags
)
912 ComplexSceneManagerTransitPtr fc
;
914 if(getClassType().getPrototype() != NULL
)
916 FieldContainerTransitPtr tmpPtr
=
917 getClassType().getPrototype()-> shallowCopyDependent(bFlags
);
919 fc
= dynamic_pointer_cast
<ComplexSceneManager
>(tmpPtr
);
925 //! create a new instance of the class
926 ComplexSceneManagerTransitPtr
ComplexSceneManagerBase::create(void)
928 return createLocal();
931 ComplexSceneManager
*ComplexSceneManagerBase::createEmptyLocal(BitVector bFlags
)
933 ComplexSceneManager
*returnValue
;
935 newPtr
<ComplexSceneManager
>(returnValue
, bFlags
);
937 returnValue
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
942 //! create an empty new instance of the class, do not copy the prototype
943 ComplexSceneManager
*ComplexSceneManagerBase::createEmpty(void)
945 return createEmptyLocal();
949 FieldContainerTransitPtr
ComplexSceneManagerBase::shallowCopyLocal(
950 BitVector bFlags
) const
952 ComplexSceneManager
*tmpPtr
;
954 newPtr(tmpPtr
, dynamic_cast<const ComplexSceneManager
*>(this), bFlags
);
956 FieldContainerTransitPtr
returnValue(tmpPtr
);
958 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
963 FieldContainerTransitPtr
ComplexSceneManagerBase::shallowCopyDependent(
964 BitVector bFlags
) const
966 ComplexSceneManager
*tmpPtr
;
968 newPtr(tmpPtr
, dynamic_cast<const ComplexSceneManager
*>(this), ~bFlags
);
970 FieldContainerTransitPtr
returnValue(tmpPtr
);
972 tmpPtr
->_pFieldFlags
->_bNamespaceMask
= bFlags
;
977 FieldContainerTransitPtr
ComplexSceneManagerBase::shallowCopy(void) const
979 return shallowCopyLocal();
985 /*------------------------- constructors ----------------------------------*/
987 ComplexSceneManagerBase::ComplexSceneManagerBase(void) :
990 _sfDrawManager (NULL
),
991 _sfStartTime (Time(0.0)),
992 _sfTimeScale (Time(1.0)),
993 _sfConstantTimeStep (Time(0.0)),
994 _sfConstantTime (bool(false)),
995 _sfPaused (bool(false)),
996 _sfDumpFrameStart (bool(false)),
997 _sfEnableWebService (bool(false)),
998 _sfWebServicePort (UInt32(8080)),
999 _sfWebServiceRoot (std::string("RootNode")),
1000 _sfWaitKeyAfterFrame (bool(false))
1004 ComplexSceneManagerBase::ComplexSceneManagerBase(const ComplexSceneManagerBase
&source
) :
1007 _sfDrawManager (NULL
),
1008 _sfStartTime (source
._sfStartTime
),
1009 _sfTimeScale (source
._sfTimeScale
),
1010 _sfConstantTimeStep (source
._sfConstantTimeStep
),
1011 _sfConstantTime (source
._sfConstantTime
),
1012 _sfPaused (source
._sfPaused
),
1013 _sfDumpFrameStart (source
._sfDumpFrameStart
),
1014 _sfEnableWebService (source
._sfEnableWebService
),
1015 _sfWebServicePort (source
._sfWebServicePort
),
1016 _sfWebServiceRoot (source
._sfWebServiceRoot
),
1017 _sfWaitKeyAfterFrame (source
._sfWaitKeyAfterFrame
)
1022 /*-------------------------- destructors ----------------------------------*/
1024 ComplexSceneManagerBase::~ComplexSceneManagerBase(void)
1028 void ComplexSceneManagerBase::onCreate(const ComplexSceneManager
*source
)
1030 Inherited::onCreate(source
);
1034 ComplexSceneManager
*pThis
= static_cast<ComplexSceneManager
*>(this);
1036 MFRecFieldContainerPtr::const_iterator GlobalsIt
=
1037 source
->_mfGlobals
.begin();
1038 MFRecFieldContainerPtr::const_iterator GlobalsEnd
=
1039 source
->_mfGlobals
.end ();
1041 while(GlobalsIt
!= GlobalsEnd
)
1043 pThis
->pushToGlobals(*GlobalsIt
);
1048 pThis
->setDrawManager(source
->getDrawManager());
1052 GetFieldHandlePtr
ComplexSceneManagerBase::getHandleGlobals (void) const
1054 MFRecFieldContainerPtr::GetHandlePtr
returnValue(
1055 new MFRecFieldContainerPtr::GetHandle(
1057 this->getType().getFieldDesc(GlobalsFieldId
),
1058 const_cast<ComplexSceneManagerBase
*>(this)));
1063 EditFieldHandlePtr
ComplexSceneManagerBase::editHandleGlobals (void)
1065 MFRecFieldContainerPtr::EditHandlePtr
returnValue(
1066 new MFRecFieldContainerPtr::EditHandle(
1068 this->getType().getFieldDesc(GlobalsFieldId
),
1071 returnValue
->setAddMethod(
1072 boost::bind(&ComplexSceneManager::pushToGlobals
,
1073 static_cast<ComplexSceneManager
*>(this), _1
));
1074 returnValue
->setRemoveMethod(
1075 boost::bind(&ComplexSceneManager::removeFromGlobals
,
1076 static_cast<ComplexSceneManager
*>(this), _1
));
1077 returnValue
->setRemoveObjMethod(
1078 boost::bind(&ComplexSceneManager::removeObjFromGlobals
,
1079 static_cast<ComplexSceneManager
*>(this), _1
));
1080 returnValue
->setClearMethod(
1081 boost::bind(&ComplexSceneManager::clearGlobals
,
1082 static_cast<ComplexSceneManager
*>(this)));
1084 editMField(GlobalsFieldMask
, _mfGlobals
);
1089 GetFieldHandlePtr
ComplexSceneManagerBase::getHandleDrawManager (void) const
1091 SFUnrecCSMDrawManagerPtr::GetHandlePtr
returnValue(
1092 new SFUnrecCSMDrawManagerPtr::GetHandle(
1094 this->getType().getFieldDesc(DrawManagerFieldId
),
1095 const_cast<ComplexSceneManagerBase
*>(this)));
1100 EditFieldHandlePtr
ComplexSceneManagerBase::editHandleDrawManager (void)
1102 SFUnrecCSMDrawManagerPtr::EditHandlePtr
returnValue(
1103 new SFUnrecCSMDrawManagerPtr::EditHandle(
1105 this->getType().getFieldDesc(DrawManagerFieldId
),
1108 returnValue
->setSetMethod(
1109 boost::bind(&ComplexSceneManager::setDrawManager
,
1110 static_cast<ComplexSceneManager
*>(this), _1
));
1112 editSField(DrawManagerFieldMask
);
1117 GetFieldHandlePtr
ComplexSceneManagerBase::getHandleStartTime (void) const
1119 SFTime::GetHandlePtr
returnValue(
1120 new SFTime::GetHandle(
1122 this->getType().getFieldDesc(StartTimeFieldId
),
1123 const_cast<ComplexSceneManagerBase
*>(this)));
1128 EditFieldHandlePtr
ComplexSceneManagerBase::editHandleStartTime (void)
1130 SFTime::EditHandlePtr
returnValue(
1131 new SFTime::EditHandle(
1133 this->getType().getFieldDesc(StartTimeFieldId
),
1137 editSField(StartTimeFieldMask
);
1142 GetFieldHandlePtr
ComplexSceneManagerBase::getHandleTimeScale (void) const
1144 SFTime::GetHandlePtr
returnValue(
1145 new SFTime::GetHandle(
1147 this->getType().getFieldDesc(TimeScaleFieldId
),
1148 const_cast<ComplexSceneManagerBase
*>(this)));
1153 EditFieldHandlePtr
ComplexSceneManagerBase::editHandleTimeScale (void)
1155 SFTime::EditHandlePtr
returnValue(
1156 new SFTime::EditHandle(
1158 this->getType().getFieldDesc(TimeScaleFieldId
),
1162 editSField(TimeScaleFieldMask
);
1167 GetFieldHandlePtr
ComplexSceneManagerBase::getHandleConstantTimeStep (void) const
1169 SFTime::GetHandlePtr
returnValue(
1170 new SFTime::GetHandle(
1171 &_sfConstantTimeStep
,
1172 this->getType().getFieldDesc(ConstantTimeStepFieldId
),
1173 const_cast<ComplexSceneManagerBase
*>(this)));
1178 EditFieldHandlePtr
ComplexSceneManagerBase::editHandleConstantTimeStep(void)
1180 SFTime::EditHandlePtr
returnValue(
1181 new SFTime::EditHandle(
1182 &_sfConstantTimeStep
,
1183 this->getType().getFieldDesc(ConstantTimeStepFieldId
),
1187 editSField(ConstantTimeStepFieldMask
);
1192 GetFieldHandlePtr
ComplexSceneManagerBase::getHandleConstantTime (void) const
1194 SFBool::GetHandlePtr
returnValue(
1195 new SFBool::GetHandle(
1197 this->getType().getFieldDesc(ConstantTimeFieldId
),
1198 const_cast<ComplexSceneManagerBase
*>(this)));
1203 EditFieldHandlePtr
ComplexSceneManagerBase::editHandleConstantTime (void)
1205 SFBool::EditHandlePtr
returnValue(
1206 new SFBool::EditHandle(
1208 this->getType().getFieldDesc(ConstantTimeFieldId
),
1212 editSField(ConstantTimeFieldMask
);
1217 GetFieldHandlePtr
ComplexSceneManagerBase::getHandlePaused (void) const
1219 SFBool::GetHandlePtr
returnValue(
1220 new SFBool::GetHandle(
1222 this->getType().getFieldDesc(PausedFieldId
),
1223 const_cast<ComplexSceneManagerBase
*>(this)));
1228 EditFieldHandlePtr
ComplexSceneManagerBase::editHandlePaused (void)
1230 SFBool::EditHandlePtr
returnValue(
1231 new SFBool::EditHandle(
1233 this->getType().getFieldDesc(PausedFieldId
),
1237 editSField(PausedFieldMask
);
1242 GetFieldHandlePtr
ComplexSceneManagerBase::getHandleDumpFrameStart (void) const
1244 SFBool::GetHandlePtr
returnValue(
1245 new SFBool::GetHandle(
1247 this->getType().getFieldDesc(DumpFrameStartFieldId
),
1248 const_cast<ComplexSceneManagerBase
*>(this)));
1253 EditFieldHandlePtr
ComplexSceneManagerBase::editHandleDumpFrameStart (void)
1255 SFBool::EditHandlePtr
returnValue(
1256 new SFBool::EditHandle(
1258 this->getType().getFieldDesc(DumpFrameStartFieldId
),
1262 editSField(DumpFrameStartFieldMask
);
1267 GetFieldHandlePtr
ComplexSceneManagerBase::getHandleEnableWebService (void) const
1269 SFBool::GetHandlePtr
returnValue(
1270 new SFBool::GetHandle(
1271 &_sfEnableWebService
,
1272 this->getType().getFieldDesc(EnableWebServiceFieldId
),
1273 const_cast<ComplexSceneManagerBase
*>(this)));
1278 EditFieldHandlePtr
ComplexSceneManagerBase::editHandleEnableWebService(void)
1280 SFBool::EditHandlePtr
returnValue(
1281 new SFBool::EditHandle(
1282 &_sfEnableWebService
,
1283 this->getType().getFieldDesc(EnableWebServiceFieldId
),
1287 editSField(EnableWebServiceFieldMask
);
1292 GetFieldHandlePtr
ComplexSceneManagerBase::getHandleWebServicePort (void) const
1294 SFUInt32::GetHandlePtr
returnValue(
1295 new SFUInt32::GetHandle(
1297 this->getType().getFieldDesc(WebServicePortFieldId
),
1298 const_cast<ComplexSceneManagerBase
*>(this)));
1303 EditFieldHandlePtr
ComplexSceneManagerBase::editHandleWebServicePort (void)
1305 SFUInt32::EditHandlePtr
returnValue(
1306 new SFUInt32::EditHandle(
1308 this->getType().getFieldDesc(WebServicePortFieldId
),
1312 editSField(WebServicePortFieldMask
);
1317 GetFieldHandlePtr
ComplexSceneManagerBase::getHandleWebServiceRoot (void) const
1319 SFString::GetHandlePtr
returnValue(
1320 new SFString::GetHandle(
1322 this->getType().getFieldDesc(WebServiceRootFieldId
),
1323 const_cast<ComplexSceneManagerBase
*>(this)));
1328 EditFieldHandlePtr
ComplexSceneManagerBase::editHandleWebServiceRoot (void)
1330 SFString::EditHandlePtr
returnValue(
1331 new SFString::EditHandle(
1333 this->getType().getFieldDesc(WebServiceRootFieldId
),
1337 editSField(WebServiceRootFieldMask
);
1342 GetFieldHandlePtr
ComplexSceneManagerBase::getHandleWaitKeyAfterFrame (void) const
1344 SFBool::GetHandlePtr
returnValue(
1345 new SFBool::GetHandle(
1346 &_sfWaitKeyAfterFrame
,
1347 this->getType().getFieldDesc(WaitKeyAfterFrameFieldId
),
1348 const_cast<ComplexSceneManagerBase
*>(this)));
1353 EditFieldHandlePtr
ComplexSceneManagerBase::editHandleWaitKeyAfterFrame(void)
1355 SFBool::EditHandlePtr
returnValue(
1356 new SFBool::EditHandle(
1357 &_sfWaitKeyAfterFrame
,
1358 this->getType().getFieldDesc(WaitKeyAfterFrameFieldId
),
1362 editSField(WaitKeyAfterFrameFieldMask
);
1368 #ifdef OSG_MT_CPTR_ASPECT
1369 void ComplexSceneManagerBase::execSyncV( FieldContainer
&oFrom
,
1370 ConstFieldMaskArg whichField
,
1371 AspectOffsetStore
&oOffsets
,
1372 ConstFieldMaskArg syncMode
,
1373 const UInt32 uiSyncInfo
)
1375 ComplexSceneManager
*pThis
= static_cast<ComplexSceneManager
*>(this);
1377 pThis
->execSync(static_cast<ComplexSceneManager
*>(&oFrom
),
1386 #ifdef OSG_MT_CPTR_ASPECT
1387 FieldContainer
*ComplexSceneManagerBase::createAspectCopy(
1388 const FieldContainer
*pRefAspect
) const
1390 ComplexSceneManager
*returnValue
;
1392 newAspectCopy(returnValue
,
1393 dynamic_cast<const ComplexSceneManager
*>(pRefAspect
),
1394 dynamic_cast<const ComplexSceneManager
*>(this));
1400 void ComplexSceneManagerBase::resolveLinks(void)
1402 Inherited::resolveLinks();
1404 static_cast<ComplexSceneManager
*>(this)->clearGlobals();
1406 static_cast<ComplexSceneManager
*>(this)->setDrawManager(NULL
);