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 GeoIntegralBufferProperty!
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 "OSGGeoIntegralBufferPropertyBase.h"
67 #include "OSGGeoIntegralBufferProperty.h"
69 #include <boost/bind.hpp>
73 /***************************************************************************\
75 \***************************************************************************/
77 /*! \class OSG::GeoIntegralBufferProperty
81 /***************************************************************************\
82 * Field Documentation *
83 \***************************************************************************/
85 /*! \var UInt32 GeoIntegralBufferPropertyBase::_sfStride
89 /*! \var UInt32 GeoIntegralBufferPropertyBase::_sfFormat
93 /*! \var UInt32 GeoIntegralBufferPropertyBase::_sfFormatSize
97 /*! \var UInt32 GeoIntegralBufferPropertyBase::_sfDimension
101 /*! \var UInt32 GeoIntegralBufferPropertyBase::_sfSize
106 /***************************************************************************\
107 * FieldType/FieldTrait Instantiation *
108 \***************************************************************************/
110 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
111 PointerType FieldTraits
<GeoIntegralBufferProperty
*, nsOSG
>::_type(
112 "GeoIntegralBufferPropertyPtr",
113 "GeoIntegralPropertyPtr",
114 GeoIntegralBufferProperty::getClassType(),
118 OSG_FIELDTRAITS_GETTYPE_NS(GeoIntegralBufferProperty
*, nsOSG
)
120 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField
,
121 GeoIntegralBufferProperty
*,
124 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField
,
125 GeoIntegralBufferProperty
*,
128 DataType
&FieldTraits
< GeoIntegralBufferProperty
*, nsOSG
+ 1 >::getType(void)
130 return FieldTraits
<GeoIntegralBufferProperty
*, nsOSG
>::getType();
134 OSG_EXPORT_PTR_SFIELD(ChildPointerSField
,
135 GeoIntegralBufferProperty
*,
136 UnrecordedRefCountPolicy
,
140 OSG_EXPORT_PTR_MFIELD(ChildPointerMField
,
141 GeoIntegralBufferProperty
*,
142 UnrecordedRefCountPolicy
,
146 /***************************************************************************\
147 * Field Description *
148 \***************************************************************************/
150 void GeoIntegralBufferPropertyBase::classDescInserter(TypeObject
&oType
)
152 FieldDescriptionBase
*pDesc
= NULL
;
155 pDesc
= new SFUInt32::Description(
156 SFUInt32::getClassType(),
159 StrideFieldId
, StrideFieldMask
,
161 (Field::SFDefaultFlags
| Field::FStdAccess
),
162 static_cast<FieldEditMethodSig
>(&GeoIntegralBufferProperty::editHandleStride
),
163 static_cast<FieldGetMethodSig
>(&GeoIntegralBufferProperty::getHandleStride
));
165 oType
.addInitialDesc(pDesc
);
167 pDesc
= new SFUInt32::Description(
168 SFUInt32::getClassType(),
171 FormatFieldId
, FormatFieldMask
,
173 (Field::SFDefaultFlags
| Field::FStdAccess
),
174 static_cast<FieldEditMethodSig
>(&GeoIntegralBufferProperty::editHandleFormat
),
175 static_cast<FieldGetMethodSig
>(&GeoIntegralBufferProperty::getHandleFormat
));
177 oType
.addInitialDesc(pDesc
);
179 pDesc
= new SFUInt32::Description(
180 SFUInt32::getClassType(),
183 FormatSizeFieldId
, FormatSizeFieldMask
,
185 (Field::SFDefaultFlags
| Field::FStdAccess
),
186 static_cast<FieldEditMethodSig
>(&GeoIntegralBufferProperty::editHandleFormatSize
),
187 static_cast<FieldGetMethodSig
>(&GeoIntegralBufferProperty::getHandleFormatSize
));
189 oType
.addInitialDesc(pDesc
);
191 pDesc
= new SFUInt32::Description(
192 SFUInt32::getClassType(),
195 DimensionFieldId
, DimensionFieldMask
,
197 (Field::SFDefaultFlags
| Field::FStdAccess
),
198 static_cast<FieldEditMethodSig
>(&GeoIntegralBufferProperty::editHandleDimension
),
199 static_cast<FieldGetMethodSig
>(&GeoIntegralBufferProperty::getHandleDimension
));
201 oType
.addInitialDesc(pDesc
);
203 pDesc
= new SFUInt32::Description(
204 SFUInt32::getClassType(),
207 SizeFieldId
, SizeFieldMask
,
209 (Field::SFDefaultFlags
| Field::FStdAccess
),
210 static_cast<FieldEditMethodSig
>(&GeoIntegralBufferProperty::editHandleSize
),
211 static_cast<FieldGetMethodSig
>(&GeoIntegralBufferProperty::getHandleSize
));
213 oType
.addInitialDesc(pDesc
);
217 GeoIntegralBufferPropertyBase::TypeObject
GeoIntegralBufferPropertyBase::_type(
218 GeoIntegralBufferPropertyBase::getClassname(),
219 Inherited::getClassname(),
222 reinterpret_cast<PrototypeCreateF
>(&GeoIntegralBufferPropertyBase::createEmptyLocal
),
223 reinterpret_cast<InitContainerF
>(&GeoIntegralBufferProperty::initMethod
),
224 reinterpret_cast<ExitContainerF
>(&GeoIntegralBufferProperty::exitMethod
),
225 reinterpret_cast<InitalInsertDescFunc
>(
226 reinterpret_cast<void *>(&GeoIntegralBufferProperty::classDescInserter
)),
229 "<?xml version=\"1.0\"?>\n"
232 " name=\"GeoIntegralBufferProperty\"\n"
233 " parent=\"GeoIntegralProperty\"\n"
234 " library=\"Drawable\"\n"
235 " pointerfieldtypes=\"both\"\n"
236 " structure=\"concrete\"\n"
237 " systemcomponent=\"true\"\n"
238 " parentsystemcomponent=\"true\"\n"
239 " decoratable=\"false\"\n"
240 " childFields=\"both\"\n"
241 " docGroupBase=\"GrpDrawablesGeometry\"\n"
246 " cardinality=\"single\"\n"
247 " visibility=\"external\"\n"
248 " defaultValue=\"0\"\n"
249 " access=\"public\"\n"
255 " cardinality=\"single\"\n"
256 " visibility=\"external\"\n"
257 " defaultValue=\"GL_FLOAT\"\n"
258 " access=\"public\"\n"
262 " name=\"formatSize\"\n"
264 " cardinality=\"single\"\n"
265 " visibility=\"external\"\n"
266 " defaultValue=\"4\"\n"
267 " access=\"public\"\n"
271 " name=\"dimension\"\n"
273 " cardinality=\"single\"\n"
274 " visibility=\"external\"\n"
275 " defaultValue=\"3\"\n"
276 " access=\"public\"\n"
282 " cardinality=\"single\"\n"
283 " visibility=\"external\"\n"
284 " defaultValue=\"0\"\n"
285 " access=\"public\"\n"
288 "</FieldContainer>\n",
292 /*------------------------------ get -----------------------------------*/
294 FieldContainerType
&GeoIntegralBufferPropertyBase::getType(void)
299 const FieldContainerType
&GeoIntegralBufferPropertyBase::getType(void) const
304 UInt32
GeoIntegralBufferPropertyBase::getContainerSize(void) const
306 return sizeof(GeoIntegralBufferProperty
);
309 /*------------------------- decorator get ------------------------------*/
312 SFUInt32
*GeoIntegralBufferPropertyBase::editSFStride(void)
314 editSField(StrideFieldMask
);
319 const SFUInt32
*GeoIntegralBufferPropertyBase::getSFStride(void) const
325 SFUInt32
*GeoIntegralBufferPropertyBase::editSFFormat(void)
327 editSField(FormatFieldMask
);
332 const SFUInt32
*GeoIntegralBufferPropertyBase::getSFFormat(void) const
338 SFUInt32
*GeoIntegralBufferPropertyBase::editSFFormatSize(void)
340 editSField(FormatSizeFieldMask
);
342 return &_sfFormatSize
;
345 const SFUInt32
*GeoIntegralBufferPropertyBase::getSFFormatSize(void) const
347 return &_sfFormatSize
;
351 SFUInt32
*GeoIntegralBufferPropertyBase::editSFDimension(void)
353 editSField(DimensionFieldMask
);
355 return &_sfDimension
;
358 const SFUInt32
*GeoIntegralBufferPropertyBase::getSFDimension(void) const
360 return &_sfDimension
;
364 SFUInt32
*GeoIntegralBufferPropertyBase::editSFSize(void)
366 editSField(SizeFieldMask
);
371 const SFUInt32
*GeoIntegralBufferPropertyBase::getSFSize(void) const
381 /*------------------------------ access -----------------------------------*/
383 SizeT
GeoIntegralBufferPropertyBase::getBinSize(ConstFieldMaskArg whichField
)
385 SizeT returnValue
= Inherited::getBinSize(whichField
);
387 if(FieldBits::NoField
!= (StrideFieldMask
& whichField
))
389 returnValue
+= _sfStride
.getBinSize();
391 if(FieldBits::NoField
!= (FormatFieldMask
& whichField
))
393 returnValue
+= _sfFormat
.getBinSize();
395 if(FieldBits::NoField
!= (FormatSizeFieldMask
& whichField
))
397 returnValue
+= _sfFormatSize
.getBinSize();
399 if(FieldBits::NoField
!= (DimensionFieldMask
& whichField
))
401 returnValue
+= _sfDimension
.getBinSize();
403 if(FieldBits::NoField
!= (SizeFieldMask
& whichField
))
405 returnValue
+= _sfSize
.getBinSize();
411 void GeoIntegralBufferPropertyBase::copyToBin(BinaryDataHandler
&pMem
,
412 ConstFieldMaskArg whichField
)
414 Inherited::copyToBin(pMem
, whichField
);
416 if(FieldBits::NoField
!= (StrideFieldMask
& whichField
))
418 _sfStride
.copyToBin(pMem
);
420 if(FieldBits::NoField
!= (FormatFieldMask
& whichField
))
422 _sfFormat
.copyToBin(pMem
);
424 if(FieldBits::NoField
!= (FormatSizeFieldMask
& whichField
))
426 _sfFormatSize
.copyToBin(pMem
);
428 if(FieldBits::NoField
!= (DimensionFieldMask
& whichField
))
430 _sfDimension
.copyToBin(pMem
);
432 if(FieldBits::NoField
!= (SizeFieldMask
& whichField
))
434 _sfSize
.copyToBin(pMem
);
438 void GeoIntegralBufferPropertyBase::copyFromBin(BinaryDataHandler
&pMem
,
439 ConstFieldMaskArg whichField
)
441 Inherited::copyFromBin(pMem
, whichField
);
443 if(FieldBits::NoField
!= (StrideFieldMask
& whichField
))
445 editSField(StrideFieldMask
);
446 _sfStride
.copyFromBin(pMem
);
448 if(FieldBits::NoField
!= (FormatFieldMask
& whichField
))
450 editSField(FormatFieldMask
);
451 _sfFormat
.copyFromBin(pMem
);
453 if(FieldBits::NoField
!= (FormatSizeFieldMask
& whichField
))
455 editSField(FormatSizeFieldMask
);
456 _sfFormatSize
.copyFromBin(pMem
);
458 if(FieldBits::NoField
!= (DimensionFieldMask
& whichField
))
460 editSField(DimensionFieldMask
);
461 _sfDimension
.copyFromBin(pMem
);
463 if(FieldBits::NoField
!= (SizeFieldMask
& whichField
))
465 editSField(SizeFieldMask
);
466 _sfSize
.copyFromBin(pMem
);
470 //! create a new instance of the class
471 GeoIntegralBufferPropertyTransitPtr
GeoIntegralBufferPropertyBase::createLocal(BitVector bFlags
)
473 GeoIntegralBufferPropertyTransitPtr fc
;
475 if(getClassType().getPrototype() != NULL
)
477 FieldContainerTransitPtr tmpPtr
=
478 getClassType().getPrototype()-> shallowCopyLocal(bFlags
);
480 fc
= dynamic_pointer_cast
<GeoIntegralBufferProperty
>(tmpPtr
);
486 //! create a new instance of the class, copy the container flags
487 GeoIntegralBufferPropertyTransitPtr
GeoIntegralBufferPropertyBase::createDependent(BitVector bFlags
)
489 GeoIntegralBufferPropertyTransitPtr fc
;
491 if(getClassType().getPrototype() != NULL
)
493 FieldContainerTransitPtr tmpPtr
=
494 getClassType().getPrototype()-> shallowCopyDependent(bFlags
);
496 fc
= dynamic_pointer_cast
<GeoIntegralBufferProperty
>(tmpPtr
);
502 //! create a new instance of the class
503 GeoIntegralBufferPropertyTransitPtr
GeoIntegralBufferPropertyBase::create(void)
505 GeoIntegralBufferPropertyTransitPtr fc
;
507 if(getClassType().getPrototype() != NULL
)
509 FieldContainerTransitPtr tmpPtr
=
510 getClassType().getPrototype()-> shallowCopy();
512 fc
= dynamic_pointer_cast
<GeoIntegralBufferProperty
>(tmpPtr
);
518 GeoIntegralBufferProperty
*GeoIntegralBufferPropertyBase::createEmptyLocal(BitVector bFlags
)
520 GeoIntegralBufferProperty
*returnValue
;
522 newPtr
<GeoIntegralBufferProperty
>(returnValue
, bFlags
);
524 returnValue
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
529 //! create an empty new instance of the class, do not copy the prototype
530 GeoIntegralBufferProperty
*GeoIntegralBufferPropertyBase::createEmpty(void)
532 GeoIntegralBufferProperty
*returnValue
;
534 newPtr
<GeoIntegralBufferProperty
>(returnValue
, Thread::getCurrentLocalFlags());
536 returnValue
->_pFieldFlags
->_bNamespaceMask
&=
537 ~Thread::getCurrentLocalFlags();
543 FieldContainerTransitPtr
GeoIntegralBufferPropertyBase::shallowCopyLocal(
544 BitVector bFlags
) const
546 GeoIntegralBufferProperty
*tmpPtr
;
548 newPtr(tmpPtr
, dynamic_cast<const GeoIntegralBufferProperty
*>(this), bFlags
);
550 FieldContainerTransitPtr
returnValue(tmpPtr
);
552 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
557 FieldContainerTransitPtr
GeoIntegralBufferPropertyBase::shallowCopyDependent(
558 BitVector bFlags
) const
560 GeoIntegralBufferProperty
*tmpPtr
;
562 newPtr(tmpPtr
, dynamic_cast<const GeoIntegralBufferProperty
*>(this), ~bFlags
);
564 FieldContainerTransitPtr
returnValue(tmpPtr
);
566 tmpPtr
->_pFieldFlags
->_bNamespaceMask
= bFlags
;
571 FieldContainerTransitPtr
GeoIntegralBufferPropertyBase::shallowCopy(void) const
573 GeoIntegralBufferProperty
*tmpPtr
;
576 dynamic_cast<const GeoIntegralBufferProperty
*>(this),
577 Thread::getCurrentLocalFlags());
579 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~Thread::getCurrentLocalFlags();
581 FieldContainerTransitPtr
returnValue(tmpPtr
);
589 /*------------------------- constructors ----------------------------------*/
591 GeoIntegralBufferPropertyBase::GeoIntegralBufferPropertyBase(void) :
593 _sfStride (UInt32(0)),
594 _sfFormat (UInt32(GL_FLOAT
)),
595 _sfFormatSize (UInt32(4)),
596 _sfDimension (UInt32(3)),
601 GeoIntegralBufferPropertyBase::GeoIntegralBufferPropertyBase(const GeoIntegralBufferPropertyBase
&source
) :
603 _sfStride (source
._sfStride
),
604 _sfFormat (source
._sfFormat
),
605 _sfFormatSize (source
._sfFormatSize
),
606 _sfDimension (source
._sfDimension
),
607 _sfSize (source
._sfSize
)
612 /*-------------------------- destructors ----------------------------------*/
614 GeoIntegralBufferPropertyBase::~GeoIntegralBufferPropertyBase(void)
619 GetFieldHandlePtr
GeoIntegralBufferPropertyBase::getHandleStride (void) const
621 SFUInt32::GetHandlePtr
returnValue(
622 new SFUInt32::GetHandle(
624 this->getType().getFieldDesc(StrideFieldId
),
625 const_cast<GeoIntegralBufferPropertyBase
*>(this)));
630 EditFieldHandlePtr
GeoIntegralBufferPropertyBase::editHandleStride (void)
632 SFUInt32::EditHandlePtr
returnValue(
633 new SFUInt32::EditHandle(
635 this->getType().getFieldDesc(StrideFieldId
),
639 editSField(StrideFieldMask
);
644 GetFieldHandlePtr
GeoIntegralBufferPropertyBase::getHandleFormat (void) const
646 SFUInt32::GetHandlePtr
returnValue(
647 new SFUInt32::GetHandle(
649 this->getType().getFieldDesc(FormatFieldId
),
650 const_cast<GeoIntegralBufferPropertyBase
*>(this)));
655 EditFieldHandlePtr
GeoIntegralBufferPropertyBase::editHandleFormat (void)
657 SFUInt32::EditHandlePtr
returnValue(
658 new SFUInt32::EditHandle(
660 this->getType().getFieldDesc(FormatFieldId
),
664 editSField(FormatFieldMask
);
669 GetFieldHandlePtr
GeoIntegralBufferPropertyBase::getHandleFormatSize (void) const
671 SFUInt32::GetHandlePtr
returnValue(
672 new SFUInt32::GetHandle(
674 this->getType().getFieldDesc(FormatSizeFieldId
),
675 const_cast<GeoIntegralBufferPropertyBase
*>(this)));
680 EditFieldHandlePtr
GeoIntegralBufferPropertyBase::editHandleFormatSize (void)
682 SFUInt32::EditHandlePtr
returnValue(
683 new SFUInt32::EditHandle(
685 this->getType().getFieldDesc(FormatSizeFieldId
),
689 editSField(FormatSizeFieldMask
);
694 GetFieldHandlePtr
GeoIntegralBufferPropertyBase::getHandleDimension (void) const
696 SFUInt32::GetHandlePtr
returnValue(
697 new SFUInt32::GetHandle(
699 this->getType().getFieldDesc(DimensionFieldId
),
700 const_cast<GeoIntegralBufferPropertyBase
*>(this)));
705 EditFieldHandlePtr
GeoIntegralBufferPropertyBase::editHandleDimension (void)
707 SFUInt32::EditHandlePtr
returnValue(
708 new SFUInt32::EditHandle(
710 this->getType().getFieldDesc(DimensionFieldId
),
714 editSField(DimensionFieldMask
);
719 GetFieldHandlePtr
GeoIntegralBufferPropertyBase::getHandleSize (void) const
721 SFUInt32::GetHandlePtr
returnValue(
722 new SFUInt32::GetHandle(
724 this->getType().getFieldDesc(SizeFieldId
),
725 const_cast<GeoIntegralBufferPropertyBase
*>(this)));
730 EditFieldHandlePtr
GeoIntegralBufferPropertyBase::editHandleSize (void)
732 SFUInt32::EditHandlePtr
returnValue(
733 new SFUInt32::EditHandle(
735 this->getType().getFieldDesc(SizeFieldId
),
739 editSField(SizeFieldMask
);
745 #ifdef OSG_MT_CPTR_ASPECT
746 void GeoIntegralBufferPropertyBase::execSyncV( FieldContainer
&oFrom
,
747 ConstFieldMaskArg whichField
,
748 AspectOffsetStore
&oOffsets
,
749 ConstFieldMaskArg syncMode
,
750 const UInt32 uiSyncInfo
)
752 GeoIntegralBufferProperty
*pThis
= static_cast<GeoIntegralBufferProperty
*>(this);
754 pThis
->execSync(static_cast<GeoIntegralBufferProperty
*>(&oFrom
),
763 #ifdef OSG_MT_CPTR_ASPECT
764 FieldContainer
*GeoIntegralBufferPropertyBase::createAspectCopy(
765 const FieldContainer
*pRefAspect
) const
767 GeoIntegralBufferProperty
*returnValue
;
769 newAspectCopy(returnValue
,
770 dynamic_cast<const GeoIntegralBufferProperty
*>(pRefAspect
),
771 dynamic_cast<const GeoIntegralBufferProperty
*>(this));
777 void GeoIntegralBufferPropertyBase::resolveLinks(void)
779 Inherited::resolveLinks();