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 ShaderVariable!
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 "OSGShaderVariableBase.h"
67 #include "OSGShaderVariable.h"
69 #include <boost/bind.hpp>
73 /***************************************************************************\
75 \***************************************************************************/
77 /*! \class OSG::ShaderVariable
81 /***************************************************************************\
82 * Field Documentation *
83 \***************************************************************************/
85 /*! \var std::string ShaderVariableBase::_sfName
90 /***************************************************************************\
91 * FieldType/FieldTrait Instantiation *
92 \***************************************************************************/
94 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
95 PointerType FieldTraits
<ShaderVariable
*, nsOSG
>::_type(
98 ShaderVariable::getClassType(),
102 OSG_FIELDTRAITS_GETTYPE_NS(ShaderVariable
*, nsOSG
)
104 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField
,
108 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField
,
112 DataType
&FieldTraits
< ShaderVariable
*, nsOSG
+ 1 >::getType(void)
114 return FieldTraits
<ShaderVariable
*, nsOSG
>::getType();
118 OSG_EXPORT_PTR_MFIELD(ChildPointerMField
,
120 UnrecordedRefCountPolicy
,
124 /***************************************************************************\
125 * Field Description *
126 \***************************************************************************/
128 void ShaderVariableBase::classDescInserter(TypeObject
&oType
)
130 FieldDescriptionBase
*pDesc
= NULL
;
133 pDesc
= new SFString::Description(
134 SFString::getClassType(),
137 NameFieldId
, NameFieldMask
,
139 (Field::SFDefaultFlags
| Field::FStdAccess
),
140 static_cast<FieldEditMethodSig
>(&ShaderVariable::editHandleName
),
141 static_cast<FieldGetMethodSig
>(&ShaderVariable::getHandleName
));
143 oType
.addInitialDesc(pDesc
);
147 ShaderVariableBase::TypeObject
ShaderVariableBase::_type(
148 ShaderVariableBase::getClassname(),
149 Inherited::getClassname(),
153 reinterpret_cast<InitContainerF
>(&ShaderVariable::initMethod
),
154 reinterpret_cast<ExitContainerF
>(&ShaderVariable::exitMethod
),
155 reinterpret_cast<InitalInsertDescFunc
>(
156 reinterpret_cast<void *>(&ShaderVariable::classDescInserter
)),
159 "<?xml version=\"1.0\"?>\n"
162 " name=\"ShaderVariable\"\n"
163 " parent=\"FieldContainer\"\n"
164 " library=\"System\"\n"
165 " pointerfieldtypes=\"both\"\n"
166 " structure=\"abstract\"\n"
167 " systemcomponent=\"true\"\n"
168 " parentsystemcomponent=\"true\"\n"
169 " decoratable=\"false\"\n"
170 " useLocalIncludes=\"false\"\n"
171 " childFields=\"multi\"\n"
172 " docGroupBase=\"GrpSystemShader\"\n"
176 " type=\"std::string\"\n"
177 " cardinality=\"single\"\n"
178 " visibility=\"external\"\n"
179 " access=\"protected\"\n"
183 "</FieldContainer>\n",
187 /*------------------------------ get -----------------------------------*/
189 FieldContainerType
&ShaderVariableBase::getType(void)
194 const FieldContainerType
&ShaderVariableBase::getType(void) const
199 UInt32
ShaderVariableBase::getContainerSize(void) const
201 return sizeof(ShaderVariable
);
204 /*------------------------- decorator get ------------------------------*/
207 SFString
*ShaderVariableBase::editSFName(void)
209 editSField(NameFieldMask
);
214 const SFString
*ShaderVariableBase::getSFName(void) const
224 /*------------------------------ access -----------------------------------*/
226 SizeT
ShaderVariableBase::getBinSize(ConstFieldMaskArg whichField
)
228 SizeT returnValue
= Inherited::getBinSize(whichField
);
230 if(FieldBits::NoField
!= (NameFieldMask
& whichField
))
232 returnValue
+= _sfName
.getBinSize();
238 void ShaderVariableBase::copyToBin(BinaryDataHandler
&pMem
,
239 ConstFieldMaskArg whichField
)
241 Inherited::copyToBin(pMem
, whichField
);
243 if(FieldBits::NoField
!= (NameFieldMask
& whichField
))
245 _sfName
.copyToBin(pMem
);
249 void ShaderVariableBase::copyFromBin(BinaryDataHandler
&pMem
,
250 ConstFieldMaskArg whichField
)
252 Inherited::copyFromBin(pMem
, whichField
);
254 if(FieldBits::NoField
!= (NameFieldMask
& whichField
))
256 editSField(NameFieldMask
);
257 _sfName
.copyFromBin(pMem
);
264 /*------------------------- constructors ----------------------------------*/
266 ShaderVariableBase::ShaderVariableBase(void) :
272 ShaderVariableBase::ShaderVariableBase(const ShaderVariableBase
&source
) :
274 _sfName (source
._sfName
)
279 /*-------------------------- destructors ----------------------------------*/
281 ShaderVariableBase::~ShaderVariableBase(void)
286 GetFieldHandlePtr
ShaderVariableBase::getHandleName (void) const
288 SFString::GetHandlePtr
returnValue(
289 new SFString::GetHandle(
291 this->getType().getFieldDesc(NameFieldId
),
292 const_cast<ShaderVariableBase
*>(this)));
297 EditFieldHandlePtr
ShaderVariableBase::editHandleName (void)
299 SFString::EditHandlePtr
returnValue(
300 new SFString::EditHandle(
302 this->getType().getFieldDesc(NameFieldId
),
306 editSField(NameFieldMask
);
312 #ifdef OSG_MT_CPTR_ASPECT
313 void ShaderVariableBase::execSyncV( FieldContainer
&oFrom
,
314 ConstFieldMaskArg whichField
,
315 AspectOffsetStore
&oOffsets
,
316 ConstFieldMaskArg syncMode
,
317 const UInt32 uiSyncInfo
)
319 ShaderVariable
*pThis
= static_cast<ShaderVariable
*>(this);
321 pThis
->execSync(static_cast<ShaderVariable
*>(&oFrom
),
331 void ShaderVariableBase::resolveLinks(void)
333 Inherited::resolveLinks();