changed: gcc8 base update
[opensg.git] / Source / Contrib / ComplexSceneManager / Helper / Shader / OSGSimpleSHLChunkFileBase.cpp
blobde9d6f272aac8cec5e61e525cebf336c0aabc4ea
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 SimpleSHLChunkFile!
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 "OSGSimpleSHLChunkFileBase.h"
67 #include "OSGSimpleSHLChunkFile.h"
69 #include <boost/bind.hpp>
71 OSG_BEGIN_NAMESPACE
73 /***************************************************************************\
74 * Description *
75 \***************************************************************************/
77 /*! \class OSG::SimpleSHLChunkFile
81 /***************************************************************************\
82 * Field Documentation *
83 \***************************************************************************/
85 /*! \var std::string SimpleSHLChunkFileBase::_sfVertexProgramUrl
89 /*! \var std::string SimpleSHLChunkFileBase::_sfGeometryProgramUrl
93 /*! \var std::string SimpleSHLChunkFileBase::_sfFragmentProgramUrl
98 /***************************************************************************\
99 * FieldType/FieldTrait Instantiation *
100 \***************************************************************************/
102 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
103 PointerType FieldTraits<SimpleSHLChunkFile *, nsOSG>::_type(
104 "SimpleSHLChunkFilePtr",
105 "SimpleSHLChunkPtr",
106 SimpleSHLChunkFile::getClassType(),
107 nsOSG);
108 #endif
110 OSG_FIELDTRAITS_GETTYPE_NS(SimpleSHLChunkFile *, nsOSG)
112 /***************************************************************************\
113 * Field Description *
114 \***************************************************************************/
116 void SimpleSHLChunkFileBase::classDescInserter(TypeObject &oType)
118 FieldDescriptionBase *pDesc = NULL;
121 pDesc = new SFString::Description(
122 SFString::getClassType(),
123 "vertexProgramUrl",
125 VertexProgramUrlFieldId, VertexProgramUrlFieldMask,
126 false,
127 (Field::SFDefaultFlags | Field::FStdAccess),
128 static_cast<FieldEditMethodSig>(&SimpleSHLChunkFile::editHandleVertexProgramUrl),
129 static_cast<FieldGetMethodSig >(&SimpleSHLChunkFile::getHandleVertexProgramUrl));
131 oType.addInitialDesc(pDesc);
133 pDesc = new SFString::Description(
134 SFString::getClassType(),
135 "geometryProgramUrl",
137 GeometryProgramUrlFieldId, GeometryProgramUrlFieldMask,
138 false,
139 (Field::SFDefaultFlags | Field::FStdAccess),
140 static_cast<FieldEditMethodSig>(&SimpleSHLChunkFile::editHandleGeometryProgramUrl),
141 static_cast<FieldGetMethodSig >(&SimpleSHLChunkFile::getHandleGeometryProgramUrl));
143 oType.addInitialDesc(pDesc);
145 pDesc = new SFString::Description(
146 SFString::getClassType(),
147 "fragmentProgramUrl",
149 FragmentProgramUrlFieldId, FragmentProgramUrlFieldMask,
150 false,
151 (Field::SFDefaultFlags | Field::FStdAccess),
152 static_cast<FieldEditMethodSig>(&SimpleSHLChunkFile::editHandleFragmentProgramUrl),
153 static_cast<FieldGetMethodSig >(&SimpleSHLChunkFile::getHandleFragmentProgramUrl));
155 oType.addInitialDesc(pDesc);
159 SimpleSHLChunkFileBase::TypeObject SimpleSHLChunkFileBase::_type(
160 SimpleSHLChunkFileBase::getClassname(),
161 Inherited::getClassname(),
162 "NULL",
163 nsOSG, //Namespace
164 reinterpret_cast<PrototypeCreateF>(&SimpleSHLChunkFileBase::createEmptyLocal),
165 reinterpret_cast<InitContainerF>(&SimpleSHLChunkFile::initMethod),
166 reinterpret_cast<ExitContainerF>(&SimpleSHLChunkFile::exitMethod),
167 reinterpret_cast<InitalInsertDescFunc>(
168 reinterpret_cast<void *>(&SimpleSHLChunkFile::classDescInserter)),
169 false,
171 "<?xml version=\"1.0\"?>\n"
172 "\n"
173 "<FieldContainer\n"
174 " name=\"SimpleSHLChunkFile\"\n"
175 " parent=\"SimpleSHLChunk\"\n"
176 " library=\"ContribCSM\"\n"
177 " pointerfieldtypes=\"none\"\n"
178 " structure=\"concrete\"\n"
179 " systemcomponent=\"true\"\n"
180 " parentsystemcomponent=\"true\"\n"
181 " decoratable=\"false\"\n"
182 " useLocalIncludes=\"false\"\n"
183 " isNodeCore=\"false\"\n"
184 " isBundle=\"false\"\n"
185 " parentFields=\"none\"\n"
186 ">\n"
187 "\t<Field\n"
188 "\t\tname=\"vertexProgramUrl\"\n"
189 "\t\ttype=\"std::string\"\n"
190 "\t\tcardinality=\"single\"\n"
191 "\t\tvisibility=\"external\"\n"
192 "\t\taccess=\"public\"\n"
193 "\t>\n"
194 "\t</Field>\n"
195 "\t<Field\n"
196 "\t\tname=\"geometryProgramUrl\"\n"
197 "\t\ttype=\"std::string\"\n"
198 "\t\tcardinality=\"single\"\n"
199 "\t\tvisibility=\"external\"\n"
200 "\t\taccess=\"public\"\n"
201 "\t>\n"
202 "\t</Field>\n"
203 "\t<Field\n"
204 "\t\tname=\"fragmentProgramUrl\"\n"
205 "\t\ttype=\"std::string\"\n"
206 "\t\tcardinality=\"single\"\n"
207 "\t\tvisibility=\"external\"\n"
208 "\t\taccess=\"public\"\n"
209 "\t>\n"
210 "\t</Field>\n"
211 "</FieldContainer>\n",
215 /*------------------------------ get -----------------------------------*/
217 FieldContainerType &SimpleSHLChunkFileBase::getType(void)
219 return _type;
222 const FieldContainerType &SimpleSHLChunkFileBase::getType(void) const
224 return _type;
227 UInt32 SimpleSHLChunkFileBase::getContainerSize(void) const
229 return sizeof(SimpleSHLChunkFile);
232 /*------------------------- decorator get ------------------------------*/
235 SFString *SimpleSHLChunkFileBase::editSFVertexProgramUrl(void)
237 editSField(VertexProgramUrlFieldMask);
239 return &_sfVertexProgramUrl;
242 const SFString *SimpleSHLChunkFileBase::getSFVertexProgramUrl(void) const
244 return &_sfVertexProgramUrl;
248 SFString *SimpleSHLChunkFileBase::editSFGeometryProgramUrl(void)
250 editSField(GeometryProgramUrlFieldMask);
252 return &_sfGeometryProgramUrl;
255 const SFString *SimpleSHLChunkFileBase::getSFGeometryProgramUrl(void) const
257 return &_sfGeometryProgramUrl;
261 SFString *SimpleSHLChunkFileBase::editSFFragmentProgramUrl(void)
263 editSField(FragmentProgramUrlFieldMask);
265 return &_sfFragmentProgramUrl;
268 const SFString *SimpleSHLChunkFileBase::getSFFragmentProgramUrl(void) const
270 return &_sfFragmentProgramUrl;
278 /*------------------------------ access -----------------------------------*/
280 SizeT SimpleSHLChunkFileBase::getBinSize(ConstFieldMaskArg whichField)
282 SizeT returnValue = Inherited::getBinSize(whichField);
284 if(FieldBits::NoField != (VertexProgramUrlFieldMask & whichField))
286 returnValue += _sfVertexProgramUrl.getBinSize();
288 if(FieldBits::NoField != (GeometryProgramUrlFieldMask & whichField))
290 returnValue += _sfGeometryProgramUrl.getBinSize();
292 if(FieldBits::NoField != (FragmentProgramUrlFieldMask & whichField))
294 returnValue += _sfFragmentProgramUrl.getBinSize();
297 return returnValue;
300 void SimpleSHLChunkFileBase::copyToBin(BinaryDataHandler &pMem,
301 ConstFieldMaskArg whichField)
303 Inherited::copyToBin(pMem, whichField);
305 if(FieldBits::NoField != (VertexProgramUrlFieldMask & whichField))
307 _sfVertexProgramUrl.copyToBin(pMem);
309 if(FieldBits::NoField != (GeometryProgramUrlFieldMask & whichField))
311 _sfGeometryProgramUrl.copyToBin(pMem);
313 if(FieldBits::NoField != (FragmentProgramUrlFieldMask & whichField))
315 _sfFragmentProgramUrl.copyToBin(pMem);
319 void SimpleSHLChunkFileBase::copyFromBin(BinaryDataHandler &pMem,
320 ConstFieldMaskArg whichField)
322 Inherited::copyFromBin(pMem, whichField);
324 if(FieldBits::NoField != (VertexProgramUrlFieldMask & whichField))
326 editSField(VertexProgramUrlFieldMask);
327 _sfVertexProgramUrl.copyFromBin(pMem);
329 if(FieldBits::NoField != (GeometryProgramUrlFieldMask & whichField))
331 editSField(GeometryProgramUrlFieldMask);
332 _sfGeometryProgramUrl.copyFromBin(pMem);
334 if(FieldBits::NoField != (FragmentProgramUrlFieldMask & whichField))
336 editSField(FragmentProgramUrlFieldMask);
337 _sfFragmentProgramUrl.copyFromBin(pMem);
341 //! create a new instance of the class
342 SimpleSHLChunkFileTransitPtr SimpleSHLChunkFileBase::createLocal(BitVector bFlags)
344 SimpleSHLChunkFileTransitPtr fc;
346 if(getClassType().getPrototype() != NULL)
348 FieldContainerTransitPtr tmpPtr =
349 getClassType().getPrototype()-> shallowCopyLocal(bFlags);
351 fc = dynamic_pointer_cast<SimpleSHLChunkFile>(tmpPtr);
354 return fc;
357 //! create a new instance of the class, copy the container flags
358 SimpleSHLChunkFileTransitPtr SimpleSHLChunkFileBase::createDependent(BitVector bFlags)
360 SimpleSHLChunkFileTransitPtr fc;
362 if(getClassType().getPrototype() != NULL)
364 FieldContainerTransitPtr tmpPtr =
365 getClassType().getPrototype()-> shallowCopyDependent(bFlags);
367 fc = dynamic_pointer_cast<SimpleSHLChunkFile>(tmpPtr);
370 return fc;
373 //! create a new instance of the class
374 SimpleSHLChunkFileTransitPtr SimpleSHLChunkFileBase::create(void)
376 SimpleSHLChunkFileTransitPtr fc;
378 if(getClassType().getPrototype() != NULL)
380 FieldContainerTransitPtr tmpPtr =
381 getClassType().getPrototype()-> shallowCopy();
383 fc = dynamic_pointer_cast<SimpleSHLChunkFile>(tmpPtr);
386 return fc;
389 SimpleSHLChunkFile *SimpleSHLChunkFileBase::createEmptyLocal(BitVector bFlags)
391 SimpleSHLChunkFile *returnValue;
393 newPtr<SimpleSHLChunkFile>(returnValue, bFlags);
395 returnValue->_pFieldFlags->_bNamespaceMask &= ~bFlags;
397 return returnValue;
400 //! create an empty new instance of the class, do not copy the prototype
401 SimpleSHLChunkFile *SimpleSHLChunkFileBase::createEmpty(void)
403 SimpleSHLChunkFile *returnValue;
405 newPtr<SimpleSHLChunkFile>(returnValue, Thread::getCurrentLocalFlags());
407 returnValue->_pFieldFlags->_bNamespaceMask &=
408 ~Thread::getCurrentLocalFlags();
410 return returnValue;
414 FieldContainerTransitPtr SimpleSHLChunkFileBase::shallowCopyLocal(
415 BitVector bFlags) const
417 SimpleSHLChunkFile *tmpPtr;
419 newPtr(tmpPtr, dynamic_cast<const SimpleSHLChunkFile *>(this), bFlags);
421 FieldContainerTransitPtr returnValue(tmpPtr);
423 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~bFlags;
425 return returnValue;
428 FieldContainerTransitPtr SimpleSHLChunkFileBase::shallowCopyDependent(
429 BitVector bFlags) const
431 SimpleSHLChunkFile *tmpPtr;
433 newPtr(tmpPtr, dynamic_cast<const SimpleSHLChunkFile *>(this), ~bFlags);
435 FieldContainerTransitPtr returnValue(tmpPtr);
437 tmpPtr->_pFieldFlags->_bNamespaceMask = bFlags;
439 return returnValue;
442 FieldContainerTransitPtr SimpleSHLChunkFileBase::shallowCopy(void) const
444 SimpleSHLChunkFile *tmpPtr;
446 newPtr(tmpPtr,
447 dynamic_cast<const SimpleSHLChunkFile *>(this),
448 Thread::getCurrentLocalFlags());
450 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~Thread::getCurrentLocalFlags();
452 FieldContainerTransitPtr returnValue(tmpPtr);
454 return returnValue;
460 /*------------------------- constructors ----------------------------------*/
462 SimpleSHLChunkFileBase::SimpleSHLChunkFileBase(void) :
463 Inherited(),
464 _sfVertexProgramUrl (),
465 _sfGeometryProgramUrl (),
466 _sfFragmentProgramUrl ()
470 SimpleSHLChunkFileBase::SimpleSHLChunkFileBase(const SimpleSHLChunkFileBase &source) :
471 Inherited(source),
472 _sfVertexProgramUrl (source._sfVertexProgramUrl ),
473 _sfGeometryProgramUrl (source._sfGeometryProgramUrl ),
474 _sfFragmentProgramUrl (source._sfFragmentProgramUrl )
479 /*-------------------------- destructors ----------------------------------*/
481 SimpleSHLChunkFileBase::~SimpleSHLChunkFileBase(void)
486 GetFieldHandlePtr SimpleSHLChunkFileBase::getHandleVertexProgramUrl (void) const
488 SFString::GetHandlePtr returnValue(
489 new SFString::GetHandle(
490 &_sfVertexProgramUrl,
491 this->getType().getFieldDesc(VertexProgramUrlFieldId),
492 const_cast<SimpleSHLChunkFileBase *>(this)));
494 return returnValue;
497 EditFieldHandlePtr SimpleSHLChunkFileBase::editHandleVertexProgramUrl(void)
499 SFString::EditHandlePtr returnValue(
500 new SFString::EditHandle(
501 &_sfVertexProgramUrl,
502 this->getType().getFieldDesc(VertexProgramUrlFieldId),
503 this));
506 editSField(VertexProgramUrlFieldMask);
508 return returnValue;
511 GetFieldHandlePtr SimpleSHLChunkFileBase::getHandleGeometryProgramUrl (void) const
513 SFString::GetHandlePtr returnValue(
514 new SFString::GetHandle(
515 &_sfGeometryProgramUrl,
516 this->getType().getFieldDesc(GeometryProgramUrlFieldId),
517 const_cast<SimpleSHLChunkFileBase *>(this)));
519 return returnValue;
522 EditFieldHandlePtr SimpleSHLChunkFileBase::editHandleGeometryProgramUrl(void)
524 SFString::EditHandlePtr returnValue(
525 new SFString::EditHandle(
526 &_sfGeometryProgramUrl,
527 this->getType().getFieldDesc(GeometryProgramUrlFieldId),
528 this));
531 editSField(GeometryProgramUrlFieldMask);
533 return returnValue;
536 GetFieldHandlePtr SimpleSHLChunkFileBase::getHandleFragmentProgramUrl (void) const
538 SFString::GetHandlePtr returnValue(
539 new SFString::GetHandle(
540 &_sfFragmentProgramUrl,
541 this->getType().getFieldDesc(FragmentProgramUrlFieldId),
542 const_cast<SimpleSHLChunkFileBase *>(this)));
544 return returnValue;
547 EditFieldHandlePtr SimpleSHLChunkFileBase::editHandleFragmentProgramUrl(void)
549 SFString::EditHandlePtr returnValue(
550 new SFString::EditHandle(
551 &_sfFragmentProgramUrl,
552 this->getType().getFieldDesc(FragmentProgramUrlFieldId),
553 this));
556 editSField(FragmentProgramUrlFieldMask);
558 return returnValue;
562 #ifdef OSG_MT_CPTR_ASPECT
563 void SimpleSHLChunkFileBase::execSyncV( FieldContainer &oFrom,
564 ConstFieldMaskArg whichField,
565 AspectOffsetStore &oOffsets,
566 ConstFieldMaskArg syncMode,
567 const UInt32 uiSyncInfo)
569 SimpleSHLChunkFile *pThis = static_cast<SimpleSHLChunkFile *>(this);
571 pThis->execSync(static_cast<SimpleSHLChunkFile *>(&oFrom),
572 whichField,
573 oOffsets,
574 syncMode,
575 uiSyncInfo);
577 #endif
580 #ifdef OSG_MT_CPTR_ASPECT
581 FieldContainer *SimpleSHLChunkFileBase::createAspectCopy(
582 const FieldContainer *pRefAspect) const
584 SimpleSHLChunkFile *returnValue;
586 newAspectCopy(returnValue,
587 dynamic_cast<const SimpleSHLChunkFile *>(pRefAspect),
588 dynamic_cast<const SimpleSHLChunkFile *>(this));
590 return returnValue;
592 #endif
594 void SimpleSHLChunkFileBase::resolveLinks(void)
596 Inherited::resolveLinks();
602 OSG_END_NAMESPACE