changed: gcc8 base update
[opensg.git] / Source / System / Window / Background / OSGTileableBackgroundBase.cpp
blob0e66b59d5a7c961cc336d6885a4dd46ea5aa2848
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 TileableBackground!
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 "OSGTileableBackgroundBase.h"
67 #include "OSGTileableBackground.h"
69 #include <boost/bind.hpp>
71 OSG_BEGIN_NAMESPACE
73 /***************************************************************************\
74 * Description *
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",
98 "BackgroundPtr",
99 TileableBackground::getClassType(),
100 nsOSG);
101 #endif
103 OSG_FIELDTRAITS_GETTYPE_NS(TileableBackground *, nsOSG)
105 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField,
106 TileableBackground *,
107 nsOSG)
110 /***************************************************************************\
111 * Field Description *
112 \***************************************************************************/
114 void TileableBackgroundBase::classDescInserter(TypeObject &oType)
116 FieldDescriptionBase *pDesc = NULL;
119 pDesc = new SFBool::Description(
120 SFBool::getClassType(),
121 "tile",
122 "If true the background tiles in multi window settings.\n",
123 TileFieldId, TileFieldMask,
124 false,
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(),
136 "NULL",
137 nsOSG, //Namespace
138 NULL,
139 reinterpret_cast<InitContainerF>(&TileableBackground::initMethod),
140 reinterpret_cast<ExitContainerF>(&TileableBackground::exitMethod),
141 reinterpret_cast<InitalInsertDescFunc>(
142 reinterpret_cast<void *>(&TileableBackground::classDescInserter)),
143 false,
145 "<?xml version=\"1.0\" ?>\n"
146 "\n"
147 "<FieldContainer\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"
156 " >\n"
157 " An abstract base class for Backgrounds that support tiling when used in\n"
158 " conjunction with the TileCameraDecorator.\n"
159 " <Field\n"
160 " name=\"tile\"\n"
161 " type=\"bool\"\n"
162 " cardinality=\"single\"\n"
163 " visibility=\"external\"\n"
164 " defaultValue=\"true\"\n"
165 " access=\"public\"\n"
166 " >\n"
167 " If true the background tiles in multi window settings.\n"
168 " </Field>\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)
178 return _type;
181 const FieldContainerType &TileableBackgroundBase::getType(void) const
183 return _type;
186 UInt32 TileableBackgroundBase::getContainerSize(void) const
188 return sizeof(TileableBackground);
191 /*------------------------- decorator get ------------------------------*/
194 SFBool *TileableBackgroundBase::editSFTile(void)
196 editSField(TileFieldMask);
198 return &_sfTile;
201 const SFBool *TileableBackgroundBase::getSFTile(void) const
203 return &_sfTile;
211 /*------------------------------ access -----------------------------------*/
213 SizeT TileableBackgroundBase::getBinSize(ConstFieldMaskArg whichField)
215 SizeT returnValue = Inherited::getBinSize(whichField);
217 if(FieldBits::NoField != (TileFieldMask & whichField))
219 returnValue += _sfTile.getBinSize();
222 return returnValue;
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) :
254 Inherited(),
255 _sfTile (bool(true))
259 TileableBackgroundBase::TileableBackgroundBase(const TileableBackgroundBase &source) :
260 Inherited(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(
277 &_sfTile,
278 this->getType().getFieldDesc(TileFieldId),
279 const_cast<TileableBackgroundBase *>(this)));
281 return returnValue;
284 EditFieldHandlePtr TileableBackgroundBase::editHandleTile (void)
286 SFBool::EditHandlePtr returnValue(
287 new SFBool::EditHandle(
288 &_sfTile,
289 this->getType().getFieldDesc(TileFieldId),
290 this));
293 editSField(TileFieldMask);
295 return returnValue;
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),
309 whichField,
310 oOffsets,
311 syncMode,
312 uiSyncInfo);
314 #endif
318 void TileableBackgroundBase::resolveLinks(void)
320 Inherited::resolveLinks();
326 OSG_END_NAMESPACE