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 TileableBackground!
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 "OSGTileableBackgroundBase.h"
67 #include "OSGTileableBackground.h"
69 #include <boost/bind.hpp>
73 /***************************************************************************\
75 \***************************************************************************/
77 /*! \class OSG::TileableBackground
78 An abstract base class for Backgrounds that support tiling when used in
79 conjunction with the TileCameraDecorator.
82 /***************************************************************************\
83 * Field Documentation *
84 \***************************************************************************/
86 /*! \var bool TileableBackgroundBase::_sfTile
87 If true the background tiles in multi window settings.
91 /***************************************************************************\
92 * FieldType/FieldTrait Instantiation *
93 \***************************************************************************/
95 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
96 PointerType FieldTraits
<TileableBackground
*, nsOSG
>::_type(
97 "TileableBackgroundPtr",
99 TileableBackground::getClassType(),
103 OSG_FIELDTRAITS_GETTYPE_NS(TileableBackground
*, nsOSG
)
105 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField
,
106 TileableBackground
*,
110 /***************************************************************************\
111 * Field Description *
112 \***************************************************************************/
114 void TileableBackgroundBase::classDescInserter(TypeObject
&oType
)
116 FieldDescriptionBase
*pDesc
= NULL
;
119 pDesc
= new SFBool::Description(
120 SFBool::getClassType(),
122 "If true the background tiles in multi window settings.\n",
123 TileFieldId
, TileFieldMask
,
125 (Field::SFDefaultFlags
| Field::FStdAccess
),
126 static_cast<FieldEditMethodSig
>(&TileableBackground::editHandleTile
),
127 static_cast<FieldGetMethodSig
>(&TileableBackground::getHandleTile
));
129 oType
.addInitialDesc(pDesc
);
133 TileableBackgroundBase::TypeObject
TileableBackgroundBase::_type(
134 TileableBackgroundBase::getClassname(),
135 Inherited::getClassname(),
139 reinterpret_cast<InitContainerF
>(&TileableBackground::initMethod
),
140 reinterpret_cast<ExitContainerF
>(&TileableBackground::exitMethod
),
141 reinterpret_cast<InitalInsertDescFunc
>(
142 reinterpret_cast<void *>(&TileableBackground::classDescInserter
)),
145 "<?xml version=\"1.0\" ?>\n"
148 " name=\"TileableBackground\"\n"
149 " parent=\"Background\"\n"
150 " library=\"Window\"\n"
151 " structure=\"abstract\"\n"
152 " pointerfieldtypes=\"single\"\n"
153 " systemcomponent=\"true\"\n"
154 " parentsystemcomponent=\"true\"\n"
155 " docGroupBase=\"GrpWindowBackground\"\n"
157 " An abstract base class for Backgrounds that support tiling when used in\n"
158 " conjunction with the TileCameraDecorator.\n"
162 " cardinality=\"single\"\n"
163 " visibility=\"external\"\n"
164 " defaultValue=\"true\"\n"
165 " access=\"public\"\n"
167 " If true the background tiles in multi window settings.\n"
169 "</FieldContainer>\n",
170 "An abstract base class for Backgrounds that support tiling when used in\n"
171 "conjunction with the TileCameraDecorator.\n"
174 /*------------------------------ get -----------------------------------*/
176 FieldContainerType
&TileableBackgroundBase::getType(void)
181 const FieldContainerType
&TileableBackgroundBase::getType(void) const
186 UInt32
TileableBackgroundBase::getContainerSize(void) const
188 return sizeof(TileableBackground
);
191 /*------------------------- decorator get ------------------------------*/
194 SFBool
*TileableBackgroundBase::editSFTile(void)
196 editSField(TileFieldMask
);
201 const SFBool
*TileableBackgroundBase::getSFTile(void) const
211 /*------------------------------ access -----------------------------------*/
213 SizeT
TileableBackgroundBase::getBinSize(ConstFieldMaskArg whichField
)
215 SizeT returnValue
= Inherited::getBinSize(whichField
);
217 if(FieldBits::NoField
!= (TileFieldMask
& whichField
))
219 returnValue
+= _sfTile
.getBinSize();
225 void TileableBackgroundBase::copyToBin(BinaryDataHandler
&pMem
,
226 ConstFieldMaskArg whichField
)
228 Inherited::copyToBin(pMem
, whichField
);
230 if(FieldBits::NoField
!= (TileFieldMask
& whichField
))
232 _sfTile
.copyToBin(pMem
);
236 void TileableBackgroundBase::copyFromBin(BinaryDataHandler
&pMem
,
237 ConstFieldMaskArg whichField
)
239 Inherited::copyFromBin(pMem
, whichField
);
241 if(FieldBits::NoField
!= (TileFieldMask
& whichField
))
243 editSField(TileFieldMask
);
244 _sfTile
.copyFromBin(pMem
);
251 /*------------------------- constructors ----------------------------------*/
253 TileableBackgroundBase::TileableBackgroundBase(void) :
259 TileableBackgroundBase::TileableBackgroundBase(const TileableBackgroundBase
&source
) :
261 _sfTile (source
._sfTile
)
266 /*-------------------------- destructors ----------------------------------*/
268 TileableBackgroundBase::~TileableBackgroundBase(void)
273 GetFieldHandlePtr
TileableBackgroundBase::getHandleTile (void) const
275 SFBool::GetHandlePtr
returnValue(
276 new SFBool::GetHandle(
278 this->getType().getFieldDesc(TileFieldId
),
279 const_cast<TileableBackgroundBase
*>(this)));
284 EditFieldHandlePtr
TileableBackgroundBase::editHandleTile (void)
286 SFBool::EditHandlePtr
returnValue(
287 new SFBool::EditHandle(
289 this->getType().getFieldDesc(TileFieldId
),
293 editSField(TileFieldMask
);
299 #ifdef OSG_MT_CPTR_ASPECT
300 void TileableBackgroundBase::execSyncV( FieldContainer
&oFrom
,
301 ConstFieldMaskArg whichField
,
302 AspectOffsetStore
&oOffsets
,
303 ConstFieldMaskArg syncMode
,
304 const UInt32 uiSyncInfo
)
306 TileableBackground
*pThis
= static_cast<TileableBackground
*>(this);
308 pThis
->execSync(static_cast<TileableBackground
*>(&oFrom
),
318 void TileableBackgroundBase::resolveLinks(void)
320 Inherited::resolveLinks();