1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000-2013 by the OpenSG Forum *
9 * contact: David Kabala (djkabala@gmail.com) *
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 BoostPathAttachment!
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"
66 #include "OSGBoostPathAttachmentBase.h"
67 #include "OSGBoostPathAttachment.h"
69 #include <boost/bind.hpp>
73 /***************************************************************************\
75 \***************************************************************************/
77 /*! \class OSG::BoostPathAttachment
81 /***************************************************************************\
82 * Field Documentation *
83 \***************************************************************************/
85 /*! \var BoostPath BoostPathAttachmentBase::_sfPath
90 /***************************************************************************\
91 * FieldType/FieldTrait Instantiation *
92 \***************************************************************************/
94 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
95 PointerType FieldTraits
<BoostPathAttachment
*, nsOSG
>::_type(
96 "BoostPathAttachmentPtr",
98 BoostPathAttachment::getClassType(),
102 OSG_FIELDTRAITS_GETTYPE_NS(BoostPathAttachment
*, nsOSG
)
104 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField
,
105 BoostPathAttachment
*,
108 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField
,
109 BoostPathAttachment
*,
112 /***************************************************************************\
113 * Field Description *
114 \***************************************************************************/
116 void BoostPathAttachmentBase::classDescInserter(TypeObject
&oType
)
118 FieldDescriptionBase
*pDesc
= NULL
;
121 pDesc
= new SFBoostPath::Description(
122 SFBoostPath::getClassType(),
125 PathFieldId
, PathFieldMask
,
127 (Field::SFDefaultFlags
| Field::FStdAccess
),
128 static_cast<FieldEditMethodSig
>(&BoostPathAttachment::editHandlePath
),
129 static_cast<FieldGetMethodSig
>(&BoostPathAttachment::getHandlePath
));
131 oType
.addInitialDesc(pDesc
);
135 BoostPathAttachmentBase::TypeObject
BoostPathAttachmentBase::_type(
136 BoostPathAttachmentBase::getClassname(),
137 Inherited::getClassname(),
138 "BoostPathAttachment",
140 reinterpret_cast<PrototypeCreateF
>(&BoostPathAttachmentBase::createEmptyLocal
),
141 reinterpret_cast<InitContainerF
>(&BoostPathAttachment::initMethod
),
142 reinterpret_cast<ExitContainerF
>(&BoostPathAttachment::exitMethod
),
143 reinterpret_cast<InitalInsertDescFunc
>(
144 reinterpret_cast<void *>(&BoostPathAttachment::classDescInserter
)),
147 "<?xml version=\"1.0\"?>\n"
150 " name=\"BoostPathAttachment\"\n"
151 " parent=\"Attachment\"\n"
152 " library=\"System\"\n"
153 " pointerfieldtypes=\"both\"\n"
154 " structure=\"concrete\"\n"
155 " systemcomponent=\"true\"\n"
156 " parentsystemcomponent=\"true\"\n"
157 " decoratable=\"false\"\n"
158 " isNodeCore=\"false\"\n"
159 " authors=\"David Kabala (djkabala@gmail.com) \"\n"
163 " type=\"BoostPath\"\n"
164 " category=\"data\"\n"
165 " cardinality=\"single\"\n"
166 " visibility=\"internal\"\n"
167 " defaultValue=\"\"\n"
168 " access=\"public\"\n"
171 "</FieldContainer>\n",
175 /*------------------------------ get -----------------------------------*/
177 FieldContainerType
&BoostPathAttachmentBase::getType(void)
182 const FieldContainerType
&BoostPathAttachmentBase::getType(void) const
187 UInt32
BoostPathAttachmentBase::getContainerSize(void) const
189 return sizeof(BoostPathAttachment
);
192 /*------------------------- decorator get ------------------------------*/
195 SFBoostPath
*BoostPathAttachmentBase::editSFPath(void)
197 editSField(PathFieldMask
);
202 const SFBoostPath
*BoostPathAttachmentBase::getSFPath(void) const
212 /*------------------------------ access -----------------------------------*/
214 SizeT
BoostPathAttachmentBase::getBinSize(ConstFieldMaskArg whichField
)
216 SizeT returnValue
= Inherited::getBinSize(whichField
);
218 if(FieldBits::NoField
!= (PathFieldMask
& whichField
))
220 returnValue
+= _sfPath
.getBinSize();
226 void BoostPathAttachmentBase::copyToBin(BinaryDataHandler
&pMem
,
227 ConstFieldMaskArg whichField
)
229 Inherited::copyToBin(pMem
, whichField
);
231 if(FieldBits::NoField
!= (PathFieldMask
& whichField
))
233 _sfPath
.copyToBin(pMem
);
237 void BoostPathAttachmentBase::copyFromBin(BinaryDataHandler
&pMem
,
238 ConstFieldMaskArg whichField
)
240 Inherited::copyFromBin(pMem
, whichField
);
242 if(FieldBits::NoField
!= (PathFieldMask
& whichField
))
244 editSField(PathFieldMask
);
245 _sfPath
.copyFromBin(pMem
);
249 //! create a new instance of the class
250 BoostPathAttachmentTransitPtr
BoostPathAttachmentBase::createLocal(BitVector bFlags
)
252 BoostPathAttachmentTransitPtr fc
;
254 if(getClassType().getPrototype() != NULL
)
256 FieldContainerTransitPtr tmpPtr
=
257 getClassType().getPrototype()-> shallowCopyLocal(bFlags
);
259 fc
= dynamic_pointer_cast
<BoostPathAttachment
>(tmpPtr
);
265 //! create a new instance of the class, copy the container flags
266 BoostPathAttachmentTransitPtr
BoostPathAttachmentBase::createDependent(BitVector bFlags
)
268 BoostPathAttachmentTransitPtr fc
;
270 if(getClassType().getPrototype() != NULL
)
272 FieldContainerTransitPtr tmpPtr
=
273 getClassType().getPrototype()-> shallowCopyDependent(bFlags
);
275 fc
= dynamic_pointer_cast
<BoostPathAttachment
>(tmpPtr
);
281 //! create a new instance of the class
282 BoostPathAttachmentTransitPtr
BoostPathAttachmentBase::create(void)
284 BoostPathAttachmentTransitPtr fc
;
286 if(getClassType().getPrototype() != NULL
)
288 FieldContainerTransitPtr tmpPtr
=
289 getClassType().getPrototype()-> shallowCopy();
291 fc
= dynamic_pointer_cast
<BoostPathAttachment
>(tmpPtr
);
297 BoostPathAttachment
*BoostPathAttachmentBase::createEmptyLocal(BitVector bFlags
)
299 BoostPathAttachment
*returnValue
;
301 newPtr
<BoostPathAttachment
>(returnValue
, bFlags
);
303 returnValue
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
308 //! create an empty new instance of the class, do not copy the prototype
309 BoostPathAttachment
*BoostPathAttachmentBase::createEmpty(void)
311 BoostPathAttachment
*returnValue
;
313 newPtr
<BoostPathAttachment
>(returnValue
, Thread::getCurrentLocalFlags());
315 returnValue
->_pFieldFlags
->_bNamespaceMask
&=
316 ~Thread::getCurrentLocalFlags();
322 FieldContainerTransitPtr
BoostPathAttachmentBase::shallowCopyLocal(
323 BitVector bFlags
) const
325 BoostPathAttachment
*tmpPtr
;
327 newPtr(tmpPtr
, dynamic_cast<const BoostPathAttachment
*>(this), bFlags
);
329 FieldContainerTransitPtr
returnValue(tmpPtr
);
331 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
336 FieldContainerTransitPtr
BoostPathAttachmentBase::shallowCopyDependent(
337 BitVector bFlags
) const
339 BoostPathAttachment
*tmpPtr
;
341 newPtr(tmpPtr
, dynamic_cast<const BoostPathAttachment
*>(this), ~bFlags
);
343 FieldContainerTransitPtr
returnValue(tmpPtr
);
345 tmpPtr
->_pFieldFlags
->_bNamespaceMask
= bFlags
;
350 FieldContainerTransitPtr
BoostPathAttachmentBase::shallowCopy(void) const
352 BoostPathAttachment
*tmpPtr
;
355 dynamic_cast<const BoostPathAttachment
*>(this),
356 Thread::getCurrentLocalFlags());
358 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~Thread::getCurrentLocalFlags();
360 FieldContainerTransitPtr
returnValue(tmpPtr
);
368 /*------------------------- constructors ----------------------------------*/
370 BoostPathAttachmentBase::BoostPathAttachmentBase(void) :
376 BoostPathAttachmentBase::BoostPathAttachmentBase(const BoostPathAttachmentBase
&source
) :
378 _sfPath (source
._sfPath
)
383 /*-------------------------- destructors ----------------------------------*/
385 BoostPathAttachmentBase::~BoostPathAttachmentBase(void)
390 GetFieldHandlePtr
BoostPathAttachmentBase::getHandlePath (void) const
392 SFBoostPath::GetHandlePtr
returnValue(
393 new SFBoostPath::GetHandle(
395 this->getType().getFieldDesc(PathFieldId
),
396 const_cast<BoostPathAttachmentBase
*>(this)));
401 EditFieldHandlePtr
BoostPathAttachmentBase::editHandlePath (void)
403 SFBoostPath::EditHandlePtr
returnValue(
404 new SFBoostPath::EditHandle(
406 this->getType().getFieldDesc(PathFieldId
),
410 editSField(PathFieldMask
);
416 #ifdef OSG_MT_CPTR_ASPECT
417 void BoostPathAttachmentBase::execSyncV( FieldContainer
&oFrom
,
418 ConstFieldMaskArg whichField
,
419 AspectOffsetStore
&oOffsets
,
420 ConstFieldMaskArg syncMode
,
421 const UInt32 uiSyncInfo
)
423 BoostPathAttachment
*pThis
= static_cast<BoostPathAttachment
*>(this);
425 pThis
->execSync(static_cast<BoostPathAttachment
*>(&oFrom
),
434 #ifdef OSG_MT_CPTR_ASPECT
435 FieldContainer
*BoostPathAttachmentBase::createAspectCopy(
436 const FieldContainer
*pRefAspect
) const
438 BoostPathAttachment
*returnValue
;
440 newAspectCopy(returnValue
,
441 dynamic_cast<const BoostPathAttachment
*>(pRefAspect
),
442 dynamic_cast<const BoostPathAttachment
*>(this));
448 void BoostPathAttachmentBase::resolveLinks(void)
450 Inherited::resolveLinks();