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 PipelineComposer!
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 "OSGPipelineComposerBase.h"
67 #include "OSGPipelineComposer.h"
69 #include <boost/bind.hpp>
73 /***************************************************************************\
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",
110 PipelineComposer::getClassType(),
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(),
129 ShortFieldId
, ShortFieldMask
,
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(),
141 AlphaFieldId
, AlphaFieldMask
,
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(),
153 TileSizeFieldId
, TileSizeFieldMask
,
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(),
165 PipelinedFieldId
, PipelinedFieldMask
,
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(),
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
)),
187 "<?xml version=\"1.0\"?>\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"
202 "\t name=\"short\"\n"
204 "\t cardinality=\"single\"\n"
205 "\t visibility=\"external\"\n"
206 "\t defaultValue=\"true\"\n"
207 "\t access=\"public\"\n"
211 "\t name=\"alpha\"\n"
213 "\t cardinality=\"single\"\n"
214 "\t visibility=\"external\"\n"
215 "\t defaultValue=\"false\"\n"
216 "\t access=\"public\"\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"
229 "\t name=\"pipelined\"\n"
231 "\t cardinality=\"single\"\n"
232 "\t visibility=\"external\"\n"
233 "\t defaultValue=\"false\"\n"
234 "\t access=\"public\"\n"
237 "</FieldContainer>\n",
241 /*------------------------------ get -----------------------------------*/
243 FieldContainerType
&PipelineComposerBase::getType(void)
248 const FieldContainerType
&PipelineComposerBase::getType(void) const
253 UInt32
PipelineComposerBase::getContainerSize(void) const
255 return sizeof(PipelineComposer
);
258 /*------------------------- decorator get ------------------------------*/
261 SFBool
*PipelineComposerBase::editSFShort(void)
263 editSField(ShortFieldMask
);
268 const SFBool
*PipelineComposerBase::getSFShort(void) const
274 SFBool
*PipelineComposerBase::editSFAlpha(void)
276 editSField(AlphaFieldMask
);
281 const SFBool
*PipelineComposerBase::getSFAlpha(void) const
287 SFUInt32
*PipelineComposerBase::editSFTileSize(void)
289 editSField(TileSizeFieldMask
);
294 const SFUInt32
*PipelineComposerBase::getSFTileSize(void) const
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();
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
);
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
);
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
);
441 PipelineComposer
*PipelineComposerBase::createEmptyLocal(BitVector bFlags
)
443 PipelineComposer
*returnValue
;
445 newPtr
<PipelineComposer
>(returnValue
, bFlags
);
447 returnValue
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
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();
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
;
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
;
494 FieldContainerTransitPtr
PipelineComposerBase::shallowCopy(void) const
496 PipelineComposer
*tmpPtr
;
499 dynamic_cast<const PipelineComposer
*>(this),
500 Thread::getCurrentLocalFlags());
502 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~Thread::getCurrentLocalFlags();
504 FieldContainerTransitPtr
returnValue(tmpPtr
);
512 /*------------------------- constructors ----------------------------------*/
514 PipelineComposerBase::PipelineComposerBase(void) :
516 _sfShort (bool(true)),
517 _sfAlpha (bool(false)),
518 _sfTileSize (UInt32(44)),
519 _sfPipelined (bool(false))
523 PipelineComposerBase::PipelineComposerBase(const PipelineComposerBase
&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(
545 this->getType().getFieldDesc(ShortFieldId
),
546 const_cast<PipelineComposerBase
*>(this)));
551 EditFieldHandlePtr
PipelineComposerBase::editHandleShort (void)
553 SFBool::EditHandlePtr
returnValue(
554 new SFBool::EditHandle(
556 this->getType().getFieldDesc(ShortFieldId
),
560 editSField(ShortFieldMask
);
565 GetFieldHandlePtr
PipelineComposerBase::getHandleAlpha (void) const
567 SFBool::GetHandlePtr
returnValue(
568 new SFBool::GetHandle(
570 this->getType().getFieldDesc(AlphaFieldId
),
571 const_cast<PipelineComposerBase
*>(this)));
576 EditFieldHandlePtr
PipelineComposerBase::editHandleAlpha (void)
578 SFBool::EditHandlePtr
returnValue(
579 new SFBool::EditHandle(
581 this->getType().getFieldDesc(AlphaFieldId
),
585 editSField(AlphaFieldMask
);
590 GetFieldHandlePtr
PipelineComposerBase::getHandleTileSize (void) const
592 SFUInt32::GetHandlePtr
returnValue(
593 new SFUInt32::GetHandle(
595 this->getType().getFieldDesc(TileSizeFieldId
),
596 const_cast<PipelineComposerBase
*>(this)));
601 EditFieldHandlePtr
PipelineComposerBase::editHandleTileSize (void)
603 SFUInt32::EditHandlePtr
returnValue(
604 new SFUInt32::EditHandle(
606 this->getType().getFieldDesc(TileSizeFieldId
),
610 editSField(TileSizeFieldMask
);
615 GetFieldHandlePtr
PipelineComposerBase::getHandlePipelined (void) const
617 SFBool::GetHandlePtr
returnValue(
618 new SFBool::GetHandle(
620 this->getType().getFieldDesc(PipelinedFieldId
),
621 const_cast<PipelineComposerBase
*>(this)));
626 EditFieldHandlePtr
PipelineComposerBase::editHandlePipelined (void)
628 SFBool::EditHandlePtr
returnValue(
629 new SFBool::EditHandle(
631 this->getType().getFieldDesc(PipelinedFieldId
),
635 editSField(PipelinedFieldMask
);
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
),
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));
673 void PipelineComposerBase::resolveLinks(void)
675 Inherited::resolveLinks();