fixed: gcc8 compile issues
[opensg.git] / Source / Contrib / ComplexSceneManager / OSGComplexSceneManagerBase.cpp
blob98bc864fc4d1541831187123258761d0014731f5
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 ComplexSceneManager!
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"
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>
73 OSG_BEGIN_NAMESPACE
75 /***************************************************************************\
76 * Description *
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",
143 "FieldContainerPtr",
144 ComplexSceneManager::getClassType(),
145 nsOSG);
146 #endif
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(),
161 "globals",
163 GlobalsFieldId, GlobalsFieldMask,
164 false,
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(),
173 "drawManager",
175 DrawManagerFieldId, DrawManagerFieldMask,
176 false,
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(),
185 "startTime",
187 StartTimeFieldId, StartTimeFieldMask,
188 true,
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(),
197 "timeScale",
199 TimeScaleFieldId, TimeScaleFieldMask,
200 true,
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(),
209 "constantTimeStep",
211 ConstantTimeStepFieldId, ConstantTimeStepFieldMask,
212 true,
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(),
221 "constantTime",
223 ConstantTimeFieldId, ConstantTimeFieldMask,
224 true,
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(),
233 "paused",
235 PausedFieldId, PausedFieldMask,
236 true,
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(),
245 "dumpFrameStart",
247 DumpFrameStartFieldId, DumpFrameStartFieldMask,
248 true,
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(),
257 "enableWebService",
259 EnableWebServiceFieldId, EnableWebServiceFieldMask,
260 true,
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(),
269 "webServicePort",
271 WebServicePortFieldId, WebServicePortFieldMask,
272 true,
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(),
281 "webServiceRoot",
283 WebServiceRootFieldId, WebServiceRootFieldMask,
284 true,
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(),
293 "waitKeyAfterFrame",
295 WaitKeyAfterFrameFieldId, WaitKeyAfterFrameFieldMask,
296 true,
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(),
308 "NULL",
309 nsOSG, //Namespace
310 reinterpret_cast<PrototypeCreateF>(&ComplexSceneManagerBase::createEmptyLocal),
311 reinterpret_cast<InitContainerF>(&ComplexSceneManager::initMethod),
312 reinterpret_cast<ExitContainerF>(&ComplexSceneManager::exitMethod),
313 reinterpret_cast<InitalInsertDescFunc>(&ComplexSceneManager::classDescInserter),
314 false,
316 "<?xml version=\"1.0\"?>\n"
317 "\n"
318 "<FieldContainer\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"
330 ">\n"
331 " \n"
332 "\t<Field\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"
339 "\t>\n"
340 "\t</Field>\n"
341 "\t<Field\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"
349 "\t>\n"
350 "\t</Field>\n"
351 "\n"
352 "<!--\n"
353 "\t<Field\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"
361 "\t>\n"
362 "\t</Field>\n"
363 "-->\n"
364 "\t<Field\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"
371 "\t>\n"
372 "\t</Field>\n"
373 "\t<Field\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"
380 "\t>\n"
381 "\t</Field>\n"
382 "\t<Field\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"
389 "\t>\n"
390 "\t</Field>\n"
391 "\t<Field\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"
398 "\t>\n"
399 "\t</Field>\n"
400 "\t<Field\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"
407 "\t>\n"
408 "\t</Field>\n"
409 "\n"
410 "\t<Field\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"
417 "\t>\n"
418 "\t</Field>\n"
419 "\n"
420 "\t<Field\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"
427 "\t>\n"
428 "\t</Field>\n"
429 "\t<Field\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"
436 "\t>\n"
437 "\t</Field>\n"
438 "\t<Field\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"
445 "\t>\n"
446 "\t</Field>\n"
447 "\t<Field\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"
454 "\t>\n"
455 "\t</Field>\n"
456 "\n"
457 "</FieldContainer>\n",
461 /*------------------------------ get -----------------------------------*/
463 FieldContainerType &ComplexSceneManagerBase::getType(void)
465 return _type;
468 const FieldContainerType &ComplexSceneManagerBase::getType(void) const
470 return _type;
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
484 return &_mfGlobals;
487 MFRecFieldContainerPtr *ComplexSceneManagerBase::editMFGlobals (void)
489 editMField(GlobalsFieldMask, _mfGlobals);
491 return &_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);
582 return &_sfPaused;
585 const SFBool *ComplexSceneManagerBase::getSFPaused(void) const
587 return &_sfPaused;
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 =
668 value.begin();
669 MFRecFieldContainerPtr::const_iterator elemEnd =
670 value.end ();
672 static_cast<ComplexSceneManager *>(this)->clearGlobals();
674 while(elemIt != elemEnd)
676 this->pushToGlobals(*elemIt);
678 ++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);
696 if(iElemIdx != -1)
698 editMField(GlobalsFieldMask, _mfGlobals);
700 _mfGlobals.erase(iElemIdx);
703 void ComplexSceneManagerBase::clearGlobals(void)
705 editMField(GlobalsFieldMask, _mfGlobals);
708 _mfGlobals.clear();
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();
768 return returnValue;
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);
906 return fc;
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);
922 return fc;
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;
939 return returnValue;
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;
960 return returnValue;
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;
974 return returnValue;
977 FieldContainerTransitPtr ComplexSceneManagerBase::shallowCopy(void) const
979 return shallowCopyLocal();
985 /*------------------------- constructors ----------------------------------*/
987 ComplexSceneManagerBase::ComplexSceneManagerBase(void) :
988 Inherited(),
989 _mfGlobals (),
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) :
1005 Inherited(source),
1006 _mfGlobals (),
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);
1032 if(source != NULL)
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);
1045 ++GlobalsIt;
1048 pThis->setDrawManager(source->getDrawManager());
1052 GetFieldHandlePtr ComplexSceneManagerBase::getHandleGlobals (void) const
1054 MFRecFieldContainerPtr::GetHandlePtr returnValue(
1055 new MFRecFieldContainerPtr::GetHandle(
1056 &_mfGlobals,
1057 this->getType().getFieldDesc(GlobalsFieldId),
1058 const_cast<ComplexSceneManagerBase *>(this)));
1060 return returnValue;
1063 EditFieldHandlePtr ComplexSceneManagerBase::editHandleGlobals (void)
1065 MFRecFieldContainerPtr::EditHandlePtr returnValue(
1066 new MFRecFieldContainerPtr::EditHandle(
1067 &_mfGlobals,
1068 this->getType().getFieldDesc(GlobalsFieldId),
1069 this));
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);
1086 return returnValue;
1089 GetFieldHandlePtr ComplexSceneManagerBase::getHandleDrawManager (void) const
1091 SFUnrecCSMDrawManagerPtr::GetHandlePtr returnValue(
1092 new SFUnrecCSMDrawManagerPtr::GetHandle(
1093 &_sfDrawManager,
1094 this->getType().getFieldDesc(DrawManagerFieldId),
1095 const_cast<ComplexSceneManagerBase *>(this)));
1097 return returnValue;
1100 EditFieldHandlePtr ComplexSceneManagerBase::editHandleDrawManager (void)
1102 SFUnrecCSMDrawManagerPtr::EditHandlePtr returnValue(
1103 new SFUnrecCSMDrawManagerPtr::EditHandle(
1104 &_sfDrawManager,
1105 this->getType().getFieldDesc(DrawManagerFieldId),
1106 this));
1108 returnValue->setSetMethod(
1109 boost::bind(&ComplexSceneManager::setDrawManager,
1110 static_cast<ComplexSceneManager *>(this), _1));
1112 editSField(DrawManagerFieldMask);
1114 return returnValue;
1117 GetFieldHandlePtr ComplexSceneManagerBase::getHandleStartTime (void) const
1119 SFTime::GetHandlePtr returnValue(
1120 new SFTime::GetHandle(
1121 &_sfStartTime,
1122 this->getType().getFieldDesc(StartTimeFieldId),
1123 const_cast<ComplexSceneManagerBase *>(this)));
1125 return returnValue;
1128 EditFieldHandlePtr ComplexSceneManagerBase::editHandleStartTime (void)
1130 SFTime::EditHandlePtr returnValue(
1131 new SFTime::EditHandle(
1132 &_sfStartTime,
1133 this->getType().getFieldDesc(StartTimeFieldId),
1134 this));
1137 editSField(StartTimeFieldMask);
1139 return returnValue;
1142 GetFieldHandlePtr ComplexSceneManagerBase::getHandleTimeScale (void) const
1144 SFTime::GetHandlePtr returnValue(
1145 new SFTime::GetHandle(
1146 &_sfTimeScale,
1147 this->getType().getFieldDesc(TimeScaleFieldId),
1148 const_cast<ComplexSceneManagerBase *>(this)));
1150 return returnValue;
1153 EditFieldHandlePtr ComplexSceneManagerBase::editHandleTimeScale (void)
1155 SFTime::EditHandlePtr returnValue(
1156 new SFTime::EditHandle(
1157 &_sfTimeScale,
1158 this->getType().getFieldDesc(TimeScaleFieldId),
1159 this));
1162 editSField(TimeScaleFieldMask);
1164 return returnValue;
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)));
1175 return returnValue;
1178 EditFieldHandlePtr ComplexSceneManagerBase::editHandleConstantTimeStep(void)
1180 SFTime::EditHandlePtr returnValue(
1181 new SFTime::EditHandle(
1182 &_sfConstantTimeStep,
1183 this->getType().getFieldDesc(ConstantTimeStepFieldId),
1184 this));
1187 editSField(ConstantTimeStepFieldMask);
1189 return returnValue;
1192 GetFieldHandlePtr ComplexSceneManagerBase::getHandleConstantTime (void) const
1194 SFBool::GetHandlePtr returnValue(
1195 new SFBool::GetHandle(
1196 &_sfConstantTime,
1197 this->getType().getFieldDesc(ConstantTimeFieldId),
1198 const_cast<ComplexSceneManagerBase *>(this)));
1200 return returnValue;
1203 EditFieldHandlePtr ComplexSceneManagerBase::editHandleConstantTime (void)
1205 SFBool::EditHandlePtr returnValue(
1206 new SFBool::EditHandle(
1207 &_sfConstantTime,
1208 this->getType().getFieldDesc(ConstantTimeFieldId),
1209 this));
1212 editSField(ConstantTimeFieldMask);
1214 return returnValue;
1217 GetFieldHandlePtr ComplexSceneManagerBase::getHandlePaused (void) const
1219 SFBool::GetHandlePtr returnValue(
1220 new SFBool::GetHandle(
1221 &_sfPaused,
1222 this->getType().getFieldDesc(PausedFieldId),
1223 const_cast<ComplexSceneManagerBase *>(this)));
1225 return returnValue;
1228 EditFieldHandlePtr ComplexSceneManagerBase::editHandlePaused (void)
1230 SFBool::EditHandlePtr returnValue(
1231 new SFBool::EditHandle(
1232 &_sfPaused,
1233 this->getType().getFieldDesc(PausedFieldId),
1234 this));
1237 editSField(PausedFieldMask);
1239 return returnValue;
1242 GetFieldHandlePtr ComplexSceneManagerBase::getHandleDumpFrameStart (void) const
1244 SFBool::GetHandlePtr returnValue(
1245 new SFBool::GetHandle(
1246 &_sfDumpFrameStart,
1247 this->getType().getFieldDesc(DumpFrameStartFieldId),
1248 const_cast<ComplexSceneManagerBase *>(this)));
1250 return returnValue;
1253 EditFieldHandlePtr ComplexSceneManagerBase::editHandleDumpFrameStart (void)
1255 SFBool::EditHandlePtr returnValue(
1256 new SFBool::EditHandle(
1257 &_sfDumpFrameStart,
1258 this->getType().getFieldDesc(DumpFrameStartFieldId),
1259 this));
1262 editSField(DumpFrameStartFieldMask);
1264 return returnValue;
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)));
1275 return returnValue;
1278 EditFieldHandlePtr ComplexSceneManagerBase::editHandleEnableWebService(void)
1280 SFBool::EditHandlePtr returnValue(
1281 new SFBool::EditHandle(
1282 &_sfEnableWebService,
1283 this->getType().getFieldDesc(EnableWebServiceFieldId),
1284 this));
1287 editSField(EnableWebServiceFieldMask);
1289 return returnValue;
1292 GetFieldHandlePtr ComplexSceneManagerBase::getHandleWebServicePort (void) const
1294 SFUInt32::GetHandlePtr returnValue(
1295 new SFUInt32::GetHandle(
1296 &_sfWebServicePort,
1297 this->getType().getFieldDesc(WebServicePortFieldId),
1298 const_cast<ComplexSceneManagerBase *>(this)));
1300 return returnValue;
1303 EditFieldHandlePtr ComplexSceneManagerBase::editHandleWebServicePort (void)
1305 SFUInt32::EditHandlePtr returnValue(
1306 new SFUInt32::EditHandle(
1307 &_sfWebServicePort,
1308 this->getType().getFieldDesc(WebServicePortFieldId),
1309 this));
1312 editSField(WebServicePortFieldMask);
1314 return returnValue;
1317 GetFieldHandlePtr ComplexSceneManagerBase::getHandleWebServiceRoot (void) const
1319 SFString::GetHandlePtr returnValue(
1320 new SFString::GetHandle(
1321 &_sfWebServiceRoot,
1322 this->getType().getFieldDesc(WebServiceRootFieldId),
1323 const_cast<ComplexSceneManagerBase *>(this)));
1325 return returnValue;
1328 EditFieldHandlePtr ComplexSceneManagerBase::editHandleWebServiceRoot (void)
1330 SFString::EditHandlePtr returnValue(
1331 new SFString::EditHandle(
1332 &_sfWebServiceRoot,
1333 this->getType().getFieldDesc(WebServiceRootFieldId),
1334 this));
1337 editSField(WebServiceRootFieldMask);
1339 return returnValue;
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)));
1350 return returnValue;
1353 EditFieldHandlePtr ComplexSceneManagerBase::editHandleWaitKeyAfterFrame(void)
1355 SFBool::EditHandlePtr returnValue(
1356 new SFBool::EditHandle(
1357 &_sfWaitKeyAfterFrame,
1358 this->getType().getFieldDesc(WaitKeyAfterFrameFieldId),
1359 this));
1362 editSField(WaitKeyAfterFrameFieldMask);
1364 return returnValue;
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),
1378 whichField,
1379 oOffsets,
1380 syncMode,
1381 uiSyncInfo);
1383 #endif
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));
1396 return returnValue;
1398 #endif
1400 void ComplexSceneManagerBase::resolveLinks(void)
1402 Inherited::resolveLinks();
1404 static_cast<ComplexSceneManager *>(this)->clearGlobals();
1406 static_cast<ComplexSceneManager *>(this)->setDrawManager(NULL);
1412 OSG_END_NAMESPACE