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 ShaderVariableFunctor!
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 "OSGShaderVariableFunctorBase.h"
67 #include "OSGShaderVariableFunctor.h"
69 #include <boost/bind.hpp>
73 /***************************************************************************\
75 \***************************************************************************/
77 /*! \class OSG::ShaderVariableFunctor
81 /***************************************************************************\
82 * Field Documentation *
83 \***************************************************************************/
86 /***************************************************************************\
87 * FieldType/FieldTrait Instantiation *
88 \***************************************************************************/
90 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
91 PointerType FieldTraits
<ShaderVariableFunctor
*, nsOSG
>::_type(
92 "ShaderVariableFunctorPtr",
93 "ShaderProcVariablePtr",
94 ShaderVariableFunctor::getClassType(),
98 OSG_FIELDTRAITS_GETTYPE_NS(ShaderVariableFunctor
*, nsOSG
)
100 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField
,
101 ShaderVariableFunctor
*,
104 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField
,
105 ShaderVariableFunctor
*,
108 /***************************************************************************\
109 * Field Description *
110 \***************************************************************************/
112 void ShaderVariableFunctorBase::classDescInserter(TypeObject
&oType
)
117 ShaderVariableFunctorBase::TypeObject
ShaderVariableFunctorBase::_type(
118 ShaderVariableFunctorBase::getClassname(),
119 Inherited::getClassname(),
122 reinterpret_cast<PrototypeCreateF
>(&ShaderVariableFunctorBase::createEmptyLocal
),
123 reinterpret_cast<InitContainerF
>(&ShaderVariableFunctor::initMethod
),
124 reinterpret_cast<ExitContainerF
>(&ShaderVariableFunctor::exitMethod
),
125 reinterpret_cast<InitalInsertDescFunc
>(
126 reinterpret_cast<void *>(&ShaderVariableFunctor::classDescInserter
)),
129 "<?xml version=\"1.0\"?>\n"
132 " name=\"ShaderVariableFunctor\"\n"
133 " parent=\"ShaderProcVariable\"\n"
134 " library=\"System\"\n"
135 " pointerfieldtypes=\"both\"\n"
136 " structure=\"concrete\"\n"
137 " systemcomponent=\"true\"\n"
138 " parentsystemcomponent=\"true\"\n"
139 " decoratable=\"false\"\n"
140 " useLocalIncludes=\"false\"\n"
141 " docGroupBase=\"GrpSystemShader\"\n"
143 "</FieldContainer>\n",
147 /*------------------------------ get -----------------------------------*/
149 FieldContainerType
&ShaderVariableFunctorBase::getType(void)
154 const FieldContainerType
&ShaderVariableFunctorBase::getType(void) const
159 UInt32
ShaderVariableFunctorBase::getContainerSize(void) const
161 return sizeof(ShaderVariableFunctor
);
164 /*------------------------- decorator get ------------------------------*/
171 /*------------------------------ access -----------------------------------*/
173 SizeT
ShaderVariableFunctorBase::getBinSize(ConstFieldMaskArg whichField
)
175 SizeT returnValue
= Inherited::getBinSize(whichField
);
181 void ShaderVariableFunctorBase::copyToBin(BinaryDataHandler
&pMem
,
182 ConstFieldMaskArg whichField
)
184 Inherited::copyToBin(pMem
, whichField
);
188 void ShaderVariableFunctorBase::copyFromBin(BinaryDataHandler
&pMem
,
189 ConstFieldMaskArg whichField
)
191 Inherited::copyFromBin(pMem
, whichField
);
195 //! create a new instance of the class
196 ShaderVariableFunctorTransitPtr
ShaderVariableFunctorBase::createLocal(BitVector bFlags
)
198 ShaderVariableFunctorTransitPtr fc
;
200 if(getClassType().getPrototype() != NULL
)
202 FieldContainerTransitPtr tmpPtr
=
203 getClassType().getPrototype()-> shallowCopyLocal(bFlags
);
205 fc
= dynamic_pointer_cast
<ShaderVariableFunctor
>(tmpPtr
);
211 //! create a new instance of the class, copy the container flags
212 ShaderVariableFunctorTransitPtr
ShaderVariableFunctorBase::createDependent(BitVector bFlags
)
214 ShaderVariableFunctorTransitPtr fc
;
216 if(getClassType().getPrototype() != NULL
)
218 FieldContainerTransitPtr tmpPtr
=
219 getClassType().getPrototype()-> shallowCopyDependent(bFlags
);
221 fc
= dynamic_pointer_cast
<ShaderVariableFunctor
>(tmpPtr
);
227 //! create a new instance of the class
228 ShaderVariableFunctorTransitPtr
ShaderVariableFunctorBase::create(void)
230 ShaderVariableFunctorTransitPtr fc
;
232 if(getClassType().getPrototype() != NULL
)
234 FieldContainerTransitPtr tmpPtr
=
235 getClassType().getPrototype()-> shallowCopy();
237 fc
= dynamic_pointer_cast
<ShaderVariableFunctor
>(tmpPtr
);
243 ShaderVariableFunctor
*ShaderVariableFunctorBase::createEmptyLocal(BitVector bFlags
)
245 ShaderVariableFunctor
*returnValue
;
247 newPtr
<ShaderVariableFunctor
>(returnValue
, bFlags
);
249 returnValue
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
254 //! create an empty new instance of the class, do not copy the prototype
255 ShaderVariableFunctor
*ShaderVariableFunctorBase::createEmpty(void)
257 ShaderVariableFunctor
*returnValue
;
259 newPtr
<ShaderVariableFunctor
>(returnValue
, Thread::getCurrentLocalFlags());
261 returnValue
->_pFieldFlags
->_bNamespaceMask
&=
262 ~Thread::getCurrentLocalFlags();
268 FieldContainerTransitPtr
ShaderVariableFunctorBase::shallowCopyLocal(
269 BitVector bFlags
) const
271 ShaderVariableFunctor
*tmpPtr
;
273 newPtr(tmpPtr
, dynamic_cast<const ShaderVariableFunctor
*>(this), bFlags
);
275 FieldContainerTransitPtr
returnValue(tmpPtr
);
277 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
282 FieldContainerTransitPtr
ShaderVariableFunctorBase::shallowCopyDependent(
283 BitVector bFlags
) const
285 ShaderVariableFunctor
*tmpPtr
;
287 newPtr(tmpPtr
, dynamic_cast<const ShaderVariableFunctor
*>(this), ~bFlags
);
289 FieldContainerTransitPtr
returnValue(tmpPtr
);
291 tmpPtr
->_pFieldFlags
->_bNamespaceMask
= bFlags
;
296 FieldContainerTransitPtr
ShaderVariableFunctorBase::shallowCopy(void) const
298 ShaderVariableFunctor
*tmpPtr
;
301 dynamic_cast<const ShaderVariableFunctor
*>(this),
302 Thread::getCurrentLocalFlags());
304 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~Thread::getCurrentLocalFlags();
306 FieldContainerTransitPtr
returnValue(tmpPtr
);
314 /*------------------------- constructors ----------------------------------*/
316 ShaderVariableFunctorBase::ShaderVariableFunctorBase(void) :
321 ShaderVariableFunctorBase::ShaderVariableFunctorBase(const ShaderVariableFunctorBase
&source
) :
327 /*-------------------------- destructors ----------------------------------*/
329 ShaderVariableFunctorBase::~ShaderVariableFunctorBase(void)
335 #ifdef OSG_MT_CPTR_ASPECT
336 void ShaderVariableFunctorBase::execSyncV( FieldContainer
&oFrom
,
337 ConstFieldMaskArg whichField
,
338 AspectOffsetStore
&oOffsets
,
339 ConstFieldMaskArg syncMode
,
340 const UInt32 uiSyncInfo
)
342 ShaderVariableFunctor
*pThis
= static_cast<ShaderVariableFunctor
*>(this);
344 pThis
->execSync(static_cast<ShaderVariableFunctor
*>(&oFrom
),
353 #ifdef OSG_MT_CPTR_ASPECT
354 FieldContainer
*ShaderVariableFunctorBase::createAspectCopy(
355 const FieldContainer
*pRefAspect
) const
357 ShaderVariableFunctor
*returnValue
;
359 newAspectCopy(returnValue
,
360 dynamic_cast<const ShaderVariableFunctor
*>(pRefAspect
),
361 dynamic_cast<const ShaderVariableFunctor
*>(this));
367 void ShaderVariableFunctorBase::resolveLinks(void)
369 Inherited::resolveLinks();