changed: gcc8 base update
[opensg.git] / Source / System / Cluster / Window / Base / OSGImageComposerBase.cpp
blobebce6ddfda0021d6df61850015a1d5d29ffb773a
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 ImageComposer!
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 "OSGImageComposerBase.h"
67 #include "OSGImageComposer.h"
69 #include <boost/bind.hpp>
71 OSG_BEGIN_NAMESPACE
73 /***************************************************************************\
74 * Description *
75 \***************************************************************************/
77 /*! \class OSG::ImageComposer
78 An image composer creates an image from multiple cluster rendering servers.
81 /***************************************************************************\
82 * Field Documentation *
83 \***************************************************************************/
85 /*! \var bool ImageComposerBase::_sfEnabled
86 Do composition if value is true
89 /*! \var bool ImageComposerBase::_sfStatistics
94 /***************************************************************************\
95 * FieldType/FieldTrait Instantiation *
96 \***************************************************************************/
98 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
99 PointerType FieldTraits<ImageComposer *, nsOSG>::_type(
100 "ImageComposerPtr",
101 "AttachmentContainerPtr",
102 ImageComposer::getClassType(),
103 nsOSG);
104 #endif
106 OSG_FIELDTRAITS_GETTYPE_NS(ImageComposer *, nsOSG)
108 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField,
109 ImageComposer *,
110 nsOSG)
112 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField,
113 ImageComposer *,
114 nsOSG)
116 /***************************************************************************\
117 * Field Description *
118 \***************************************************************************/
120 void ImageComposerBase::classDescInserter(TypeObject &oType)
122 FieldDescriptionBase *pDesc = NULL;
125 pDesc = new SFBool::Description(
126 SFBool::getClassType(),
127 "enabled",
128 "Do composition if value is true\n",
129 EnabledFieldId, EnabledFieldMask,
130 false,
131 (Field::SFDefaultFlags | Field::FStdAccess),
132 static_cast<FieldEditMethodSig>(&ImageComposer::editHandleEnabled),
133 static_cast<FieldGetMethodSig >(&ImageComposer::getHandleEnabled));
135 oType.addInitialDesc(pDesc);
137 pDesc = new SFBool::Description(
138 SFBool::getClassType(),
139 "statistics",
141 StatisticsFieldId, StatisticsFieldMask,
142 false,
143 (Field::SFDefaultFlags | Field::FStdAccess),
144 static_cast<FieldEditMethodSig>(&ImageComposer::editHandleStatistics),
145 static_cast<FieldGetMethodSig >(&ImageComposer::getHandleStatistics));
147 oType.addInitialDesc(pDesc);
151 ImageComposerBase::TypeObject ImageComposerBase::_type(
152 ImageComposerBase::getClassname(),
153 Inherited::getClassname(),
154 "NULL",
155 nsOSG, //Namespace
156 NULL,
157 reinterpret_cast<InitContainerF>(&ImageComposer::initMethod),
158 reinterpret_cast<ExitContainerF>(&ImageComposer::exitMethod),
159 reinterpret_cast<InitalInsertDescFunc>(
160 reinterpret_cast<void *>(&ImageComposer::classDescInserter)),
161 false,
163 "<?xml version=\"1.0\"?>\n"
164 "\n"
165 "<FieldContainer\n"
166 " name=\"ImageComposer\"\n"
167 " parent=\"AttachmentContainer\"\n"
168 " library=\"Cluster\"\n"
169 " pointerfieldtypes=\"both\"\n"
170 " structure=\"abstract\"\n"
171 " systemcomponent=\"true\"\n"
172 " parentsystemcomponent=\"true\"\n"
173 " decoratable=\"false\"\n"
174 " useLocalIncludes=\"false\"\n"
175 " docGroupBase=\"GrpClusterWindow\"\n"
176 " >\n"
177 " An image composer creates an image from multiple cluster rendering servers.\n"
178 " <Field\n"
179 "\t name=\"enabled\"\n"
180 "\t type=\"bool\"\n"
181 "\t cardinality=\"single\"\n"
182 "\t visibility=\"external\"\n"
183 "\t defaultValue=\"true\"\n"
184 "\t access=\"public\"\n"
185 "\t >\n"
186 "\tDo composition if value is true\n"
187 " </Field>\n"
188 " <Field\n"
189 "\t name=\"statistics\"\n"
190 "\t type=\"bool\"\n"
191 "\t cardinality=\"single\"\n"
192 "\t visibility=\"external\"\n"
193 "\t defaultValue=\"false\"\n"
194 "\t access=\"public\"\n"
195 "\t >\n"
196 " </Field>\n"
197 "</FieldContainer>\n",
198 "An image composer creates an image from multiple cluster rendering servers.\n"
201 /*------------------------------ get -----------------------------------*/
203 FieldContainerType &ImageComposerBase::getType(void)
205 return _type;
208 const FieldContainerType &ImageComposerBase::getType(void) const
210 return _type;
213 UInt32 ImageComposerBase::getContainerSize(void) const
215 return sizeof(ImageComposer);
218 /*------------------------- decorator get ------------------------------*/
221 SFBool *ImageComposerBase::editSFEnabled(void)
223 editSField(EnabledFieldMask);
225 return &_sfEnabled;
228 const SFBool *ImageComposerBase::getSFEnabled(void) const
230 return &_sfEnabled;
234 SFBool *ImageComposerBase::editSFStatistics(void)
236 editSField(StatisticsFieldMask);
238 return &_sfStatistics;
241 const SFBool *ImageComposerBase::getSFStatistics(void) const
243 return &_sfStatistics;
251 /*------------------------------ access -----------------------------------*/
253 SizeT ImageComposerBase::getBinSize(ConstFieldMaskArg whichField)
255 SizeT returnValue = Inherited::getBinSize(whichField);
257 if(FieldBits::NoField != (EnabledFieldMask & whichField))
259 returnValue += _sfEnabled.getBinSize();
261 if(FieldBits::NoField != (StatisticsFieldMask & whichField))
263 returnValue += _sfStatistics.getBinSize();
266 return returnValue;
269 void ImageComposerBase::copyToBin(BinaryDataHandler &pMem,
270 ConstFieldMaskArg whichField)
272 Inherited::copyToBin(pMem, whichField);
274 if(FieldBits::NoField != (EnabledFieldMask & whichField))
276 _sfEnabled.copyToBin(pMem);
278 if(FieldBits::NoField != (StatisticsFieldMask & whichField))
280 _sfStatistics.copyToBin(pMem);
284 void ImageComposerBase::copyFromBin(BinaryDataHandler &pMem,
285 ConstFieldMaskArg whichField)
287 Inherited::copyFromBin(pMem, whichField);
289 if(FieldBits::NoField != (EnabledFieldMask & whichField))
291 editSField(EnabledFieldMask);
292 _sfEnabled.copyFromBin(pMem);
294 if(FieldBits::NoField != (StatisticsFieldMask & whichField))
296 editSField(StatisticsFieldMask);
297 _sfStatistics.copyFromBin(pMem);
304 /*------------------------- constructors ----------------------------------*/
306 ImageComposerBase::ImageComposerBase(void) :
307 Inherited(),
308 _sfEnabled (bool(true)),
309 _sfStatistics (bool(false))
313 ImageComposerBase::ImageComposerBase(const ImageComposerBase &source) :
314 Inherited(source),
315 _sfEnabled (source._sfEnabled ),
316 _sfStatistics (source._sfStatistics )
321 /*-------------------------- destructors ----------------------------------*/
323 ImageComposerBase::~ImageComposerBase(void)
328 GetFieldHandlePtr ImageComposerBase::getHandleEnabled (void) const
330 SFBool::GetHandlePtr returnValue(
331 new SFBool::GetHandle(
332 &_sfEnabled,
333 this->getType().getFieldDesc(EnabledFieldId),
334 const_cast<ImageComposerBase *>(this)));
336 return returnValue;
339 EditFieldHandlePtr ImageComposerBase::editHandleEnabled (void)
341 SFBool::EditHandlePtr returnValue(
342 new SFBool::EditHandle(
343 &_sfEnabled,
344 this->getType().getFieldDesc(EnabledFieldId),
345 this));
348 editSField(EnabledFieldMask);
350 return returnValue;
353 GetFieldHandlePtr ImageComposerBase::getHandleStatistics (void) const
355 SFBool::GetHandlePtr returnValue(
356 new SFBool::GetHandle(
357 &_sfStatistics,
358 this->getType().getFieldDesc(StatisticsFieldId),
359 const_cast<ImageComposerBase *>(this)));
361 return returnValue;
364 EditFieldHandlePtr ImageComposerBase::editHandleStatistics (void)
366 SFBool::EditHandlePtr returnValue(
367 new SFBool::EditHandle(
368 &_sfStatistics,
369 this->getType().getFieldDesc(StatisticsFieldId),
370 this));
373 editSField(StatisticsFieldMask);
375 return returnValue;
379 #ifdef OSG_MT_CPTR_ASPECT
380 void ImageComposerBase::execSyncV( FieldContainer &oFrom,
381 ConstFieldMaskArg whichField,
382 AspectOffsetStore &oOffsets,
383 ConstFieldMaskArg syncMode,
384 const UInt32 uiSyncInfo)
386 ImageComposer *pThis = static_cast<ImageComposer *>(this);
388 pThis->execSync(static_cast<ImageComposer *>(&oFrom),
389 whichField,
390 oOffsets,
391 syncMode,
392 uiSyncInfo);
394 #endif
398 void ImageComposerBase::resolveLinks(void)
400 Inherited::resolveLinks();
406 OSG_END_NAMESPACE