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 **
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 "OSGNode.h" // Root Class
67 #include "OSGInlineBase.h"
68 #include "OSGInline.h"
70 #include <boost/bind.hpp>
74 /***************************************************************************\
76 \***************************************************************************/
78 /*! \class OSG::Inline
82 /***************************************************************************\
83 * Field Documentation *
84 \***************************************************************************/
86 /*! \var std::string InlineBase::_mfUrl
90 /*! \var bool InlineBase::_sfLoaded
94 /*! \var Node * InlineBase::_sfRoot
98 /*! \var std::string InlineBase::_sfGraphOp
102 /*! \var std::string InlineBase::_mfOptions
107 /***************************************************************************\
108 * FieldType/FieldTrait Instantiation *
109 \***************************************************************************/
111 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
112 PointerType FieldTraits
<Inline
*, nsOSG
>::_type(
115 Inline::getClassType(),
119 OSG_FIELDTRAITS_GETTYPE_NS(Inline
*, nsOSG
)
121 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField
,
125 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField
,
129 /***************************************************************************\
130 * Field Description *
131 \***************************************************************************/
133 void InlineBase::classDescInserter(TypeObject
&oType
)
135 FieldDescriptionBase
*pDesc
= NULL
;
138 pDesc
= new MFString::Description(
139 MFString::getClassType(),
142 UrlFieldId
, UrlFieldMask
,
144 (Field::MFDefaultFlags
| Field::FStdAccess
),
145 static_cast<FieldEditMethodSig
>(&Inline::editHandleUrl
),
146 static_cast<FieldGetMethodSig
>(&Inline::getHandleUrl
));
148 oType
.addInitialDesc(pDesc
);
150 pDesc
= new SFBool::Description(
151 SFBool::getClassType(),
154 LoadedFieldId
, LoadedFieldMask
,
156 (Field::SFDefaultFlags
| Field::FStdAccess
),
157 static_cast<FieldEditMethodSig
>(&Inline::editHandleLoaded
),
158 static_cast<FieldGetMethodSig
>(&Inline::getHandleLoaded
));
160 oType
.addInitialDesc(pDesc
);
162 pDesc
= new SFUnrecNodePtr::Description(
163 SFUnrecNodePtr::getClassType(),
166 RootFieldId
, RootFieldMask
,
168 (Field::SFDefaultFlags
| Field::FStdAccess
),
169 static_cast<FieldEditMethodSig
>(&Inline::editHandleRoot
),
170 static_cast<FieldGetMethodSig
>(&Inline::getHandleRoot
));
172 oType
.addInitialDesc(pDesc
);
174 pDesc
= new SFString::Description(
175 SFString::getClassType(),
178 GraphOpFieldId
, GraphOpFieldMask
,
180 (Field::SFDefaultFlags
| Field::FStdAccess
),
181 static_cast<FieldEditMethodSig
>(&Inline::editHandleGraphOp
),
182 static_cast<FieldGetMethodSig
>(&Inline::getHandleGraphOp
));
184 oType
.addInitialDesc(pDesc
);
186 pDesc
= new MFString::Description(
187 MFString::getClassType(),
190 OptionsFieldId
, OptionsFieldMask
,
192 (Field::MFDefaultFlags
| Field::FStdAccess
),
193 static_cast<FieldEditMethodSig
>(&Inline::editHandleOptions
),
194 static_cast<FieldGetMethodSig
>(&Inline::getHandleOptions
));
196 oType
.addInitialDesc(pDesc
);
200 InlineBase::TypeObject
InlineBase::_type(
201 InlineBase::getClassname(),
202 Inherited::getClassname(),
205 reinterpret_cast<PrototypeCreateF
>(&InlineBase::createEmptyLocal
),
206 reinterpret_cast<InitContainerF
>(&Inline::initMethod
),
207 reinterpret_cast<ExitContainerF
>(&Inline::exitMethod
),
208 reinterpret_cast<InitalInsertDescFunc
>(
209 reinterpret_cast<void *>(&Inline::classDescInserter
)),
212 "<?xml version=\"1.0\"?>\n"
216 " parent=\"RootGroup\"\n"
217 " library=\"Group\"\n"
218 " pointerfieldtypes=\"both\"\n"
219 " structure=\"concrete\"\n"
220 " systemcomponent=\"true\"\n"
221 " parentsystemcomponent=\"true\"\n"
222 " isNodeCore=\"true\"\n"
223 " docGroupBase=\"GrpGroupMisc\"\n"
227 "\t type=\"std::string\"\n"
228 "\t cardinality=\"multi\"\n"
229 "\t visibility=\"external\"\n"
230 "\t access=\"public\"\n"
234 "\t name=\"loaded\"\n"
236 "\t cardinality=\"single\"\n"
237 "\t visibility=\"internal\"\n"
238 "\t access=\"public\"\n"
239 "\t defaultValue=\"true\"\n"
244 "\t type=\"NodePtr\"\n"
245 "\t cardinality=\"single\"\n"
246 "\t visibility=\"internal\"\n"
247 "\t defaultValue=\"NULL\"\n"
248 "\t access=\"protected\"\n"
252 "\t name=\"graphOp\"\n"
253 "\t type=\"std::string\"\n"
254 "\t cardinality=\"single\"\n"
255 "\t visibility=\"external\"\n"
256 "\t defaultValue='\"default\"'\n"
257 "\t access=\"public\"\n"
261 "\t name=\"options\"\n"
262 "\t type=\"std::string\"\n"
263 "\t cardinality=\"multi\"\n"
264 "\t visibility=\"external\"\n"
265 "\t access=\"public\"\n"
268 "</FieldContainer>\n",
272 /*------------------------------ get -----------------------------------*/
274 FieldContainerType
&InlineBase::getType(void)
279 const FieldContainerType
&InlineBase::getType(void) const
284 UInt32
InlineBase::getContainerSize(void) const
286 return sizeof(Inline
);
289 /*------------------------- decorator get ------------------------------*/
292 MFString
*InlineBase::editMFUrl(void)
294 editMField(UrlFieldMask
, _mfUrl
);
299 const MFString
*InlineBase::getMFUrl(void) const
305 SFBool
*InlineBase::editSFLoaded(void)
307 editSField(LoadedFieldMask
);
312 const SFBool
*InlineBase::getSFLoaded(void) const
318 //! Get the Inline::_sfRoot field.
319 const SFUnrecNodePtr
*InlineBase::getSFRoot(void) const
324 SFUnrecNodePtr
*InlineBase::editSFRoot (void)
326 editSField(RootFieldMask
);
331 //! Get the value of the Inline::_sfRoot field.
332 Node
* InlineBase::getRoot(void) const
334 return _sfRoot
.getValue();
337 //! Set the value of the Inline::_sfRoot field.
338 void InlineBase::setRoot(Node
* const value
)
340 editSField(RootFieldMask
);
342 _sfRoot
.setValue(value
);
346 SFString
*InlineBase::editSFGraphOp(void)
348 editSField(GraphOpFieldMask
);
353 const SFString
*InlineBase::getSFGraphOp(void) const
359 MFString
*InlineBase::editMFOptions(void)
361 editMField(OptionsFieldMask
, _mfOptions
);
366 const MFString
*InlineBase::getMFOptions(void) const
376 /*------------------------------ access -----------------------------------*/
378 SizeT
InlineBase::getBinSize(ConstFieldMaskArg whichField
)
380 SizeT returnValue
= Inherited::getBinSize(whichField
);
382 if(FieldBits::NoField
!= (UrlFieldMask
& whichField
))
384 returnValue
+= _mfUrl
.getBinSize();
386 if(FieldBits::NoField
!= (LoadedFieldMask
& whichField
))
388 returnValue
+= _sfLoaded
.getBinSize();
390 if(FieldBits::NoField
!= (RootFieldMask
& whichField
))
392 returnValue
+= _sfRoot
.getBinSize();
394 if(FieldBits::NoField
!= (GraphOpFieldMask
& whichField
))
396 returnValue
+= _sfGraphOp
.getBinSize();
398 if(FieldBits::NoField
!= (OptionsFieldMask
& whichField
))
400 returnValue
+= _mfOptions
.getBinSize();
406 void InlineBase::copyToBin(BinaryDataHandler
&pMem
,
407 ConstFieldMaskArg whichField
)
409 Inherited::copyToBin(pMem
, whichField
);
411 if(FieldBits::NoField
!= (UrlFieldMask
& whichField
))
413 _mfUrl
.copyToBin(pMem
);
415 if(FieldBits::NoField
!= (LoadedFieldMask
& whichField
))
417 _sfLoaded
.copyToBin(pMem
);
419 if(FieldBits::NoField
!= (RootFieldMask
& whichField
))
421 _sfRoot
.copyToBin(pMem
);
423 if(FieldBits::NoField
!= (GraphOpFieldMask
& whichField
))
425 _sfGraphOp
.copyToBin(pMem
);
427 if(FieldBits::NoField
!= (OptionsFieldMask
& whichField
))
429 _mfOptions
.copyToBin(pMem
);
433 void InlineBase::copyFromBin(BinaryDataHandler
&pMem
,
434 ConstFieldMaskArg whichField
)
436 Inherited::copyFromBin(pMem
, whichField
);
438 if(FieldBits::NoField
!= (UrlFieldMask
& whichField
))
440 editMField(UrlFieldMask
, _mfUrl
);
441 _mfUrl
.copyFromBin(pMem
);
443 if(FieldBits::NoField
!= (LoadedFieldMask
& whichField
))
445 editSField(LoadedFieldMask
);
446 _sfLoaded
.copyFromBin(pMem
);
448 if(FieldBits::NoField
!= (RootFieldMask
& whichField
))
450 editSField(RootFieldMask
);
451 _sfRoot
.copyFromBin(pMem
);
453 if(FieldBits::NoField
!= (GraphOpFieldMask
& whichField
))
455 editSField(GraphOpFieldMask
);
456 _sfGraphOp
.copyFromBin(pMem
);
458 if(FieldBits::NoField
!= (OptionsFieldMask
& whichField
))
460 editMField(OptionsFieldMask
, _mfOptions
);
461 _mfOptions
.copyFromBin(pMem
);
465 //! create a new instance of the class
466 InlineTransitPtr
InlineBase::createLocal(BitVector bFlags
)
470 if(getClassType().getPrototype() != NULL
)
472 FieldContainerTransitPtr tmpPtr
=
473 getClassType().getPrototype()-> shallowCopyLocal(bFlags
);
475 fc
= dynamic_pointer_cast
<Inline
>(tmpPtr
);
481 //! create a new instance of the class, copy the container flags
482 InlineTransitPtr
InlineBase::createDependent(BitVector bFlags
)
486 if(getClassType().getPrototype() != NULL
)
488 FieldContainerTransitPtr tmpPtr
=
489 getClassType().getPrototype()-> shallowCopyDependent(bFlags
);
491 fc
= dynamic_pointer_cast
<Inline
>(tmpPtr
);
497 //! create a new instance of the class
498 InlineTransitPtr
InlineBase::create(void)
502 if(getClassType().getPrototype() != NULL
)
504 FieldContainerTransitPtr tmpPtr
=
505 getClassType().getPrototype()-> shallowCopy();
507 fc
= dynamic_pointer_cast
<Inline
>(tmpPtr
);
513 Inline
*InlineBase::createEmptyLocal(BitVector bFlags
)
517 newPtr
<Inline
>(returnValue
, bFlags
);
519 returnValue
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
524 //! create an empty new instance of the class, do not copy the prototype
525 Inline
*InlineBase::createEmpty(void)
529 newPtr
<Inline
>(returnValue
, Thread::getCurrentLocalFlags());
531 returnValue
->_pFieldFlags
->_bNamespaceMask
&=
532 ~Thread::getCurrentLocalFlags();
538 FieldContainerTransitPtr
InlineBase::shallowCopyLocal(
539 BitVector bFlags
) const
543 newPtr(tmpPtr
, dynamic_cast<const Inline
*>(this), bFlags
);
545 FieldContainerTransitPtr
returnValue(tmpPtr
);
547 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
552 FieldContainerTransitPtr
InlineBase::shallowCopyDependent(
553 BitVector bFlags
) const
557 newPtr(tmpPtr
, dynamic_cast<const Inline
*>(this), ~bFlags
);
559 FieldContainerTransitPtr
returnValue(tmpPtr
);
561 tmpPtr
->_pFieldFlags
->_bNamespaceMask
= bFlags
;
566 FieldContainerTransitPtr
InlineBase::shallowCopy(void) const
571 dynamic_cast<const Inline
*>(this),
572 Thread::getCurrentLocalFlags());
574 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~Thread::getCurrentLocalFlags();
576 FieldContainerTransitPtr
returnValue(tmpPtr
);
584 /*------------------------- constructors ----------------------------------*/
586 InlineBase::InlineBase(void) :
589 _sfLoaded (bool(true)),
591 _sfGraphOp (std::string("default")),
596 InlineBase::InlineBase(const InlineBase
&source
) :
598 _mfUrl (source
._mfUrl
),
599 _sfLoaded (source
._sfLoaded
),
601 _sfGraphOp (source
._sfGraphOp
),
602 _mfOptions (source
._mfOptions
)
607 /*-------------------------- destructors ----------------------------------*/
609 InlineBase::~InlineBase(void)
613 void InlineBase::onCreate(const Inline
*source
)
615 Inherited::onCreate(source
);
619 Inline
*pThis
= static_cast<Inline
*>(this);
621 pThis
->setRoot(source
->getRoot());
625 GetFieldHandlePtr
InlineBase::getHandleUrl (void) const
627 MFString::GetHandlePtr
returnValue(
628 new MFString::GetHandle(
630 this->getType().getFieldDesc(UrlFieldId
),
631 const_cast<InlineBase
*>(this)));
636 EditFieldHandlePtr
InlineBase::editHandleUrl (void)
638 MFString::EditHandlePtr
returnValue(
639 new MFString::EditHandle(
641 this->getType().getFieldDesc(UrlFieldId
),
645 editMField(UrlFieldMask
, _mfUrl
);
650 GetFieldHandlePtr
InlineBase::getHandleLoaded (void) const
652 SFBool::GetHandlePtr
returnValue(
653 new SFBool::GetHandle(
655 this->getType().getFieldDesc(LoadedFieldId
),
656 const_cast<InlineBase
*>(this)));
661 EditFieldHandlePtr
InlineBase::editHandleLoaded (void)
663 SFBool::EditHandlePtr
returnValue(
664 new SFBool::EditHandle(
666 this->getType().getFieldDesc(LoadedFieldId
),
670 editSField(LoadedFieldMask
);
675 GetFieldHandlePtr
InlineBase::getHandleRoot (void) const
677 SFUnrecNodePtr::GetHandlePtr
returnValue(
678 new SFUnrecNodePtr::GetHandle(
680 this->getType().getFieldDesc(RootFieldId
),
681 const_cast<InlineBase
*>(this)));
686 EditFieldHandlePtr
InlineBase::editHandleRoot (void)
688 SFUnrecNodePtr::EditHandlePtr
returnValue(
689 new SFUnrecNodePtr::EditHandle(
691 this->getType().getFieldDesc(RootFieldId
),
694 returnValue
->setSetMethod(
695 boost::bind(&Inline::setRoot
,
696 static_cast<Inline
*>(this), _1
));
698 editSField(RootFieldMask
);
703 GetFieldHandlePtr
InlineBase::getHandleGraphOp (void) const
705 SFString::GetHandlePtr
returnValue(
706 new SFString::GetHandle(
708 this->getType().getFieldDesc(GraphOpFieldId
),
709 const_cast<InlineBase
*>(this)));
714 EditFieldHandlePtr
InlineBase::editHandleGraphOp (void)
716 SFString::EditHandlePtr
returnValue(
717 new SFString::EditHandle(
719 this->getType().getFieldDesc(GraphOpFieldId
),
723 editSField(GraphOpFieldMask
);
728 GetFieldHandlePtr
InlineBase::getHandleOptions (void) const
730 MFString::GetHandlePtr
returnValue(
731 new MFString::GetHandle(
733 this->getType().getFieldDesc(OptionsFieldId
),
734 const_cast<InlineBase
*>(this)));
739 EditFieldHandlePtr
InlineBase::editHandleOptions (void)
741 MFString::EditHandlePtr
returnValue(
742 new MFString::EditHandle(
744 this->getType().getFieldDesc(OptionsFieldId
),
748 editMField(OptionsFieldMask
, _mfOptions
);
754 #ifdef OSG_MT_CPTR_ASPECT
755 void InlineBase::execSyncV( FieldContainer
&oFrom
,
756 ConstFieldMaskArg whichField
,
757 AspectOffsetStore
&oOffsets
,
758 ConstFieldMaskArg syncMode
,
759 const UInt32 uiSyncInfo
)
761 Inline
*pThis
= static_cast<Inline
*>(this);
763 pThis
->execSync(static_cast<Inline
*>(&oFrom
),
772 #ifdef OSG_MT_CPTR_ASPECT
773 FieldContainer
*InlineBase::createAspectCopy(
774 const FieldContainer
*pRefAspect
) const
778 newAspectCopy(returnValue
,
779 dynamic_cast<const Inline
*>(pRefAspect
),
780 dynamic_cast<const Inline
*>(this));
786 void InlineBase::resolveLinks(void)
788 Inherited::resolveLinks();
790 static_cast<Inline
*>(this)->setRoot(NULL
);
792 #ifdef OSG_MT_CPTR_ASPECT
793 AspectOffsetStore oOffsets
;
795 _pAspectStore
->fillOffsetArray(oOffsets
, this);
798 #ifdef OSG_MT_CPTR_ASPECT
799 _mfUrl
.terminateShare(Thread::getCurrentAspect(),
802 #ifdef OSG_MT_CPTR_ASPECT
803 _mfOptions
.terminateShare(Thread::getCurrentAspect(),