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 CSMMultiWinOptions!
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 "OSGCSMMultiWinOptionsBase.h"
67 #include "OSGCSMMultiWinOptions.h"
69 #include <boost/bind.hpp>
73 /***************************************************************************\
75 \***************************************************************************/
77 /*! \class OSG::CSMMultiWinOptions
81 /***************************************************************************\
82 * Field Documentation *
83 \***************************************************************************/
85 /*! \var Int32 CSMMultiWinOptionsBase::_sfXOverlap
89 /*! \var Int32 CSMMultiWinOptionsBase::_sfYOverlap
93 /*! \var bool CSMMultiWinOptionsBase::_sfManageClientViewports
97 /*! \var bool CSMMultiWinOptionsBase::_sfBalance
101 /*! \var bool CSMMultiWinOptionsBase::_sfBestCut
105 /*! \var bool CSMMultiWinOptionsBase::_sfShowBalancing
110 /***************************************************************************\
111 * FieldType/FieldTrait Instantiation *
112 \***************************************************************************/
114 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
115 PointerType FieldTraits
<CSMMultiWinOptions
*, nsOSG
>::_type(
116 "CSMMultiWinOptionsPtr",
117 "CSMClusterWinOptionsPtr",
118 CSMMultiWinOptions::getClassType(),
122 OSG_FIELDTRAITS_GETTYPE_NS(CSMMultiWinOptions
*, nsOSG
)
124 /***************************************************************************\
125 * Field Description *
126 \***************************************************************************/
128 void CSMMultiWinOptionsBase::classDescInserter(TypeObject
&oType
)
130 FieldDescriptionBase
*pDesc
= NULL
;
133 pDesc
= new SFInt32::Description(
134 SFInt32::getClassType(),
137 XOverlapFieldId
, XOverlapFieldMask
,
139 (Field::SFDefaultFlags
| Field::FStdAccess
),
140 static_cast<FieldEditMethodSig
>(&CSMMultiWinOptions::editHandleXOverlap
),
141 static_cast<FieldGetMethodSig
>(&CSMMultiWinOptions::getHandleXOverlap
));
143 oType
.addInitialDesc(pDesc
);
145 pDesc
= new SFInt32::Description(
146 SFInt32::getClassType(),
149 YOverlapFieldId
, YOverlapFieldMask
,
151 (Field::SFDefaultFlags
| Field::FStdAccess
),
152 static_cast<FieldEditMethodSig
>(&CSMMultiWinOptions::editHandleYOverlap
),
153 static_cast<FieldGetMethodSig
>(&CSMMultiWinOptions::getHandleYOverlap
));
155 oType
.addInitialDesc(pDesc
);
157 pDesc
= new SFBool::Description(
158 SFBool::getClassType(),
159 "manageClientViewports",
161 ManageClientViewportsFieldId
, ManageClientViewportsFieldMask
,
163 (Field::SFDefaultFlags
| Field::FStdAccess
),
164 static_cast<FieldEditMethodSig
>(&CSMMultiWinOptions::editHandleManageClientViewports
),
165 static_cast<FieldGetMethodSig
>(&CSMMultiWinOptions::getHandleManageClientViewports
));
167 oType
.addInitialDesc(pDesc
);
169 pDesc
= new SFBool::Description(
170 SFBool::getClassType(),
173 BalanceFieldId
, BalanceFieldMask
,
175 (Field::SFDefaultFlags
| Field::FStdAccess
),
176 static_cast<FieldEditMethodSig
>(&CSMMultiWinOptions::editHandleBalance
),
177 static_cast<FieldGetMethodSig
>(&CSMMultiWinOptions::getHandleBalance
));
179 oType
.addInitialDesc(pDesc
);
181 pDesc
= new SFBool::Description(
182 SFBool::getClassType(),
185 BestCutFieldId
, BestCutFieldMask
,
187 (Field::SFDefaultFlags
| Field::FStdAccess
),
188 static_cast<FieldEditMethodSig
>(&CSMMultiWinOptions::editHandleBestCut
),
189 static_cast<FieldGetMethodSig
>(&CSMMultiWinOptions::getHandleBestCut
));
191 oType
.addInitialDesc(pDesc
);
193 pDesc
= new SFBool::Description(
194 SFBool::getClassType(),
197 ShowBalancingFieldId
, ShowBalancingFieldMask
,
199 (Field::SFDefaultFlags
| Field::FStdAccess
),
200 static_cast<FieldEditMethodSig
>(&CSMMultiWinOptions::editHandleShowBalancing
),
201 static_cast<FieldGetMethodSig
>(&CSMMultiWinOptions::getHandleShowBalancing
));
203 oType
.addInitialDesc(pDesc
);
207 CSMMultiWinOptionsBase::TypeObject
CSMMultiWinOptionsBase::_type(
208 CSMMultiWinOptionsBase::getClassname(),
209 Inherited::getClassname(),
212 reinterpret_cast<PrototypeCreateF
>(&CSMMultiWinOptionsBase::createEmptyLocal
),
213 reinterpret_cast<InitContainerF
>(&CSMMultiWinOptions::initMethod
),
214 reinterpret_cast<ExitContainerF
>(&CSMMultiWinOptions::exitMethod
),
215 reinterpret_cast<InitalInsertDescFunc
>(
216 reinterpret_cast<void *>(&CSMMultiWinOptions::classDescInserter
)),
219 "<?xml version=\"1.0\"?>\n"
222 " name=\"CSMMultiWinOptions\"\n"
223 " parent=\"CSMClusterWinOptions\"\n"
224 " library=\"ContribCSM\"\n"
225 " pointerfieldtypes=\"none\"\n"
226 " structure=\"concrete\"\n"
227 " systemcomponent=\"true\"\n"
228 " parentsystemcomponent=\"true\"\n"
229 " decoratable=\"false\"\n"
230 " useLocalIncludes=\"false\"\n"
231 " isNodeCore=\"false\"\n"
232 " isBundle=\"true\"\n"
233 " parentFields=\"none\"\n"
236 " name=\"xOverlap\"\n"
238 " cardinality=\"single\"\n"
239 " visibility=\"external\"\n"
240 " access=\"public\"\n"
244 " name=\"yOverlap\"\n"
246 " cardinality=\"single\"\n"
247 " visibility=\"external\"\n"
248 " access=\"public\"\n"
252 "\t\tname=\"manageClientViewports\"\n"
253 "\t\ttype=\"bool\"\n"
254 "\t\tcardinality=\"single\"\n"
255 "\t\tvisibility=\"external\"\n"
256 "\t\tdefaultValue=\"true\"\n"
257 "\t\taccess=\"public\"\n"
261 "\t\tname=\"balance\"\n"
262 "\t\ttype=\"bool\"\n"
263 "\t\tcardinality=\"single\"\n"
264 "\t\tvisibility=\"external\"\n"
265 "\t\tdefaultValue=\"true\"\n"
266 "\t\taccess=\"public\"\n"
270 "\t\tname=\"bestCut\"\n"
271 "\t\ttype=\"bool\"\n"
272 "\t\tcardinality=\"single\"\n"
273 "\t\tvisibility=\"external\"\n"
274 "\t\tdefaultValue=\"false\"\n"
275 "\t\taccess=\"public\"\n"
279 "\t\tname=\"showBalancing\"\n"
280 "\t\ttype=\"bool\"\n"
281 "\t\tcardinality=\"single\"\n"
282 "\t\tvisibility=\"external\"\n"
283 "\t\tdefaultValue=\"false\"\n"
284 "\t\taccess=\"public\"\n"
287 "</FieldContainer>\n",
291 /*------------------------------ get -----------------------------------*/
293 FieldContainerType
&CSMMultiWinOptionsBase::getType(void)
298 const FieldContainerType
&CSMMultiWinOptionsBase::getType(void) const
303 UInt32
CSMMultiWinOptionsBase::getContainerSize(void) const
305 return sizeof(CSMMultiWinOptions
);
308 /*------------------------- decorator get ------------------------------*/
311 SFInt32
*CSMMultiWinOptionsBase::editSFXOverlap(void)
313 editSField(XOverlapFieldMask
);
318 const SFInt32
*CSMMultiWinOptionsBase::getSFXOverlap(void) const
324 SFInt32
*CSMMultiWinOptionsBase::editSFYOverlap(void)
326 editSField(YOverlapFieldMask
);
331 const SFInt32
*CSMMultiWinOptionsBase::getSFYOverlap(void) const
337 SFBool
*CSMMultiWinOptionsBase::editSFManageClientViewports(void)
339 editSField(ManageClientViewportsFieldMask
);
341 return &_sfManageClientViewports
;
344 const SFBool
*CSMMultiWinOptionsBase::getSFManageClientViewports(void) const
346 return &_sfManageClientViewports
;
350 SFBool
*CSMMultiWinOptionsBase::editSFBalance(void)
352 editSField(BalanceFieldMask
);
357 const SFBool
*CSMMultiWinOptionsBase::getSFBalance(void) const
363 SFBool
*CSMMultiWinOptionsBase::editSFBestCut(void)
365 editSField(BestCutFieldMask
);
370 const SFBool
*CSMMultiWinOptionsBase::getSFBestCut(void) const
376 SFBool
*CSMMultiWinOptionsBase::editSFShowBalancing(void)
378 editSField(ShowBalancingFieldMask
);
380 return &_sfShowBalancing
;
383 const SFBool
*CSMMultiWinOptionsBase::getSFShowBalancing(void) const
385 return &_sfShowBalancing
;
393 /*------------------------------ access -----------------------------------*/
395 SizeT
CSMMultiWinOptionsBase::getBinSize(ConstFieldMaskArg whichField
)
397 SizeT returnValue
= Inherited::getBinSize(whichField
);
399 if(FieldBits::NoField
!= (XOverlapFieldMask
& whichField
))
401 returnValue
+= _sfXOverlap
.getBinSize();
403 if(FieldBits::NoField
!= (YOverlapFieldMask
& whichField
))
405 returnValue
+= _sfYOverlap
.getBinSize();
407 if(FieldBits::NoField
!= (ManageClientViewportsFieldMask
& whichField
))
409 returnValue
+= _sfManageClientViewports
.getBinSize();
411 if(FieldBits::NoField
!= (BalanceFieldMask
& whichField
))
413 returnValue
+= _sfBalance
.getBinSize();
415 if(FieldBits::NoField
!= (BestCutFieldMask
& whichField
))
417 returnValue
+= _sfBestCut
.getBinSize();
419 if(FieldBits::NoField
!= (ShowBalancingFieldMask
& whichField
))
421 returnValue
+= _sfShowBalancing
.getBinSize();
427 void CSMMultiWinOptionsBase::copyToBin(BinaryDataHandler
&pMem
,
428 ConstFieldMaskArg whichField
)
430 Inherited::copyToBin(pMem
, whichField
);
432 if(FieldBits::NoField
!= (XOverlapFieldMask
& whichField
))
434 _sfXOverlap
.copyToBin(pMem
);
436 if(FieldBits::NoField
!= (YOverlapFieldMask
& whichField
))
438 _sfYOverlap
.copyToBin(pMem
);
440 if(FieldBits::NoField
!= (ManageClientViewportsFieldMask
& whichField
))
442 _sfManageClientViewports
.copyToBin(pMem
);
444 if(FieldBits::NoField
!= (BalanceFieldMask
& whichField
))
446 _sfBalance
.copyToBin(pMem
);
448 if(FieldBits::NoField
!= (BestCutFieldMask
& whichField
))
450 _sfBestCut
.copyToBin(pMem
);
452 if(FieldBits::NoField
!= (ShowBalancingFieldMask
& whichField
))
454 _sfShowBalancing
.copyToBin(pMem
);
458 void CSMMultiWinOptionsBase::copyFromBin(BinaryDataHandler
&pMem
,
459 ConstFieldMaskArg whichField
)
461 Inherited::copyFromBin(pMem
, whichField
);
463 if(FieldBits::NoField
!= (XOverlapFieldMask
& whichField
))
465 editSField(XOverlapFieldMask
);
466 _sfXOverlap
.copyFromBin(pMem
);
468 if(FieldBits::NoField
!= (YOverlapFieldMask
& whichField
))
470 editSField(YOverlapFieldMask
);
471 _sfYOverlap
.copyFromBin(pMem
);
473 if(FieldBits::NoField
!= (ManageClientViewportsFieldMask
& whichField
))
475 editSField(ManageClientViewportsFieldMask
);
476 _sfManageClientViewports
.copyFromBin(pMem
);
478 if(FieldBits::NoField
!= (BalanceFieldMask
& whichField
))
480 editSField(BalanceFieldMask
);
481 _sfBalance
.copyFromBin(pMem
);
483 if(FieldBits::NoField
!= (BestCutFieldMask
& whichField
))
485 editSField(BestCutFieldMask
);
486 _sfBestCut
.copyFromBin(pMem
);
488 if(FieldBits::NoField
!= (ShowBalancingFieldMask
& whichField
))
490 editSField(ShowBalancingFieldMask
);
491 _sfShowBalancing
.copyFromBin(pMem
);
495 //! create a new instance of the class
496 CSMMultiWinOptionsTransitPtr
CSMMultiWinOptionsBase::createLocal(BitVector bFlags
)
498 CSMMultiWinOptionsTransitPtr fc
;
500 if(getClassType().getPrototype() != NULL
)
502 FieldContainerTransitPtr tmpPtr
=
503 getClassType().getPrototype()-> shallowCopyLocal(bFlags
);
505 fc
= dynamic_pointer_cast
<CSMMultiWinOptions
>(tmpPtr
);
511 //! create a new instance of the class, copy the container flags
512 CSMMultiWinOptionsTransitPtr
CSMMultiWinOptionsBase::createDependent(BitVector bFlags
)
514 CSMMultiWinOptionsTransitPtr fc
;
516 if(getClassType().getPrototype() != NULL
)
518 FieldContainerTransitPtr tmpPtr
=
519 getClassType().getPrototype()-> shallowCopyDependent(bFlags
);
521 fc
= dynamic_pointer_cast
<CSMMultiWinOptions
>(tmpPtr
);
527 //! create a new instance of the class
528 CSMMultiWinOptionsTransitPtr
CSMMultiWinOptionsBase::create(void)
530 return createLocal();
533 CSMMultiWinOptions
*CSMMultiWinOptionsBase::createEmptyLocal(BitVector bFlags
)
535 CSMMultiWinOptions
*returnValue
;
537 newPtr
<CSMMultiWinOptions
>(returnValue
, bFlags
);
539 returnValue
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
544 //! create an empty new instance of the class, do not copy the prototype
545 CSMMultiWinOptions
*CSMMultiWinOptionsBase::createEmpty(void)
547 return createEmptyLocal();
551 FieldContainerTransitPtr
CSMMultiWinOptionsBase::shallowCopyLocal(
552 BitVector bFlags
) const
554 CSMMultiWinOptions
*tmpPtr
;
556 newPtr(tmpPtr
, dynamic_cast<const CSMMultiWinOptions
*>(this), bFlags
);
558 FieldContainerTransitPtr
returnValue(tmpPtr
);
560 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
565 FieldContainerTransitPtr
CSMMultiWinOptionsBase::shallowCopyDependent(
566 BitVector bFlags
) const
568 CSMMultiWinOptions
*tmpPtr
;
570 newPtr(tmpPtr
, dynamic_cast<const CSMMultiWinOptions
*>(this), ~bFlags
);
572 FieldContainerTransitPtr
returnValue(tmpPtr
);
574 tmpPtr
->_pFieldFlags
->_bNamespaceMask
= bFlags
;
579 FieldContainerTransitPtr
CSMMultiWinOptionsBase::shallowCopy(void) const
581 return shallowCopyLocal();
587 /*------------------------- constructors ----------------------------------*/
589 CSMMultiWinOptionsBase::CSMMultiWinOptionsBase(void) :
593 _sfManageClientViewports (bool(true)),
594 _sfBalance (bool(true)),
595 _sfBestCut (bool(false)),
596 _sfShowBalancing (bool(false))
600 CSMMultiWinOptionsBase::CSMMultiWinOptionsBase(const CSMMultiWinOptionsBase
&source
) :
602 _sfXOverlap (source
._sfXOverlap
),
603 _sfYOverlap (source
._sfYOverlap
),
604 _sfManageClientViewports (source
._sfManageClientViewports
),
605 _sfBalance (source
._sfBalance
),
606 _sfBestCut (source
._sfBestCut
),
607 _sfShowBalancing (source
._sfShowBalancing
)
612 /*-------------------------- destructors ----------------------------------*/
614 CSMMultiWinOptionsBase::~CSMMultiWinOptionsBase(void)
619 GetFieldHandlePtr
CSMMultiWinOptionsBase::getHandleXOverlap (void) const
621 SFInt32::GetHandlePtr
returnValue(
622 new SFInt32::GetHandle(
624 this->getType().getFieldDesc(XOverlapFieldId
),
625 const_cast<CSMMultiWinOptionsBase
*>(this)));
630 EditFieldHandlePtr
CSMMultiWinOptionsBase::editHandleXOverlap (void)
632 SFInt32::EditHandlePtr
returnValue(
633 new SFInt32::EditHandle(
635 this->getType().getFieldDesc(XOverlapFieldId
),
639 editSField(XOverlapFieldMask
);
644 GetFieldHandlePtr
CSMMultiWinOptionsBase::getHandleYOverlap (void) const
646 SFInt32::GetHandlePtr
returnValue(
647 new SFInt32::GetHandle(
649 this->getType().getFieldDesc(YOverlapFieldId
),
650 const_cast<CSMMultiWinOptionsBase
*>(this)));
655 EditFieldHandlePtr
CSMMultiWinOptionsBase::editHandleYOverlap (void)
657 SFInt32::EditHandlePtr
returnValue(
658 new SFInt32::EditHandle(
660 this->getType().getFieldDesc(YOverlapFieldId
),
664 editSField(YOverlapFieldMask
);
669 GetFieldHandlePtr
CSMMultiWinOptionsBase::getHandleManageClientViewports (void) const
671 SFBool::GetHandlePtr
returnValue(
672 new SFBool::GetHandle(
673 &_sfManageClientViewports
,
674 this->getType().getFieldDesc(ManageClientViewportsFieldId
),
675 const_cast<CSMMultiWinOptionsBase
*>(this)));
680 EditFieldHandlePtr
CSMMultiWinOptionsBase::editHandleManageClientViewports(void)
682 SFBool::EditHandlePtr
returnValue(
683 new SFBool::EditHandle(
684 &_sfManageClientViewports
,
685 this->getType().getFieldDesc(ManageClientViewportsFieldId
),
689 editSField(ManageClientViewportsFieldMask
);
694 GetFieldHandlePtr
CSMMultiWinOptionsBase::getHandleBalance (void) const
696 SFBool::GetHandlePtr
returnValue(
697 new SFBool::GetHandle(
699 this->getType().getFieldDesc(BalanceFieldId
),
700 const_cast<CSMMultiWinOptionsBase
*>(this)));
705 EditFieldHandlePtr
CSMMultiWinOptionsBase::editHandleBalance (void)
707 SFBool::EditHandlePtr
returnValue(
708 new SFBool::EditHandle(
710 this->getType().getFieldDesc(BalanceFieldId
),
714 editSField(BalanceFieldMask
);
719 GetFieldHandlePtr
CSMMultiWinOptionsBase::getHandleBestCut (void) const
721 SFBool::GetHandlePtr
returnValue(
722 new SFBool::GetHandle(
724 this->getType().getFieldDesc(BestCutFieldId
),
725 const_cast<CSMMultiWinOptionsBase
*>(this)));
730 EditFieldHandlePtr
CSMMultiWinOptionsBase::editHandleBestCut (void)
732 SFBool::EditHandlePtr
returnValue(
733 new SFBool::EditHandle(
735 this->getType().getFieldDesc(BestCutFieldId
),
739 editSField(BestCutFieldMask
);
744 GetFieldHandlePtr
CSMMultiWinOptionsBase::getHandleShowBalancing (void) const
746 SFBool::GetHandlePtr
returnValue(
747 new SFBool::GetHandle(
749 this->getType().getFieldDesc(ShowBalancingFieldId
),
750 const_cast<CSMMultiWinOptionsBase
*>(this)));
755 EditFieldHandlePtr
CSMMultiWinOptionsBase::editHandleShowBalancing (void)
757 SFBool::EditHandlePtr
returnValue(
758 new SFBool::EditHandle(
760 this->getType().getFieldDesc(ShowBalancingFieldId
),
764 editSField(ShowBalancingFieldMask
);
770 #ifdef OSG_MT_CPTR_ASPECT
771 void CSMMultiWinOptionsBase::execSyncV( FieldContainer
&oFrom
,
772 ConstFieldMaskArg whichField
,
773 AspectOffsetStore
&oOffsets
,
774 ConstFieldMaskArg syncMode
,
775 const UInt32 uiSyncInfo
)
777 CSMMultiWinOptions
*pThis
= static_cast<CSMMultiWinOptions
*>(this);
779 pThis
->execSync(static_cast<CSMMultiWinOptions
*>(&oFrom
),
788 #ifdef OSG_MT_CPTR_ASPECT
789 FieldContainer
*CSMMultiWinOptionsBase::createAspectCopy(
790 const FieldContainer
*pRefAspect
) const
792 CSMMultiWinOptions
*returnValue
;
794 newAspectCopy(returnValue
,
795 dynamic_cast<const CSMMultiWinOptions
*>(pRefAspect
),
796 dynamic_cast<const CSMMultiWinOptions
*>(this));
802 void CSMMultiWinOptionsBase::resolveLinks(void)
804 Inherited::resolveLinks();