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 "OSGProxyGroupBase.h"
68 #include "OSGProxyGroup.h"
70 #include <boost/bind.hpp>
74 /***************************************************************************\
76 \***************************************************************************/
78 /*! \class OSG::ProxyGroup
79 This group is used for delayed loading. If enabled the child
80 nodes are loaded in a second thread. Until the load is finished
81 the child nodes of this group are rendered. This could be used
82 to show a proxy object. If concurrentLoad is false, then loading
83 is done during the first frame. This is the behaviour of a simple
87 /***************************************************************************\
88 * Field Documentation *
89 \***************************************************************************/
91 /*! \var bool ProxyGroupBase::_sfEnabled
95 /*! \var std::string ProxyGroupBase::_sfUrl
99 /*! \var Node * ProxyGroupBase::_sfRoot
103 /*! \var UInt32 ProxyGroupBase::_sfState
107 /*! \var bool ProxyGroupBase::_sfConcurrentLoad
111 /*! \var BoxVolume ProxyGroupBase::_sfVolume
115 /*! \var UInt32 ProxyGroupBase::_sfIndices
119 /*! \var UInt32 ProxyGroupBase::_sfTriangles
123 /*! \var UInt32 ProxyGroupBase::_sfPositions
127 /*! \var UInt32 ProxyGroupBase::_sfGeometries
131 /*! \var std::string ProxyGroupBase::_sfAbsoluteUrl
135 /*! \var UInt8 ProxyGroupBase::_mfInline
140 /***************************************************************************\
141 * FieldType/FieldTrait Instantiation *
142 \***************************************************************************/
144 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
145 PointerType FieldTraits
<ProxyGroup
*, nsOSG
>::_type(
148 ProxyGroup::getClassType(),
152 OSG_FIELDTRAITS_GETTYPE_NS(ProxyGroup
*, nsOSG
)
154 /***************************************************************************\
155 * Field Description *
156 \***************************************************************************/
158 void ProxyGroupBase::classDescInserter(TypeObject
&oType
)
160 FieldDescriptionBase
*pDesc
= NULL
;
163 pDesc
= new SFBool::Description(
164 SFBool::getClassType(),
167 EnabledFieldId
, EnabledFieldMask
,
169 (Field::SFDefaultFlags
| Field::FStdAccess
),
170 static_cast<FieldEditMethodSig
>(&ProxyGroup::editHandleEnabled
),
171 static_cast<FieldGetMethodSig
>(&ProxyGroup::getHandleEnabled
));
173 oType
.addInitialDesc(pDesc
);
175 pDesc
= new SFString::Description(
176 SFString::getClassType(),
179 UrlFieldId
, UrlFieldMask
,
181 (Field::SFDefaultFlags
| Field::FStdAccess
),
182 static_cast<FieldEditMethodSig
>(&ProxyGroup::editHandleUrl
),
183 static_cast<FieldGetMethodSig
>(&ProxyGroup::getHandleUrl
));
185 oType
.addInitialDesc(pDesc
);
187 pDesc
= new SFUnrecNodePtr::Description(
188 SFUnrecNodePtr::getClassType(),
191 RootFieldId
, RootFieldMask
,
193 (Field::SFDefaultFlags
| Field::FStdAccess
),
194 static_cast<FieldEditMethodSig
>(&ProxyGroup::editHandleRoot
),
195 static_cast<FieldGetMethodSig
>(&ProxyGroup::getHandleRoot
));
197 oType
.addInitialDesc(pDesc
);
199 pDesc
= new SFUInt32::Description(
200 SFUInt32::getClassType(),
203 StateFieldId
, StateFieldMask
,
205 (Field::SFDefaultFlags
| Field::FStdAccess
),
206 static_cast<FieldEditMethodSig
>(&ProxyGroup::editHandleState
),
207 static_cast<FieldGetMethodSig
>(&ProxyGroup::getHandleState
));
209 oType
.addInitialDesc(pDesc
);
211 pDesc
= new SFBool::Description(
212 SFBool::getClassType(),
215 ConcurrentLoadFieldId
, ConcurrentLoadFieldMask
,
217 (Field::SFDefaultFlags
| Field::FStdAccess
),
218 static_cast<FieldEditMethodSig
>(&ProxyGroup::editHandleConcurrentLoad
),
219 static_cast<FieldGetMethodSig
>(&ProxyGroup::getHandleConcurrentLoad
));
221 oType
.addInitialDesc(pDesc
);
223 pDesc
= new SFBoxVolume::Description(
224 SFBoxVolume::getClassType(),
227 VolumeFieldId
, VolumeFieldMask
,
229 (Field::SFDefaultFlags
| Field::FStdAccess
),
230 static_cast<FieldEditMethodSig
>(&ProxyGroup::editHandleVolume
),
231 static_cast<FieldGetMethodSig
>(&ProxyGroup::getHandleVolume
));
233 oType
.addInitialDesc(pDesc
);
235 pDesc
= new SFUInt32::Description(
236 SFUInt32::getClassType(),
239 IndicesFieldId
, IndicesFieldMask
,
241 (Field::SFDefaultFlags
| Field::FStdAccess
),
242 static_cast<FieldEditMethodSig
>(&ProxyGroup::editHandleIndices
),
243 static_cast<FieldGetMethodSig
>(&ProxyGroup::getHandleIndices
));
245 oType
.addInitialDesc(pDesc
);
247 pDesc
= new SFUInt32::Description(
248 SFUInt32::getClassType(),
251 TrianglesFieldId
, TrianglesFieldMask
,
253 (Field::SFDefaultFlags
| Field::FStdAccess
),
254 static_cast<FieldEditMethodSig
>(&ProxyGroup::editHandleTriangles
),
255 static_cast<FieldGetMethodSig
>(&ProxyGroup::getHandleTriangles
));
257 oType
.addInitialDesc(pDesc
);
259 pDesc
= new SFUInt32::Description(
260 SFUInt32::getClassType(),
263 PositionsFieldId
, PositionsFieldMask
,
265 (Field::SFDefaultFlags
| Field::FStdAccess
),
266 static_cast<FieldEditMethodSig
>(&ProxyGroup::editHandlePositions
),
267 static_cast<FieldGetMethodSig
>(&ProxyGroup::getHandlePositions
));
269 oType
.addInitialDesc(pDesc
);
271 pDesc
= new SFUInt32::Description(
272 SFUInt32::getClassType(),
275 GeometriesFieldId
, GeometriesFieldMask
,
277 (Field::SFDefaultFlags
| Field::FStdAccess
),
278 static_cast<FieldEditMethodSig
>(&ProxyGroup::editHandleGeometries
),
279 static_cast<FieldGetMethodSig
>(&ProxyGroup::getHandleGeometries
));
281 oType
.addInitialDesc(pDesc
);
283 pDesc
= new SFString::Description(
284 SFString::getClassType(),
287 AbsoluteUrlFieldId
, AbsoluteUrlFieldMask
,
289 (Field::SFDefaultFlags
| Field::FStdAccess
),
290 static_cast<FieldEditMethodSig
>(&ProxyGroup::editHandleAbsoluteUrl
),
291 static_cast<FieldGetMethodSig
>(&ProxyGroup::getHandleAbsoluteUrl
));
293 oType
.addInitialDesc(pDesc
);
295 pDesc
= new MFUInt8::Description(
296 MFUInt8::getClassType(),
299 InlineFieldId
, InlineFieldMask
,
301 (Field::MFDefaultFlags
| Field::FStdAccess
),
302 static_cast<FieldEditMethodSig
>(&ProxyGroup::editHandleInline
),
303 static_cast<FieldGetMethodSig
>(&ProxyGroup::getHandleInline
));
305 oType
.addInitialDesc(pDesc
);
309 ProxyGroupBase::TypeObject
ProxyGroupBase::_type(
310 ProxyGroupBase::getClassname(),
311 Inherited::getClassname(),
314 reinterpret_cast<PrototypeCreateF
>(&ProxyGroupBase::createEmptyLocal
),
315 reinterpret_cast<InitContainerF
>(&ProxyGroup::initMethod
),
316 reinterpret_cast<ExitContainerF
>(&ProxyGroup::exitMethod
),
317 reinterpret_cast<InitalInsertDescFunc
>(
318 reinterpret_cast<void *>(&ProxyGroup::classDescInserter
)),
321 "<?xml version=\"1.0\"?>\n"
324 " name=\"ProxyGroup\"\n"
325 " parent=\"Group\"\n"
326 " library=\"Group\"\n"
327 " pointerfieldtypes=\"none\"\n"
328 " structure=\"concrete\"\n"
329 " systemcomponent=\"true\"\n"
330 " parentsystemcomponent=\"true\"\n"
331 " decoratable=\"false\"\n"
332 " useLocalIncludes=\"false\"\n"
333 " isNodeCore=\"true\"\n"
334 " docGroupBase=\"GrpGroupMisc\"\n"
336 " This group is used for delayed loading. If enabled the child\n"
337 " nodes are loaded in a second thread. Until the load is finished\n"
338 " the child nodes of this group are rendered. This could be used\n"
339 " to show a proxy object. If concurrentLoad is false, then loading\n"
340 " is done during the first frame. This is the behaviour of a simple\n"
343 "\t name=\"enabled\"\n"
345 "\t cardinality=\"single\"\n"
346 "\t visibility=\"external\"\n"
347 "\t defaultValue=\"true\"\n"
348 "\t access=\"public\"\n"
353 "\t type=\"std::string\"\n"
354 "\t cardinality=\"single\"\n"
355 "\t visibility=\"external\"\n"
356 "\t access=\"public\"\n"
361 "\t type=\"NodePtr\"\n"
362 "\t cardinality=\"single\"\n"
363 "\t visibility=\"internal\"\n"
364 "\t defaultValue=\"NULL\"\n"
365 "\t access=\"public\"\n"
369 "\t name=\"state\"\n"
370 "\t type=\"UInt32\"\n"
371 "\t cardinality=\"single\"\n"
372 "\t visibility=\"external\"\n"
373 "\t defaultValue=\"0\"\n"
374 "\t access=\"public\"\n"
378 "\t name=\"concurrentLoad\"\n"
380 "\t cardinality=\"single\"\n"
381 "\t visibility=\"external\"\n"
382 "\t defaultValue=\"true\"\n"
383 "\t access=\"public\"\n"
387 "\t name=\"volume\"\n"
388 "\t type=\"BoxVolume\"\n"
389 "\t cardinality=\"single\"\n"
390 "\t visibility=\"external\"\n"
391 "\t access=\"public\"\n"
395 "\t name=\"indices\"\n"
396 "\t type=\"UInt32\"\n"
397 "\t cardinality=\"single\"\n"
398 "\t visibility=\"external\"\n"
399 "\t defaultValue=\"0\"\n"
400 "\t access=\"public\"\n"
404 "\t name=\"triangles\"\n"
405 "\t type=\"UInt32\"\n"
406 "\t cardinality=\"single\"\n"
407 "\t visibility=\"external\"\n"
408 "\t defaultValue=\"0\"\n"
409 "\t access=\"public\"\n"
413 "\t name=\"positions\"\n"
414 "\t type=\"UInt32\"\n"
415 "\t cardinality=\"single\"\n"
416 "\t visibility=\"external\"\n"
417 "\t access=\"public\"\n"
421 "\t name=\"geometries\"\n"
422 "\t type=\"UInt32\"\n"
423 "\t cardinality=\"single\"\n"
424 "\t visibility=\"external\"\n"
425 "\t access=\"public\"\n"
429 "\t name=\"absoluteUrl\"\n"
430 "\t type=\"std::string\"\n"
431 "\t cardinality=\"single\"\n"
432 "\t visibility=\"internal\"\n"
433 "\t access=\"protected\"\n"
437 "\t name=\"inline\"\n"
438 "\t type=\"UInt8\"\n"
439 "\t cardinality=\"multi\"\n"
440 "\t visibility=\"external\"\n"
441 "\t access=\"public\"\n"
444 "</FieldContainer>\n",
445 "This group is used for delayed loading. If enabled the child\n"
446 "nodes are loaded in a second thread. Until the load is finished\n"
447 "the child nodes of this group are rendered. This could be used\n"
448 "to show a proxy object. If concurrentLoad is false, then loading\n"
449 "is done during the first frame. This is the behaviour of a simple\n"
453 /*------------------------------ get -----------------------------------*/
455 FieldContainerType
&ProxyGroupBase::getType(void)
460 const FieldContainerType
&ProxyGroupBase::getType(void) const
465 UInt32
ProxyGroupBase::getContainerSize(void) const
467 return sizeof(ProxyGroup
);
470 /*------------------------- decorator get ------------------------------*/
473 SFBool
*ProxyGroupBase::editSFEnabled(void)
475 editSField(EnabledFieldMask
);
480 const SFBool
*ProxyGroupBase::getSFEnabled(void) const
486 SFString
*ProxyGroupBase::editSFUrl(void)
488 editSField(UrlFieldMask
);
493 const SFString
*ProxyGroupBase::getSFUrl(void) const
499 //! Get the ProxyGroup::_sfRoot field.
500 const SFUnrecNodePtr
*ProxyGroupBase::getSFRoot(void) const
505 SFUnrecNodePtr
*ProxyGroupBase::editSFRoot (void)
507 editSField(RootFieldMask
);
512 //! Get the value of the ProxyGroup::_sfRoot field.
513 Node
* ProxyGroupBase::getRoot(void) const
515 return _sfRoot
.getValue();
518 //! Set the value of the ProxyGroup::_sfRoot field.
519 void ProxyGroupBase::setRoot(Node
* const value
)
521 editSField(RootFieldMask
);
523 _sfRoot
.setValue(value
);
527 SFUInt32
*ProxyGroupBase::editSFState(void)
529 editSField(StateFieldMask
);
534 const SFUInt32
*ProxyGroupBase::getSFState(void) const
540 SFBool
*ProxyGroupBase::editSFConcurrentLoad(void)
542 editSField(ConcurrentLoadFieldMask
);
544 return &_sfConcurrentLoad
;
547 const SFBool
*ProxyGroupBase::getSFConcurrentLoad(void) const
549 return &_sfConcurrentLoad
;
553 SFBoxVolume
*ProxyGroupBase::editSFVolume(void)
555 editSField(VolumeFieldMask
);
560 const SFBoxVolume
*ProxyGroupBase::getSFVolume(void) const
566 SFUInt32
*ProxyGroupBase::editSFIndices(void)
568 editSField(IndicesFieldMask
);
573 const SFUInt32
*ProxyGroupBase::getSFIndices(void) const
579 SFUInt32
*ProxyGroupBase::editSFTriangles(void)
581 editSField(TrianglesFieldMask
);
583 return &_sfTriangles
;
586 const SFUInt32
*ProxyGroupBase::getSFTriangles(void) const
588 return &_sfTriangles
;
592 SFUInt32
*ProxyGroupBase::editSFPositions(void)
594 editSField(PositionsFieldMask
);
596 return &_sfPositions
;
599 const SFUInt32
*ProxyGroupBase::getSFPositions(void) const
601 return &_sfPositions
;
605 SFUInt32
*ProxyGroupBase::editSFGeometries(void)
607 editSField(GeometriesFieldMask
);
609 return &_sfGeometries
;
612 const SFUInt32
*ProxyGroupBase::getSFGeometries(void) const
614 return &_sfGeometries
;
618 SFString
*ProxyGroupBase::editSFAbsoluteUrl(void)
620 editSField(AbsoluteUrlFieldMask
);
622 return &_sfAbsoluteUrl
;
625 const SFString
*ProxyGroupBase::getSFAbsoluteUrl(void) const
627 return &_sfAbsoluteUrl
;
631 MFUInt8
*ProxyGroupBase::editMFInline(void)
633 editMField(InlineFieldMask
, _mfInline
);
638 const MFUInt8
*ProxyGroupBase::getMFInline(void) const
648 /*------------------------------ access -----------------------------------*/
650 SizeT
ProxyGroupBase::getBinSize(ConstFieldMaskArg whichField
)
652 SizeT returnValue
= Inherited::getBinSize(whichField
);
654 if(FieldBits::NoField
!= (EnabledFieldMask
& whichField
))
656 returnValue
+= _sfEnabled
.getBinSize();
658 if(FieldBits::NoField
!= (UrlFieldMask
& whichField
))
660 returnValue
+= _sfUrl
.getBinSize();
662 if(FieldBits::NoField
!= (RootFieldMask
& whichField
))
664 returnValue
+= _sfRoot
.getBinSize();
666 if(FieldBits::NoField
!= (StateFieldMask
& whichField
))
668 returnValue
+= _sfState
.getBinSize();
670 if(FieldBits::NoField
!= (ConcurrentLoadFieldMask
& whichField
))
672 returnValue
+= _sfConcurrentLoad
.getBinSize();
674 if(FieldBits::NoField
!= (VolumeFieldMask
& whichField
))
676 returnValue
+= _sfVolume
.getBinSize();
678 if(FieldBits::NoField
!= (IndicesFieldMask
& whichField
))
680 returnValue
+= _sfIndices
.getBinSize();
682 if(FieldBits::NoField
!= (TrianglesFieldMask
& whichField
))
684 returnValue
+= _sfTriangles
.getBinSize();
686 if(FieldBits::NoField
!= (PositionsFieldMask
& whichField
))
688 returnValue
+= _sfPositions
.getBinSize();
690 if(FieldBits::NoField
!= (GeometriesFieldMask
& whichField
))
692 returnValue
+= _sfGeometries
.getBinSize();
694 if(FieldBits::NoField
!= (AbsoluteUrlFieldMask
& whichField
))
696 returnValue
+= _sfAbsoluteUrl
.getBinSize();
698 if(FieldBits::NoField
!= (InlineFieldMask
& whichField
))
700 returnValue
+= _mfInline
.getBinSize();
706 void ProxyGroupBase::copyToBin(BinaryDataHandler
&pMem
,
707 ConstFieldMaskArg whichField
)
709 Inherited::copyToBin(pMem
, whichField
);
711 if(FieldBits::NoField
!= (EnabledFieldMask
& whichField
))
713 _sfEnabled
.copyToBin(pMem
);
715 if(FieldBits::NoField
!= (UrlFieldMask
& whichField
))
717 _sfUrl
.copyToBin(pMem
);
719 if(FieldBits::NoField
!= (RootFieldMask
& whichField
))
721 _sfRoot
.copyToBin(pMem
);
723 if(FieldBits::NoField
!= (StateFieldMask
& whichField
))
725 _sfState
.copyToBin(pMem
);
727 if(FieldBits::NoField
!= (ConcurrentLoadFieldMask
& whichField
))
729 _sfConcurrentLoad
.copyToBin(pMem
);
731 if(FieldBits::NoField
!= (VolumeFieldMask
& whichField
))
733 _sfVolume
.copyToBin(pMem
);
735 if(FieldBits::NoField
!= (IndicesFieldMask
& whichField
))
737 _sfIndices
.copyToBin(pMem
);
739 if(FieldBits::NoField
!= (TrianglesFieldMask
& whichField
))
741 _sfTriangles
.copyToBin(pMem
);
743 if(FieldBits::NoField
!= (PositionsFieldMask
& whichField
))
745 _sfPositions
.copyToBin(pMem
);
747 if(FieldBits::NoField
!= (GeometriesFieldMask
& whichField
))
749 _sfGeometries
.copyToBin(pMem
);
751 if(FieldBits::NoField
!= (AbsoluteUrlFieldMask
& whichField
))
753 _sfAbsoluteUrl
.copyToBin(pMem
);
755 if(FieldBits::NoField
!= (InlineFieldMask
& whichField
))
757 _mfInline
.copyToBin(pMem
);
761 void ProxyGroupBase::copyFromBin(BinaryDataHandler
&pMem
,
762 ConstFieldMaskArg whichField
)
764 Inherited::copyFromBin(pMem
, whichField
);
766 if(FieldBits::NoField
!= (EnabledFieldMask
& whichField
))
768 editSField(EnabledFieldMask
);
769 _sfEnabled
.copyFromBin(pMem
);
771 if(FieldBits::NoField
!= (UrlFieldMask
& whichField
))
773 editSField(UrlFieldMask
);
774 _sfUrl
.copyFromBin(pMem
);
776 if(FieldBits::NoField
!= (RootFieldMask
& whichField
))
778 editSField(RootFieldMask
);
779 _sfRoot
.copyFromBin(pMem
);
781 if(FieldBits::NoField
!= (StateFieldMask
& whichField
))
783 editSField(StateFieldMask
);
784 _sfState
.copyFromBin(pMem
);
786 if(FieldBits::NoField
!= (ConcurrentLoadFieldMask
& whichField
))
788 editSField(ConcurrentLoadFieldMask
);
789 _sfConcurrentLoad
.copyFromBin(pMem
);
791 if(FieldBits::NoField
!= (VolumeFieldMask
& whichField
))
793 editSField(VolumeFieldMask
);
794 _sfVolume
.copyFromBin(pMem
);
796 if(FieldBits::NoField
!= (IndicesFieldMask
& whichField
))
798 editSField(IndicesFieldMask
);
799 _sfIndices
.copyFromBin(pMem
);
801 if(FieldBits::NoField
!= (TrianglesFieldMask
& whichField
))
803 editSField(TrianglesFieldMask
);
804 _sfTriangles
.copyFromBin(pMem
);
806 if(FieldBits::NoField
!= (PositionsFieldMask
& whichField
))
808 editSField(PositionsFieldMask
);
809 _sfPositions
.copyFromBin(pMem
);
811 if(FieldBits::NoField
!= (GeometriesFieldMask
& whichField
))
813 editSField(GeometriesFieldMask
);
814 _sfGeometries
.copyFromBin(pMem
);
816 if(FieldBits::NoField
!= (AbsoluteUrlFieldMask
& whichField
))
818 editSField(AbsoluteUrlFieldMask
);
819 _sfAbsoluteUrl
.copyFromBin(pMem
);
821 if(FieldBits::NoField
!= (InlineFieldMask
& whichField
))
823 editMField(InlineFieldMask
, _mfInline
);
824 _mfInline
.copyFromBin(pMem
);
828 //! create a new instance of the class
829 ProxyGroupTransitPtr
ProxyGroupBase::createLocal(BitVector bFlags
)
831 ProxyGroupTransitPtr fc
;
833 if(getClassType().getPrototype() != NULL
)
835 FieldContainerTransitPtr tmpPtr
=
836 getClassType().getPrototype()-> shallowCopyLocal(bFlags
);
838 fc
= dynamic_pointer_cast
<ProxyGroup
>(tmpPtr
);
844 //! create a new instance of the class, copy the container flags
845 ProxyGroupTransitPtr
ProxyGroupBase::createDependent(BitVector bFlags
)
847 ProxyGroupTransitPtr fc
;
849 if(getClassType().getPrototype() != NULL
)
851 FieldContainerTransitPtr tmpPtr
=
852 getClassType().getPrototype()-> shallowCopyDependent(bFlags
);
854 fc
= dynamic_pointer_cast
<ProxyGroup
>(tmpPtr
);
860 //! create a new instance of the class
861 ProxyGroupTransitPtr
ProxyGroupBase::create(void)
863 ProxyGroupTransitPtr fc
;
865 if(getClassType().getPrototype() != NULL
)
867 FieldContainerTransitPtr tmpPtr
=
868 getClassType().getPrototype()-> shallowCopy();
870 fc
= dynamic_pointer_cast
<ProxyGroup
>(tmpPtr
);
876 ProxyGroup
*ProxyGroupBase::createEmptyLocal(BitVector bFlags
)
878 ProxyGroup
*returnValue
;
880 newPtr
<ProxyGroup
>(returnValue
, bFlags
);
882 returnValue
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
887 //! create an empty new instance of the class, do not copy the prototype
888 ProxyGroup
*ProxyGroupBase::createEmpty(void)
890 ProxyGroup
*returnValue
;
892 newPtr
<ProxyGroup
>(returnValue
, Thread::getCurrentLocalFlags());
894 returnValue
->_pFieldFlags
->_bNamespaceMask
&=
895 ~Thread::getCurrentLocalFlags();
901 FieldContainerTransitPtr
ProxyGroupBase::shallowCopyLocal(
902 BitVector bFlags
) const
906 newPtr(tmpPtr
, dynamic_cast<const ProxyGroup
*>(this), bFlags
);
908 FieldContainerTransitPtr
returnValue(tmpPtr
);
910 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
915 FieldContainerTransitPtr
ProxyGroupBase::shallowCopyDependent(
916 BitVector bFlags
) const
920 newPtr(tmpPtr
, dynamic_cast<const ProxyGroup
*>(this), ~bFlags
);
922 FieldContainerTransitPtr
returnValue(tmpPtr
);
924 tmpPtr
->_pFieldFlags
->_bNamespaceMask
= bFlags
;
929 FieldContainerTransitPtr
ProxyGroupBase::shallowCopy(void) const
934 dynamic_cast<const ProxyGroup
*>(this),
935 Thread::getCurrentLocalFlags());
937 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~Thread::getCurrentLocalFlags();
939 FieldContainerTransitPtr
returnValue(tmpPtr
);
947 /*------------------------- constructors ----------------------------------*/
949 ProxyGroupBase::ProxyGroupBase(void) :
951 _sfEnabled (bool(true)),
954 _sfState (UInt32(0)),
955 _sfConcurrentLoad (bool(true)),
957 _sfIndices (UInt32(0)),
958 _sfTriangles (UInt32(0)),
966 ProxyGroupBase::ProxyGroupBase(const ProxyGroupBase
&source
) :
968 _sfEnabled (source
._sfEnabled
),
969 _sfUrl (source
._sfUrl
),
971 _sfState (source
._sfState
),
972 _sfConcurrentLoad (source
._sfConcurrentLoad
),
973 _sfVolume (source
._sfVolume
),
974 _sfIndices (source
._sfIndices
),
975 _sfTriangles (source
._sfTriangles
),
976 _sfPositions (source
._sfPositions
),
977 _sfGeometries (source
._sfGeometries
),
978 _sfAbsoluteUrl (source
._sfAbsoluteUrl
),
979 _mfInline (source
._mfInline
)
984 /*-------------------------- destructors ----------------------------------*/
986 ProxyGroupBase::~ProxyGroupBase(void)
990 void ProxyGroupBase::onCreate(const ProxyGroup
*source
)
992 Inherited::onCreate(source
);
996 ProxyGroup
*pThis
= static_cast<ProxyGroup
*>(this);
998 pThis
->setRoot(source
->getRoot());
1002 GetFieldHandlePtr
ProxyGroupBase::getHandleEnabled (void) const
1004 SFBool::GetHandlePtr
returnValue(
1005 new SFBool::GetHandle(
1007 this->getType().getFieldDesc(EnabledFieldId
),
1008 const_cast<ProxyGroupBase
*>(this)));
1013 EditFieldHandlePtr
ProxyGroupBase::editHandleEnabled (void)
1015 SFBool::EditHandlePtr
returnValue(
1016 new SFBool::EditHandle(
1018 this->getType().getFieldDesc(EnabledFieldId
),
1022 editSField(EnabledFieldMask
);
1027 GetFieldHandlePtr
ProxyGroupBase::getHandleUrl (void) const
1029 SFString::GetHandlePtr
returnValue(
1030 new SFString::GetHandle(
1032 this->getType().getFieldDesc(UrlFieldId
),
1033 const_cast<ProxyGroupBase
*>(this)));
1038 EditFieldHandlePtr
ProxyGroupBase::editHandleUrl (void)
1040 SFString::EditHandlePtr
returnValue(
1041 new SFString::EditHandle(
1043 this->getType().getFieldDesc(UrlFieldId
),
1047 editSField(UrlFieldMask
);
1052 GetFieldHandlePtr
ProxyGroupBase::getHandleRoot (void) const
1054 SFUnrecNodePtr::GetHandlePtr
returnValue(
1055 new SFUnrecNodePtr::GetHandle(
1057 this->getType().getFieldDesc(RootFieldId
),
1058 const_cast<ProxyGroupBase
*>(this)));
1063 EditFieldHandlePtr
ProxyGroupBase::editHandleRoot (void)
1065 SFUnrecNodePtr::EditHandlePtr
returnValue(
1066 new SFUnrecNodePtr::EditHandle(
1068 this->getType().getFieldDesc(RootFieldId
),
1071 returnValue
->setSetMethod(
1072 boost::bind(&ProxyGroup::setRoot
,
1073 static_cast<ProxyGroup
*>(this), _1
));
1075 editSField(RootFieldMask
);
1080 GetFieldHandlePtr
ProxyGroupBase::getHandleState (void) const
1082 SFUInt32::GetHandlePtr
returnValue(
1083 new SFUInt32::GetHandle(
1085 this->getType().getFieldDesc(StateFieldId
),
1086 const_cast<ProxyGroupBase
*>(this)));
1091 EditFieldHandlePtr
ProxyGroupBase::editHandleState (void)
1093 SFUInt32::EditHandlePtr
returnValue(
1094 new SFUInt32::EditHandle(
1096 this->getType().getFieldDesc(StateFieldId
),
1100 editSField(StateFieldMask
);
1105 GetFieldHandlePtr
ProxyGroupBase::getHandleConcurrentLoad (void) const
1107 SFBool::GetHandlePtr
returnValue(
1108 new SFBool::GetHandle(
1110 this->getType().getFieldDesc(ConcurrentLoadFieldId
),
1111 const_cast<ProxyGroupBase
*>(this)));
1116 EditFieldHandlePtr
ProxyGroupBase::editHandleConcurrentLoad (void)
1118 SFBool::EditHandlePtr
returnValue(
1119 new SFBool::EditHandle(
1121 this->getType().getFieldDesc(ConcurrentLoadFieldId
),
1125 editSField(ConcurrentLoadFieldMask
);
1130 GetFieldHandlePtr
ProxyGroupBase::getHandleVolume (void) const
1132 SFBoxVolume::GetHandlePtr
returnValue(
1133 new SFBoxVolume::GetHandle(
1135 this->getType().getFieldDesc(VolumeFieldId
),
1136 const_cast<ProxyGroupBase
*>(this)));
1141 EditFieldHandlePtr
ProxyGroupBase::editHandleVolume (void)
1143 SFBoxVolume::EditHandlePtr
returnValue(
1144 new SFBoxVolume::EditHandle(
1146 this->getType().getFieldDesc(VolumeFieldId
),
1150 editSField(VolumeFieldMask
);
1155 GetFieldHandlePtr
ProxyGroupBase::getHandleIndices (void) const
1157 SFUInt32::GetHandlePtr
returnValue(
1158 new SFUInt32::GetHandle(
1160 this->getType().getFieldDesc(IndicesFieldId
),
1161 const_cast<ProxyGroupBase
*>(this)));
1166 EditFieldHandlePtr
ProxyGroupBase::editHandleIndices (void)
1168 SFUInt32::EditHandlePtr
returnValue(
1169 new SFUInt32::EditHandle(
1171 this->getType().getFieldDesc(IndicesFieldId
),
1175 editSField(IndicesFieldMask
);
1180 GetFieldHandlePtr
ProxyGroupBase::getHandleTriangles (void) const
1182 SFUInt32::GetHandlePtr
returnValue(
1183 new SFUInt32::GetHandle(
1185 this->getType().getFieldDesc(TrianglesFieldId
),
1186 const_cast<ProxyGroupBase
*>(this)));
1191 EditFieldHandlePtr
ProxyGroupBase::editHandleTriangles (void)
1193 SFUInt32::EditHandlePtr
returnValue(
1194 new SFUInt32::EditHandle(
1196 this->getType().getFieldDesc(TrianglesFieldId
),
1200 editSField(TrianglesFieldMask
);
1205 GetFieldHandlePtr
ProxyGroupBase::getHandlePositions (void) const
1207 SFUInt32::GetHandlePtr
returnValue(
1208 new SFUInt32::GetHandle(
1210 this->getType().getFieldDesc(PositionsFieldId
),
1211 const_cast<ProxyGroupBase
*>(this)));
1216 EditFieldHandlePtr
ProxyGroupBase::editHandlePositions (void)
1218 SFUInt32::EditHandlePtr
returnValue(
1219 new SFUInt32::EditHandle(
1221 this->getType().getFieldDesc(PositionsFieldId
),
1225 editSField(PositionsFieldMask
);
1230 GetFieldHandlePtr
ProxyGroupBase::getHandleGeometries (void) const
1232 SFUInt32::GetHandlePtr
returnValue(
1233 new SFUInt32::GetHandle(
1235 this->getType().getFieldDesc(GeometriesFieldId
),
1236 const_cast<ProxyGroupBase
*>(this)));
1241 EditFieldHandlePtr
ProxyGroupBase::editHandleGeometries (void)
1243 SFUInt32::EditHandlePtr
returnValue(
1244 new SFUInt32::EditHandle(
1246 this->getType().getFieldDesc(GeometriesFieldId
),
1250 editSField(GeometriesFieldMask
);
1255 GetFieldHandlePtr
ProxyGroupBase::getHandleAbsoluteUrl (void) const
1257 SFString::GetHandlePtr
returnValue(
1258 new SFString::GetHandle(
1260 this->getType().getFieldDesc(AbsoluteUrlFieldId
),
1261 const_cast<ProxyGroupBase
*>(this)));
1266 EditFieldHandlePtr
ProxyGroupBase::editHandleAbsoluteUrl (void)
1268 SFString::EditHandlePtr
returnValue(
1269 new SFString::EditHandle(
1271 this->getType().getFieldDesc(AbsoluteUrlFieldId
),
1275 editSField(AbsoluteUrlFieldMask
);
1280 GetFieldHandlePtr
ProxyGroupBase::getHandleInline (void) const
1282 MFUInt8::GetHandlePtr
returnValue(
1283 new MFUInt8::GetHandle(
1285 this->getType().getFieldDesc(InlineFieldId
),
1286 const_cast<ProxyGroupBase
*>(this)));
1291 EditFieldHandlePtr
ProxyGroupBase::editHandleInline (void)
1293 MFUInt8::EditHandlePtr
returnValue(
1294 new MFUInt8::EditHandle(
1296 this->getType().getFieldDesc(InlineFieldId
),
1300 editMField(InlineFieldMask
, _mfInline
);
1306 #ifdef OSG_MT_CPTR_ASPECT
1307 void ProxyGroupBase::execSyncV( FieldContainer
&oFrom
,
1308 ConstFieldMaskArg whichField
,
1309 AspectOffsetStore
&oOffsets
,
1310 ConstFieldMaskArg syncMode
,
1311 const UInt32 uiSyncInfo
)
1313 ProxyGroup
*pThis
= static_cast<ProxyGroup
*>(this);
1315 pThis
->execSync(static_cast<ProxyGroup
*>(&oFrom
),
1324 #ifdef OSG_MT_CPTR_ASPECT
1325 FieldContainer
*ProxyGroupBase::createAspectCopy(
1326 const FieldContainer
*pRefAspect
) const
1328 ProxyGroup
*returnValue
;
1330 newAspectCopy(returnValue
,
1331 dynamic_cast<const ProxyGroup
*>(pRefAspect
),
1332 dynamic_cast<const ProxyGroup
*>(this));
1338 void ProxyGroupBase::resolveLinks(void)
1340 Inherited::resolveLinks();
1342 static_cast<ProxyGroup
*>(this)->setRoot(NULL
);
1344 #ifdef OSG_MT_CPTR_ASPECT
1345 AspectOffsetStore oOffsets
;
1347 _pAspectStore
->fillOffsetArray(oOffsets
, this);
1350 #ifdef OSG_MT_CPTR_ASPECT
1351 _mfInline
.terminateShare(Thread::getCurrentAspect(),