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 PrimeMaterial!
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 "OSGPrimeMaterialBase.h"
67 #include "OSGPrimeMaterial.h"
69 #include <boost/bind.hpp>
73 /***************************************************************************\
75 \***************************************************************************/
77 /*! \class OSG::PrimeMaterial
81 /***************************************************************************\
82 * Field Documentation *
83 \***************************************************************************/
85 /*! \var UInt32 PrimeMaterialBase::_sfCoreGLChunkLimit
90 /***************************************************************************\
91 * FieldType/FieldTrait Instantiation *
92 \***************************************************************************/
94 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
95 PointerType FieldTraits
<PrimeMaterial
*, nsOSG
>::_type(
98 PrimeMaterial::getClassType(),
102 OSG_FIELDTRAITS_GETTYPE_NS(PrimeMaterial
*, nsOSG
)
104 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField
,
108 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField
,
112 /***************************************************************************\
113 * Field Description *
114 \***************************************************************************/
116 void PrimeMaterialBase::classDescInserter(TypeObject
&oType
)
118 FieldDescriptionBase
*pDesc
= NULL
;
121 pDesc
= new SFUInt32::Description(
122 SFUInt32::getClassType(),
125 CoreGLChunkLimitFieldId
, CoreGLChunkLimitFieldMask
,
127 (Field::SFDefaultFlags
| Field::FStdAccess
),
128 static_cast<FieldEditMethodSig
>(&PrimeMaterial::editHandleCoreGLChunkLimit
),
129 static_cast<FieldGetMethodSig
>(&PrimeMaterial::getHandleCoreGLChunkLimit
));
131 oType
.addInitialDesc(pDesc
);
135 PrimeMaterialBase::TypeObject
PrimeMaterialBase::_type(
136 PrimeMaterialBase::getClassname(),
137 Inherited::getClassname(),
141 reinterpret_cast<InitContainerF
>(&PrimeMaterial::initMethod
),
142 reinterpret_cast<ExitContainerF
>(&PrimeMaterial::exitMethod
),
143 reinterpret_cast<InitalInsertDescFunc
>(
144 reinterpret_cast<void *>(&PrimeMaterial::classDescInserter
)),
147 "<?xml version=\"1.0\"?>\n"
150 " name=\"PrimeMaterial\"\n"
151 " parent=\"Material\"\n"
152 " library=\"System\"\n"
153 " structure=\"abstract\"\n"
154 " pointerfieldtypes=\"both\"\n"
155 " systemcomponent=\"true\"\n"
156 " parentsystemcomponent=\"true\"\n"
157 " decoratable=\"false\"\n"
158 " useLocalIncludes=\"false\"\n"
159 " docGroupBase=\"GrpSystemMaterial\"\n"
162 "\t name=\"coreGLChunkLimit\"\n"
163 "\t type=\"UInt32\"\n"
164 "\t cardinality=\"single\"\n"
165 "\t visibility=\"external\"\n"
166 "\t defaultValue=\"4096\"\n"
167 "\t access=\"public\"\n"
170 "</FieldContainer>\n",
174 /*------------------------------ get -----------------------------------*/
176 FieldContainerType
&PrimeMaterialBase::getType(void)
181 const FieldContainerType
&PrimeMaterialBase::getType(void) const
186 UInt32
PrimeMaterialBase::getContainerSize(void) const
188 return sizeof(PrimeMaterial
);
191 /*------------------------- decorator get ------------------------------*/
194 SFUInt32
*PrimeMaterialBase::editSFCoreGLChunkLimit(void)
196 editSField(CoreGLChunkLimitFieldMask
);
198 return &_sfCoreGLChunkLimit
;
201 const SFUInt32
*PrimeMaterialBase::getSFCoreGLChunkLimit(void) const
203 return &_sfCoreGLChunkLimit
;
211 /*------------------------------ access -----------------------------------*/
213 SizeT
PrimeMaterialBase::getBinSize(ConstFieldMaskArg whichField
)
215 SizeT returnValue
= Inherited::getBinSize(whichField
);
217 if(FieldBits::NoField
!= (CoreGLChunkLimitFieldMask
& whichField
))
219 returnValue
+= _sfCoreGLChunkLimit
.getBinSize();
225 void PrimeMaterialBase::copyToBin(BinaryDataHandler
&pMem
,
226 ConstFieldMaskArg whichField
)
228 Inherited::copyToBin(pMem
, whichField
);
230 if(FieldBits::NoField
!= (CoreGLChunkLimitFieldMask
& whichField
))
232 _sfCoreGLChunkLimit
.copyToBin(pMem
);
236 void PrimeMaterialBase::copyFromBin(BinaryDataHandler
&pMem
,
237 ConstFieldMaskArg whichField
)
239 Inherited::copyFromBin(pMem
, whichField
);
241 if(FieldBits::NoField
!= (CoreGLChunkLimitFieldMask
& whichField
))
243 editSField(CoreGLChunkLimitFieldMask
);
244 _sfCoreGLChunkLimit
.copyFromBin(pMem
);
251 /*------------------------- constructors ----------------------------------*/
253 PrimeMaterialBase::PrimeMaterialBase(void) :
255 _sfCoreGLChunkLimit (UInt32(4096))
259 PrimeMaterialBase::PrimeMaterialBase(const PrimeMaterialBase
&source
) :
261 _sfCoreGLChunkLimit (source
._sfCoreGLChunkLimit
)
266 /*-------------------------- destructors ----------------------------------*/
268 PrimeMaterialBase::~PrimeMaterialBase(void)
273 GetFieldHandlePtr
PrimeMaterialBase::getHandleCoreGLChunkLimit (void) const
275 SFUInt32::GetHandlePtr
returnValue(
276 new SFUInt32::GetHandle(
277 &_sfCoreGLChunkLimit
,
278 this->getType().getFieldDesc(CoreGLChunkLimitFieldId
),
279 const_cast<PrimeMaterialBase
*>(this)));
284 EditFieldHandlePtr
PrimeMaterialBase::editHandleCoreGLChunkLimit(void)
286 SFUInt32::EditHandlePtr
returnValue(
287 new SFUInt32::EditHandle(
288 &_sfCoreGLChunkLimit
,
289 this->getType().getFieldDesc(CoreGLChunkLimitFieldId
),
293 editSField(CoreGLChunkLimitFieldMask
);
299 #ifdef OSG_MT_CPTR_ASPECT
300 void PrimeMaterialBase::execSyncV( FieldContainer
&oFrom
,
301 ConstFieldMaskArg whichField
,
302 AspectOffsetStore
&oOffsets
,
303 ConstFieldMaskArg syncMode
,
304 const UInt32 uiSyncInfo
)
306 PrimeMaterial
*pThis
= static_cast<PrimeMaterial
*>(this);
308 pThis
->execSync(static_cast<PrimeMaterial
*>(&oFrom
),
318 void PrimeMaterialBase::resolveLinks(void)
320 Inherited::resolveLinks();