changed: gcc8 base update
[opensg.git] / Source / System / Cluster / Window / SortLast / OSGPipelineComposerBase.cpp
blob80e33cd7ec42f1da4971fd1a81789b896c159879
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 PipelineComposer!
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 "OSGPipelineComposerBase.h"
67 #include "OSGPipelineComposer.h"
69 #include <boost/bind.hpp>
71 OSG_BEGIN_NAMESPACE
73 /***************************************************************************\
74 * Description *
75 \***************************************************************************/
77 /*! \class OSG::PipelineComposer
81 /***************************************************************************\
82 * Field Documentation *
83 \***************************************************************************/
85 /*! \var bool PipelineComposerBase::_sfShort
89 /*! \var bool PipelineComposerBase::_sfAlpha
93 /*! \var UInt32 PipelineComposerBase::_sfTileSize
97 /*! \var bool PipelineComposerBase::_sfPipelined
102 /***************************************************************************\
103 * FieldType/FieldTrait Instantiation *
104 \***************************************************************************/
106 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
107 PointerType FieldTraits<PipelineComposer *, nsOSG>::_type(
108 "PipelineComposerPtr",
109 "ImageComposerPtr",
110 PipelineComposer::getClassType(),
111 nsOSG);
112 #endif
114 OSG_FIELDTRAITS_GETTYPE_NS(PipelineComposer *, nsOSG)
116 /***************************************************************************\
117 * Field Description *
118 \***************************************************************************/
120 void PipelineComposerBase::classDescInserter(TypeObject &oType)
122 FieldDescriptionBase *pDesc = NULL;
125 pDesc = new SFBool::Description(
126 SFBool::getClassType(),
127 "short",
129 ShortFieldId, ShortFieldMask,
130 false,
131 (Field::SFDefaultFlags | Field::FStdAccess),
132 static_cast<FieldEditMethodSig>(&PipelineComposer::editHandleShort),
133 static_cast<FieldGetMethodSig >(&PipelineComposer::getHandleShort));
135 oType.addInitialDesc(pDesc);
137 pDesc = new SFBool::Description(
138 SFBool::getClassType(),
139 "alpha",
141 AlphaFieldId, AlphaFieldMask,
142 false,
143 (Field::SFDefaultFlags | Field::FStdAccess),
144 static_cast<FieldEditMethodSig>(&PipelineComposer::editHandleAlpha),
145 static_cast<FieldGetMethodSig >(&PipelineComposer::getHandleAlpha));
147 oType.addInitialDesc(pDesc);
149 pDesc = new SFUInt32::Description(
150 SFUInt32::getClassType(),
151 "tileSize",
153 TileSizeFieldId, TileSizeFieldMask,
154 false,
155 (Field::SFDefaultFlags | Field::FStdAccess),
156 static_cast<FieldEditMethodSig>(&PipelineComposer::editHandleTileSize),
157 static_cast<FieldGetMethodSig >(&PipelineComposer::getHandleTileSize));
159 oType.addInitialDesc(pDesc);
161 pDesc = new SFBool::Description(
162 SFBool::getClassType(),
163 "pipelined",
165 PipelinedFieldId, PipelinedFieldMask,
166 false,
167 (Field::SFDefaultFlags | Field::FStdAccess),
168 static_cast<FieldEditMethodSig>(&PipelineComposer::editHandlePipelined),
169 static_cast<FieldGetMethodSig >(&PipelineComposer::getHandlePipelined));
171 oType.addInitialDesc(pDesc);
175 PipelineComposerBase::TypeObject PipelineComposerBase::_type(
176 PipelineComposerBase::getClassname(),
177 Inherited::getClassname(),
178 "NULL",
179 nsOSG, //Namespace
180 reinterpret_cast<PrototypeCreateF>(&PipelineComposerBase::createEmptyLocal),
181 reinterpret_cast<InitContainerF>(&PipelineComposer::initMethod),
182 reinterpret_cast<ExitContainerF>(&PipelineComposer::exitMethod),
183 reinterpret_cast<InitalInsertDescFunc>(
184 reinterpret_cast<void *>(&PipelineComposer::classDescInserter)),
185 false,
187 "<?xml version=\"1.0\"?>\n"
188 "\n"
189 "<FieldContainer\n"
190 " name=\"PipelineComposer\"\n"
191 " parent=\"ImageComposer\"\n"
192 " library=\"Cluster\"\n"
193 " pointerfieldtypes=\"none\"\n"
194 " structure=\"concrete\"\n"
195 " systemcomponent=\"true\"\n"
196 " parentsystemcomponent=\"true\"\n"
197 " decoratable=\"false\"\n"
198 " useLocalIncludes=\"false\"\n"
199 " docGroupBase=\"GrpClusterWindow\"\n"
200 " >\n"
201 " <Field\n"
202 "\t name=\"short\"\n"
203 "\t type=\"bool\"\n"
204 "\t cardinality=\"single\"\n"
205 "\t visibility=\"external\"\n"
206 "\t defaultValue=\"true\"\n"
207 "\t access=\"public\"\n"
208 "\t >\n"
209 " </Field>\n"
210 " <Field\n"
211 "\t name=\"alpha\"\n"
212 "\t type=\"bool\"\n"
213 "\t cardinality=\"single\"\n"
214 "\t visibility=\"external\"\n"
215 "\t defaultValue=\"false\"\n"
216 "\t access=\"public\"\n"
217 "\t >\n"
218 " </Field>\n"
219 " <Field\n"
220 "\t name=\"tileSize\"\n"
221 "\t type=\"UInt32\"\n"
222 "\t cardinality=\"single\"\n"
223 "\t visibility=\"external\"\n"
224 "\t defaultValue=\"44\"\n"
225 "\t access=\"public\"\n"
226 "\t >\n"
227 " </Field>\n"
228 " <Field\n"
229 "\t name=\"pipelined\"\n"
230 "\t type=\"bool\"\n"
231 "\t cardinality=\"single\"\n"
232 "\t visibility=\"external\"\n"
233 "\t defaultValue=\"false\"\n"
234 "\t access=\"public\"\n"
235 "\t >\n"
236 " </Field>\n"
237 "</FieldContainer>\n",
241 /*------------------------------ get -----------------------------------*/
243 FieldContainerType &PipelineComposerBase::getType(void)
245 return _type;
248 const FieldContainerType &PipelineComposerBase::getType(void) const
250 return _type;
253 UInt32 PipelineComposerBase::getContainerSize(void) const
255 return sizeof(PipelineComposer);
258 /*------------------------- decorator get ------------------------------*/
261 SFBool *PipelineComposerBase::editSFShort(void)
263 editSField(ShortFieldMask);
265 return &_sfShort;
268 const SFBool *PipelineComposerBase::getSFShort(void) const
270 return &_sfShort;
274 SFBool *PipelineComposerBase::editSFAlpha(void)
276 editSField(AlphaFieldMask);
278 return &_sfAlpha;
281 const SFBool *PipelineComposerBase::getSFAlpha(void) const
283 return &_sfAlpha;
287 SFUInt32 *PipelineComposerBase::editSFTileSize(void)
289 editSField(TileSizeFieldMask);
291 return &_sfTileSize;
294 const SFUInt32 *PipelineComposerBase::getSFTileSize(void) const
296 return &_sfTileSize;
300 SFBool *PipelineComposerBase::editSFPipelined(void)
302 editSField(PipelinedFieldMask);
304 return &_sfPipelined;
307 const SFBool *PipelineComposerBase::getSFPipelined(void) const
309 return &_sfPipelined;
317 /*------------------------------ access -----------------------------------*/
319 SizeT PipelineComposerBase::getBinSize(ConstFieldMaskArg whichField)
321 SizeT returnValue = Inherited::getBinSize(whichField);
323 if(FieldBits::NoField != (ShortFieldMask & whichField))
325 returnValue += _sfShort.getBinSize();
327 if(FieldBits::NoField != (AlphaFieldMask & whichField))
329 returnValue += _sfAlpha.getBinSize();
331 if(FieldBits::NoField != (TileSizeFieldMask & whichField))
333 returnValue += _sfTileSize.getBinSize();
335 if(FieldBits::NoField != (PipelinedFieldMask & whichField))
337 returnValue += _sfPipelined.getBinSize();
340 return returnValue;
343 void PipelineComposerBase::copyToBin(BinaryDataHandler &pMem,
344 ConstFieldMaskArg whichField)
346 Inherited::copyToBin(pMem, whichField);
348 if(FieldBits::NoField != (ShortFieldMask & whichField))
350 _sfShort.copyToBin(pMem);
352 if(FieldBits::NoField != (AlphaFieldMask & whichField))
354 _sfAlpha.copyToBin(pMem);
356 if(FieldBits::NoField != (TileSizeFieldMask & whichField))
358 _sfTileSize.copyToBin(pMem);
360 if(FieldBits::NoField != (PipelinedFieldMask & whichField))
362 _sfPipelined.copyToBin(pMem);
366 void PipelineComposerBase::copyFromBin(BinaryDataHandler &pMem,
367 ConstFieldMaskArg whichField)
369 Inherited::copyFromBin(pMem, whichField);
371 if(FieldBits::NoField != (ShortFieldMask & whichField))
373 editSField(ShortFieldMask);
374 _sfShort.copyFromBin(pMem);
376 if(FieldBits::NoField != (AlphaFieldMask & whichField))
378 editSField(AlphaFieldMask);
379 _sfAlpha.copyFromBin(pMem);
381 if(FieldBits::NoField != (TileSizeFieldMask & whichField))
383 editSField(TileSizeFieldMask);
384 _sfTileSize.copyFromBin(pMem);
386 if(FieldBits::NoField != (PipelinedFieldMask & whichField))
388 editSField(PipelinedFieldMask);
389 _sfPipelined.copyFromBin(pMem);
393 //! create a new instance of the class
394 PipelineComposerTransitPtr PipelineComposerBase::createLocal(BitVector bFlags)
396 PipelineComposerTransitPtr fc;
398 if(getClassType().getPrototype() != NULL)
400 FieldContainerTransitPtr tmpPtr =
401 getClassType().getPrototype()-> shallowCopyLocal(bFlags);
403 fc = dynamic_pointer_cast<PipelineComposer>(tmpPtr);
406 return fc;
409 //! create a new instance of the class, copy the container flags
410 PipelineComposerTransitPtr PipelineComposerBase::createDependent(BitVector bFlags)
412 PipelineComposerTransitPtr fc;
414 if(getClassType().getPrototype() != NULL)
416 FieldContainerTransitPtr tmpPtr =
417 getClassType().getPrototype()-> shallowCopyDependent(bFlags);
419 fc = dynamic_pointer_cast<PipelineComposer>(tmpPtr);
422 return fc;
425 //! create a new instance of the class
426 PipelineComposerTransitPtr PipelineComposerBase::create(void)
428 PipelineComposerTransitPtr fc;
430 if(getClassType().getPrototype() != NULL)
432 FieldContainerTransitPtr tmpPtr =
433 getClassType().getPrototype()-> shallowCopy();
435 fc = dynamic_pointer_cast<PipelineComposer>(tmpPtr);
438 return fc;
441 PipelineComposer *PipelineComposerBase::createEmptyLocal(BitVector bFlags)
443 PipelineComposer *returnValue;
445 newPtr<PipelineComposer>(returnValue, bFlags);
447 returnValue->_pFieldFlags->_bNamespaceMask &= ~bFlags;
449 return returnValue;
452 //! create an empty new instance of the class, do not copy the prototype
453 PipelineComposer *PipelineComposerBase::createEmpty(void)
455 PipelineComposer *returnValue;
457 newPtr<PipelineComposer>(returnValue, Thread::getCurrentLocalFlags());
459 returnValue->_pFieldFlags->_bNamespaceMask &=
460 ~Thread::getCurrentLocalFlags();
462 return returnValue;
466 FieldContainerTransitPtr PipelineComposerBase::shallowCopyLocal(
467 BitVector bFlags) const
469 PipelineComposer *tmpPtr;
471 newPtr(tmpPtr, dynamic_cast<const PipelineComposer *>(this), bFlags);
473 FieldContainerTransitPtr returnValue(tmpPtr);
475 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~bFlags;
477 return returnValue;
480 FieldContainerTransitPtr PipelineComposerBase::shallowCopyDependent(
481 BitVector bFlags) const
483 PipelineComposer *tmpPtr;
485 newPtr(tmpPtr, dynamic_cast<const PipelineComposer *>(this), ~bFlags);
487 FieldContainerTransitPtr returnValue(tmpPtr);
489 tmpPtr->_pFieldFlags->_bNamespaceMask = bFlags;
491 return returnValue;
494 FieldContainerTransitPtr PipelineComposerBase::shallowCopy(void) const
496 PipelineComposer *tmpPtr;
498 newPtr(tmpPtr,
499 dynamic_cast<const PipelineComposer *>(this),
500 Thread::getCurrentLocalFlags());
502 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~Thread::getCurrentLocalFlags();
504 FieldContainerTransitPtr returnValue(tmpPtr);
506 return returnValue;
512 /*------------------------- constructors ----------------------------------*/
514 PipelineComposerBase::PipelineComposerBase(void) :
515 Inherited(),
516 _sfShort (bool(true)),
517 _sfAlpha (bool(false)),
518 _sfTileSize (UInt32(44)),
519 _sfPipelined (bool(false))
523 PipelineComposerBase::PipelineComposerBase(const PipelineComposerBase &source) :
524 Inherited(source),
525 _sfShort (source._sfShort ),
526 _sfAlpha (source._sfAlpha ),
527 _sfTileSize (source._sfTileSize ),
528 _sfPipelined (source._sfPipelined )
533 /*-------------------------- destructors ----------------------------------*/
535 PipelineComposerBase::~PipelineComposerBase(void)
540 GetFieldHandlePtr PipelineComposerBase::getHandleShort (void) const
542 SFBool::GetHandlePtr returnValue(
543 new SFBool::GetHandle(
544 &_sfShort,
545 this->getType().getFieldDesc(ShortFieldId),
546 const_cast<PipelineComposerBase *>(this)));
548 return returnValue;
551 EditFieldHandlePtr PipelineComposerBase::editHandleShort (void)
553 SFBool::EditHandlePtr returnValue(
554 new SFBool::EditHandle(
555 &_sfShort,
556 this->getType().getFieldDesc(ShortFieldId),
557 this));
560 editSField(ShortFieldMask);
562 return returnValue;
565 GetFieldHandlePtr PipelineComposerBase::getHandleAlpha (void) const
567 SFBool::GetHandlePtr returnValue(
568 new SFBool::GetHandle(
569 &_sfAlpha,
570 this->getType().getFieldDesc(AlphaFieldId),
571 const_cast<PipelineComposerBase *>(this)));
573 return returnValue;
576 EditFieldHandlePtr PipelineComposerBase::editHandleAlpha (void)
578 SFBool::EditHandlePtr returnValue(
579 new SFBool::EditHandle(
580 &_sfAlpha,
581 this->getType().getFieldDesc(AlphaFieldId),
582 this));
585 editSField(AlphaFieldMask);
587 return returnValue;
590 GetFieldHandlePtr PipelineComposerBase::getHandleTileSize (void) const
592 SFUInt32::GetHandlePtr returnValue(
593 new SFUInt32::GetHandle(
594 &_sfTileSize,
595 this->getType().getFieldDesc(TileSizeFieldId),
596 const_cast<PipelineComposerBase *>(this)));
598 return returnValue;
601 EditFieldHandlePtr PipelineComposerBase::editHandleTileSize (void)
603 SFUInt32::EditHandlePtr returnValue(
604 new SFUInt32::EditHandle(
605 &_sfTileSize,
606 this->getType().getFieldDesc(TileSizeFieldId),
607 this));
610 editSField(TileSizeFieldMask);
612 return returnValue;
615 GetFieldHandlePtr PipelineComposerBase::getHandlePipelined (void) const
617 SFBool::GetHandlePtr returnValue(
618 new SFBool::GetHandle(
619 &_sfPipelined,
620 this->getType().getFieldDesc(PipelinedFieldId),
621 const_cast<PipelineComposerBase *>(this)));
623 return returnValue;
626 EditFieldHandlePtr PipelineComposerBase::editHandlePipelined (void)
628 SFBool::EditHandlePtr returnValue(
629 new SFBool::EditHandle(
630 &_sfPipelined,
631 this->getType().getFieldDesc(PipelinedFieldId),
632 this));
635 editSField(PipelinedFieldMask);
637 return returnValue;
641 #ifdef OSG_MT_CPTR_ASPECT
642 void PipelineComposerBase::execSyncV( FieldContainer &oFrom,
643 ConstFieldMaskArg whichField,
644 AspectOffsetStore &oOffsets,
645 ConstFieldMaskArg syncMode,
646 const UInt32 uiSyncInfo)
648 PipelineComposer *pThis = static_cast<PipelineComposer *>(this);
650 pThis->execSync(static_cast<PipelineComposer *>(&oFrom),
651 whichField,
652 oOffsets,
653 syncMode,
654 uiSyncInfo);
656 #endif
659 #ifdef OSG_MT_CPTR_ASPECT
660 FieldContainer *PipelineComposerBase::createAspectCopy(
661 const FieldContainer *pRefAspect) const
663 PipelineComposer *returnValue;
665 newAspectCopy(returnValue,
666 dynamic_cast<const PipelineComposer *>(pRefAspect),
667 dynamic_cast<const PipelineComposer *>(this));
669 return returnValue;
671 #endif
673 void PipelineComposerBase::resolveLinks(void)
675 Inherited::resolveLinks();
681 OSG_END_NAMESPACE