changed: gcc8 base update
[opensg.git] / Source / System / NodeCores / Groups / Base / OSGLightEngineBase.cpp
blob0d3a32d33856456b88d2f14b4cfddecca6832f7d
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 LightEngine!
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 "OSGLightEngineBase.h"
67 #include "OSGLightEngine.h"
69 #include <boost/bind.hpp>
71 OSG_BEGIN_NAMESPACE
73 /***************************************************************************\
74 * Description *
75 \***************************************************************************/
77 /*! \class OSG::LightEngine
81 /***************************************************************************\
82 * Field Documentation *
83 \***************************************************************************/
85 /*! \var bool LightEngineBase::_sfEnabled
90 /***************************************************************************\
91 * FieldType/FieldTrait Instantiation *
92 \***************************************************************************/
94 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
95 PointerType FieldTraits<LightEngine *, nsOSG>::_type(
96 "LightEnginePtr",
97 "AttachmentContainerPtr",
98 LightEngine::getClassType(),
99 nsOSG);
100 #endif
102 OSG_FIELDTRAITS_GETTYPE_NS(LightEngine *, nsOSG)
104 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField,
105 LightEngine *,
106 nsOSG)
108 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField,
109 LightEngine *,
110 nsOSG)
112 /***************************************************************************\
113 * Field Description *
114 \***************************************************************************/
116 void LightEngineBase::classDescInserter(TypeObject &oType)
118 FieldDescriptionBase *pDesc = NULL;
121 pDesc = new SFBool::Description(
122 SFBool::getClassType(),
123 "enabled",
125 EnabledFieldId, EnabledFieldMask,
126 false,
127 (Field::SFDefaultFlags | Field::FStdAccess),
128 static_cast<FieldEditMethodSig>(&LightEngine::editHandleEnabled),
129 static_cast<FieldGetMethodSig >(&LightEngine::getHandleEnabled));
131 oType.addInitialDesc(pDesc);
135 LightEngineBase::TypeObject LightEngineBase::_type(
136 LightEngineBase::getClassname(),
137 Inherited::getClassname(),
138 "NULL",
139 nsOSG, //Namespace
140 NULL,
141 reinterpret_cast<InitContainerF>(&LightEngine::initMethod),
142 reinterpret_cast<ExitContainerF>(&LightEngine::exitMethod),
143 reinterpret_cast<InitalInsertDescFunc>(
144 reinterpret_cast<void *>(&LightEngine::classDescInserter)),
145 false,
147 "<?xml version=\"1.0\" ?>\n"
148 "\n"
149 "<FieldContainer\n"
150 " name=\"LightEngine\"\n"
151 " parent=\"AttachmentContainer\"\n"
152 " library=\"System\"\n"
153 " structure=\"abstract\"\n"
154 " pointerfieldtypes=\"both\"\n"
155 " systemcomponent=\"true\"\n"
156 " parentsystemcomponent=\"true\"\n"
157 " isNodeCore=\"false\"\n"
158 " docGroupBase=\"GrpSystemNodeCoreGroups\"\n"
159 " >\n"
160 " <Field\n"
161 "\t name=\"enabled\"\n"
162 "\t type=\"bool\"\n"
163 "\t cardinality=\"single\"\n"
164 "\t visibility=\"external\"\n"
165 "\t defaultValue=\"true\"\n"
166 "\t access=\"public\"\n"
167 "\t >\n"
168 " </Field>\n"
169 "</FieldContainer>\n",
173 /*------------------------------ get -----------------------------------*/
175 FieldContainerType &LightEngineBase::getType(void)
177 return _type;
180 const FieldContainerType &LightEngineBase::getType(void) const
182 return _type;
185 UInt32 LightEngineBase::getContainerSize(void) const
187 return sizeof(LightEngine);
190 /*------------------------- decorator get ------------------------------*/
193 SFBool *LightEngineBase::editSFEnabled(void)
195 editSField(EnabledFieldMask);
197 return &_sfEnabled;
200 const SFBool *LightEngineBase::getSFEnabled(void) const
202 return &_sfEnabled;
210 /*------------------------------ access -----------------------------------*/
212 SizeT LightEngineBase::getBinSize(ConstFieldMaskArg whichField)
214 SizeT returnValue = Inherited::getBinSize(whichField);
216 if(FieldBits::NoField != (EnabledFieldMask & whichField))
218 returnValue += _sfEnabled.getBinSize();
221 return returnValue;
224 void LightEngineBase::copyToBin(BinaryDataHandler &pMem,
225 ConstFieldMaskArg whichField)
227 Inherited::copyToBin(pMem, whichField);
229 if(FieldBits::NoField != (EnabledFieldMask & whichField))
231 _sfEnabled.copyToBin(pMem);
235 void LightEngineBase::copyFromBin(BinaryDataHandler &pMem,
236 ConstFieldMaskArg whichField)
238 Inherited::copyFromBin(pMem, whichField);
240 if(FieldBits::NoField != (EnabledFieldMask & whichField))
242 editSField(EnabledFieldMask);
243 _sfEnabled.copyFromBin(pMem);
250 /*------------------------- constructors ----------------------------------*/
252 LightEngineBase::LightEngineBase(void) :
253 Inherited(),
254 _sfEnabled (bool(true))
258 LightEngineBase::LightEngineBase(const LightEngineBase &source) :
259 Inherited(source),
260 _sfEnabled (source._sfEnabled )
265 /*-------------------------- destructors ----------------------------------*/
267 LightEngineBase::~LightEngineBase(void)
272 GetFieldHandlePtr LightEngineBase::getHandleEnabled (void) const
274 SFBool::GetHandlePtr returnValue(
275 new SFBool::GetHandle(
276 &_sfEnabled,
277 this->getType().getFieldDesc(EnabledFieldId),
278 const_cast<LightEngineBase *>(this)));
280 return returnValue;
283 EditFieldHandlePtr LightEngineBase::editHandleEnabled (void)
285 SFBool::EditHandlePtr returnValue(
286 new SFBool::EditHandle(
287 &_sfEnabled,
288 this->getType().getFieldDesc(EnabledFieldId),
289 this));
292 editSField(EnabledFieldMask);
294 return returnValue;
298 #ifdef OSG_MT_CPTR_ASPECT
299 void LightEngineBase::execSyncV( FieldContainer &oFrom,
300 ConstFieldMaskArg whichField,
301 AspectOffsetStore &oOffsets,
302 ConstFieldMaskArg syncMode,
303 const UInt32 uiSyncInfo)
305 LightEngine *pThis = static_cast<LightEngine *>(this);
307 pThis->execSync(static_cast<LightEngine *>(&oFrom),
308 whichField,
309 oOffsets,
310 syncMode,
311 uiSyncInfo);
313 #endif
317 void LightEngineBase::resolveLinks(void)
319 Inherited::resolveLinks();
325 OSG_END_NAMESPACE