changed: gcc8 base update
[opensg.git] / Source / System / Material / Base / OSGPrimeMaterialBase.cpp
blobf87cc48dc2ead445837bccce1572b388742cabfd
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2000-2013 by the OpenSG Forum *
6 * *
7 * www.opensg.org *
8 * *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, carsten_neumann@gmx.net *
10 * *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
13 * License *
14 * *
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. *
18 * *
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. *
23 * *
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. *
27 * *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
30 * Changes *
31 * *
32 * *
33 * *
34 * *
35 * *
36 * *
37 \*---------------------------------------------------------------------------*/
39 /*****************************************************************************\
40 *****************************************************************************
41 ** **
42 ** This file is automatically generated. **
43 ** **
44 ** Any changes made to this file WILL be lost when it is **
45 ** regenerated, which can become necessary at any time. **
46 ** **
47 ** Do not change this file, changes should be done in the derived **
48 ** class PrimeMaterial!
49 ** **
50 *****************************************************************************
51 \*****************************************************************************/
53 #include <cstdlib>
54 #include <cstdio>
56 #ifdef WIN32
57 #pragma warning(disable: 4355) // turn off 'this' : used in base member initializer list warning
58 #pragma warning(disable: 4290) // disable exception specification warning
59 #endif
61 #include "OSGConfig.h"
66 #include "OSGPrimeMaterialBase.h"
67 #include "OSGPrimeMaterial.h"
69 #include <boost/bind.hpp>
71 OSG_BEGIN_NAMESPACE
73 /***************************************************************************\
74 * Description *
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(
96 "PrimeMaterialPtr",
97 "MaterialPtr",
98 PrimeMaterial::getClassType(),
99 nsOSG);
100 #endif
102 OSG_FIELDTRAITS_GETTYPE_NS(PrimeMaterial *, nsOSG)
104 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField,
105 PrimeMaterial *,
106 nsOSG)
108 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField,
109 PrimeMaterial *,
110 nsOSG)
112 /***************************************************************************\
113 * Field Description *
114 \***************************************************************************/
116 void PrimeMaterialBase::classDescInserter(TypeObject &oType)
118 FieldDescriptionBase *pDesc = NULL;
121 pDesc = new SFUInt32::Description(
122 SFUInt32::getClassType(),
123 "coreGLChunkLimit",
125 CoreGLChunkLimitFieldId, CoreGLChunkLimitFieldMask,
126 false,
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(),
138 "NULL",
139 nsOSG, //Namespace
140 NULL,
141 reinterpret_cast<InitContainerF>(&PrimeMaterial::initMethod),
142 reinterpret_cast<ExitContainerF>(&PrimeMaterial::exitMethod),
143 reinterpret_cast<InitalInsertDescFunc>(
144 reinterpret_cast<void *>(&PrimeMaterial::classDescInserter)),
145 false,
147 "<?xml version=\"1.0\"?>\n"
148 "\n"
149 "<FieldContainer\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"
160 " >\n"
161 " <Field\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"
168 "\t >\n"
169 " </Field>\n"
170 "</FieldContainer>\n",
174 /*------------------------------ get -----------------------------------*/
176 FieldContainerType &PrimeMaterialBase::getType(void)
178 return _type;
181 const FieldContainerType &PrimeMaterialBase::getType(void) const
183 return _type;
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();
222 return returnValue;
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) :
254 Inherited(),
255 _sfCoreGLChunkLimit (UInt32(4096))
259 PrimeMaterialBase::PrimeMaterialBase(const PrimeMaterialBase &source) :
260 Inherited(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)));
281 return returnValue;
284 EditFieldHandlePtr PrimeMaterialBase::editHandleCoreGLChunkLimit(void)
286 SFUInt32::EditHandlePtr returnValue(
287 new SFUInt32::EditHandle(
288 &_sfCoreGLChunkLimit,
289 this->getType().getFieldDesc(CoreGLChunkLimitFieldId),
290 this));
293 editSField(CoreGLChunkLimitFieldMask);
295 return returnValue;
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),
309 whichField,
310 oOffsets,
311 syncMode,
312 uiSyncInfo);
314 #endif
318 void PrimeMaterialBase::resolveLinks(void)
320 Inherited::resolveLinks();
326 OSG_END_NAMESPACE