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 "OSGStateChunkBase.h"
67 #include "OSGStateChunk.h"
69 #include <boost/bind.hpp>
73 /***************************************************************************\
75 \***************************************************************************/
77 /*! \class OSG::StateChunk
78 See \ref PageSystemState for the conceptual background.
81 /***************************************************************************\
82 * Field Documentation *
83 \***************************************************************************/
85 /*! \var bool StateChunkBase::_sfIgnore
86 Enables / disables a chunk
90 /***************************************************************************\
91 * FieldType/FieldTrait Instantiation *
92 \***************************************************************************/
94 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
95 PointerType FieldTraits
<StateChunk
*, nsOSG
>::_type(
98 StateChunk::getClassType(),
102 OSG_FIELDTRAITS_GETTYPE_NS(StateChunk
*, nsOSG
)
104 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField
,
108 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField
,
112 /***************************************************************************\
113 * Field Description *
114 \***************************************************************************/
116 void StateChunkBase::classDescInserter(TypeObject
&oType
)
118 FieldDescriptionBase
*pDesc
= NULL
;
121 pDesc
= new SFBool::Description(
122 SFBool::getClassType(),
124 "Enables / disables a chunk\n",
125 IgnoreFieldId
, IgnoreFieldMask
,
127 (Field::SFDefaultFlags
| Field::FStdAccess
),
128 static_cast<FieldEditMethodSig
>(&StateChunk::editHandleIgnore
),
129 static_cast<FieldGetMethodSig
>(&StateChunk::getHandleIgnore
));
131 oType
.addInitialDesc(pDesc
);
135 StateChunkBase::TypeObject
StateChunkBase::_type(
136 StateChunkBase::getClassname(),
137 Inherited::getClassname(),
141 reinterpret_cast<InitContainerF
>(&StateChunk::initMethod
),
142 reinterpret_cast<ExitContainerF
>(&StateChunk::exitMethod
),
143 reinterpret_cast<InitalInsertDescFunc
>(
144 reinterpret_cast<void *>(&StateChunk::classDescInserter
)),
147 "<?xml version=\"1.0\"?>\n"
150 " name=\"StateChunk\"\n"
151 " parent=\"Attachment\"\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=\"GrpSystemState\"\n"
161 " See \\ref PageSystemState for the conceptual background.\n"
163 "\t name=\"ignore\"\n"
165 "\t cardinality=\"single\"\n"
166 "\t visibility=\"external\"\n"
167 "\t defaultValue=\"false\"\n"
168 "\t access=\"public\"\n"
170 "\tEnables / disables a chunk\n"
172 "</FieldContainer>\n",
173 "See \\ref PageSystemState for the conceptual background.\n"
176 /*------------------------------ get -----------------------------------*/
178 FieldContainerType
&StateChunkBase::getType(void)
183 const FieldContainerType
&StateChunkBase::getType(void) const
188 UInt32
StateChunkBase::getContainerSize(void) const
190 return sizeof(StateChunk
);
193 /*------------------------- decorator get ------------------------------*/
196 SFBool
*StateChunkBase::editSFIgnore(void)
198 editSField(IgnoreFieldMask
);
203 const SFBool
*StateChunkBase::getSFIgnore(void) const
213 /*------------------------------ access -----------------------------------*/
215 SizeT
StateChunkBase::getBinSize(ConstFieldMaskArg whichField
)
217 SizeT returnValue
= Inherited::getBinSize(whichField
);
219 if(FieldBits::NoField
!= (IgnoreFieldMask
& whichField
))
221 returnValue
+= _sfIgnore
.getBinSize();
227 void StateChunkBase::copyToBin(BinaryDataHandler
&pMem
,
228 ConstFieldMaskArg whichField
)
230 Inherited::copyToBin(pMem
, whichField
);
232 if(FieldBits::NoField
!= (IgnoreFieldMask
& whichField
))
234 _sfIgnore
.copyToBin(pMem
);
238 void StateChunkBase::copyFromBin(BinaryDataHandler
&pMem
,
239 ConstFieldMaskArg whichField
)
241 Inherited::copyFromBin(pMem
, whichField
);
243 if(FieldBits::NoField
!= (IgnoreFieldMask
& whichField
))
245 editSField(IgnoreFieldMask
);
246 _sfIgnore
.copyFromBin(pMem
);
253 /*------------------------- constructors ----------------------------------*/
255 StateChunkBase::StateChunkBase(void) :
257 _sfIgnore (bool(false))
261 StateChunkBase::StateChunkBase(const StateChunkBase
&source
) :
263 _sfIgnore (source
._sfIgnore
)
268 /*-------------------------- destructors ----------------------------------*/
270 StateChunkBase::~StateChunkBase(void)
275 GetFieldHandlePtr
StateChunkBase::getHandleIgnore (void) const
277 SFBool::GetHandlePtr
returnValue(
278 new SFBool::GetHandle(
280 this->getType().getFieldDesc(IgnoreFieldId
),
281 const_cast<StateChunkBase
*>(this)));
286 EditFieldHandlePtr
StateChunkBase::editHandleIgnore (void)
288 SFBool::EditHandlePtr
returnValue(
289 new SFBool::EditHandle(
291 this->getType().getFieldDesc(IgnoreFieldId
),
295 editSField(IgnoreFieldMask
);
301 #ifdef OSG_MT_CPTR_ASPECT
302 void StateChunkBase::execSyncV( FieldContainer
&oFrom
,
303 ConstFieldMaskArg whichField
,
304 AspectOffsetStore
&oOffsets
,
305 ConstFieldMaskArg syncMode
,
306 const UInt32 uiSyncInfo
)
308 StateChunk
*pThis
= static_cast<StateChunk
*>(this);
310 pThis
->execSync(static_cast<StateChunk
*>(&oFrom
),
320 void StateChunkBase::resolveLinks(void)
322 Inherited::resolveLinks();