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 SortFirstWindow!
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 "OSGSortFirstWindowBase.h"
67 #include "OSGSortFirstWindow.h"
69 #include <boost/bind.hpp>
73 /***************************************************************************\
75 \***************************************************************************/
77 /*! \class OSG::SortFirstWindow
78 Cluster rendering configuration for sort first image composition
81 /***************************************************************************\
82 * Field Documentation *
83 \***************************************************************************/
85 /*! \var std::string SortFirstWindowBase::_sfCompression
89 /*! \var UInt32 SortFirstWindowBase::_sfSubtileSize
93 /*! \var bool SortFirstWindowBase::_sfCompose
94 Transmit rendered image to cleint
97 /*! \var UInt32 SortFirstWindowBase::_mfRegion
98 left,right,bottom,top for each viewport
101 /*! \var bool SortFirstWindowBase::_sfUseFaceDistribution
102 Enabe, disable analysation of face distribution
106 /***************************************************************************\
107 * FieldType/FieldTrait Instantiation *
108 \***************************************************************************/
110 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
111 PointerType FieldTraits
<SortFirstWindow
*, nsOSG
>::_type(
112 "SortFirstWindowPtr",
114 SortFirstWindow::getClassType(),
118 OSG_FIELDTRAITS_GETTYPE_NS(SortFirstWindow
*, nsOSG
)
120 /***************************************************************************\
121 * Field Description *
122 \***************************************************************************/
124 void SortFirstWindowBase::classDescInserter(TypeObject
&oType
)
126 FieldDescriptionBase
*pDesc
= NULL
;
129 pDesc
= new SFString::Description(
130 SFString::getClassType(),
133 CompressionFieldId
, CompressionFieldMask
,
135 (Field::SFDefaultFlags
| Field::FStdAccess
),
136 static_cast<FieldEditMethodSig
>(&SortFirstWindow::editHandleCompression
),
137 static_cast<FieldGetMethodSig
>(&SortFirstWindow::getHandleCompression
));
139 oType
.addInitialDesc(pDesc
);
141 pDesc
= new SFUInt32::Description(
142 SFUInt32::getClassType(),
145 SubtileSizeFieldId
, SubtileSizeFieldMask
,
147 (Field::SFDefaultFlags
| Field::FStdAccess
),
148 static_cast<FieldEditMethodSig
>(&SortFirstWindow::editHandleSubtileSize
),
149 static_cast<FieldGetMethodSig
>(&SortFirstWindow::getHandleSubtileSize
));
151 oType
.addInitialDesc(pDesc
);
153 pDesc
= new SFBool::Description(
154 SFBool::getClassType(),
156 "Transmit rendered image to cleint\n",
157 ComposeFieldId
, ComposeFieldMask
,
159 (Field::SFDefaultFlags
| Field::FStdAccess
),
160 static_cast<FieldEditMethodSig
>(&SortFirstWindow::editHandleCompose
),
161 static_cast<FieldGetMethodSig
>(&SortFirstWindow::getHandleCompose
));
163 oType
.addInitialDesc(pDesc
);
165 pDesc
= new MFUInt32::Description(
166 MFUInt32::getClassType(),
168 "left,right,bottom,top for each viewport\n",
169 RegionFieldId
, RegionFieldMask
,
171 (Field::MFDefaultFlags
| Field::FStdAccess
),
172 static_cast<FieldEditMethodSig
>(&SortFirstWindow::editHandleRegion
),
173 static_cast<FieldGetMethodSig
>(&SortFirstWindow::getHandleRegion
));
175 oType
.addInitialDesc(pDesc
);
177 pDesc
= new SFBool::Description(
178 SFBool::getClassType(),
179 "useFaceDistribution",
180 "Enabe, disable analysation of face distribution\n",
181 UseFaceDistributionFieldId
, UseFaceDistributionFieldMask
,
183 (Field::SFDefaultFlags
| Field::FStdAccess
),
184 static_cast<FieldEditMethodSig
>(&SortFirstWindow::editHandleUseFaceDistribution
),
185 static_cast<FieldGetMethodSig
>(&SortFirstWindow::getHandleUseFaceDistribution
));
187 oType
.addInitialDesc(pDesc
);
191 SortFirstWindowBase::TypeObject
SortFirstWindowBase::_type(
192 SortFirstWindowBase::getClassname(),
193 Inherited::getClassname(),
196 reinterpret_cast<PrototypeCreateF
>(&SortFirstWindowBase::createEmptyLocal
),
197 reinterpret_cast<InitContainerF
>(&SortFirstWindow::initMethod
),
198 reinterpret_cast<ExitContainerF
>(&SortFirstWindow::exitMethod
),
199 reinterpret_cast<InitalInsertDescFunc
>(
200 reinterpret_cast<void *>(&SortFirstWindow::classDescInserter
)),
203 "<?xml version=\"1.0\"?>\n"
206 " name=\"SortFirstWindow\"\n"
207 " parent=\"ClusterWindow\"\n"
208 " library=\"Cluster\"\n"
209 " pointerfieldtypes=\"none\"\n"
210 " structure=\"concrete\"\n"
211 " systemcomponent=\"true\"\n"
212 " parentsystemcomponent=\"true\"\n"
213 " decoratable=\"false\"\n"
214 " docGroupBase=\"GrpClusterWindow\"\n"
216 " Cluster rendering configuration for sort first image composition\n"
218 "\t name=\"compression\"\n"
219 "\t type=\"std::string\"\n"
220 "\t cardinality=\"single\"\n"
221 "\t visibility=\"external\"\n"
222 "\t access=\"public\"\n"
226 "\t name=\"subtileSize\"\n"
227 "\t type=\"UInt32\"\n"
228 "\t cardinality=\"single\"\n"
229 "\t visibility=\"external\"\n"
230 "\t defaultValue=\"32\"\n"
231 "\t access=\"public\"\n"
235 "\t name=\"compose\"\n"
237 "\t cardinality=\"single\"\n"
238 "\t visibility=\"external\"\n"
239 "\t defaultValue=\"true\"\n"
240 "\t access=\"public\"\n"
242 "\tTransmit rendered image to cleint\n"
245 "\t name=\"region\"\n"
246 "\t type=\"UInt32\"\n"
247 "\t cardinality=\"multi\"\n"
248 "\t visibility=\"external\"\n"
249 "\t access=\"public\"\n"
251 "\tleft,right,bottom,top for each viewport\n"
254 "\t name=\"useFaceDistribution\"\n"
256 "\t cardinality=\"single\"\n"
257 "\t visibility=\"external\"\n"
258 "\t defaultValue=\"false\"\n"
259 "\t access=\"public\"\n"
261 "\tEnabe, disable analysation of face distribution\n"
263 "</FieldContainer>\n",
264 "Cluster rendering configuration for sort first image composition\n"
267 /*------------------------------ get -----------------------------------*/
269 FieldContainerType
&SortFirstWindowBase::getType(void)
274 const FieldContainerType
&SortFirstWindowBase::getType(void) const
279 UInt32
SortFirstWindowBase::getContainerSize(void) const
281 return sizeof(SortFirstWindow
);
284 /*------------------------- decorator get ------------------------------*/
287 SFString
*SortFirstWindowBase::editSFCompression(void)
289 editSField(CompressionFieldMask
);
291 return &_sfCompression
;
294 const SFString
*SortFirstWindowBase::getSFCompression(void) const
296 return &_sfCompression
;
300 SFUInt32
*SortFirstWindowBase::editSFSubtileSize(void)
302 editSField(SubtileSizeFieldMask
);
304 return &_sfSubtileSize
;
307 const SFUInt32
*SortFirstWindowBase::getSFSubtileSize(void) const
309 return &_sfSubtileSize
;
313 SFBool
*SortFirstWindowBase::editSFCompose(void)
315 editSField(ComposeFieldMask
);
320 const SFBool
*SortFirstWindowBase::getSFCompose(void) const
326 MFUInt32
*SortFirstWindowBase::editMFRegion(void)
328 editMField(RegionFieldMask
, _mfRegion
);
333 const MFUInt32
*SortFirstWindowBase::getMFRegion(void) const
339 SFBool
*SortFirstWindowBase::editSFUseFaceDistribution(void)
341 editSField(UseFaceDistributionFieldMask
);
343 return &_sfUseFaceDistribution
;
346 const SFBool
*SortFirstWindowBase::getSFUseFaceDistribution(void) const
348 return &_sfUseFaceDistribution
;
356 /*------------------------------ access -----------------------------------*/
358 SizeT
SortFirstWindowBase::getBinSize(ConstFieldMaskArg whichField
)
360 SizeT returnValue
= Inherited::getBinSize(whichField
);
362 if(FieldBits::NoField
!= (CompressionFieldMask
& whichField
))
364 returnValue
+= _sfCompression
.getBinSize();
366 if(FieldBits::NoField
!= (SubtileSizeFieldMask
& whichField
))
368 returnValue
+= _sfSubtileSize
.getBinSize();
370 if(FieldBits::NoField
!= (ComposeFieldMask
& whichField
))
372 returnValue
+= _sfCompose
.getBinSize();
374 if(FieldBits::NoField
!= (RegionFieldMask
& whichField
))
376 returnValue
+= _mfRegion
.getBinSize();
378 if(FieldBits::NoField
!= (UseFaceDistributionFieldMask
& whichField
))
380 returnValue
+= _sfUseFaceDistribution
.getBinSize();
386 void SortFirstWindowBase::copyToBin(BinaryDataHandler
&pMem
,
387 ConstFieldMaskArg whichField
)
389 Inherited::copyToBin(pMem
, whichField
);
391 if(FieldBits::NoField
!= (CompressionFieldMask
& whichField
))
393 _sfCompression
.copyToBin(pMem
);
395 if(FieldBits::NoField
!= (SubtileSizeFieldMask
& whichField
))
397 _sfSubtileSize
.copyToBin(pMem
);
399 if(FieldBits::NoField
!= (ComposeFieldMask
& whichField
))
401 _sfCompose
.copyToBin(pMem
);
403 if(FieldBits::NoField
!= (RegionFieldMask
& whichField
))
405 _mfRegion
.copyToBin(pMem
);
407 if(FieldBits::NoField
!= (UseFaceDistributionFieldMask
& whichField
))
409 _sfUseFaceDistribution
.copyToBin(pMem
);
413 void SortFirstWindowBase::copyFromBin(BinaryDataHandler
&pMem
,
414 ConstFieldMaskArg whichField
)
416 Inherited::copyFromBin(pMem
, whichField
);
418 if(FieldBits::NoField
!= (CompressionFieldMask
& whichField
))
420 editSField(CompressionFieldMask
);
421 _sfCompression
.copyFromBin(pMem
);
423 if(FieldBits::NoField
!= (SubtileSizeFieldMask
& whichField
))
425 editSField(SubtileSizeFieldMask
);
426 _sfSubtileSize
.copyFromBin(pMem
);
428 if(FieldBits::NoField
!= (ComposeFieldMask
& whichField
))
430 editSField(ComposeFieldMask
);
431 _sfCompose
.copyFromBin(pMem
);
433 if(FieldBits::NoField
!= (RegionFieldMask
& whichField
))
435 editMField(RegionFieldMask
, _mfRegion
);
436 _mfRegion
.copyFromBin(pMem
);
438 if(FieldBits::NoField
!= (UseFaceDistributionFieldMask
& whichField
))
440 editSField(UseFaceDistributionFieldMask
);
441 _sfUseFaceDistribution
.copyFromBin(pMem
);
445 //! create a new instance of the class
446 SortFirstWindowTransitPtr
SortFirstWindowBase::createLocal(BitVector bFlags
)
448 SortFirstWindowTransitPtr fc
;
450 if(getClassType().getPrototype() != NULL
)
452 FieldContainerTransitPtr tmpPtr
=
453 getClassType().getPrototype()-> shallowCopyLocal(bFlags
);
455 fc
= dynamic_pointer_cast
<SortFirstWindow
>(tmpPtr
);
461 //! create a new instance of the class, copy the container flags
462 SortFirstWindowTransitPtr
SortFirstWindowBase::createDependent(BitVector bFlags
)
464 SortFirstWindowTransitPtr fc
;
466 if(getClassType().getPrototype() != NULL
)
468 FieldContainerTransitPtr tmpPtr
=
469 getClassType().getPrototype()-> shallowCopyDependent(bFlags
);
471 fc
= dynamic_pointer_cast
<SortFirstWindow
>(tmpPtr
);
477 //! create a new instance of the class
478 SortFirstWindowTransitPtr
SortFirstWindowBase::create(void)
480 SortFirstWindowTransitPtr fc
;
482 if(getClassType().getPrototype() != NULL
)
484 FieldContainerTransitPtr tmpPtr
=
485 getClassType().getPrototype()-> shallowCopy();
487 fc
= dynamic_pointer_cast
<SortFirstWindow
>(tmpPtr
);
493 SortFirstWindow
*SortFirstWindowBase::createEmptyLocal(BitVector bFlags
)
495 SortFirstWindow
*returnValue
;
497 newPtr
<SortFirstWindow
>(returnValue
, bFlags
);
499 returnValue
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
504 //! create an empty new instance of the class, do not copy the prototype
505 SortFirstWindow
*SortFirstWindowBase::createEmpty(void)
507 SortFirstWindow
*returnValue
;
509 newPtr
<SortFirstWindow
>(returnValue
, Thread::getCurrentLocalFlags());
511 returnValue
->_pFieldFlags
->_bNamespaceMask
&=
512 ~Thread::getCurrentLocalFlags();
518 FieldContainerTransitPtr
SortFirstWindowBase::shallowCopyLocal(
519 BitVector bFlags
) const
521 SortFirstWindow
*tmpPtr
;
523 newPtr(tmpPtr
, dynamic_cast<const SortFirstWindow
*>(this), bFlags
);
525 FieldContainerTransitPtr
returnValue(tmpPtr
);
527 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
532 FieldContainerTransitPtr
SortFirstWindowBase::shallowCopyDependent(
533 BitVector bFlags
) const
535 SortFirstWindow
*tmpPtr
;
537 newPtr(tmpPtr
, dynamic_cast<const SortFirstWindow
*>(this), ~bFlags
);
539 FieldContainerTransitPtr
returnValue(tmpPtr
);
541 tmpPtr
->_pFieldFlags
->_bNamespaceMask
= bFlags
;
546 FieldContainerTransitPtr
SortFirstWindowBase::shallowCopy(void) const
548 SortFirstWindow
*tmpPtr
;
551 dynamic_cast<const SortFirstWindow
*>(this),
552 Thread::getCurrentLocalFlags());
554 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~Thread::getCurrentLocalFlags();
556 FieldContainerTransitPtr
returnValue(tmpPtr
);
564 /*------------------------- constructors ----------------------------------*/
566 SortFirstWindowBase::SortFirstWindowBase(void) :
569 _sfSubtileSize (UInt32(32)),
570 _sfCompose (bool(true)),
572 _sfUseFaceDistribution (bool(false))
576 SortFirstWindowBase::SortFirstWindowBase(const SortFirstWindowBase
&source
) :
578 _sfCompression (source
._sfCompression
),
579 _sfSubtileSize (source
._sfSubtileSize
),
580 _sfCompose (source
._sfCompose
),
581 _mfRegion (source
._mfRegion
),
582 _sfUseFaceDistribution (source
._sfUseFaceDistribution
)
587 /*-------------------------- destructors ----------------------------------*/
589 SortFirstWindowBase::~SortFirstWindowBase(void)
594 GetFieldHandlePtr
SortFirstWindowBase::getHandleCompression (void) const
596 SFString::GetHandlePtr
returnValue(
597 new SFString::GetHandle(
599 this->getType().getFieldDesc(CompressionFieldId
),
600 const_cast<SortFirstWindowBase
*>(this)));
605 EditFieldHandlePtr
SortFirstWindowBase::editHandleCompression (void)
607 SFString::EditHandlePtr
returnValue(
608 new SFString::EditHandle(
610 this->getType().getFieldDesc(CompressionFieldId
),
614 editSField(CompressionFieldMask
);
619 GetFieldHandlePtr
SortFirstWindowBase::getHandleSubtileSize (void) const
621 SFUInt32::GetHandlePtr
returnValue(
622 new SFUInt32::GetHandle(
624 this->getType().getFieldDesc(SubtileSizeFieldId
),
625 const_cast<SortFirstWindowBase
*>(this)));
630 EditFieldHandlePtr
SortFirstWindowBase::editHandleSubtileSize (void)
632 SFUInt32::EditHandlePtr
returnValue(
633 new SFUInt32::EditHandle(
635 this->getType().getFieldDesc(SubtileSizeFieldId
),
639 editSField(SubtileSizeFieldMask
);
644 GetFieldHandlePtr
SortFirstWindowBase::getHandleCompose (void) const
646 SFBool::GetHandlePtr
returnValue(
647 new SFBool::GetHandle(
649 this->getType().getFieldDesc(ComposeFieldId
),
650 const_cast<SortFirstWindowBase
*>(this)));
655 EditFieldHandlePtr
SortFirstWindowBase::editHandleCompose (void)
657 SFBool::EditHandlePtr
returnValue(
658 new SFBool::EditHandle(
660 this->getType().getFieldDesc(ComposeFieldId
),
664 editSField(ComposeFieldMask
);
669 GetFieldHandlePtr
SortFirstWindowBase::getHandleRegion (void) const
671 MFUInt32::GetHandlePtr
returnValue(
672 new MFUInt32::GetHandle(
674 this->getType().getFieldDesc(RegionFieldId
),
675 const_cast<SortFirstWindowBase
*>(this)));
680 EditFieldHandlePtr
SortFirstWindowBase::editHandleRegion (void)
682 MFUInt32::EditHandlePtr
returnValue(
683 new MFUInt32::EditHandle(
685 this->getType().getFieldDesc(RegionFieldId
),
689 editMField(RegionFieldMask
, _mfRegion
);
694 GetFieldHandlePtr
SortFirstWindowBase::getHandleUseFaceDistribution (void) const
696 SFBool::GetHandlePtr
returnValue(
697 new SFBool::GetHandle(
698 &_sfUseFaceDistribution
,
699 this->getType().getFieldDesc(UseFaceDistributionFieldId
),
700 const_cast<SortFirstWindowBase
*>(this)));
705 EditFieldHandlePtr
SortFirstWindowBase::editHandleUseFaceDistribution(void)
707 SFBool::EditHandlePtr
returnValue(
708 new SFBool::EditHandle(
709 &_sfUseFaceDistribution
,
710 this->getType().getFieldDesc(UseFaceDistributionFieldId
),
714 editSField(UseFaceDistributionFieldMask
);
720 #ifdef OSG_MT_CPTR_ASPECT
721 void SortFirstWindowBase::execSyncV( FieldContainer
&oFrom
,
722 ConstFieldMaskArg whichField
,
723 AspectOffsetStore
&oOffsets
,
724 ConstFieldMaskArg syncMode
,
725 const UInt32 uiSyncInfo
)
727 SortFirstWindow
*pThis
= static_cast<SortFirstWindow
*>(this);
729 pThis
->execSync(static_cast<SortFirstWindow
*>(&oFrom
),
738 #ifdef OSG_MT_CPTR_ASPECT
739 FieldContainer
*SortFirstWindowBase::createAspectCopy(
740 const FieldContainer
*pRefAspect
) const
742 SortFirstWindow
*returnValue
;
744 newAspectCopy(returnValue
,
745 dynamic_cast<const SortFirstWindow
*>(pRefAspect
),
746 dynamic_cast<const SortFirstWindow
*>(this));
752 void SortFirstWindowBase::resolveLinks(void)
754 Inherited::resolveLinks();
756 #ifdef OSG_MT_CPTR_ASPECT
757 AspectOffsetStore oOffsets
;
759 _pAspectStore
->fillOffsetArray(oOffsets
, this);
762 #ifdef OSG_MT_CPTR_ASPECT
763 _mfRegion
.terminateShare(Thread::getCurrentAspect(),