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 TwoSidedLightingChunk!
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 "OSGTwoSidedLightingChunkBase.h"
67 #include "OSGTwoSidedLightingChunk.h"
69 #include <boost/bind.hpp>
73 /***************************************************************************\
75 \***************************************************************************/
77 /*! \class OSG::TwoSidedLightingChunk
81 /***************************************************************************\
82 * Field Documentation *
83 \***************************************************************************/
86 /***************************************************************************\
87 * FieldType/FieldTrait Instantiation *
88 \***************************************************************************/
90 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
91 PointerType FieldTraits
<TwoSidedLightingChunk
*, nsOSG
>::_type(
92 "TwoSidedLightingChunkPtr",
94 TwoSidedLightingChunk::getClassType(),
98 OSG_FIELDTRAITS_GETTYPE_NS(TwoSidedLightingChunk
*, nsOSG
)
100 /***************************************************************************\
101 * Field Description *
102 \***************************************************************************/
104 void TwoSidedLightingChunkBase::classDescInserter(TypeObject
&oType
)
109 TwoSidedLightingChunkBase::TypeObject
TwoSidedLightingChunkBase::_type(
110 TwoSidedLightingChunkBase::getClassname(),
111 Inherited::getClassname(),
114 reinterpret_cast<PrototypeCreateF
>(&TwoSidedLightingChunkBase::createEmptyLocal
),
115 reinterpret_cast<InitContainerF
>(&TwoSidedLightingChunk::initMethod
),
116 reinterpret_cast<ExitContainerF
>(&TwoSidedLightingChunk::exitMethod
),
117 reinterpret_cast<InitalInsertDescFunc
>(
118 reinterpret_cast<void *>(&TwoSidedLightingChunk::classDescInserter
)),
121 "<?xml version=\"1.0\"?>\n"
124 " name=\"TwoSidedLightingChunk\"\n"
125 " parent=\"StateChunk\"\n"
126 " library=\"State\"\n"
127 " pointerfieldtypes=\"none\"\n"
128 " structure=\"concrete\"\n"
129 " systemcomponent=\"true\"\n"
130 " parentsystemcomponent=\"true\"\n"
131 " decoratable=\"false\"\n"
132 " useLocalIncludes=\"false\"\n"
133 " docGroupBase=\"GrpStateOpenGL\"\n"
135 "</FieldContainer>\n",
139 /*------------------------------ get -----------------------------------*/
141 FieldContainerType
&TwoSidedLightingChunkBase::getType(void)
146 const FieldContainerType
&TwoSidedLightingChunkBase::getType(void) const
151 UInt32
TwoSidedLightingChunkBase::getContainerSize(void) const
153 return sizeof(TwoSidedLightingChunk
);
156 /*------------------------- decorator get ------------------------------*/
163 /*------------------------------ access -----------------------------------*/
165 SizeT
TwoSidedLightingChunkBase::getBinSize(ConstFieldMaskArg whichField
)
167 SizeT returnValue
= Inherited::getBinSize(whichField
);
173 void TwoSidedLightingChunkBase::copyToBin(BinaryDataHandler
&pMem
,
174 ConstFieldMaskArg whichField
)
176 Inherited::copyToBin(pMem
, whichField
);
180 void TwoSidedLightingChunkBase::copyFromBin(BinaryDataHandler
&pMem
,
181 ConstFieldMaskArg whichField
)
183 Inherited::copyFromBin(pMem
, whichField
);
187 //! create a new instance of the class
188 TwoSidedLightingChunkTransitPtr
TwoSidedLightingChunkBase::createLocal(BitVector bFlags
)
190 TwoSidedLightingChunkTransitPtr fc
;
192 if(getClassType().getPrototype() != NULL
)
194 FieldContainerTransitPtr tmpPtr
=
195 getClassType().getPrototype()-> shallowCopyLocal(bFlags
);
197 fc
= dynamic_pointer_cast
<TwoSidedLightingChunk
>(tmpPtr
);
203 //! create a new instance of the class, copy the container flags
204 TwoSidedLightingChunkTransitPtr
TwoSidedLightingChunkBase::createDependent(BitVector bFlags
)
206 TwoSidedLightingChunkTransitPtr fc
;
208 if(getClassType().getPrototype() != NULL
)
210 FieldContainerTransitPtr tmpPtr
=
211 getClassType().getPrototype()-> shallowCopyDependent(bFlags
);
213 fc
= dynamic_pointer_cast
<TwoSidedLightingChunk
>(tmpPtr
);
219 //! create a new instance of the class
220 TwoSidedLightingChunkTransitPtr
TwoSidedLightingChunkBase::create(void)
222 TwoSidedLightingChunkTransitPtr fc
;
224 if(getClassType().getPrototype() != NULL
)
226 FieldContainerTransitPtr tmpPtr
=
227 getClassType().getPrototype()-> shallowCopy();
229 fc
= dynamic_pointer_cast
<TwoSidedLightingChunk
>(tmpPtr
);
235 TwoSidedLightingChunk
*TwoSidedLightingChunkBase::createEmptyLocal(BitVector bFlags
)
237 TwoSidedLightingChunk
*returnValue
;
239 newPtr
<TwoSidedLightingChunk
>(returnValue
, bFlags
);
241 returnValue
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
246 //! create an empty new instance of the class, do not copy the prototype
247 TwoSidedLightingChunk
*TwoSidedLightingChunkBase::createEmpty(void)
249 TwoSidedLightingChunk
*returnValue
;
251 newPtr
<TwoSidedLightingChunk
>(returnValue
, Thread::getCurrentLocalFlags());
253 returnValue
->_pFieldFlags
->_bNamespaceMask
&=
254 ~Thread::getCurrentLocalFlags();
260 FieldContainerTransitPtr
TwoSidedLightingChunkBase::shallowCopyLocal(
261 BitVector bFlags
) const
263 TwoSidedLightingChunk
*tmpPtr
;
265 newPtr(tmpPtr
, dynamic_cast<const TwoSidedLightingChunk
*>(this), bFlags
);
267 FieldContainerTransitPtr
returnValue(tmpPtr
);
269 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
274 FieldContainerTransitPtr
TwoSidedLightingChunkBase::shallowCopyDependent(
275 BitVector bFlags
) const
277 TwoSidedLightingChunk
*tmpPtr
;
279 newPtr(tmpPtr
, dynamic_cast<const TwoSidedLightingChunk
*>(this), ~bFlags
);
281 FieldContainerTransitPtr
returnValue(tmpPtr
);
283 tmpPtr
->_pFieldFlags
->_bNamespaceMask
= bFlags
;
288 FieldContainerTransitPtr
TwoSidedLightingChunkBase::shallowCopy(void) const
290 TwoSidedLightingChunk
*tmpPtr
;
293 dynamic_cast<const TwoSidedLightingChunk
*>(this),
294 Thread::getCurrentLocalFlags());
296 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~Thread::getCurrentLocalFlags();
298 FieldContainerTransitPtr
returnValue(tmpPtr
);
306 /*------------------------- constructors ----------------------------------*/
308 TwoSidedLightingChunkBase::TwoSidedLightingChunkBase(void) :
313 TwoSidedLightingChunkBase::TwoSidedLightingChunkBase(const TwoSidedLightingChunkBase
&source
) :
319 /*-------------------------- destructors ----------------------------------*/
321 TwoSidedLightingChunkBase::~TwoSidedLightingChunkBase(void)
327 #ifdef OSG_MT_CPTR_ASPECT
328 void TwoSidedLightingChunkBase::execSyncV( FieldContainer
&oFrom
,
329 ConstFieldMaskArg whichField
,
330 AspectOffsetStore
&oOffsets
,
331 ConstFieldMaskArg syncMode
,
332 const UInt32 uiSyncInfo
)
334 TwoSidedLightingChunk
*pThis
= static_cast<TwoSidedLightingChunk
*>(this);
336 pThis
->execSync(static_cast<TwoSidedLightingChunk
*>(&oFrom
),
345 #ifdef OSG_MT_CPTR_ASPECT
346 FieldContainer
*TwoSidedLightingChunkBase::createAspectCopy(
347 const FieldContainer
*pRefAspect
) const
349 TwoSidedLightingChunk
*returnValue
;
351 newAspectCopy(returnValue
,
352 dynamic_cast<const TwoSidedLightingChunk
*>(pRefAspect
),
353 dynamic_cast<const TwoSidedLightingChunk
*>(this));
359 void TwoSidedLightingChunkBase::resolveLinks(void)
361 Inherited::resolveLinks();