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 **
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 "OSGLightEngineBase.h"
67 #include "OSGLightEngine.h"
69 #include <boost/bind.hpp>
73 /***************************************************************************\
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(
97 "AttachmentContainerPtr",
98 LightEngine::getClassType(),
102 OSG_FIELDTRAITS_GETTYPE_NS(LightEngine
*, nsOSG
)
104 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField
,
108 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField
,
112 /***************************************************************************\
113 * Field Description *
114 \***************************************************************************/
116 void LightEngineBase::classDescInserter(TypeObject
&oType
)
118 FieldDescriptionBase
*pDesc
= NULL
;
121 pDesc
= new SFBool::Description(
122 SFBool::getClassType(),
125 EnabledFieldId
, EnabledFieldMask
,
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(),
141 reinterpret_cast<InitContainerF
>(&LightEngine::initMethod
),
142 reinterpret_cast<ExitContainerF
>(&LightEngine::exitMethod
),
143 reinterpret_cast<InitalInsertDescFunc
>(
144 reinterpret_cast<void *>(&LightEngine::classDescInserter
)),
147 "<?xml version=\"1.0\" ?>\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"
161 "\t name=\"enabled\"\n"
163 "\t cardinality=\"single\"\n"
164 "\t visibility=\"external\"\n"
165 "\t defaultValue=\"true\"\n"
166 "\t access=\"public\"\n"
169 "</FieldContainer>\n",
173 /*------------------------------ get -----------------------------------*/
175 FieldContainerType
&LightEngineBase::getType(void)
180 const FieldContainerType
&LightEngineBase::getType(void) const
185 UInt32
LightEngineBase::getContainerSize(void) const
187 return sizeof(LightEngine
);
190 /*------------------------- decorator get ------------------------------*/
193 SFBool
*LightEngineBase::editSFEnabled(void)
195 editSField(EnabledFieldMask
);
200 const SFBool
*LightEngineBase::getSFEnabled(void) const
210 /*------------------------------ access -----------------------------------*/
212 SizeT
LightEngineBase::getBinSize(ConstFieldMaskArg whichField
)
214 SizeT returnValue
= Inherited::getBinSize(whichField
);
216 if(FieldBits::NoField
!= (EnabledFieldMask
& whichField
))
218 returnValue
+= _sfEnabled
.getBinSize();
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) :
254 _sfEnabled (bool(true))
258 LightEngineBase::LightEngineBase(const LightEngineBase
&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(
277 this->getType().getFieldDesc(EnabledFieldId
),
278 const_cast<LightEngineBase
*>(this)));
283 EditFieldHandlePtr
LightEngineBase::editHandleEnabled (void)
285 SFBool::EditHandlePtr
returnValue(
286 new SFBool::EditHandle(
288 this->getType().getFieldDesc(EnabledFieldId
),
292 editSField(EnabledFieldMask
);
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
),
317 void LightEngineBase::resolveLinks(void)
319 Inherited::resolveLinks();