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 DSLightChunk!
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 "OSGDSLightChunkBase.h"
67 #include "OSGDSLightChunk.h"
69 #include <boost/bind.hpp>
73 /***************************************************************************\
75 \***************************************************************************/
77 /*! \class OSG::DSLightChunk
81 /***************************************************************************\
82 * Field Documentation *
83 \***************************************************************************/
85 /*! \var Real32 DSLightChunkBase::_sfEffectiveRange
90 /***************************************************************************\
91 * FieldType/FieldTrait Instantiation *
92 \***************************************************************************/
94 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
95 PointerType FieldTraits
<DSLightChunk
*, nsOSG
>::_type(
98 DSLightChunk::getClassType(),
102 OSG_FIELDTRAITS_GETTYPE_NS(DSLightChunk
*, nsOSG
)
104 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField
,
108 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField
,
112 /***************************************************************************\
113 * Field Description *
114 \***************************************************************************/
116 void DSLightChunkBase::classDescInserter(TypeObject
&oType
)
118 FieldDescriptionBase
*pDesc
= NULL
;
121 pDesc
= new SFReal32::Description(
122 SFReal32::getClassType(),
125 EffectiveRangeFieldId
, EffectiveRangeFieldMask
,
127 (Field::SFDefaultFlags
| Field::FStdAccess
),
128 static_cast<FieldEditMethodSig
>(&DSLightChunk::editHandleEffectiveRange
),
129 static_cast<FieldGetMethodSig
>(&DSLightChunk::getHandleEffectiveRange
));
131 oType
.addInitialDesc(pDesc
);
135 DSLightChunkBase::TypeObject
DSLightChunkBase::_type(
136 DSLightChunkBase::getClassname(),
137 Inherited::getClassname(),
140 reinterpret_cast<PrototypeCreateF
>(&DSLightChunkBase::createEmptyLocal
),
141 reinterpret_cast<InitContainerF
>(&DSLightChunk::initMethod
),
142 reinterpret_cast<ExitContainerF
>(&DSLightChunk::exitMethod
),
143 reinterpret_cast<InitalInsertDescFunc
>(
144 reinterpret_cast<void *>(&DSLightChunk::classDescInserter
)),
147 "<?xml version=\"1.0\" ?>\n"
150 " name=\"DSLightChunk\"\n"
151 " parent=\"LightChunk\"\n"
152 " library=\"EffectGroups\"\n"
153 " structure=\"concrete\"\n"
154 " pointerfieldtypes=\"both\"\n"
155 " systemcomponent=\"true\"\n"
156 " parentsystemcomponent=\"true\"\n"
157 " docGroupBase=\"GrpEffectsGroupsDeferredShading\"\n"
160 " name=\"effectiveRange\"\n"
161 " category=\"data\"\n"
163 " cardinality=\"single\"\n"
164 " visibility=\"external\"\n"
165 " defaultValue=\"0.f\"\n"
166 " access=\"public\"\n"
169 "</FieldContainer>\n",
173 /*------------------------------ get -----------------------------------*/
175 FieldContainerType
&DSLightChunkBase::getType(void)
180 const FieldContainerType
&DSLightChunkBase::getType(void) const
185 UInt32
DSLightChunkBase::getContainerSize(void) const
187 return sizeof(DSLightChunk
);
190 /*------------------------- decorator get ------------------------------*/
193 SFReal32
*DSLightChunkBase::editSFEffectiveRange(void)
195 editSField(EffectiveRangeFieldMask
);
197 return &_sfEffectiveRange
;
200 const SFReal32
*DSLightChunkBase::getSFEffectiveRange(void) const
202 return &_sfEffectiveRange
;
210 /*------------------------------ access -----------------------------------*/
212 SizeT
DSLightChunkBase::getBinSize(ConstFieldMaskArg whichField
)
214 SizeT returnValue
= Inherited::getBinSize(whichField
);
216 if(FieldBits::NoField
!= (EffectiveRangeFieldMask
& whichField
))
218 returnValue
+= _sfEffectiveRange
.getBinSize();
224 void DSLightChunkBase::copyToBin(BinaryDataHandler
&pMem
,
225 ConstFieldMaskArg whichField
)
227 Inherited::copyToBin(pMem
, whichField
);
229 if(FieldBits::NoField
!= (EffectiveRangeFieldMask
& whichField
))
231 _sfEffectiveRange
.copyToBin(pMem
);
235 void DSLightChunkBase::copyFromBin(BinaryDataHandler
&pMem
,
236 ConstFieldMaskArg whichField
)
238 Inherited::copyFromBin(pMem
, whichField
);
240 if(FieldBits::NoField
!= (EffectiveRangeFieldMask
& whichField
))
242 editSField(EffectiveRangeFieldMask
);
243 _sfEffectiveRange
.copyFromBin(pMem
);
247 //! create a new instance of the class
248 DSLightChunkTransitPtr
DSLightChunkBase::createLocal(BitVector bFlags
)
250 DSLightChunkTransitPtr fc
;
252 if(getClassType().getPrototype() != NULL
)
254 FieldContainerTransitPtr tmpPtr
=
255 getClassType().getPrototype()-> shallowCopyLocal(bFlags
);
257 fc
= dynamic_pointer_cast
<DSLightChunk
>(tmpPtr
);
263 //! create a new instance of the class, copy the container flags
264 DSLightChunkTransitPtr
DSLightChunkBase::createDependent(BitVector bFlags
)
266 DSLightChunkTransitPtr fc
;
268 if(getClassType().getPrototype() != NULL
)
270 FieldContainerTransitPtr tmpPtr
=
271 getClassType().getPrototype()-> shallowCopyDependent(bFlags
);
273 fc
= dynamic_pointer_cast
<DSLightChunk
>(tmpPtr
);
279 //! create a new instance of the class
280 DSLightChunkTransitPtr
DSLightChunkBase::create(void)
282 DSLightChunkTransitPtr fc
;
284 if(getClassType().getPrototype() != NULL
)
286 FieldContainerTransitPtr tmpPtr
=
287 getClassType().getPrototype()-> shallowCopy();
289 fc
= dynamic_pointer_cast
<DSLightChunk
>(tmpPtr
);
295 DSLightChunk
*DSLightChunkBase::createEmptyLocal(BitVector bFlags
)
297 DSLightChunk
*returnValue
;
299 newPtr
<DSLightChunk
>(returnValue
, bFlags
);
301 returnValue
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
306 //! create an empty new instance of the class, do not copy the prototype
307 DSLightChunk
*DSLightChunkBase::createEmpty(void)
309 DSLightChunk
*returnValue
;
311 newPtr
<DSLightChunk
>(returnValue
, Thread::getCurrentLocalFlags());
313 returnValue
->_pFieldFlags
->_bNamespaceMask
&=
314 ~Thread::getCurrentLocalFlags();
320 FieldContainerTransitPtr
DSLightChunkBase::shallowCopyLocal(
321 BitVector bFlags
) const
323 DSLightChunk
*tmpPtr
;
325 newPtr(tmpPtr
, dynamic_cast<const DSLightChunk
*>(this), bFlags
);
327 FieldContainerTransitPtr
returnValue(tmpPtr
);
329 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
334 FieldContainerTransitPtr
DSLightChunkBase::shallowCopyDependent(
335 BitVector bFlags
) const
337 DSLightChunk
*tmpPtr
;
339 newPtr(tmpPtr
, dynamic_cast<const DSLightChunk
*>(this), ~bFlags
);
341 FieldContainerTransitPtr
returnValue(tmpPtr
);
343 tmpPtr
->_pFieldFlags
->_bNamespaceMask
= bFlags
;
348 FieldContainerTransitPtr
DSLightChunkBase::shallowCopy(void) const
350 DSLightChunk
*tmpPtr
;
353 dynamic_cast<const DSLightChunk
*>(this),
354 Thread::getCurrentLocalFlags());
356 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~Thread::getCurrentLocalFlags();
358 FieldContainerTransitPtr
returnValue(tmpPtr
);
366 /*------------------------- constructors ----------------------------------*/
368 DSLightChunkBase::DSLightChunkBase(void) :
370 _sfEffectiveRange (Real32(0.f
))
374 DSLightChunkBase::DSLightChunkBase(const DSLightChunkBase
&source
) :
376 _sfEffectiveRange (source
._sfEffectiveRange
)
381 /*-------------------------- destructors ----------------------------------*/
383 DSLightChunkBase::~DSLightChunkBase(void)
388 GetFieldHandlePtr
DSLightChunkBase::getHandleEffectiveRange (void) const
390 SFReal32::GetHandlePtr
returnValue(
391 new SFReal32::GetHandle(
393 this->getType().getFieldDesc(EffectiveRangeFieldId
),
394 const_cast<DSLightChunkBase
*>(this)));
399 EditFieldHandlePtr
DSLightChunkBase::editHandleEffectiveRange (void)
401 SFReal32::EditHandlePtr
returnValue(
402 new SFReal32::EditHandle(
404 this->getType().getFieldDesc(EffectiveRangeFieldId
),
408 editSField(EffectiveRangeFieldMask
);
414 #ifdef OSG_MT_CPTR_ASPECT
415 void DSLightChunkBase::execSyncV( FieldContainer
&oFrom
,
416 ConstFieldMaskArg whichField
,
417 AspectOffsetStore
&oOffsets
,
418 ConstFieldMaskArg syncMode
,
419 const UInt32 uiSyncInfo
)
421 DSLightChunk
*pThis
= static_cast<DSLightChunk
*>(this);
423 pThis
->execSync(static_cast<DSLightChunk
*>(&oFrom
),
432 #ifdef OSG_MT_CPTR_ASPECT
433 FieldContainer
*DSLightChunkBase::createAspectCopy(
434 const FieldContainer
*pRefAspect
) const
436 DSLightChunk
*returnValue
;
438 newAspectCopy(returnValue
,
439 dynamic_cast<const DSLightChunk
*>(pRefAspect
),
440 dynamic_cast<const DSLightChunk
*>(this));
446 void DSLightChunkBase::resolveLinks(void)
448 Inherited::resolveLinks();