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 ImageComposer!
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 "OSGImageComposerBase.h"
67 #include "OSGImageComposer.h"
69 #include <boost/bind.hpp>
73 /***************************************************************************\
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(
101 "AttachmentContainerPtr",
102 ImageComposer::getClassType(),
106 OSG_FIELDTRAITS_GETTYPE_NS(ImageComposer
*, nsOSG
)
108 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField
,
112 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField
,
116 /***************************************************************************\
117 * Field Description *
118 \***************************************************************************/
120 void ImageComposerBase::classDescInserter(TypeObject
&oType
)
122 FieldDescriptionBase
*pDesc
= NULL
;
125 pDesc
= new SFBool::Description(
126 SFBool::getClassType(),
128 "Do composition if value is true\n",
129 EnabledFieldId
, EnabledFieldMask
,
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(),
141 StatisticsFieldId
, StatisticsFieldMask
,
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(),
157 reinterpret_cast<InitContainerF
>(&ImageComposer::initMethod
),
158 reinterpret_cast<ExitContainerF
>(&ImageComposer::exitMethod
),
159 reinterpret_cast<InitalInsertDescFunc
>(
160 reinterpret_cast<void *>(&ImageComposer::classDescInserter
)),
163 "<?xml version=\"1.0\"?>\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"
177 " An image composer creates an image from multiple cluster rendering servers.\n"
179 "\t name=\"enabled\"\n"
181 "\t cardinality=\"single\"\n"
182 "\t visibility=\"external\"\n"
183 "\t defaultValue=\"true\"\n"
184 "\t access=\"public\"\n"
186 "\tDo composition if value is true\n"
189 "\t name=\"statistics\"\n"
191 "\t cardinality=\"single\"\n"
192 "\t visibility=\"external\"\n"
193 "\t defaultValue=\"false\"\n"
194 "\t access=\"public\"\n"
197 "</FieldContainer>\n",
198 "An image composer creates an image from multiple cluster rendering servers.\n"
201 /*------------------------------ get -----------------------------------*/
203 FieldContainerType
&ImageComposerBase::getType(void)
208 const FieldContainerType
&ImageComposerBase::getType(void) const
213 UInt32
ImageComposerBase::getContainerSize(void) const
215 return sizeof(ImageComposer
);
218 /*------------------------- decorator get ------------------------------*/
221 SFBool
*ImageComposerBase::editSFEnabled(void)
223 editSField(EnabledFieldMask
);
228 const SFBool
*ImageComposerBase::getSFEnabled(void) const
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();
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) :
308 _sfEnabled (bool(true)),
309 _sfStatistics (bool(false))
313 ImageComposerBase::ImageComposerBase(const ImageComposerBase
&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(
333 this->getType().getFieldDesc(EnabledFieldId
),
334 const_cast<ImageComposerBase
*>(this)));
339 EditFieldHandlePtr
ImageComposerBase::editHandleEnabled (void)
341 SFBool::EditHandlePtr
returnValue(
342 new SFBool::EditHandle(
344 this->getType().getFieldDesc(EnabledFieldId
),
348 editSField(EnabledFieldMask
);
353 GetFieldHandlePtr
ImageComposerBase::getHandleStatistics (void) const
355 SFBool::GetHandlePtr
returnValue(
356 new SFBool::GetHandle(
358 this->getType().getFieldDesc(StatisticsFieldId
),
359 const_cast<ImageComposerBase
*>(this)));
364 EditFieldHandlePtr
ImageComposerBase::editHandleStatistics (void)
366 SFBool::EditHandlePtr
returnValue(
367 new SFBool::EditHandle(
369 this->getType().getFieldDesc(StatisticsFieldId
),
373 editSField(StatisticsFieldMask
);
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
),
398 void ImageComposerBase::resolveLinks(void)
400 Inherited::resolveLinks();