changed: gcc8 base update
[opensg.git] / Source / Contrib / ComplexSceneManager / OSGCSMClusterWindowBase.cpp
blob526306b0e4c78b3d96cca1c8194bb74da7717cda
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 CSMClusterWindow!
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"
65 #include "OSGCSMWindow.h" // ClientWindow Class
66 #include "OSGImageComposer.h" // Composer Class
67 #include "OSGCSMClusterWinOptions.h" // Options Class
69 #include "OSGCSMClusterWindowBase.h"
70 #include "OSGCSMClusterWindow.h"
72 #include <boost/bind.hpp>
74 OSG_BEGIN_NAMESPACE
76 /***************************************************************************\
77 * Description *
78 \***************************************************************************/
80 /*! \class OSG::CSMClusterWindow
84 /***************************************************************************\
85 * Field Documentation *
86 \***************************************************************************/
88 /*! \var CSMWindow * CSMClusterWindowBase::_sfClientWindow
92 /*! \var bool CSMClusterWindowBase::_sfRenderClient
96 /*! \var std::string CSMClusterWindowBase::_mfServers
100 /*! \var UInt32 CSMClusterWindowBase::_mfServerIds
104 /*! \var UInt32 CSMClusterWindowBase::_sfServerRows
108 /*! \var std::string CSMClusterWindowBase::_sfConnectionType
112 /*! \var std::string CSMClusterWindowBase::_sfClusterMode
116 /*! \var ImageComposer * CSMClusterWindowBase::_sfComposer
120 /*! \var CSMClusterWinOptions * CSMClusterWindowBase::_sfOptions
125 /***************************************************************************\
126 * FieldType/FieldTrait Instantiation *
127 \***************************************************************************/
129 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
130 PointerType FieldTraits<CSMClusterWindow *, nsOSG>::_type(
131 "CSMClusterWindowPtr",
132 "CSMWindowPtr",
133 CSMClusterWindow::getClassType(),
134 nsOSG);
135 #endif
137 OSG_FIELDTRAITS_GETTYPE_NS(CSMClusterWindow *, nsOSG)
139 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField,
140 CSMClusterWindow *,
141 nsOSG)
143 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField,
144 CSMClusterWindow *,
145 nsOSG)
147 DataType &FieldTraits<CSMClusterWindow *, nsOSG + 1 >::getType(void)
149 return FieldTraits<CSMClusterWindow *, nsOSG>::getType();
153 OSG_SFIELDTYPE_INST(ParentPointerSField,
154 CSMClusterWindow *,
155 NoRefCountPolicy,
156 nsOSG + 1);
158 OSG_FIELD_DLLEXPORT_DEF3(ParentPointerSField,
159 CSMClusterWindow *,
160 NoRefCountPolicy,
161 nsOSG + 1)
164 /***************************************************************************\
165 * Field Description *
166 \***************************************************************************/
168 void CSMClusterWindowBase::classDescInserter(TypeObject &oType)
170 FieldDescriptionBase *pDesc = NULL;
173 pDesc = new SFUnrecChildCSMWindowPtr::Description(
174 SFUnrecChildCSMWindowPtr::getClassType(),
175 "clientWindow",
177 ClientWindowFieldId, ClientWindowFieldMask,
178 false,
179 (Field::SFDefaultFlags | Field::FStdAccess),
180 static_cast<FieldEditMethodSig>(&CSMClusterWindow::editHandleClientWindow),
181 static_cast<FieldGetMethodSig >(&CSMClusterWindow::getHandleClientWindow));
183 oType.addInitialDesc(pDesc);
185 pDesc = new SFBool::Description(
186 SFBool::getClassType(),
187 "renderClient",
189 RenderClientFieldId, RenderClientFieldMask,
190 false,
191 (Field::SFDefaultFlags | Field::FStdAccess),
192 static_cast<FieldEditMethodSig>(&CSMClusterWindow::editHandleRenderClient),
193 static_cast<FieldGetMethodSig >(&CSMClusterWindow::getHandleRenderClient));
195 oType.addInitialDesc(pDesc);
197 pDesc = new MFString::Description(
198 MFString::getClassType(),
199 "servers",
201 ServersFieldId, ServersFieldMask,
202 true,
203 (Field::MFDefaultFlags | Field::FStdAccess),
204 static_cast<FieldEditMethodSig>(&CSMClusterWindow::editHandleServers),
205 static_cast<FieldGetMethodSig >(&CSMClusterWindow::getHandleServers));
207 oType.addInitialDesc(pDesc);
209 pDesc = new MFUInt32::Description(
210 MFUInt32::getClassType(),
211 "serverIds",
213 ServerIdsFieldId, ServerIdsFieldMask,
214 false,
215 (Field::MFDefaultFlags | Field::FStdAccess),
216 static_cast<FieldEditMethodSig>(&CSMClusterWindow::editHandleServerIds),
217 static_cast<FieldGetMethodSig >(&CSMClusterWindow::getHandleServerIds));
219 oType.addInitialDesc(pDesc);
221 pDesc = new SFUInt32::Description(
222 SFUInt32::getClassType(),
223 "serverRows",
225 ServerRowsFieldId, ServerRowsFieldMask,
226 false,
227 (Field::SFDefaultFlags | Field::FStdAccess),
228 static_cast<FieldEditMethodSig>(&CSMClusterWindow::editHandleServerRows),
229 static_cast<FieldGetMethodSig >(&CSMClusterWindow::getHandleServerRows));
231 oType.addInitialDesc(pDesc);
233 pDesc = new SFString::Description(
234 SFString::getClassType(),
235 "connectionType",
237 ConnectionTypeFieldId, ConnectionTypeFieldMask,
238 true,
239 (Field::SFDefaultFlags | Field::FStdAccess),
240 static_cast<FieldEditMethodSig>(&CSMClusterWindow::editHandleConnectionType),
241 static_cast<FieldGetMethodSig >(&CSMClusterWindow::getHandleConnectionType));
243 oType.addInitialDesc(pDesc);
245 pDesc = new SFString::Description(
246 SFString::getClassType(),
247 "clusterMode",
249 ClusterModeFieldId, ClusterModeFieldMask,
250 true,
251 (Field::SFDefaultFlags | Field::FStdAccess),
252 static_cast<FieldEditMethodSig>(&CSMClusterWindow::editHandleClusterMode),
253 static_cast<FieldGetMethodSig >(&CSMClusterWindow::getHandleClusterMode));
255 oType.addInitialDesc(pDesc);
257 pDesc = new SFUnrecImageComposerPtr::Description(
258 SFUnrecImageComposerPtr::getClassType(),
259 "composer",
261 ComposerFieldId, ComposerFieldMask,
262 false,
263 (Field::SFDefaultFlags | Field::FStdAccess),
264 static_cast<FieldEditMethodSig>(&CSMClusterWindow::editHandleComposer),
265 static_cast<FieldGetMethodSig >(&CSMClusterWindow::getHandleComposer));
267 oType.addInitialDesc(pDesc);
269 pDesc = new SFUnrecChildCSMClusterWinOptionsPtr::Description(
270 SFUnrecChildCSMClusterWinOptionsPtr::getClassType(),
271 "options",
273 OptionsFieldId, OptionsFieldMask,
274 false,
275 (Field::SFDefaultFlags | Field::FStdAccess),
276 static_cast<FieldEditMethodSig>(&CSMClusterWindow::editHandleOptions),
277 static_cast<FieldGetMethodSig >(&CSMClusterWindow::getHandleOptions));
279 oType.addInitialDesc(pDesc);
283 CSMClusterWindowBase::TypeObject CSMClusterWindowBase::_type(
284 CSMClusterWindowBase::getClassname(),
285 Inherited::getClassname(),
286 "NULL",
287 nsOSG, //Namespace
288 reinterpret_cast<PrototypeCreateF>(&CSMClusterWindowBase::createEmptyLocal),
289 reinterpret_cast<InitContainerF>(&CSMClusterWindow::initMethod),
290 reinterpret_cast<ExitContainerF>(&CSMClusterWindow::exitMethod),
291 reinterpret_cast<InitalInsertDescFunc>(
292 reinterpret_cast<void *>(&CSMClusterWindow::classDescInserter)),
293 false,
295 "<?xml version=\"1.0\"?>\n"
296 "\n"
297 "<FieldContainer\n"
298 " name=\"CSMClusterWindow\"\n"
299 " parent=\"CSMWindow\"\n"
300 " library=\"ContribCSM\"\n"
301 " pointerfieldtypes=\"both\"\n"
302 " structure=\"concrete\"\n"
303 " systemcomponent=\"true\"\n"
304 " parentsystemcomponent=\"true\"\n"
305 " decoratable=\"false\"\n"
306 " useLocalIncludes=\"false\"\n"
307 " isNodeCore=\"false\"\n"
308 " isBundle=\"true\"\n"
309 " parentFields=\"single\"\n"
310 ">\n"
311 "\t<Field\n"
312 "\t\tname=\"clientWindow\"\n"
313 "\t\ttype=\"CSMWindow\"\n"
314 "\t\tcardinality=\"single\"\n"
315 "\t\tvisibility=\"external\"\n"
316 "\t\taccess=\"public\"\n"
317 " category=\"childpointer\"\n"
318 " childParentType=\"CSMClusterWindow\"\n"
319 " linkParentField=\"Parent\"\n"
320 "\t>\n"
321 "\t</Field>\n"
322 " <Field\n"
323 " name=\"renderClient\"\n"
324 " type=\"bool\"\n"
325 " cardinality=\"single\"\n"
326 " visibility=\"external\"\n"
327 " access=\"public\"\n"
328 " defaultValue=\"true\"\n"
329 " >\n"
330 " </Field>\n"
331 "\n"
332 "\t<Field\n"
333 "\t\tname=\"servers\"\n"
334 "\t\ttype=\"std::string\"\n"
335 "\t\tcardinality=\"multi\"\n"
336 "\t\tvisibility=\"internal\"\n"
337 "\t\taccess=\"public\"\n"
338 "\t>\n"
339 "\t</Field>\n"
340 "\t<Field\n"
341 "\t\tname=\"serverIds\"\n"
342 "\t\ttype=\"UInt32\"\n"
343 "\t\tcardinality=\"multi\"\n"
344 "\t\tvisibility=\"external\"\n"
345 "\t\taccess=\"public\"\n"
346 "\t>\n"
347 "\t</Field>\n"
348 " <Field\n"
349 " name=\"serverRows\"\n"
350 " type=\"UInt32\"\n"
351 " cardinality=\"single\"\n"
352 " visibility=\"external\"\n"
353 " access=\"public\"\n"
354 " >\n"
355 " </Field>\n"
356 "\n"
357 "\t<Field\n"
358 "\t\tname=\"connectionType\"\n"
359 "\t\ttype=\"std::string\"\n"
360 "\t\tcardinality=\"single\"\n"
361 "\t\tvisibility=\"internal\"\n"
362 "\t\taccess=\"public\"\n"
363 "\t>\n"
364 "\t</Field>\n"
365 "\t<Field\n"
366 "\t\tname=\"clusterMode\"\n"
367 "\t\ttype=\"std::string\"\n"
368 "\t\tcardinality=\"single\"\n"
369 "\t\tvisibility=\"internal\"\n"
370 "\t\taccess=\"public\"\n"
371 "\t>\n"
372 "\t</Field>\n"
373 "\n"
374 "\n"
375 "\t<Field\n"
376 "\t\tname=\"composer\"\n"
377 "\t\ttype=\"ImageComposer\"\n"
378 "\t\tcardinality=\"single\"\n"
379 "\t\tvisibility=\"external\"\n"
380 "\t\taccess=\"public\"\n"
381 " category=\"pointer\"\n"
382 "\t>\n"
383 "\t</Field>\n"
384 "\t<Field\n"
385 "\t\tname=\"options\"\n"
386 "\t\ttype=\"CSMClusterWinOptions\"\n"
387 "\t\tcardinality=\"single\"\n"
388 "\t\tvisibility=\"external\"\n"
389 "\t\taccess=\"public\"\n"
390 " category=\"childpointer\"\n"
391 " childParentType=\"CSMClusterWindow\"\n"
392 " linkParentField=\"Parent\"\n"
393 "\t>\n"
394 "\t</Field>\n"
395 "</FieldContainer>\n",
399 /*------------------------------ get -----------------------------------*/
401 FieldContainerType &CSMClusterWindowBase::getType(void)
403 return _type;
406 const FieldContainerType &CSMClusterWindowBase::getType(void) const
408 return _type;
411 UInt32 CSMClusterWindowBase::getContainerSize(void) const
413 return sizeof(CSMClusterWindow);
416 /*------------------------- decorator get ------------------------------*/
419 //! Get the CSMClusterWindow::_sfClientWindow field.
420 const SFUnrecChildCSMWindowPtr *CSMClusterWindowBase::getSFClientWindow(void) const
422 return &_sfClientWindow;
425 SFUnrecChildCSMWindowPtr *CSMClusterWindowBase::editSFClientWindow (void)
427 editSField(ClientWindowFieldMask);
429 return &_sfClientWindow;
432 //! Get the value of the CSMClusterWindow::_sfClientWindow field.
433 CSMWindow * CSMClusterWindowBase::getClientWindow(void) const
435 return _sfClientWindow.getValue();
438 //! Set the value of the CSMClusterWindow::_sfClientWindow field.
439 void CSMClusterWindowBase::setClientWindow(CSMWindow * const value)
441 editSField(ClientWindowFieldMask);
443 _sfClientWindow.setValue(value);
447 SFBool *CSMClusterWindowBase::editSFRenderClient(void)
449 editSField(RenderClientFieldMask);
451 return &_sfRenderClient;
454 const SFBool *CSMClusterWindowBase::getSFRenderClient(void) const
456 return &_sfRenderClient;
460 MFString *CSMClusterWindowBase::editMFServers(void)
462 editMField(ServersFieldMask, _mfServers);
464 return &_mfServers;
467 const MFString *CSMClusterWindowBase::getMFServers(void) const
469 return &_mfServers;
473 MFUInt32 *CSMClusterWindowBase::editMFServerIds(void)
475 editMField(ServerIdsFieldMask, _mfServerIds);
477 return &_mfServerIds;
480 const MFUInt32 *CSMClusterWindowBase::getMFServerIds(void) const
482 return &_mfServerIds;
486 SFUInt32 *CSMClusterWindowBase::editSFServerRows(void)
488 editSField(ServerRowsFieldMask);
490 return &_sfServerRows;
493 const SFUInt32 *CSMClusterWindowBase::getSFServerRows(void) const
495 return &_sfServerRows;
499 SFString *CSMClusterWindowBase::editSFConnectionType(void)
501 editSField(ConnectionTypeFieldMask);
503 return &_sfConnectionType;
506 const SFString *CSMClusterWindowBase::getSFConnectionType(void) const
508 return &_sfConnectionType;
512 SFString *CSMClusterWindowBase::editSFClusterMode(void)
514 editSField(ClusterModeFieldMask);
516 return &_sfClusterMode;
519 const SFString *CSMClusterWindowBase::getSFClusterMode(void) const
521 return &_sfClusterMode;
525 //! Get the CSMClusterWindow::_sfComposer field.
526 const SFUnrecImageComposerPtr *CSMClusterWindowBase::getSFComposer(void) const
528 return &_sfComposer;
531 SFUnrecImageComposerPtr *CSMClusterWindowBase::editSFComposer (void)
533 editSField(ComposerFieldMask);
535 return &_sfComposer;
538 //! Get the value of the CSMClusterWindow::_sfComposer field.
539 ImageComposer * CSMClusterWindowBase::getComposer(void) const
541 return _sfComposer.getValue();
544 //! Set the value of the CSMClusterWindow::_sfComposer field.
545 void CSMClusterWindowBase::setComposer(ImageComposer * const value)
547 editSField(ComposerFieldMask);
549 _sfComposer.setValue(value);
553 //! Get the CSMClusterWindow::_sfOptions field.
554 const SFUnrecChildCSMClusterWinOptionsPtr *CSMClusterWindowBase::getSFOptions(void) const
556 return &_sfOptions;
559 SFUnrecChildCSMClusterWinOptionsPtr *CSMClusterWindowBase::editSFOptions (void)
561 editSField(OptionsFieldMask);
563 return &_sfOptions;
566 //! Get the value of the CSMClusterWindow::_sfOptions field.
567 CSMClusterWinOptions * CSMClusterWindowBase::getOptions(void) const
569 return _sfOptions.getValue();
572 //! Set the value of the CSMClusterWindow::_sfOptions field.
573 void CSMClusterWindowBase::setOptions(CSMClusterWinOptions * const value)
575 editSField(OptionsFieldMask);
577 _sfOptions.setValue(value);
585 /*------------------------------ access -----------------------------------*/
587 SizeT CSMClusterWindowBase::getBinSize(ConstFieldMaskArg whichField)
589 SizeT returnValue = Inherited::getBinSize(whichField);
591 if(FieldBits::NoField != (ClientWindowFieldMask & whichField))
593 returnValue += _sfClientWindow.getBinSize();
595 if(FieldBits::NoField != (RenderClientFieldMask & whichField))
597 returnValue += _sfRenderClient.getBinSize();
599 if(FieldBits::NoField != (ServersFieldMask & whichField))
601 returnValue += _mfServers.getBinSize();
603 if(FieldBits::NoField != (ServerIdsFieldMask & whichField))
605 returnValue += _mfServerIds.getBinSize();
607 if(FieldBits::NoField != (ServerRowsFieldMask & whichField))
609 returnValue += _sfServerRows.getBinSize();
611 if(FieldBits::NoField != (ConnectionTypeFieldMask & whichField))
613 returnValue += _sfConnectionType.getBinSize();
615 if(FieldBits::NoField != (ClusterModeFieldMask & whichField))
617 returnValue += _sfClusterMode.getBinSize();
619 if(FieldBits::NoField != (ComposerFieldMask & whichField))
621 returnValue += _sfComposer.getBinSize();
623 if(FieldBits::NoField != (OptionsFieldMask & whichField))
625 returnValue += _sfOptions.getBinSize();
628 return returnValue;
631 void CSMClusterWindowBase::copyToBin(BinaryDataHandler &pMem,
632 ConstFieldMaskArg whichField)
634 Inherited::copyToBin(pMem, whichField);
636 if(FieldBits::NoField != (ClientWindowFieldMask & whichField))
638 _sfClientWindow.copyToBin(pMem);
640 if(FieldBits::NoField != (RenderClientFieldMask & whichField))
642 _sfRenderClient.copyToBin(pMem);
644 if(FieldBits::NoField != (ServersFieldMask & whichField))
646 _mfServers.copyToBin(pMem);
648 if(FieldBits::NoField != (ServerIdsFieldMask & whichField))
650 _mfServerIds.copyToBin(pMem);
652 if(FieldBits::NoField != (ServerRowsFieldMask & whichField))
654 _sfServerRows.copyToBin(pMem);
656 if(FieldBits::NoField != (ConnectionTypeFieldMask & whichField))
658 _sfConnectionType.copyToBin(pMem);
660 if(FieldBits::NoField != (ClusterModeFieldMask & whichField))
662 _sfClusterMode.copyToBin(pMem);
664 if(FieldBits::NoField != (ComposerFieldMask & whichField))
666 _sfComposer.copyToBin(pMem);
668 if(FieldBits::NoField != (OptionsFieldMask & whichField))
670 _sfOptions.copyToBin(pMem);
674 void CSMClusterWindowBase::copyFromBin(BinaryDataHandler &pMem,
675 ConstFieldMaskArg whichField)
677 Inherited::copyFromBin(pMem, whichField);
679 if(FieldBits::NoField != (ClientWindowFieldMask & whichField))
681 editSField(ClientWindowFieldMask);
682 _sfClientWindow.copyFromBin(pMem);
684 if(FieldBits::NoField != (RenderClientFieldMask & whichField))
686 editSField(RenderClientFieldMask);
687 _sfRenderClient.copyFromBin(pMem);
689 if(FieldBits::NoField != (ServersFieldMask & whichField))
691 editMField(ServersFieldMask, _mfServers);
692 _mfServers.copyFromBin(pMem);
694 if(FieldBits::NoField != (ServerIdsFieldMask & whichField))
696 editMField(ServerIdsFieldMask, _mfServerIds);
697 _mfServerIds.copyFromBin(pMem);
699 if(FieldBits::NoField != (ServerRowsFieldMask & whichField))
701 editSField(ServerRowsFieldMask);
702 _sfServerRows.copyFromBin(pMem);
704 if(FieldBits::NoField != (ConnectionTypeFieldMask & whichField))
706 editSField(ConnectionTypeFieldMask);
707 _sfConnectionType.copyFromBin(pMem);
709 if(FieldBits::NoField != (ClusterModeFieldMask & whichField))
711 editSField(ClusterModeFieldMask);
712 _sfClusterMode.copyFromBin(pMem);
714 if(FieldBits::NoField != (ComposerFieldMask & whichField))
716 editSField(ComposerFieldMask);
717 _sfComposer.copyFromBin(pMem);
719 if(FieldBits::NoField != (OptionsFieldMask & whichField))
721 editSField(OptionsFieldMask);
722 _sfOptions.copyFromBin(pMem);
726 //! create a new instance of the class
727 CSMClusterWindowTransitPtr CSMClusterWindowBase::createLocal(BitVector bFlags)
729 CSMClusterWindowTransitPtr fc;
731 if(getClassType().getPrototype() != NULL)
733 FieldContainerTransitPtr tmpPtr =
734 getClassType().getPrototype()-> shallowCopyLocal(bFlags);
736 fc = dynamic_pointer_cast<CSMClusterWindow>(tmpPtr);
739 return fc;
742 //! create a new instance of the class, copy the container flags
743 CSMClusterWindowTransitPtr CSMClusterWindowBase::createDependent(BitVector bFlags)
745 CSMClusterWindowTransitPtr fc;
747 if(getClassType().getPrototype() != NULL)
749 FieldContainerTransitPtr tmpPtr =
750 getClassType().getPrototype()-> shallowCopyDependent(bFlags);
752 fc = dynamic_pointer_cast<CSMClusterWindow>(tmpPtr);
755 return fc;
758 //! create a new instance of the class
759 CSMClusterWindowTransitPtr CSMClusterWindowBase::create(void)
761 return createLocal();
764 CSMClusterWindow *CSMClusterWindowBase::createEmptyLocal(BitVector bFlags)
766 CSMClusterWindow *returnValue;
768 newPtr<CSMClusterWindow>(returnValue, bFlags);
770 returnValue->_pFieldFlags->_bNamespaceMask &= ~bFlags;
772 return returnValue;
775 //! create an empty new instance of the class, do not copy the prototype
776 CSMClusterWindow *CSMClusterWindowBase::createEmpty(void)
778 return createEmptyLocal();
782 FieldContainerTransitPtr CSMClusterWindowBase::shallowCopyLocal(
783 BitVector bFlags) const
785 CSMClusterWindow *tmpPtr;
787 newPtr(tmpPtr, dynamic_cast<const CSMClusterWindow *>(this), bFlags);
789 FieldContainerTransitPtr returnValue(tmpPtr);
791 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~bFlags;
793 return returnValue;
796 FieldContainerTransitPtr CSMClusterWindowBase::shallowCopyDependent(
797 BitVector bFlags) const
799 CSMClusterWindow *tmpPtr;
801 newPtr(tmpPtr, dynamic_cast<const CSMClusterWindow *>(this), ~bFlags);
803 FieldContainerTransitPtr returnValue(tmpPtr);
805 tmpPtr->_pFieldFlags->_bNamespaceMask = bFlags;
807 return returnValue;
810 FieldContainerTransitPtr CSMClusterWindowBase::shallowCopy(void) const
812 return shallowCopyLocal();
818 /*------------------------- constructors ----------------------------------*/
820 CSMClusterWindowBase::CSMClusterWindowBase(void) :
821 Inherited(),
822 _sfClientWindow (this,
823 ClientWindowFieldId,
824 CSMWindow::ParentFieldId),
825 _sfRenderClient (bool(true)),
826 _mfServers (),
827 _mfServerIds (),
828 _sfServerRows (),
829 _sfConnectionType (),
830 _sfClusterMode (),
831 _sfComposer (NULL),
832 _sfOptions (this,
833 OptionsFieldId,
834 CSMClusterWinOptions::ParentFieldId)
838 CSMClusterWindowBase::CSMClusterWindowBase(const CSMClusterWindowBase &source) :
839 Inherited(source),
840 _sfClientWindow (this,
841 ClientWindowFieldId,
842 CSMWindow::ParentFieldId),
843 _sfRenderClient (source._sfRenderClient ),
844 _mfServers (source._mfServers ),
845 _mfServerIds (source._mfServerIds ),
846 _sfServerRows (source._sfServerRows ),
847 _sfConnectionType (source._sfConnectionType ),
848 _sfClusterMode (source._sfClusterMode ),
849 _sfComposer (NULL),
850 _sfOptions (this,
851 OptionsFieldId,
852 CSMClusterWinOptions::ParentFieldId)
857 /*-------------------------- destructors ----------------------------------*/
859 CSMClusterWindowBase::~CSMClusterWindowBase(void)
863 /*-------------------------------------------------------------------------*/
864 /* Child linking */
866 bool CSMClusterWindowBase::unlinkChild(
867 FieldContainer * const pChild,
868 UInt16 const childFieldId)
870 if(childFieldId == ClientWindowFieldId)
872 CSMWindow * pTypedChild =
873 dynamic_cast<CSMWindow *>(pChild);
875 if(pTypedChild != NULL)
877 if(_sfClientWindow.getValue() == pTypedChild)
879 editSField(ClientWindowFieldMask);
881 _sfClientWindow.setValue(NULL);
883 return true;
886 SWARNING << "Parent ([" << this
887 << "] id [" << this->getId()
888 << "] type [" << this->getType().getCName()
889 << "] childFieldId [" << childFieldId
890 << "]) - Child ([" << pChild
891 << "] id [" << pChild->getId()
892 << "] type [" << pChild->getType().getCName()
893 << "]): link inconsistent!"
894 << std::endl;
896 return false;
899 return false;
902 if(childFieldId == OptionsFieldId)
904 CSMClusterWinOptions * pTypedChild =
905 dynamic_cast<CSMClusterWinOptions *>(pChild);
907 if(pTypedChild != NULL)
909 if(_sfOptions.getValue() == pTypedChild)
911 editSField(OptionsFieldMask);
913 _sfOptions.setValue(NULL);
915 return true;
918 SWARNING << "Parent ([" << this
919 << "] id [" << this->getId()
920 << "] type [" << this->getType().getCName()
921 << "] childFieldId [" << childFieldId
922 << "]) - Child ([" << pChild
923 << "] id [" << pChild->getId()
924 << "] type [" << pChild->getType().getCName()
925 << "]): link inconsistent!"
926 << std::endl;
928 return false;
931 return false;
935 return Inherited::unlinkChild(pChild, childFieldId);
938 void CSMClusterWindowBase::onCreate(const CSMClusterWindow *source)
940 Inherited::onCreate(source);
942 if(source != NULL)
944 CSMClusterWindow *pThis = static_cast<CSMClusterWindow *>(this);
946 pThis->setClientWindow(source->getClientWindow());
948 pThis->setComposer(source->getComposer());
950 pThis->setOptions(source->getOptions());
954 GetFieldHandlePtr CSMClusterWindowBase::getHandleClientWindow (void) const
956 SFUnrecChildCSMWindowPtr::GetHandlePtr returnValue(
957 new SFUnrecChildCSMWindowPtr::GetHandle(
958 &_sfClientWindow,
959 this->getType().getFieldDesc(ClientWindowFieldId),
960 const_cast<CSMClusterWindowBase *>(this)));
962 return returnValue;
965 EditFieldHandlePtr CSMClusterWindowBase::editHandleClientWindow (void)
967 SFUnrecChildCSMWindowPtr::EditHandlePtr returnValue(
968 new SFUnrecChildCSMWindowPtr::EditHandle(
969 &_sfClientWindow,
970 this->getType().getFieldDesc(ClientWindowFieldId),
971 this));
973 returnValue->setSetMethod(
974 boost::bind(&CSMClusterWindow::setClientWindow,
975 static_cast<CSMClusterWindow *>(this), _1));
977 editSField(ClientWindowFieldMask);
979 return returnValue;
982 GetFieldHandlePtr CSMClusterWindowBase::getHandleRenderClient (void) const
984 SFBool::GetHandlePtr returnValue(
985 new SFBool::GetHandle(
986 &_sfRenderClient,
987 this->getType().getFieldDesc(RenderClientFieldId),
988 const_cast<CSMClusterWindowBase *>(this)));
990 return returnValue;
993 EditFieldHandlePtr CSMClusterWindowBase::editHandleRenderClient (void)
995 SFBool::EditHandlePtr returnValue(
996 new SFBool::EditHandle(
997 &_sfRenderClient,
998 this->getType().getFieldDesc(RenderClientFieldId),
999 this));
1002 editSField(RenderClientFieldMask);
1004 return returnValue;
1007 GetFieldHandlePtr CSMClusterWindowBase::getHandleServers (void) const
1009 MFString::GetHandlePtr returnValue(
1010 new MFString::GetHandle(
1011 &_mfServers,
1012 this->getType().getFieldDesc(ServersFieldId),
1013 const_cast<CSMClusterWindowBase *>(this)));
1015 return returnValue;
1018 EditFieldHandlePtr CSMClusterWindowBase::editHandleServers (void)
1020 MFString::EditHandlePtr returnValue(
1021 new MFString::EditHandle(
1022 &_mfServers,
1023 this->getType().getFieldDesc(ServersFieldId),
1024 this));
1027 editMField(ServersFieldMask, _mfServers);
1029 return returnValue;
1032 GetFieldHandlePtr CSMClusterWindowBase::getHandleServerIds (void) const
1034 MFUInt32::GetHandlePtr returnValue(
1035 new MFUInt32::GetHandle(
1036 &_mfServerIds,
1037 this->getType().getFieldDesc(ServerIdsFieldId),
1038 const_cast<CSMClusterWindowBase *>(this)));
1040 return returnValue;
1043 EditFieldHandlePtr CSMClusterWindowBase::editHandleServerIds (void)
1045 MFUInt32::EditHandlePtr returnValue(
1046 new MFUInt32::EditHandle(
1047 &_mfServerIds,
1048 this->getType().getFieldDesc(ServerIdsFieldId),
1049 this));
1052 editMField(ServerIdsFieldMask, _mfServerIds);
1054 return returnValue;
1057 GetFieldHandlePtr CSMClusterWindowBase::getHandleServerRows (void) const
1059 SFUInt32::GetHandlePtr returnValue(
1060 new SFUInt32::GetHandle(
1061 &_sfServerRows,
1062 this->getType().getFieldDesc(ServerRowsFieldId),
1063 const_cast<CSMClusterWindowBase *>(this)));
1065 return returnValue;
1068 EditFieldHandlePtr CSMClusterWindowBase::editHandleServerRows (void)
1070 SFUInt32::EditHandlePtr returnValue(
1071 new SFUInt32::EditHandle(
1072 &_sfServerRows,
1073 this->getType().getFieldDesc(ServerRowsFieldId),
1074 this));
1077 editSField(ServerRowsFieldMask);
1079 return returnValue;
1082 GetFieldHandlePtr CSMClusterWindowBase::getHandleConnectionType (void) const
1084 SFString::GetHandlePtr returnValue(
1085 new SFString::GetHandle(
1086 &_sfConnectionType,
1087 this->getType().getFieldDesc(ConnectionTypeFieldId),
1088 const_cast<CSMClusterWindowBase *>(this)));
1090 return returnValue;
1093 EditFieldHandlePtr CSMClusterWindowBase::editHandleConnectionType (void)
1095 SFString::EditHandlePtr returnValue(
1096 new SFString::EditHandle(
1097 &_sfConnectionType,
1098 this->getType().getFieldDesc(ConnectionTypeFieldId),
1099 this));
1102 editSField(ConnectionTypeFieldMask);
1104 return returnValue;
1107 GetFieldHandlePtr CSMClusterWindowBase::getHandleClusterMode (void) const
1109 SFString::GetHandlePtr returnValue(
1110 new SFString::GetHandle(
1111 &_sfClusterMode,
1112 this->getType().getFieldDesc(ClusterModeFieldId),
1113 const_cast<CSMClusterWindowBase *>(this)));
1115 return returnValue;
1118 EditFieldHandlePtr CSMClusterWindowBase::editHandleClusterMode (void)
1120 SFString::EditHandlePtr returnValue(
1121 new SFString::EditHandle(
1122 &_sfClusterMode,
1123 this->getType().getFieldDesc(ClusterModeFieldId),
1124 this));
1127 editSField(ClusterModeFieldMask);
1129 return returnValue;
1132 GetFieldHandlePtr CSMClusterWindowBase::getHandleComposer (void) const
1134 SFUnrecImageComposerPtr::GetHandlePtr returnValue(
1135 new SFUnrecImageComposerPtr::GetHandle(
1136 &_sfComposer,
1137 this->getType().getFieldDesc(ComposerFieldId),
1138 const_cast<CSMClusterWindowBase *>(this)));
1140 return returnValue;
1143 EditFieldHandlePtr CSMClusterWindowBase::editHandleComposer (void)
1145 SFUnrecImageComposerPtr::EditHandlePtr returnValue(
1146 new SFUnrecImageComposerPtr::EditHandle(
1147 &_sfComposer,
1148 this->getType().getFieldDesc(ComposerFieldId),
1149 this));
1151 returnValue->setSetMethod(
1152 boost::bind(&CSMClusterWindow::setComposer,
1153 static_cast<CSMClusterWindow *>(this), _1));
1155 editSField(ComposerFieldMask);
1157 return returnValue;
1160 GetFieldHandlePtr CSMClusterWindowBase::getHandleOptions (void) const
1162 SFUnrecChildCSMClusterWinOptionsPtr::GetHandlePtr returnValue(
1163 new SFUnrecChildCSMClusterWinOptionsPtr::GetHandle(
1164 &_sfOptions,
1165 this->getType().getFieldDesc(OptionsFieldId),
1166 const_cast<CSMClusterWindowBase *>(this)));
1168 return returnValue;
1171 EditFieldHandlePtr CSMClusterWindowBase::editHandleOptions (void)
1173 SFUnrecChildCSMClusterWinOptionsPtr::EditHandlePtr returnValue(
1174 new SFUnrecChildCSMClusterWinOptionsPtr::EditHandle(
1175 &_sfOptions,
1176 this->getType().getFieldDesc(OptionsFieldId),
1177 this));
1179 returnValue->setSetMethod(
1180 boost::bind(&CSMClusterWindow::setOptions,
1181 static_cast<CSMClusterWindow *>(this), _1));
1183 editSField(OptionsFieldMask);
1185 return returnValue;
1189 #ifdef OSG_MT_CPTR_ASPECT
1190 void CSMClusterWindowBase::execSyncV( FieldContainer &oFrom,
1191 ConstFieldMaskArg whichField,
1192 AspectOffsetStore &oOffsets,
1193 ConstFieldMaskArg syncMode,
1194 const UInt32 uiSyncInfo)
1196 CSMClusterWindow *pThis = static_cast<CSMClusterWindow *>(this);
1198 pThis->execSync(static_cast<CSMClusterWindow *>(&oFrom),
1199 whichField,
1200 oOffsets,
1201 syncMode,
1202 uiSyncInfo);
1204 #endif
1207 #ifdef OSG_MT_CPTR_ASPECT
1208 FieldContainer *CSMClusterWindowBase::createAspectCopy(
1209 const FieldContainer *pRefAspect) const
1211 CSMClusterWindow *returnValue;
1213 newAspectCopy(returnValue,
1214 dynamic_cast<const CSMClusterWindow *>(pRefAspect),
1215 dynamic_cast<const CSMClusterWindow *>(this));
1217 return returnValue;
1219 #endif
1221 void CSMClusterWindowBase::resolveLinks(void)
1223 Inherited::resolveLinks();
1225 static_cast<CSMClusterWindow *>(this)->setClientWindow(NULL);
1227 static_cast<CSMClusterWindow *>(this)->setComposer(NULL);
1229 static_cast<CSMClusterWindow *>(this)->setOptions(NULL);
1231 #ifdef OSG_MT_CPTR_ASPECT
1232 AspectOffsetStore oOffsets;
1234 _pAspectStore->fillOffsetArray(oOffsets, this);
1235 #endif
1237 #ifdef OSG_MT_CPTR_ASPECT
1238 _mfServers.terminateShare(Thread::getCurrentAspect(),
1239 oOffsets);
1240 #endif
1241 #ifdef OSG_MT_CPTR_ASPECT
1242 _mfServerIds.terminateShare(Thread::getCurrentAspect(),
1243 oOffsets);
1244 #endif
1248 OSG_END_NAMESPACE