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 GeoVectorBufferProperty!
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 "OSGGeoVectorBufferPropertyBase.h"
67 #include "OSGGeoVectorBufferProperty.h"
69 #include <boost/bind.hpp>
73 /***************************************************************************\
75 \***************************************************************************/
77 /*! \class OSG::GeoVectorBufferProperty
81 /***************************************************************************\
82 * Field Documentation *
83 \***************************************************************************/
85 /*! \var UInt32 GeoVectorBufferPropertyBase::_sfStride
89 /*! \var UInt32 GeoVectorBufferPropertyBase::_sfFormat
93 /*! \var UInt32 GeoVectorBufferPropertyBase::_sfFormatSize
97 /*! \var UInt32 GeoVectorBufferPropertyBase::_sfDimension
101 /*! \var UInt32 GeoVectorBufferPropertyBase::_sfVectorType
105 /*! \var UInt32 GeoVectorBufferPropertyBase::_sfSize
110 /***************************************************************************\
111 * FieldType/FieldTrait Instantiation *
112 \***************************************************************************/
114 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
115 PointerType FieldTraits
<GeoVectorBufferProperty
*, nsOSG
>::_type(
116 "GeoVectorBufferPropertyPtr",
117 "GeoVectorPropertyPtr",
118 GeoVectorBufferProperty::getClassType(),
122 OSG_FIELDTRAITS_GETTYPE_NS(GeoVectorBufferProperty
*, nsOSG
)
124 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField
,
125 GeoVectorBufferProperty
*,
128 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField
,
129 GeoVectorBufferProperty
*,
132 DataType
&FieldTraits
< GeoVectorBufferProperty
*, nsOSG
+ 1 >::getType(void)
134 return FieldTraits
<GeoVectorBufferProperty
*, nsOSG
>::getType();
138 OSG_EXPORT_PTR_SFIELD(ChildPointerSField
,
139 GeoVectorBufferProperty
*,
140 UnrecordedRefCountPolicy
,
144 OSG_EXPORT_PTR_MFIELD(ChildPointerMField
,
145 GeoVectorBufferProperty
*,
146 UnrecordedRefCountPolicy
,
150 /***************************************************************************\
151 * Field Description *
152 \***************************************************************************/
154 void GeoVectorBufferPropertyBase::classDescInserter(TypeObject
&oType
)
156 FieldDescriptionBase
*pDesc
= NULL
;
159 pDesc
= new SFUInt32::Description(
160 SFUInt32::getClassType(),
163 StrideFieldId
, StrideFieldMask
,
165 (Field::SFDefaultFlags
| Field::FStdAccess
),
166 static_cast<FieldEditMethodSig
>(&GeoVectorBufferProperty::editHandleStride
),
167 static_cast<FieldGetMethodSig
>(&GeoVectorBufferProperty::getHandleStride
));
169 oType
.addInitialDesc(pDesc
);
171 pDesc
= new SFUInt32::Description(
172 SFUInt32::getClassType(),
175 FormatFieldId
, FormatFieldMask
,
177 (Field::SFDefaultFlags
| Field::FStdAccess
),
178 static_cast<FieldEditMethodSig
>(&GeoVectorBufferProperty::editHandleFormat
),
179 static_cast<FieldGetMethodSig
>(&GeoVectorBufferProperty::getHandleFormat
));
181 oType
.addInitialDesc(pDesc
);
183 pDesc
= new SFUInt32::Description(
184 SFUInt32::getClassType(),
187 FormatSizeFieldId
, FormatSizeFieldMask
,
189 (Field::SFDefaultFlags
| Field::FStdAccess
),
190 static_cast<FieldEditMethodSig
>(&GeoVectorBufferProperty::editHandleFormatSize
),
191 static_cast<FieldGetMethodSig
>(&GeoVectorBufferProperty::getHandleFormatSize
));
193 oType
.addInitialDesc(pDesc
);
195 pDesc
= new SFUInt32::Description(
196 SFUInt32::getClassType(),
199 DimensionFieldId
, DimensionFieldMask
,
201 (Field::SFDefaultFlags
| Field::FStdAccess
),
202 static_cast<FieldEditMethodSig
>(&GeoVectorBufferProperty::editHandleDimension
),
203 static_cast<FieldGetMethodSig
>(&GeoVectorBufferProperty::getHandleDimension
));
205 oType
.addInitialDesc(pDesc
);
207 pDesc
= new SFUInt32::Description(
208 SFUInt32::getClassType(),
211 VectorTypeFieldId
, VectorTypeFieldMask
,
213 (Field::SFDefaultFlags
| Field::FStdAccess
),
214 static_cast<FieldEditMethodSig
>(&GeoVectorBufferProperty::editHandleVectorType
),
215 static_cast<FieldGetMethodSig
>(&GeoVectorBufferProperty::getHandleVectorType
));
217 oType
.addInitialDesc(pDesc
);
219 pDesc
= new SFUInt32::Description(
220 SFUInt32::getClassType(),
223 SizeFieldId
, SizeFieldMask
,
225 (Field::SFDefaultFlags
| Field::FStdAccess
),
226 static_cast<FieldEditMethodSig
>(&GeoVectorBufferProperty::editHandleSize
),
227 static_cast<FieldGetMethodSig
>(&GeoVectorBufferProperty::getHandleSize
));
229 oType
.addInitialDesc(pDesc
);
233 GeoVectorBufferPropertyBase::TypeObject
GeoVectorBufferPropertyBase::_type(
234 GeoVectorBufferPropertyBase::getClassname(),
235 Inherited::getClassname(),
238 reinterpret_cast<PrototypeCreateF
>(&GeoVectorBufferPropertyBase::createEmptyLocal
),
239 reinterpret_cast<InitContainerF
>(&GeoVectorBufferProperty::initMethod
),
240 reinterpret_cast<ExitContainerF
>(&GeoVectorBufferProperty::exitMethod
),
241 reinterpret_cast<InitalInsertDescFunc
>(
242 reinterpret_cast<void *>(&GeoVectorBufferProperty::classDescInserter
)),
245 "<?xml version=\"1.0\"?>\n"
248 " name=\"GeoVectorBufferProperty\"\n"
249 " parent=\"GeoVectorProperty\"\n"
250 " library=\"Drawable\"\n"
251 " pointerfieldtypes=\"both\"\n"
252 " structure=\"concrete\"\n"
253 " systemcomponent=\"true\"\n"
254 " parentsystemcomponent=\"true\"\n"
255 " decoratable=\"false\"\n"
256 " childFields=\"both\"\n"
257 " docGroupBase=\"GrpDrawablesGeometry\"\n"
262 " cardinality=\"single\"\n"
263 " visibility=\"external\"\n"
264 " defaultValue=\"0\"\n"
265 " access=\"public\"\n"
271 " cardinality=\"single\"\n"
272 " visibility=\"external\"\n"
273 " defaultValue=\"GL_FLOAT\"\n"
274 " access=\"public\"\n"
278 " name=\"formatSize\"\n"
280 " cardinality=\"single\"\n"
281 " visibility=\"external\"\n"
282 " defaultValue=\"4\"\n"
283 " access=\"public\"\n"
287 " name=\"dimension\"\n"
289 " cardinality=\"single\"\n"
290 " visibility=\"external\"\n"
291 " defaultValue=\"3\"\n"
292 " access=\"public\"\n"
296 " name=\"vectorType\"\n"
298 " cardinality=\"single\"\n"
299 " visibility=\"external\"\n"
300 " defaultValue=\"GeoProperty::VectorTypeVector\"\n"
301 " access=\"public\"\n"
307 " cardinality=\"single\"\n"
308 " visibility=\"external\"\n"
309 " defaultValue=\"0\"\n"
310 " access=\"public\"\n"
313 "</FieldContainer>\n",
317 /*------------------------------ get -----------------------------------*/
319 FieldContainerType
&GeoVectorBufferPropertyBase::getType(void)
324 const FieldContainerType
&GeoVectorBufferPropertyBase::getType(void) const
329 UInt32
GeoVectorBufferPropertyBase::getContainerSize(void) const
331 return sizeof(GeoVectorBufferProperty
);
334 /*------------------------- decorator get ------------------------------*/
337 SFUInt32
*GeoVectorBufferPropertyBase::editSFStride(void)
339 editSField(StrideFieldMask
);
344 const SFUInt32
*GeoVectorBufferPropertyBase::getSFStride(void) const
350 SFUInt32
*GeoVectorBufferPropertyBase::editSFFormat(void)
352 editSField(FormatFieldMask
);
357 const SFUInt32
*GeoVectorBufferPropertyBase::getSFFormat(void) const
363 SFUInt32
*GeoVectorBufferPropertyBase::editSFFormatSize(void)
365 editSField(FormatSizeFieldMask
);
367 return &_sfFormatSize
;
370 const SFUInt32
*GeoVectorBufferPropertyBase::getSFFormatSize(void) const
372 return &_sfFormatSize
;
376 SFUInt32
*GeoVectorBufferPropertyBase::editSFDimension(void)
378 editSField(DimensionFieldMask
);
380 return &_sfDimension
;
383 const SFUInt32
*GeoVectorBufferPropertyBase::getSFDimension(void) const
385 return &_sfDimension
;
389 SFUInt32
*GeoVectorBufferPropertyBase::editSFVectorType(void)
391 editSField(VectorTypeFieldMask
);
393 return &_sfVectorType
;
396 const SFUInt32
*GeoVectorBufferPropertyBase::getSFVectorType(void) const
398 return &_sfVectorType
;
402 SFUInt32
*GeoVectorBufferPropertyBase::editSFSize(void)
404 editSField(SizeFieldMask
);
409 const SFUInt32
*GeoVectorBufferPropertyBase::getSFSize(void) const
419 /*------------------------------ access -----------------------------------*/
421 SizeT
GeoVectorBufferPropertyBase::getBinSize(ConstFieldMaskArg whichField
)
423 SizeT returnValue
= Inherited::getBinSize(whichField
);
425 if(FieldBits::NoField
!= (StrideFieldMask
& whichField
))
427 returnValue
+= _sfStride
.getBinSize();
429 if(FieldBits::NoField
!= (FormatFieldMask
& whichField
))
431 returnValue
+= _sfFormat
.getBinSize();
433 if(FieldBits::NoField
!= (FormatSizeFieldMask
& whichField
))
435 returnValue
+= _sfFormatSize
.getBinSize();
437 if(FieldBits::NoField
!= (DimensionFieldMask
& whichField
))
439 returnValue
+= _sfDimension
.getBinSize();
441 if(FieldBits::NoField
!= (VectorTypeFieldMask
& whichField
))
443 returnValue
+= _sfVectorType
.getBinSize();
445 if(FieldBits::NoField
!= (SizeFieldMask
& whichField
))
447 returnValue
+= _sfSize
.getBinSize();
453 void GeoVectorBufferPropertyBase::copyToBin(BinaryDataHandler
&pMem
,
454 ConstFieldMaskArg whichField
)
456 Inherited::copyToBin(pMem
, whichField
);
458 if(FieldBits::NoField
!= (StrideFieldMask
& whichField
))
460 _sfStride
.copyToBin(pMem
);
462 if(FieldBits::NoField
!= (FormatFieldMask
& whichField
))
464 _sfFormat
.copyToBin(pMem
);
466 if(FieldBits::NoField
!= (FormatSizeFieldMask
& whichField
))
468 _sfFormatSize
.copyToBin(pMem
);
470 if(FieldBits::NoField
!= (DimensionFieldMask
& whichField
))
472 _sfDimension
.copyToBin(pMem
);
474 if(FieldBits::NoField
!= (VectorTypeFieldMask
& whichField
))
476 _sfVectorType
.copyToBin(pMem
);
478 if(FieldBits::NoField
!= (SizeFieldMask
& whichField
))
480 _sfSize
.copyToBin(pMem
);
484 void GeoVectorBufferPropertyBase::copyFromBin(BinaryDataHandler
&pMem
,
485 ConstFieldMaskArg whichField
)
487 Inherited::copyFromBin(pMem
, whichField
);
489 if(FieldBits::NoField
!= (StrideFieldMask
& whichField
))
491 editSField(StrideFieldMask
);
492 _sfStride
.copyFromBin(pMem
);
494 if(FieldBits::NoField
!= (FormatFieldMask
& whichField
))
496 editSField(FormatFieldMask
);
497 _sfFormat
.copyFromBin(pMem
);
499 if(FieldBits::NoField
!= (FormatSizeFieldMask
& whichField
))
501 editSField(FormatSizeFieldMask
);
502 _sfFormatSize
.copyFromBin(pMem
);
504 if(FieldBits::NoField
!= (DimensionFieldMask
& whichField
))
506 editSField(DimensionFieldMask
);
507 _sfDimension
.copyFromBin(pMem
);
509 if(FieldBits::NoField
!= (VectorTypeFieldMask
& whichField
))
511 editSField(VectorTypeFieldMask
);
512 _sfVectorType
.copyFromBin(pMem
);
514 if(FieldBits::NoField
!= (SizeFieldMask
& whichField
))
516 editSField(SizeFieldMask
);
517 _sfSize
.copyFromBin(pMem
);
521 //! create a new instance of the class
522 GeoVectorBufferPropertyTransitPtr
GeoVectorBufferPropertyBase::createLocal(BitVector bFlags
)
524 GeoVectorBufferPropertyTransitPtr fc
;
526 if(getClassType().getPrototype() != NULL
)
528 FieldContainerTransitPtr tmpPtr
=
529 getClassType().getPrototype()-> shallowCopyLocal(bFlags
);
531 fc
= dynamic_pointer_cast
<GeoVectorBufferProperty
>(tmpPtr
);
537 //! create a new instance of the class, copy the container flags
538 GeoVectorBufferPropertyTransitPtr
GeoVectorBufferPropertyBase::createDependent(BitVector bFlags
)
540 GeoVectorBufferPropertyTransitPtr fc
;
542 if(getClassType().getPrototype() != NULL
)
544 FieldContainerTransitPtr tmpPtr
=
545 getClassType().getPrototype()-> shallowCopyDependent(bFlags
);
547 fc
= dynamic_pointer_cast
<GeoVectorBufferProperty
>(tmpPtr
);
553 //! create a new instance of the class
554 GeoVectorBufferPropertyTransitPtr
GeoVectorBufferPropertyBase::create(void)
556 GeoVectorBufferPropertyTransitPtr fc
;
558 if(getClassType().getPrototype() != NULL
)
560 FieldContainerTransitPtr tmpPtr
=
561 getClassType().getPrototype()-> shallowCopy();
563 fc
= dynamic_pointer_cast
<GeoVectorBufferProperty
>(tmpPtr
);
569 GeoVectorBufferProperty
*GeoVectorBufferPropertyBase::createEmptyLocal(BitVector bFlags
)
571 GeoVectorBufferProperty
*returnValue
;
573 newPtr
<GeoVectorBufferProperty
>(returnValue
, bFlags
);
575 returnValue
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
580 //! create an empty new instance of the class, do not copy the prototype
581 GeoVectorBufferProperty
*GeoVectorBufferPropertyBase::createEmpty(void)
583 GeoVectorBufferProperty
*returnValue
;
585 newPtr
<GeoVectorBufferProperty
>(returnValue
, Thread::getCurrentLocalFlags());
587 returnValue
->_pFieldFlags
->_bNamespaceMask
&=
588 ~Thread::getCurrentLocalFlags();
594 FieldContainerTransitPtr
GeoVectorBufferPropertyBase::shallowCopyLocal(
595 BitVector bFlags
) const
597 GeoVectorBufferProperty
*tmpPtr
;
599 newPtr(tmpPtr
, dynamic_cast<const GeoVectorBufferProperty
*>(this), bFlags
);
601 FieldContainerTransitPtr
returnValue(tmpPtr
);
603 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
608 FieldContainerTransitPtr
GeoVectorBufferPropertyBase::shallowCopyDependent(
609 BitVector bFlags
) const
611 GeoVectorBufferProperty
*tmpPtr
;
613 newPtr(tmpPtr
, dynamic_cast<const GeoVectorBufferProperty
*>(this), ~bFlags
);
615 FieldContainerTransitPtr
returnValue(tmpPtr
);
617 tmpPtr
->_pFieldFlags
->_bNamespaceMask
= bFlags
;
622 FieldContainerTransitPtr
GeoVectorBufferPropertyBase::shallowCopy(void) const
624 GeoVectorBufferProperty
*tmpPtr
;
627 dynamic_cast<const GeoVectorBufferProperty
*>(this),
628 Thread::getCurrentLocalFlags());
630 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~Thread::getCurrentLocalFlags();
632 FieldContainerTransitPtr
returnValue(tmpPtr
);
640 /*------------------------- constructors ----------------------------------*/
642 GeoVectorBufferPropertyBase::GeoVectorBufferPropertyBase(void) :
644 _sfStride (UInt32(0)),
645 _sfFormat (UInt32(GL_FLOAT
)),
646 _sfFormatSize (UInt32(4)),
647 _sfDimension (UInt32(3)),
648 _sfVectorType (UInt32(GeoProperty::VectorTypeVector
)),
653 GeoVectorBufferPropertyBase::GeoVectorBufferPropertyBase(const GeoVectorBufferPropertyBase
&source
) :
655 _sfStride (source
._sfStride
),
656 _sfFormat (source
._sfFormat
),
657 _sfFormatSize (source
._sfFormatSize
),
658 _sfDimension (source
._sfDimension
),
659 _sfVectorType (source
._sfVectorType
),
660 _sfSize (source
._sfSize
)
665 /*-------------------------- destructors ----------------------------------*/
667 GeoVectorBufferPropertyBase::~GeoVectorBufferPropertyBase(void)
672 GetFieldHandlePtr
GeoVectorBufferPropertyBase::getHandleStride (void) const
674 SFUInt32::GetHandlePtr
returnValue(
675 new SFUInt32::GetHandle(
677 this->getType().getFieldDesc(StrideFieldId
),
678 const_cast<GeoVectorBufferPropertyBase
*>(this)));
683 EditFieldHandlePtr
GeoVectorBufferPropertyBase::editHandleStride (void)
685 SFUInt32::EditHandlePtr
returnValue(
686 new SFUInt32::EditHandle(
688 this->getType().getFieldDesc(StrideFieldId
),
692 editSField(StrideFieldMask
);
697 GetFieldHandlePtr
GeoVectorBufferPropertyBase::getHandleFormat (void) const
699 SFUInt32::GetHandlePtr
returnValue(
700 new SFUInt32::GetHandle(
702 this->getType().getFieldDesc(FormatFieldId
),
703 const_cast<GeoVectorBufferPropertyBase
*>(this)));
708 EditFieldHandlePtr
GeoVectorBufferPropertyBase::editHandleFormat (void)
710 SFUInt32::EditHandlePtr
returnValue(
711 new SFUInt32::EditHandle(
713 this->getType().getFieldDesc(FormatFieldId
),
717 editSField(FormatFieldMask
);
722 GetFieldHandlePtr
GeoVectorBufferPropertyBase::getHandleFormatSize (void) const
724 SFUInt32::GetHandlePtr
returnValue(
725 new SFUInt32::GetHandle(
727 this->getType().getFieldDesc(FormatSizeFieldId
),
728 const_cast<GeoVectorBufferPropertyBase
*>(this)));
733 EditFieldHandlePtr
GeoVectorBufferPropertyBase::editHandleFormatSize (void)
735 SFUInt32::EditHandlePtr
returnValue(
736 new SFUInt32::EditHandle(
738 this->getType().getFieldDesc(FormatSizeFieldId
),
742 editSField(FormatSizeFieldMask
);
747 GetFieldHandlePtr
GeoVectorBufferPropertyBase::getHandleDimension (void) const
749 SFUInt32::GetHandlePtr
returnValue(
750 new SFUInt32::GetHandle(
752 this->getType().getFieldDesc(DimensionFieldId
),
753 const_cast<GeoVectorBufferPropertyBase
*>(this)));
758 EditFieldHandlePtr
GeoVectorBufferPropertyBase::editHandleDimension (void)
760 SFUInt32::EditHandlePtr
returnValue(
761 new SFUInt32::EditHandle(
763 this->getType().getFieldDesc(DimensionFieldId
),
767 editSField(DimensionFieldMask
);
772 GetFieldHandlePtr
GeoVectorBufferPropertyBase::getHandleVectorType (void) const
774 SFUInt32::GetHandlePtr
returnValue(
775 new SFUInt32::GetHandle(
777 this->getType().getFieldDesc(VectorTypeFieldId
),
778 const_cast<GeoVectorBufferPropertyBase
*>(this)));
783 EditFieldHandlePtr
GeoVectorBufferPropertyBase::editHandleVectorType (void)
785 SFUInt32::EditHandlePtr
returnValue(
786 new SFUInt32::EditHandle(
788 this->getType().getFieldDesc(VectorTypeFieldId
),
792 editSField(VectorTypeFieldMask
);
797 GetFieldHandlePtr
GeoVectorBufferPropertyBase::getHandleSize (void) const
799 SFUInt32::GetHandlePtr
returnValue(
800 new SFUInt32::GetHandle(
802 this->getType().getFieldDesc(SizeFieldId
),
803 const_cast<GeoVectorBufferPropertyBase
*>(this)));
808 EditFieldHandlePtr
GeoVectorBufferPropertyBase::editHandleSize (void)
810 SFUInt32::EditHandlePtr
returnValue(
811 new SFUInt32::EditHandle(
813 this->getType().getFieldDesc(SizeFieldId
),
817 editSField(SizeFieldMask
);
823 #ifdef OSG_MT_CPTR_ASPECT
824 void GeoVectorBufferPropertyBase::execSyncV( FieldContainer
&oFrom
,
825 ConstFieldMaskArg whichField
,
826 AspectOffsetStore
&oOffsets
,
827 ConstFieldMaskArg syncMode
,
828 const UInt32 uiSyncInfo
)
830 GeoVectorBufferProperty
*pThis
= static_cast<GeoVectorBufferProperty
*>(this);
832 pThis
->execSync(static_cast<GeoVectorBufferProperty
*>(&oFrom
),
841 #ifdef OSG_MT_CPTR_ASPECT
842 FieldContainer
*GeoVectorBufferPropertyBase::createAspectCopy(
843 const FieldContainer
*pRefAspect
) const
845 GeoVectorBufferProperty
*returnValue
;
847 newAspectCopy(returnValue
,
848 dynamic_cast<const GeoVectorBufferProperty
*>(pRefAspect
),
849 dynamic_cast<const GeoVectorBufferProperty
*>(this));
855 void GeoVectorBufferPropertyBase::resolveLinks(void)
857 Inherited::resolveLinks();