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 SimpleSHLChunkFile!
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 "OSGSimpleSHLChunkFileBase.h"
67 #include "OSGSimpleSHLChunkFile.h"
69 #include <boost/bind.hpp>
73 /***************************************************************************\
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",
106 SimpleSHLChunkFile::getClassType(),
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(),
125 VertexProgramUrlFieldId
, VertexProgramUrlFieldMask
,
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
,
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
,
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(),
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
)),
171 "<?xml version=\"1.0\"?>\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"
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"
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"
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"
211 "</FieldContainer>\n",
215 /*------------------------------ get -----------------------------------*/
217 FieldContainerType
&SimpleSHLChunkFileBase::getType(void)
222 const FieldContainerType
&SimpleSHLChunkFileBase::getType(void) const
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();
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
);
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
);
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
);
389 SimpleSHLChunkFile
*SimpleSHLChunkFileBase::createEmptyLocal(BitVector bFlags
)
391 SimpleSHLChunkFile
*returnValue
;
393 newPtr
<SimpleSHLChunkFile
>(returnValue
, bFlags
);
395 returnValue
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
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();
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
;
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
;
442 FieldContainerTransitPtr
SimpleSHLChunkFileBase::shallowCopy(void) const
444 SimpleSHLChunkFile
*tmpPtr
;
447 dynamic_cast<const SimpleSHLChunkFile
*>(this),
448 Thread::getCurrentLocalFlags());
450 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~Thread::getCurrentLocalFlags();
452 FieldContainerTransitPtr
returnValue(tmpPtr
);
460 /*------------------------- constructors ----------------------------------*/
462 SimpleSHLChunkFileBase::SimpleSHLChunkFileBase(void) :
464 _sfVertexProgramUrl (),
465 _sfGeometryProgramUrl (),
466 _sfFragmentProgramUrl ()
470 SimpleSHLChunkFileBase::SimpleSHLChunkFileBase(const SimpleSHLChunkFileBase
&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)));
497 EditFieldHandlePtr
SimpleSHLChunkFileBase::editHandleVertexProgramUrl(void)
499 SFString::EditHandlePtr
returnValue(
500 new SFString::EditHandle(
501 &_sfVertexProgramUrl
,
502 this->getType().getFieldDesc(VertexProgramUrlFieldId
),
506 editSField(VertexProgramUrlFieldMask
);
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)));
522 EditFieldHandlePtr
SimpleSHLChunkFileBase::editHandleGeometryProgramUrl(void)
524 SFString::EditHandlePtr
returnValue(
525 new SFString::EditHandle(
526 &_sfGeometryProgramUrl
,
527 this->getType().getFieldDesc(GeometryProgramUrlFieldId
),
531 editSField(GeometryProgramUrlFieldMask
);
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)));
547 EditFieldHandlePtr
SimpleSHLChunkFileBase::editHandleFragmentProgramUrl(void)
549 SFString::EditHandlePtr
returnValue(
550 new SFString::EditHandle(
551 &_sfFragmentProgramUrl
,
552 this->getType().getFieldDesc(FragmentProgramUrlFieldId
),
556 editSField(FragmentProgramUrlFieldMask
);
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
),
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));
594 void SimpleSHLChunkFileBase::resolveLinks(void)
596 Inherited::resolveLinks();