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 SortLastWindow!
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"
65 #include "OSGNode.h" // GroupNodes Class
67 #include "OSGSortLastWindowBase.h"
68 #include "OSGSortLastWindow.h"
70 #include <boost/bind.hpp>
74 /***************************************************************************\
76 \***************************************************************************/
78 /*! \class OSG::SortLastWindow
79 Cluster rendering configuration for sort first image composition
82 /***************************************************************************\
83 * Field Documentation *
84 \***************************************************************************/
86 /*! \var Node * SortLastWindowBase::_mfGroupNodes
90 /*! \var UInt32 SortLastWindowBase::_mfGroupLengths
94 /*! \var bool SortLastWindowBase::_sfGroupsChanged
99 /***************************************************************************\
100 * FieldType/FieldTrait Instantiation *
101 \***************************************************************************/
103 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
104 PointerType FieldTraits
<SortLastWindow
*, nsOSG
>::_type(
107 SortLastWindow::getClassType(),
111 OSG_FIELDTRAITS_GETTYPE_NS(SortLastWindow
*, nsOSG
)
113 /***************************************************************************\
114 * Field Description *
115 \***************************************************************************/
117 void SortLastWindowBase::classDescInserter(TypeObject
&oType
)
119 FieldDescriptionBase
*pDesc
= NULL
;
122 pDesc
= new MFUnrecNodePtr::Description(
123 MFUnrecNodePtr::getClassType(),
126 GroupNodesFieldId
, GroupNodesFieldMask
,
128 (Field::MFDefaultFlags
| Field::FStdAccess
),
129 static_cast<FieldEditMethodSig
>(&SortLastWindow::editHandleGroupNodes
),
130 static_cast<FieldGetMethodSig
>(&SortLastWindow::getHandleGroupNodes
));
132 oType
.addInitialDesc(pDesc
);
134 pDesc
= new MFUInt32::Description(
135 MFUInt32::getClassType(),
138 GroupLengthsFieldId
, GroupLengthsFieldMask
,
140 (Field::MFDefaultFlags
| Field::FStdAccess
),
141 static_cast<FieldEditMethodSig
>(&SortLastWindow::editHandleGroupLengths
),
142 static_cast<FieldGetMethodSig
>(&SortLastWindow::getHandleGroupLengths
));
144 oType
.addInitialDesc(pDesc
);
146 pDesc
= new SFBool::Description(
147 SFBool::getClassType(),
150 GroupsChangedFieldId
, GroupsChangedFieldMask
,
152 (Field::SFDefaultFlags
| Field::FStdAccess
),
153 static_cast<FieldEditMethodSig
>(&SortLastWindow::editHandleGroupsChanged
),
154 static_cast<FieldGetMethodSig
>(&SortLastWindow::getHandleGroupsChanged
));
156 oType
.addInitialDesc(pDesc
);
160 SortLastWindowBase::TypeObject
SortLastWindowBase::_type(
161 SortLastWindowBase::getClassname(),
162 Inherited::getClassname(),
165 reinterpret_cast<PrototypeCreateF
>(&SortLastWindowBase::createEmptyLocal
),
166 reinterpret_cast<InitContainerF
>(&SortLastWindow::initMethod
),
167 reinterpret_cast<ExitContainerF
>(&SortLastWindow::exitMethod
),
168 reinterpret_cast<InitalInsertDescFunc
>(
169 reinterpret_cast<void *>(&SortLastWindow::classDescInserter
)),
172 "<?xml version=\"1.0\"?>\n"
175 " name=\"SortLastWindow\"\n"
176 " parent=\"ClusterWindow\"\n"
177 " library=\"Cluster\"\n"
178 " pointerfieldtypes=\"none\"\n"
179 " structure=\"concrete\"\n"
180 " systemcomponent=\"true\"\n"
181 " parentsystemcomponent=\"true\"\n"
182 " decoratable=\"false\"\n"
183 " useLocalIncludes=\"false\"\n"
184 " docGroupBase=\"GrpClusterWindow\"\n"
186 " Cluster rendering configuration for sort first image composition\n"
188 "\t name=\"groupNodes\"\n"
189 "\t type=\"NodePtr\"\n"
190 "\t cardinality=\"multi\"\n"
191 "\t visibility=\"external\"\n"
192 "\t access=\"protected\"\n"
196 "\t name=\"groupLengths\"\n"
197 "\t type=\"UInt32\"\n"
198 "\t cardinality=\"multi\"\n"
199 "\t visibility=\"external\"\n"
200 "\t access=\"protected\"\n"
204 "\t name=\"groupsChanged\"\n"
206 "\t cardinality=\"single\"\n"
207 "\t visibility=\"internal\"\n"
208 "\t access=\"protected\"\n"
211 "</FieldContainer>\n",
212 "Cluster rendering configuration for sort first image composition\n"
215 /*------------------------------ get -----------------------------------*/
217 FieldContainerType
&SortLastWindowBase::getType(void)
222 const FieldContainerType
&SortLastWindowBase::getType(void) const
227 UInt32
SortLastWindowBase::getContainerSize(void) const
229 return sizeof(SortLastWindow
);
232 /*------------------------- decorator get ------------------------------*/
235 //! Get the SortLastWindow::_mfGroupNodes field.
236 const MFUnrecNodePtr
*SortLastWindowBase::getMFGroupNodes(void) const
238 return &_mfGroupNodes
;
241 MFUnrecNodePtr
*SortLastWindowBase::editMFGroupNodes (void)
243 editMField(GroupNodesFieldMask
, _mfGroupNodes
);
245 return &_mfGroupNodes
;
247 Node
* SortLastWindowBase::getGroupNodes(const UInt32 index
) const
249 return _mfGroupNodes
[index
];
252 MFUInt32
*SortLastWindowBase::editMFGroupLengths(void)
254 editMField(GroupLengthsFieldMask
, _mfGroupLengths
);
256 return &_mfGroupLengths
;
259 const MFUInt32
*SortLastWindowBase::getMFGroupLengths(void) const
261 return &_mfGroupLengths
;
265 SFBool
*SortLastWindowBase::editSFGroupsChanged(void)
267 editSField(GroupsChangedFieldMask
);
269 return &_sfGroupsChanged
;
272 const SFBool
*SortLastWindowBase::getSFGroupsChanged(void) const
274 return &_sfGroupsChanged
;
280 void SortLastWindowBase::pushToGroupNodes(Node
* const value
)
282 editMField(GroupNodesFieldMask
, _mfGroupNodes
);
284 _mfGroupNodes
.push_back(value
);
287 void SortLastWindowBase::assignGroupNodes(const MFUnrecNodePtr
&value
)
289 MFUnrecNodePtr ::const_iterator elemIt
=
291 MFUnrecNodePtr ::const_iterator elemEnd
=
294 static_cast<SortLastWindow
*>(this)->clearGroupNodes();
296 while(elemIt
!= elemEnd
)
298 this->pushToGroupNodes(*elemIt
);
304 void SortLastWindowBase::removeFromGroupNodes(UInt32 uiIndex
)
306 if(uiIndex
< _mfGroupNodes
.size())
308 editMField(GroupNodesFieldMask
, _mfGroupNodes
);
310 _mfGroupNodes
.erase(uiIndex
);
314 void SortLastWindowBase::removeObjFromGroupNodes(Node
* const value
)
316 Int32 iElemIdx
= _mfGroupNodes
.findIndex(value
);
320 editMField(GroupNodesFieldMask
, _mfGroupNodes
);
322 _mfGroupNodes
.erase(iElemIdx
);
325 void SortLastWindowBase::clearGroupNodes(void)
327 editMField(GroupNodesFieldMask
, _mfGroupNodes
);
330 _mfGroupNodes
.clear();
335 /*------------------------------ access -----------------------------------*/
337 SizeT
SortLastWindowBase::getBinSize(ConstFieldMaskArg whichField
)
339 SizeT returnValue
= Inherited::getBinSize(whichField
);
341 if(FieldBits::NoField
!= (GroupNodesFieldMask
& whichField
))
343 returnValue
+= _mfGroupNodes
.getBinSize();
345 if(FieldBits::NoField
!= (GroupLengthsFieldMask
& whichField
))
347 returnValue
+= _mfGroupLengths
.getBinSize();
349 if(FieldBits::NoField
!= (GroupsChangedFieldMask
& whichField
))
351 returnValue
+= _sfGroupsChanged
.getBinSize();
357 void SortLastWindowBase::copyToBin(BinaryDataHandler
&pMem
,
358 ConstFieldMaskArg whichField
)
360 Inherited::copyToBin(pMem
, whichField
);
362 if(FieldBits::NoField
!= (GroupNodesFieldMask
& whichField
))
364 _mfGroupNodes
.copyToBin(pMem
);
366 if(FieldBits::NoField
!= (GroupLengthsFieldMask
& whichField
))
368 _mfGroupLengths
.copyToBin(pMem
);
370 if(FieldBits::NoField
!= (GroupsChangedFieldMask
& whichField
))
372 _sfGroupsChanged
.copyToBin(pMem
);
376 void SortLastWindowBase::copyFromBin(BinaryDataHandler
&pMem
,
377 ConstFieldMaskArg whichField
)
379 Inherited::copyFromBin(pMem
, whichField
);
381 if(FieldBits::NoField
!= (GroupNodesFieldMask
& whichField
))
383 editMField(GroupNodesFieldMask
, _mfGroupNodes
);
384 _mfGroupNodes
.copyFromBin(pMem
);
386 if(FieldBits::NoField
!= (GroupLengthsFieldMask
& whichField
))
388 editMField(GroupLengthsFieldMask
, _mfGroupLengths
);
389 _mfGroupLengths
.copyFromBin(pMem
);
391 if(FieldBits::NoField
!= (GroupsChangedFieldMask
& whichField
))
393 editSField(GroupsChangedFieldMask
);
394 _sfGroupsChanged
.copyFromBin(pMem
);
398 //! create a new instance of the class
399 SortLastWindowTransitPtr
SortLastWindowBase::createLocal(BitVector bFlags
)
401 SortLastWindowTransitPtr fc
;
403 if(getClassType().getPrototype() != NULL
)
405 FieldContainerTransitPtr tmpPtr
=
406 getClassType().getPrototype()-> shallowCopyLocal(bFlags
);
408 fc
= dynamic_pointer_cast
<SortLastWindow
>(tmpPtr
);
414 //! create a new instance of the class, copy the container flags
415 SortLastWindowTransitPtr
SortLastWindowBase::createDependent(BitVector bFlags
)
417 SortLastWindowTransitPtr fc
;
419 if(getClassType().getPrototype() != NULL
)
421 FieldContainerTransitPtr tmpPtr
=
422 getClassType().getPrototype()-> shallowCopyDependent(bFlags
);
424 fc
= dynamic_pointer_cast
<SortLastWindow
>(tmpPtr
);
430 //! create a new instance of the class
431 SortLastWindowTransitPtr
SortLastWindowBase::create(void)
433 SortLastWindowTransitPtr fc
;
435 if(getClassType().getPrototype() != NULL
)
437 FieldContainerTransitPtr tmpPtr
=
438 getClassType().getPrototype()-> shallowCopy();
440 fc
= dynamic_pointer_cast
<SortLastWindow
>(tmpPtr
);
446 SortLastWindow
*SortLastWindowBase::createEmptyLocal(BitVector bFlags
)
448 SortLastWindow
*returnValue
;
450 newPtr
<SortLastWindow
>(returnValue
, bFlags
);
452 returnValue
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
457 //! create an empty new instance of the class, do not copy the prototype
458 SortLastWindow
*SortLastWindowBase::createEmpty(void)
460 SortLastWindow
*returnValue
;
462 newPtr
<SortLastWindow
>(returnValue
, Thread::getCurrentLocalFlags());
464 returnValue
->_pFieldFlags
->_bNamespaceMask
&=
465 ~Thread::getCurrentLocalFlags();
471 FieldContainerTransitPtr
SortLastWindowBase::shallowCopyLocal(
472 BitVector bFlags
) const
474 SortLastWindow
*tmpPtr
;
476 newPtr(tmpPtr
, dynamic_cast<const SortLastWindow
*>(this), bFlags
);
478 FieldContainerTransitPtr
returnValue(tmpPtr
);
480 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
485 FieldContainerTransitPtr
SortLastWindowBase::shallowCopyDependent(
486 BitVector bFlags
) const
488 SortLastWindow
*tmpPtr
;
490 newPtr(tmpPtr
, dynamic_cast<const SortLastWindow
*>(this), ~bFlags
);
492 FieldContainerTransitPtr
returnValue(tmpPtr
);
494 tmpPtr
->_pFieldFlags
->_bNamespaceMask
= bFlags
;
499 FieldContainerTransitPtr
SortLastWindowBase::shallowCopy(void) const
501 SortLastWindow
*tmpPtr
;
504 dynamic_cast<const SortLastWindow
*>(this),
505 Thread::getCurrentLocalFlags());
507 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~Thread::getCurrentLocalFlags();
509 FieldContainerTransitPtr
returnValue(tmpPtr
);
517 /*------------------------- constructors ----------------------------------*/
519 SortLastWindowBase::SortLastWindowBase(void) :
527 SortLastWindowBase::SortLastWindowBase(const SortLastWindowBase
&source
) :
530 _mfGroupLengths (source
._mfGroupLengths
),
531 _sfGroupsChanged (source
._sfGroupsChanged
)
536 /*-------------------------- destructors ----------------------------------*/
538 SortLastWindowBase::~SortLastWindowBase(void)
542 void SortLastWindowBase::onCreate(const SortLastWindow
*source
)
544 Inherited::onCreate(source
);
548 SortLastWindow
*pThis
= static_cast<SortLastWindow
*>(this);
550 MFUnrecNodePtr::const_iterator GroupNodesIt
=
551 source
->_mfGroupNodes
.begin();
552 MFUnrecNodePtr::const_iterator GroupNodesEnd
=
553 source
->_mfGroupNodes
.end ();
555 while(GroupNodesIt
!= GroupNodesEnd
)
557 pThis
->pushToGroupNodes(*GroupNodesIt
);
564 GetFieldHandlePtr
SortLastWindowBase::getHandleGroupNodes (void) const
566 MFUnrecNodePtr::GetHandlePtr
returnValue(
567 new MFUnrecNodePtr::GetHandle(
569 this->getType().getFieldDesc(GroupNodesFieldId
),
570 const_cast<SortLastWindowBase
*>(this)));
575 EditFieldHandlePtr
SortLastWindowBase::editHandleGroupNodes (void)
577 MFUnrecNodePtr::EditHandlePtr
returnValue(
578 new MFUnrecNodePtr::EditHandle(
580 this->getType().getFieldDesc(GroupNodesFieldId
),
583 returnValue
->setAddMethod(
584 boost::bind(&SortLastWindow::pushToGroupNodes
,
585 static_cast<SortLastWindow
*>(this), _1
));
586 returnValue
->setRemoveMethod(
587 boost::bind(&SortLastWindow::removeFromGroupNodes
,
588 static_cast<SortLastWindow
*>(this), _1
));
589 returnValue
->setRemoveObjMethod(
590 boost::bind(&SortLastWindow::removeObjFromGroupNodes
,
591 static_cast<SortLastWindow
*>(this), _1
));
592 returnValue
->setClearMethod(
593 boost::bind(&SortLastWindow::clearGroupNodes
,
594 static_cast<SortLastWindow
*>(this)));
596 editMField(GroupNodesFieldMask
, _mfGroupNodes
);
601 GetFieldHandlePtr
SortLastWindowBase::getHandleGroupLengths (void) const
603 MFUInt32::GetHandlePtr
returnValue(
604 new MFUInt32::GetHandle(
606 this->getType().getFieldDesc(GroupLengthsFieldId
),
607 const_cast<SortLastWindowBase
*>(this)));
612 EditFieldHandlePtr
SortLastWindowBase::editHandleGroupLengths (void)
614 MFUInt32::EditHandlePtr
returnValue(
615 new MFUInt32::EditHandle(
617 this->getType().getFieldDesc(GroupLengthsFieldId
),
621 editMField(GroupLengthsFieldMask
, _mfGroupLengths
);
626 GetFieldHandlePtr
SortLastWindowBase::getHandleGroupsChanged (void) const
628 SFBool::GetHandlePtr
returnValue(
629 new SFBool::GetHandle(
631 this->getType().getFieldDesc(GroupsChangedFieldId
),
632 const_cast<SortLastWindowBase
*>(this)));
637 EditFieldHandlePtr
SortLastWindowBase::editHandleGroupsChanged (void)
639 SFBool::EditHandlePtr
returnValue(
640 new SFBool::EditHandle(
642 this->getType().getFieldDesc(GroupsChangedFieldId
),
646 editSField(GroupsChangedFieldMask
);
652 #ifdef OSG_MT_CPTR_ASPECT
653 void SortLastWindowBase::execSyncV( FieldContainer
&oFrom
,
654 ConstFieldMaskArg whichField
,
655 AspectOffsetStore
&oOffsets
,
656 ConstFieldMaskArg syncMode
,
657 const UInt32 uiSyncInfo
)
659 SortLastWindow
*pThis
= static_cast<SortLastWindow
*>(this);
661 pThis
->execSync(static_cast<SortLastWindow
*>(&oFrom
),
670 #ifdef OSG_MT_CPTR_ASPECT
671 FieldContainer
*SortLastWindowBase::createAspectCopy(
672 const FieldContainer
*pRefAspect
) const
674 SortLastWindow
*returnValue
;
676 newAspectCopy(returnValue
,
677 dynamic_cast<const SortLastWindow
*>(pRefAspect
),
678 dynamic_cast<const SortLastWindow
*>(this));
684 void SortLastWindowBase::resolveLinks(void)
686 Inherited::resolveLinks();
688 static_cast<SortLastWindow
*>(this)->clearGroupNodes();
690 #ifdef OSG_MT_CPTR_ASPECT
691 AspectOffsetStore oOffsets
;
693 _pAspectStore
->fillOffsetArray(oOffsets
, this);
696 #ifdef OSG_MT_CPTR_ASPECT
697 _mfGroupLengths
.terminateShare(Thread::getCurrentAspect(),