changed: gcc8 base update
[opensg.git] / Source / System / Cluster / Window / SortLast / OSGParallelComposerBase.cpp
blobdac08091197fed381bb265aab511f0f630c21ceb
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 ParallelComposer!
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 "OSGParallelComposerBase.h"
67 #include "OSGParallelComposer.h"
69 #include <boost/bind.hpp>
71 OSG_BEGIN_NAMESPACE
73 /***************************************************************************\
74 * Description *
75 \***************************************************************************/
77 /*! \class OSG::ParallelComposer
81 /***************************************************************************\
82 * Field Documentation *
83 \***************************************************************************/
85 /*! \var bool ParallelComposerBase::_sfShort
89 /*! \var bool ParallelComposerBase::_sfAlpha
93 /*! \var std::string ParallelComposerBase::_sfPcLibPath
98 /***************************************************************************\
99 * FieldType/FieldTrait Instantiation *
100 \***************************************************************************/
102 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
103 PointerType FieldTraits<ParallelComposer *, nsOSG>::_type(
104 "ParallelComposerPtr",
105 "ImageComposerPtr",
106 ParallelComposer::getClassType(),
107 nsOSG);
108 #endif
110 OSG_FIELDTRAITS_GETTYPE_NS(ParallelComposer *, nsOSG)
112 /***************************************************************************\
113 * Field Description *
114 \***************************************************************************/
116 void ParallelComposerBase::classDescInserter(TypeObject &oType)
118 FieldDescriptionBase *pDesc = NULL;
121 pDesc = new SFBool::Description(
122 SFBool::getClassType(),
123 "short",
125 ShortFieldId, ShortFieldMask,
126 false,
127 (Field::SFDefaultFlags | Field::FStdAccess),
128 static_cast<FieldEditMethodSig>(&ParallelComposer::editHandleShort),
129 static_cast<FieldGetMethodSig >(&ParallelComposer::getHandleShort));
131 oType.addInitialDesc(pDesc);
133 pDesc = new SFBool::Description(
134 SFBool::getClassType(),
135 "alpha",
137 AlphaFieldId, AlphaFieldMask,
138 false,
139 (Field::SFDefaultFlags | Field::FStdAccess),
140 static_cast<FieldEditMethodSig>(&ParallelComposer::editHandleAlpha),
141 static_cast<FieldGetMethodSig >(&ParallelComposer::getHandleAlpha));
143 oType.addInitialDesc(pDesc);
145 pDesc = new SFString::Description(
146 SFString::getClassType(),
147 "pcLibPath",
149 PcLibPathFieldId, PcLibPathFieldMask,
150 false,
151 (Field::SFDefaultFlags | Field::FStdAccess),
152 static_cast<FieldEditMethodSig>(&ParallelComposer::editHandlePcLibPath),
153 static_cast<FieldGetMethodSig >(&ParallelComposer::getHandlePcLibPath));
155 oType.addInitialDesc(pDesc);
159 ParallelComposerBase::TypeObject ParallelComposerBase::_type(
160 ParallelComposerBase::getClassname(),
161 Inherited::getClassname(),
162 "NULL",
163 nsOSG, //Namespace
164 reinterpret_cast<PrototypeCreateF>(&ParallelComposerBase::createEmptyLocal),
165 reinterpret_cast<InitContainerF>(&ParallelComposer::initMethod),
166 reinterpret_cast<ExitContainerF>(&ParallelComposer::exitMethod),
167 reinterpret_cast<InitalInsertDescFunc>(
168 reinterpret_cast<void *>(&ParallelComposer::classDescInserter)),
169 false,
171 "<?xml version=\"1.0\"?>\n"
172 "\n"
173 "<FieldContainer\n"
174 " name=\"ParallelComposer\"\n"
175 " parent=\"ImageComposer\"\n"
176 " library=\"Cluster\"\n"
177 " pointerfieldtypes=\"none\"\n"
178 " structure=\"concrete\"\n"
179 " systemcomponent=\"true\"\n"
180 " parentsystemcomponent=\"true\"\n"
181 " decoratable=\"false\"\n"
182 " useLocalIncludes=\"false\"\n"
183 " docGroupBase=\"GrpClusterWindow\"\n"
184 " >\n"
185 " <Field\n"
186 " name=\"short\"\n"
187 " type=\"bool\"\n"
188 " cardinality=\"single\"\n"
189 " visibility=\"external\"\n"
190 " defaultValue=\"true\"\n"
191 " access=\"public\"\n"
192 " >\n"
193 " </Field>\n"
194 " <Field\n"
195 " name=\"alpha\"\n"
196 " type=\"bool\"\n"
197 " cardinality=\"single\"\n"
198 " visibility=\"external\"\n"
199 " defaultValue=\"false\"\n"
200 " access=\"public\"\n"
201 " >\n"
202 " </Field>\n"
203 " <Field\n"
204 " name=\"pcLibPath\"\n"
205 " type=\"std::string\"\n"
206 " cardinality=\"single\"\n"
207 " visibility=\"external\"\n"
208 " access=\"public\"\n"
209 " defaultValue=\"\"\n"
210 " >\n"
211 " </Field> \n"
212 "</FieldContainer>\n",
216 /*------------------------------ get -----------------------------------*/
218 FieldContainerType &ParallelComposerBase::getType(void)
220 return _type;
223 const FieldContainerType &ParallelComposerBase::getType(void) const
225 return _type;
228 UInt32 ParallelComposerBase::getContainerSize(void) const
230 return sizeof(ParallelComposer);
233 /*------------------------- decorator get ------------------------------*/
236 SFBool *ParallelComposerBase::editSFShort(void)
238 editSField(ShortFieldMask);
240 return &_sfShort;
243 const SFBool *ParallelComposerBase::getSFShort(void) const
245 return &_sfShort;
249 SFBool *ParallelComposerBase::editSFAlpha(void)
251 editSField(AlphaFieldMask);
253 return &_sfAlpha;
256 const SFBool *ParallelComposerBase::getSFAlpha(void) const
258 return &_sfAlpha;
262 SFString *ParallelComposerBase::editSFPcLibPath(void)
264 editSField(PcLibPathFieldMask);
266 return &_sfPcLibPath;
269 const SFString *ParallelComposerBase::getSFPcLibPath(void) const
271 return &_sfPcLibPath;
279 /*------------------------------ access -----------------------------------*/
281 SizeT ParallelComposerBase::getBinSize(ConstFieldMaskArg whichField)
283 SizeT returnValue = Inherited::getBinSize(whichField);
285 if(FieldBits::NoField != (ShortFieldMask & whichField))
287 returnValue += _sfShort.getBinSize();
289 if(FieldBits::NoField != (AlphaFieldMask & whichField))
291 returnValue += _sfAlpha.getBinSize();
293 if(FieldBits::NoField != (PcLibPathFieldMask & whichField))
295 returnValue += _sfPcLibPath.getBinSize();
298 return returnValue;
301 void ParallelComposerBase::copyToBin(BinaryDataHandler &pMem,
302 ConstFieldMaskArg whichField)
304 Inherited::copyToBin(pMem, whichField);
306 if(FieldBits::NoField != (ShortFieldMask & whichField))
308 _sfShort.copyToBin(pMem);
310 if(FieldBits::NoField != (AlphaFieldMask & whichField))
312 _sfAlpha.copyToBin(pMem);
314 if(FieldBits::NoField != (PcLibPathFieldMask & whichField))
316 _sfPcLibPath.copyToBin(pMem);
320 void ParallelComposerBase::copyFromBin(BinaryDataHandler &pMem,
321 ConstFieldMaskArg whichField)
323 Inherited::copyFromBin(pMem, whichField);
325 if(FieldBits::NoField != (ShortFieldMask & whichField))
327 editSField(ShortFieldMask);
328 _sfShort.copyFromBin(pMem);
330 if(FieldBits::NoField != (AlphaFieldMask & whichField))
332 editSField(AlphaFieldMask);
333 _sfAlpha.copyFromBin(pMem);
335 if(FieldBits::NoField != (PcLibPathFieldMask & whichField))
337 editSField(PcLibPathFieldMask);
338 _sfPcLibPath.copyFromBin(pMem);
342 //! create a new instance of the class
343 ParallelComposerTransitPtr ParallelComposerBase::createLocal(BitVector bFlags)
345 ParallelComposerTransitPtr fc;
347 if(getClassType().getPrototype() != NULL)
349 FieldContainerTransitPtr tmpPtr =
350 getClassType().getPrototype()-> shallowCopyLocal(bFlags);
352 fc = dynamic_pointer_cast<ParallelComposer>(tmpPtr);
355 return fc;
358 //! create a new instance of the class, copy the container flags
359 ParallelComposerTransitPtr ParallelComposerBase::createDependent(BitVector bFlags)
361 ParallelComposerTransitPtr fc;
363 if(getClassType().getPrototype() != NULL)
365 FieldContainerTransitPtr tmpPtr =
366 getClassType().getPrototype()-> shallowCopyDependent(bFlags);
368 fc = dynamic_pointer_cast<ParallelComposer>(tmpPtr);
371 return fc;
374 //! create a new instance of the class
375 ParallelComposerTransitPtr ParallelComposerBase::create(void)
377 ParallelComposerTransitPtr fc;
379 if(getClassType().getPrototype() != NULL)
381 FieldContainerTransitPtr tmpPtr =
382 getClassType().getPrototype()-> shallowCopy();
384 fc = dynamic_pointer_cast<ParallelComposer>(tmpPtr);
387 return fc;
390 ParallelComposer *ParallelComposerBase::createEmptyLocal(BitVector bFlags)
392 ParallelComposer *returnValue;
394 newPtr<ParallelComposer>(returnValue, bFlags);
396 returnValue->_pFieldFlags->_bNamespaceMask &= ~bFlags;
398 return returnValue;
401 //! create an empty new instance of the class, do not copy the prototype
402 ParallelComposer *ParallelComposerBase::createEmpty(void)
404 ParallelComposer *returnValue;
406 newPtr<ParallelComposer>(returnValue, Thread::getCurrentLocalFlags());
408 returnValue->_pFieldFlags->_bNamespaceMask &=
409 ~Thread::getCurrentLocalFlags();
411 return returnValue;
415 FieldContainerTransitPtr ParallelComposerBase::shallowCopyLocal(
416 BitVector bFlags) const
418 ParallelComposer *tmpPtr;
420 newPtr(tmpPtr, dynamic_cast<const ParallelComposer *>(this), bFlags);
422 FieldContainerTransitPtr returnValue(tmpPtr);
424 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~bFlags;
426 return returnValue;
429 FieldContainerTransitPtr ParallelComposerBase::shallowCopyDependent(
430 BitVector bFlags) const
432 ParallelComposer *tmpPtr;
434 newPtr(tmpPtr, dynamic_cast<const ParallelComposer *>(this), ~bFlags);
436 FieldContainerTransitPtr returnValue(tmpPtr);
438 tmpPtr->_pFieldFlags->_bNamespaceMask = bFlags;
440 return returnValue;
443 FieldContainerTransitPtr ParallelComposerBase::shallowCopy(void) const
445 ParallelComposer *tmpPtr;
447 newPtr(tmpPtr,
448 dynamic_cast<const ParallelComposer *>(this),
449 Thread::getCurrentLocalFlags());
451 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~Thread::getCurrentLocalFlags();
453 FieldContainerTransitPtr returnValue(tmpPtr);
455 return returnValue;
461 /*------------------------- constructors ----------------------------------*/
463 ParallelComposerBase::ParallelComposerBase(void) :
464 Inherited(),
465 _sfShort (bool(true)),
466 _sfAlpha (bool(false)),
467 _sfPcLibPath ()
471 ParallelComposerBase::ParallelComposerBase(const ParallelComposerBase &source) :
472 Inherited(source),
473 _sfShort (source._sfShort ),
474 _sfAlpha (source._sfAlpha ),
475 _sfPcLibPath (source._sfPcLibPath )
480 /*-------------------------- destructors ----------------------------------*/
482 ParallelComposerBase::~ParallelComposerBase(void)
487 GetFieldHandlePtr ParallelComposerBase::getHandleShort (void) const
489 SFBool::GetHandlePtr returnValue(
490 new SFBool::GetHandle(
491 &_sfShort,
492 this->getType().getFieldDesc(ShortFieldId),
493 const_cast<ParallelComposerBase *>(this)));
495 return returnValue;
498 EditFieldHandlePtr ParallelComposerBase::editHandleShort (void)
500 SFBool::EditHandlePtr returnValue(
501 new SFBool::EditHandle(
502 &_sfShort,
503 this->getType().getFieldDesc(ShortFieldId),
504 this));
507 editSField(ShortFieldMask);
509 return returnValue;
512 GetFieldHandlePtr ParallelComposerBase::getHandleAlpha (void) const
514 SFBool::GetHandlePtr returnValue(
515 new SFBool::GetHandle(
516 &_sfAlpha,
517 this->getType().getFieldDesc(AlphaFieldId),
518 const_cast<ParallelComposerBase *>(this)));
520 return returnValue;
523 EditFieldHandlePtr ParallelComposerBase::editHandleAlpha (void)
525 SFBool::EditHandlePtr returnValue(
526 new SFBool::EditHandle(
527 &_sfAlpha,
528 this->getType().getFieldDesc(AlphaFieldId),
529 this));
532 editSField(AlphaFieldMask);
534 return returnValue;
537 GetFieldHandlePtr ParallelComposerBase::getHandlePcLibPath (void) const
539 SFString::GetHandlePtr returnValue(
540 new SFString::GetHandle(
541 &_sfPcLibPath,
542 this->getType().getFieldDesc(PcLibPathFieldId),
543 const_cast<ParallelComposerBase *>(this)));
545 return returnValue;
548 EditFieldHandlePtr ParallelComposerBase::editHandlePcLibPath (void)
550 SFString::EditHandlePtr returnValue(
551 new SFString::EditHandle(
552 &_sfPcLibPath,
553 this->getType().getFieldDesc(PcLibPathFieldId),
554 this));
557 editSField(PcLibPathFieldMask);
559 return returnValue;
563 #ifdef OSG_MT_CPTR_ASPECT
564 void ParallelComposerBase::execSyncV( FieldContainer &oFrom,
565 ConstFieldMaskArg whichField,
566 AspectOffsetStore &oOffsets,
567 ConstFieldMaskArg syncMode,
568 const UInt32 uiSyncInfo)
570 ParallelComposer *pThis = static_cast<ParallelComposer *>(this);
572 pThis->execSync(static_cast<ParallelComposer *>(&oFrom),
573 whichField,
574 oOffsets,
575 syncMode,
576 uiSyncInfo);
578 #endif
581 #ifdef OSG_MT_CPTR_ASPECT
582 FieldContainer *ParallelComposerBase::createAspectCopy(
583 const FieldContainer *pRefAspect) const
585 ParallelComposer *returnValue;
587 newAspectCopy(returnValue,
588 dynamic_cast<const ParallelComposer *>(pRefAspect),
589 dynamic_cast<const ParallelComposer *>(this));
591 return returnValue;
593 #endif
595 void ParallelComposerBase::resolveLinks(void)
597 Inherited::resolveLinks();
603 OSG_END_NAMESPACE