changed: gcc8 base update
[opensg.git] / Source / System / NodeCores / Drawables / Geometry / Properties / OSGGeoIntegralBufferPropertyBase.cpp
blob3d4a57e3397c695f8de913947bb81d13fcedc48c
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2000-2013 by the OpenSG Forum *
6 * *
7 * www.opensg.org *
8 * *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, carsten_neumann@gmx.net *
10 * *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
13 * License *
14 * *
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. *
18 * *
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. *
23 * *
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. *
27 * *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
30 * Changes *
31 * *
32 * *
33 * *
34 * *
35 * *
36 * *
37 \*---------------------------------------------------------------------------*/
39 /*****************************************************************************\
40 *****************************************************************************
41 ** **
42 ** This file is automatically generated. **
43 ** **
44 ** Any changes made to this file WILL be lost when it is **
45 ** regenerated, which can become necessary at any time. **
46 ** **
47 ** Do not change this file, changes should be done in the derived **
48 ** class GeoIntegralBufferProperty!
49 ** **
50 *****************************************************************************
51 \*****************************************************************************/
53 #include <cstdlib>
54 #include <cstdio>
56 #ifdef WIN32
57 #pragma warning(disable: 4355) // turn off 'this' : used in base member initializer list warning
58 #pragma warning(disable: 4290) // disable exception specification warning
59 #endif
61 #include "OSGConfig.h"
66 #include "OSGGeoIntegralBufferPropertyBase.h"
67 #include "OSGGeoIntegralBufferProperty.h"
69 #include <boost/bind.hpp>
71 OSG_BEGIN_NAMESPACE
73 /***************************************************************************\
74 * Description *
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(),
115 nsOSG);
116 #endif
118 OSG_FIELDTRAITS_GETTYPE_NS(GeoIntegralBufferProperty *, nsOSG)
120 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField,
121 GeoIntegralBufferProperty *,
122 nsOSG)
124 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField,
125 GeoIntegralBufferProperty *,
126 nsOSG)
128 DataType &FieldTraits< GeoIntegralBufferProperty *, nsOSG + 1 >::getType(void)
130 return FieldTraits<GeoIntegralBufferProperty *, nsOSG>::getType();
134 OSG_EXPORT_PTR_SFIELD(ChildPointerSField,
135 GeoIntegralBufferProperty *,
136 UnrecordedRefCountPolicy,
137 nsOSG + 1)
140 OSG_EXPORT_PTR_MFIELD(ChildPointerMField,
141 GeoIntegralBufferProperty *,
142 UnrecordedRefCountPolicy,
143 nsOSG + 1)
146 /***************************************************************************\
147 * Field Description *
148 \***************************************************************************/
150 void GeoIntegralBufferPropertyBase::classDescInserter(TypeObject &oType)
152 FieldDescriptionBase *pDesc = NULL;
155 pDesc = new SFUInt32::Description(
156 SFUInt32::getClassType(),
157 "stride",
159 StrideFieldId, StrideFieldMask,
160 false,
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(),
169 "format",
171 FormatFieldId, FormatFieldMask,
172 false,
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(),
181 "formatSize",
183 FormatSizeFieldId, FormatSizeFieldMask,
184 false,
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(),
193 "dimension",
195 DimensionFieldId, DimensionFieldMask,
196 false,
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(),
205 "size",
207 SizeFieldId, SizeFieldMask,
208 false,
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(),
220 "NULL",
221 nsOSG, //Namespace
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)),
227 false,
229 "<?xml version=\"1.0\"?>\n"
230 "\n"
231 "<FieldContainer\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"
242 " >\n"
243 " <Field\n"
244 " name=\"stride\"\n"
245 " type=\"UInt32\"\n"
246 " cardinality=\"single\"\n"
247 " visibility=\"external\"\n"
248 " defaultValue=\"0\"\n"
249 " access=\"public\"\n"
250 " >\n"
251 " </Field>\n"
252 " <Field\n"
253 " name=\"format\"\n"
254 " type=\"UInt32\"\n"
255 " cardinality=\"single\"\n"
256 " visibility=\"external\"\n"
257 " defaultValue=\"GL_FLOAT\"\n"
258 " access=\"public\"\n"
259 " >\n"
260 " </Field>\n"
261 " <Field\n"
262 " name=\"formatSize\"\n"
263 " type=\"UInt32\"\n"
264 " cardinality=\"single\"\n"
265 " visibility=\"external\"\n"
266 " defaultValue=\"4\"\n"
267 " access=\"public\"\n"
268 " >\n"
269 " </Field>\n"
270 " <Field\n"
271 " name=\"dimension\"\n"
272 " type=\"UInt32\"\n"
273 " cardinality=\"single\"\n"
274 " visibility=\"external\"\n"
275 " defaultValue=\"3\"\n"
276 " access=\"public\"\n"
277 " >\n"
278 " </Field>\n"
279 " <Field\n"
280 " name=\"size\"\n"
281 " type=\"UInt32\"\n"
282 " cardinality=\"single\"\n"
283 " visibility=\"external\"\n"
284 " defaultValue=\"0\"\n"
285 " access=\"public\"\n"
286 " >\n"
287 " </Field>\n"
288 "</FieldContainer>\n",
292 /*------------------------------ get -----------------------------------*/
294 FieldContainerType &GeoIntegralBufferPropertyBase::getType(void)
296 return _type;
299 const FieldContainerType &GeoIntegralBufferPropertyBase::getType(void) const
301 return _type;
304 UInt32 GeoIntegralBufferPropertyBase::getContainerSize(void) const
306 return sizeof(GeoIntegralBufferProperty);
309 /*------------------------- decorator get ------------------------------*/
312 SFUInt32 *GeoIntegralBufferPropertyBase::editSFStride(void)
314 editSField(StrideFieldMask);
316 return &_sfStride;
319 const SFUInt32 *GeoIntegralBufferPropertyBase::getSFStride(void) const
321 return &_sfStride;
325 SFUInt32 *GeoIntegralBufferPropertyBase::editSFFormat(void)
327 editSField(FormatFieldMask);
329 return &_sfFormat;
332 const SFUInt32 *GeoIntegralBufferPropertyBase::getSFFormat(void) const
334 return &_sfFormat;
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);
368 return &_sfSize;
371 const SFUInt32 *GeoIntegralBufferPropertyBase::getSFSize(void) const
373 return &_sfSize;
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();
408 return returnValue;
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);
483 return fc;
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);
499 return fc;
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);
515 return fc;
518 GeoIntegralBufferProperty *GeoIntegralBufferPropertyBase::createEmptyLocal(BitVector bFlags)
520 GeoIntegralBufferProperty *returnValue;
522 newPtr<GeoIntegralBufferProperty>(returnValue, bFlags);
524 returnValue->_pFieldFlags->_bNamespaceMask &= ~bFlags;
526 return returnValue;
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();
539 return returnValue;
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;
554 return returnValue;
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;
568 return returnValue;
571 FieldContainerTransitPtr GeoIntegralBufferPropertyBase::shallowCopy(void) const
573 GeoIntegralBufferProperty *tmpPtr;
575 newPtr(tmpPtr,
576 dynamic_cast<const GeoIntegralBufferProperty *>(this),
577 Thread::getCurrentLocalFlags());
579 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~Thread::getCurrentLocalFlags();
581 FieldContainerTransitPtr returnValue(tmpPtr);
583 return returnValue;
589 /*------------------------- constructors ----------------------------------*/
591 GeoIntegralBufferPropertyBase::GeoIntegralBufferPropertyBase(void) :
592 Inherited(),
593 _sfStride (UInt32(0)),
594 _sfFormat (UInt32(GL_FLOAT)),
595 _sfFormatSize (UInt32(4)),
596 _sfDimension (UInt32(3)),
597 _sfSize (UInt32(0))
601 GeoIntegralBufferPropertyBase::GeoIntegralBufferPropertyBase(const GeoIntegralBufferPropertyBase &source) :
602 Inherited(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(
623 &_sfStride,
624 this->getType().getFieldDesc(StrideFieldId),
625 const_cast<GeoIntegralBufferPropertyBase *>(this)));
627 return returnValue;
630 EditFieldHandlePtr GeoIntegralBufferPropertyBase::editHandleStride (void)
632 SFUInt32::EditHandlePtr returnValue(
633 new SFUInt32::EditHandle(
634 &_sfStride,
635 this->getType().getFieldDesc(StrideFieldId),
636 this));
639 editSField(StrideFieldMask);
641 return returnValue;
644 GetFieldHandlePtr GeoIntegralBufferPropertyBase::getHandleFormat (void) const
646 SFUInt32::GetHandlePtr returnValue(
647 new SFUInt32::GetHandle(
648 &_sfFormat,
649 this->getType().getFieldDesc(FormatFieldId),
650 const_cast<GeoIntegralBufferPropertyBase *>(this)));
652 return returnValue;
655 EditFieldHandlePtr GeoIntegralBufferPropertyBase::editHandleFormat (void)
657 SFUInt32::EditHandlePtr returnValue(
658 new SFUInt32::EditHandle(
659 &_sfFormat,
660 this->getType().getFieldDesc(FormatFieldId),
661 this));
664 editSField(FormatFieldMask);
666 return returnValue;
669 GetFieldHandlePtr GeoIntegralBufferPropertyBase::getHandleFormatSize (void) const
671 SFUInt32::GetHandlePtr returnValue(
672 new SFUInt32::GetHandle(
673 &_sfFormatSize,
674 this->getType().getFieldDesc(FormatSizeFieldId),
675 const_cast<GeoIntegralBufferPropertyBase *>(this)));
677 return returnValue;
680 EditFieldHandlePtr GeoIntegralBufferPropertyBase::editHandleFormatSize (void)
682 SFUInt32::EditHandlePtr returnValue(
683 new SFUInt32::EditHandle(
684 &_sfFormatSize,
685 this->getType().getFieldDesc(FormatSizeFieldId),
686 this));
689 editSField(FormatSizeFieldMask);
691 return returnValue;
694 GetFieldHandlePtr GeoIntegralBufferPropertyBase::getHandleDimension (void) const
696 SFUInt32::GetHandlePtr returnValue(
697 new SFUInt32::GetHandle(
698 &_sfDimension,
699 this->getType().getFieldDesc(DimensionFieldId),
700 const_cast<GeoIntegralBufferPropertyBase *>(this)));
702 return returnValue;
705 EditFieldHandlePtr GeoIntegralBufferPropertyBase::editHandleDimension (void)
707 SFUInt32::EditHandlePtr returnValue(
708 new SFUInt32::EditHandle(
709 &_sfDimension,
710 this->getType().getFieldDesc(DimensionFieldId),
711 this));
714 editSField(DimensionFieldMask);
716 return returnValue;
719 GetFieldHandlePtr GeoIntegralBufferPropertyBase::getHandleSize (void) const
721 SFUInt32::GetHandlePtr returnValue(
722 new SFUInt32::GetHandle(
723 &_sfSize,
724 this->getType().getFieldDesc(SizeFieldId),
725 const_cast<GeoIntegralBufferPropertyBase *>(this)));
727 return returnValue;
730 EditFieldHandlePtr GeoIntegralBufferPropertyBase::editHandleSize (void)
732 SFUInt32::EditHandlePtr returnValue(
733 new SFUInt32::EditHandle(
734 &_sfSize,
735 this->getType().getFieldDesc(SizeFieldId),
736 this));
739 editSField(SizeFieldMask);
741 return returnValue;
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),
755 whichField,
756 oOffsets,
757 syncMode,
758 uiSyncInfo);
760 #endif
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));
773 return returnValue;
775 #endif
777 void GeoIntegralBufferPropertyBase::resolveLinks(void)
779 Inherited::resolveLinks();
785 OSG_END_NAMESPACE