1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000-2013 by the OpenSG Forum *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, carsten_neumann@gmx.net *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
15 * This library is free software; you can redistribute it and/or modify it *
16 * under the terms of the GNU Library General Public License as published *
17 * by the Free Software Foundation, version 2. *
19 * This library is distributed in the hope that it will be useful, but *
20 * WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
22 * Library General Public License for more details. *
24 * You should have received a copy of the GNU Library General Public *
25 * License along with this library; if not, write to the Free Software *
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
37 \*---------------------------------------------------------------------------*/
39 /*****************************************************************************\
40 *****************************************************************************
42 ** This file is automatically generated. **
44 ** Any changes made to this file WILL be lost when it is **
45 ** regenerated, which can become necessary at any time. **
47 ** Do not change this file, changes should be done in the derived **
48 ** class GeoMultiPropertyData!
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 "OSGGeoMultiPropertyDataBase.h"
67 #include "OSGGeoMultiPropertyData.h"
69 #include <boost/bind.hpp>
73 /***************************************************************************\
75 \***************************************************************************/
77 /*! \class OSG::GeoMultiPropertyData
81 /***************************************************************************\
82 * Field Documentation *
83 \***************************************************************************/
85 /*! \var UInt8 GeoMultiPropertyDataBase::_mfIData
86 The data for the multi-properties.
89 /*! \var UInt32 GeoMultiPropertyDataBase::_sfGLId
90 The internal GL object id for the VBO, if used.
94 /***************************************************************************\
95 * FieldType/FieldTrait Instantiation *
96 \***************************************************************************/
98 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
99 PointerType FieldTraits
<GeoMultiPropertyData
*, nsOSG
>::_type(
100 "GeoMultiPropertyDataPtr",
102 GeoMultiPropertyData::getClassType(),
106 OSG_FIELDTRAITS_GETTYPE_NS(GeoMultiPropertyData
*, nsOSG
)
108 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField
,
109 GeoMultiPropertyData
*,
112 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField
,
113 GeoMultiPropertyData
*,
116 /***************************************************************************\
117 * Field Description *
118 \***************************************************************************/
120 void GeoMultiPropertyDataBase::classDescInserter(TypeObject
&oType
)
122 FieldDescriptionBase
*pDesc
= NULL
;
125 pDesc
= new MFUInt8::Description(
126 MFUInt8::getClassType(),
128 "The data for the multi-properties.\n",
129 IDataFieldId
, IDataFieldMask
,
131 (Field::MFDefaultFlags
| Field::FStdAccess
),
132 static_cast<FieldEditMethodSig
>(&GeoMultiPropertyData::editHandleIData
),
133 static_cast<FieldGetMethodSig
>(&GeoMultiPropertyData::getHandleIData
));
135 oType
.addInitialDesc(pDesc
);
137 pDesc
= new SFUInt32::Description(
138 SFUInt32::getClassType(),
140 "The internal GL object id for the VBO, if used.\n",
141 GLIdFieldId
, GLIdFieldMask
,
143 (Field::FClusterLocal
),
144 static_cast<FieldEditMethodSig
>(&GeoMultiPropertyData::editHandleGLId
),
145 static_cast<FieldGetMethodSig
>(&GeoMultiPropertyData::getHandleGLId
));
147 oType
.addInitialDesc(pDesc
);
151 GeoMultiPropertyDataBase::TypeObject
GeoMultiPropertyDataBase::_type(
152 GeoMultiPropertyDataBase::getClassname(),
153 Inherited::getClassname(),
156 reinterpret_cast<PrototypeCreateF
>(&GeoMultiPropertyDataBase::createEmptyLocal
),
157 reinterpret_cast<InitContainerF
>(&GeoMultiPropertyData::initMethod
),
158 reinterpret_cast<ExitContainerF
>(&GeoMultiPropertyData::exitMethod
),
159 reinterpret_cast<InitalInsertDescFunc
>(
160 reinterpret_cast<void *>(&GeoMultiPropertyData::classDescInserter
)),
163 "<?xml version=\"1.0\"?>\n"
166 " name=\"GeoMultiPropertyData\"\n"
167 " parent=\"StateChunk\"\n"
168 " library=\"Drawable\"\n"
169 " pointerfieldtypes=\"both\"\n"
170 " structure=\"concrete\"\n"
171 " systemcomponent=\"true\"\n"
172 " parentsystemcomponent=\"true\"\n"
173 " decoratable=\"false\"\n"
174 " docGroupBase=\"GrpDrawablesGeometry\"\n"
179 " cardinality=\"multi\"\n"
180 " visibility=\"external\"\n"
181 " access=\"public\"\n"
183 "\tThe data for the multi-properties.\n"
188 " cardinality=\"single\"\n"
189 " visibility=\"internal\"\n"
190 " access=\"public\"\n"
191 " defaultValue=\"0\"\n"
192 " fieldFlags=\"FClusterLocal\"\n"
194 "\tThe internal GL object id for the VBO, if used.\n"
196 "</FieldContainer>\n",
200 /*------------------------------ get -----------------------------------*/
202 FieldContainerType
&GeoMultiPropertyDataBase::getType(void)
207 const FieldContainerType
&GeoMultiPropertyDataBase::getType(void) const
212 UInt32
GeoMultiPropertyDataBase::getContainerSize(void) const
214 return sizeof(GeoMultiPropertyData
);
217 /*------------------------- decorator get ------------------------------*/
220 MFUInt8
*GeoMultiPropertyDataBase::editMFIData(void)
222 editMField(IDataFieldMask
, _mfIData
);
227 const MFUInt8
*GeoMultiPropertyDataBase::getMFIData(void) const
233 SFUInt32
*GeoMultiPropertyDataBase::editSFGLId(void)
235 editSField(GLIdFieldMask
);
240 const SFUInt32
*GeoMultiPropertyDataBase::getSFGLId(void) const
250 /*------------------------------ access -----------------------------------*/
252 SizeT
GeoMultiPropertyDataBase::getBinSize(ConstFieldMaskArg whichField
)
254 SizeT returnValue
= Inherited::getBinSize(whichField
);
256 if(FieldBits::NoField
!= (IDataFieldMask
& whichField
))
258 returnValue
+= _mfIData
.getBinSize();
260 if(FieldBits::NoField
!= (GLIdFieldMask
& whichField
))
262 returnValue
+= _sfGLId
.getBinSize();
268 void GeoMultiPropertyDataBase::copyToBin(BinaryDataHandler
&pMem
,
269 ConstFieldMaskArg whichField
)
271 Inherited::copyToBin(pMem
, whichField
);
273 if(FieldBits::NoField
!= (IDataFieldMask
& whichField
))
275 _mfIData
.copyToBin(pMem
);
277 if(FieldBits::NoField
!= (GLIdFieldMask
& whichField
))
279 _sfGLId
.copyToBin(pMem
);
283 void GeoMultiPropertyDataBase::copyFromBin(BinaryDataHandler
&pMem
,
284 ConstFieldMaskArg whichField
)
286 Inherited::copyFromBin(pMem
, whichField
);
288 if(FieldBits::NoField
!= (IDataFieldMask
& whichField
))
290 editMField(IDataFieldMask
, _mfIData
);
291 _mfIData
.copyFromBin(pMem
);
293 if(FieldBits::NoField
!= (GLIdFieldMask
& whichField
))
295 editSField(GLIdFieldMask
);
296 _sfGLId
.copyFromBin(pMem
);
300 //! create a new instance of the class
301 GeoMultiPropertyDataTransitPtr
GeoMultiPropertyDataBase::createLocal(BitVector bFlags
)
303 GeoMultiPropertyDataTransitPtr fc
;
305 if(getClassType().getPrototype() != NULL
)
307 FieldContainerTransitPtr tmpPtr
=
308 getClassType().getPrototype()-> shallowCopyLocal(bFlags
);
310 fc
= dynamic_pointer_cast
<GeoMultiPropertyData
>(tmpPtr
);
316 //! create a new instance of the class, copy the container flags
317 GeoMultiPropertyDataTransitPtr
GeoMultiPropertyDataBase::createDependent(BitVector bFlags
)
319 GeoMultiPropertyDataTransitPtr fc
;
321 if(getClassType().getPrototype() != NULL
)
323 FieldContainerTransitPtr tmpPtr
=
324 getClassType().getPrototype()-> shallowCopyDependent(bFlags
);
326 fc
= dynamic_pointer_cast
<GeoMultiPropertyData
>(tmpPtr
);
332 //! create a new instance of the class
333 GeoMultiPropertyDataTransitPtr
GeoMultiPropertyDataBase::create(void)
335 GeoMultiPropertyDataTransitPtr fc
;
337 if(getClassType().getPrototype() != NULL
)
339 FieldContainerTransitPtr tmpPtr
=
340 getClassType().getPrototype()-> shallowCopy();
342 fc
= dynamic_pointer_cast
<GeoMultiPropertyData
>(tmpPtr
);
348 GeoMultiPropertyData
*GeoMultiPropertyDataBase::createEmptyLocal(BitVector bFlags
)
350 GeoMultiPropertyData
*returnValue
;
352 newPtr
<GeoMultiPropertyData
>(returnValue
, bFlags
);
354 returnValue
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
359 //! create an empty new instance of the class, do not copy the prototype
360 GeoMultiPropertyData
*GeoMultiPropertyDataBase::createEmpty(void)
362 GeoMultiPropertyData
*returnValue
;
364 newPtr
<GeoMultiPropertyData
>(returnValue
, Thread::getCurrentLocalFlags());
366 returnValue
->_pFieldFlags
->_bNamespaceMask
&=
367 ~Thread::getCurrentLocalFlags();
373 FieldContainerTransitPtr
GeoMultiPropertyDataBase::shallowCopyLocal(
374 BitVector bFlags
) const
376 GeoMultiPropertyData
*tmpPtr
;
378 newPtr(tmpPtr
, dynamic_cast<const GeoMultiPropertyData
*>(this), bFlags
);
380 FieldContainerTransitPtr
returnValue(tmpPtr
);
382 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
387 FieldContainerTransitPtr
GeoMultiPropertyDataBase::shallowCopyDependent(
388 BitVector bFlags
) const
390 GeoMultiPropertyData
*tmpPtr
;
392 newPtr(tmpPtr
, dynamic_cast<const GeoMultiPropertyData
*>(this), ~bFlags
);
394 FieldContainerTransitPtr
returnValue(tmpPtr
);
396 tmpPtr
->_pFieldFlags
->_bNamespaceMask
= bFlags
;
401 FieldContainerTransitPtr
GeoMultiPropertyDataBase::shallowCopy(void) const
403 GeoMultiPropertyData
*tmpPtr
;
406 dynamic_cast<const GeoMultiPropertyData
*>(this),
407 Thread::getCurrentLocalFlags());
409 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~Thread::getCurrentLocalFlags();
411 FieldContainerTransitPtr
returnValue(tmpPtr
);
419 /*------------------------- constructors ----------------------------------*/
421 GeoMultiPropertyDataBase::GeoMultiPropertyDataBase(void) :
428 GeoMultiPropertyDataBase::GeoMultiPropertyDataBase(const GeoMultiPropertyDataBase
&source
) :
430 _mfIData (source
._mfIData
),
431 _sfGLId (source
._sfGLId
)
436 /*-------------------------- destructors ----------------------------------*/
438 GeoMultiPropertyDataBase::~GeoMultiPropertyDataBase(void)
443 GetFieldHandlePtr
GeoMultiPropertyDataBase::getHandleIData (void) const
445 MFUInt8::GetHandlePtr
returnValue(
446 new MFUInt8::GetHandle(
448 this->getType().getFieldDesc(IDataFieldId
),
449 const_cast<GeoMultiPropertyDataBase
*>(this)));
454 EditFieldHandlePtr
GeoMultiPropertyDataBase::editHandleIData (void)
456 MFUInt8::EditHandlePtr
returnValue(
457 new MFUInt8::EditHandle(
459 this->getType().getFieldDesc(IDataFieldId
),
463 editMField(IDataFieldMask
, _mfIData
);
468 GetFieldHandlePtr
GeoMultiPropertyDataBase::getHandleGLId (void) const
470 SFUInt32::GetHandlePtr
returnValue(
471 new SFUInt32::GetHandle(
473 this->getType().getFieldDesc(GLIdFieldId
),
474 const_cast<GeoMultiPropertyDataBase
*>(this)));
479 EditFieldHandlePtr
GeoMultiPropertyDataBase::editHandleGLId (void)
481 SFUInt32::EditHandlePtr
returnValue(
482 new SFUInt32::EditHandle(
484 this->getType().getFieldDesc(GLIdFieldId
),
488 editSField(GLIdFieldMask
);
494 #ifdef OSG_MT_CPTR_ASPECT
495 void GeoMultiPropertyDataBase::execSyncV( FieldContainer
&oFrom
,
496 ConstFieldMaskArg whichField
,
497 AspectOffsetStore
&oOffsets
,
498 ConstFieldMaskArg syncMode
,
499 const UInt32 uiSyncInfo
)
501 GeoMultiPropertyData
*pThis
= static_cast<GeoMultiPropertyData
*>(this);
503 pThis
->execSync(static_cast<GeoMultiPropertyData
*>(&oFrom
),
512 #ifdef OSG_MT_CPTR_ASPECT
513 FieldContainer
*GeoMultiPropertyDataBase::createAspectCopy(
514 const FieldContainer
*pRefAspect
) const
516 GeoMultiPropertyData
*returnValue
;
518 newAspectCopy(returnValue
,
519 dynamic_cast<const GeoMultiPropertyData
*>(pRefAspect
),
520 dynamic_cast<const GeoMultiPropertyData
*>(this));
526 void GeoMultiPropertyDataBase::resolveLinks(void)
528 Inherited::resolveLinks();
530 #ifdef OSG_MT_CPTR_ASPECT
531 AspectOffsetStore oOffsets
;
533 _pAspectStore
->fillOffsetArray(oOffsets
, this);
536 #ifdef OSG_MT_CPTR_ASPECT
537 _mfIData
.terminateShare(Thread::getCurrentAspect(),