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 ClusterWindow!
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 "OSGWindow.h" // ClientWindow Class
66 #include "OSGImageComposer.h" // Composer Class
68 #include "OSGClusterWindowBase.h"
69 #include "OSGClusterWindow.h"
71 #include <boost/bind.hpp>
75 /***************************************************************************\
77 \***************************************************************************/
79 /*! \class OSG::ClusterWindow
80 The base class for all windows.
83 /***************************************************************************\
84 * Field Documentation *
85 \***************************************************************************/
87 /*! \var std::string ClusterWindowBase::_mfServers
88 List of all symbolic server names
91 /*! \var UInt32 ClusterWindowBase::_mfServerIds
95 /*! \var std::string ClusterWindowBase::_sfConnectionType
96 How to connect to the servers
99 /*! \var std::string ClusterWindowBase::_sfConnectionInterface
100 Which network interface to use for communication
103 /*! \var std::string ClusterWindowBase::_sfConnectionDestination
104 Multicast address for multicast connections
107 /*! \var std::string ClusterWindowBase::_sfConnectionParams
108 Optional parameters e.g. "TTL=2"
111 /*! \var UInt32 ClusterWindowBase::_sfServicePort
112 Broadcastport used for server search
115 /*! \var std::string ClusterWindowBase::_sfServiceAddress
116 Broadcast or Multicast address used for server search
119 /*! \var std::string ClusterWindowBase::_sfServiceInterface
120 Ethernet interface to be used for server search
123 /*! \var Window * ClusterWindowBase::_sfClientWindow
124 Window for client rendering
127 /*! \var UInt32 ClusterWindowBase::_sfInterleave
131 /*! \var UInt32 ClusterWindowBase::_sfFrameCount
135 /*! \var ImageComposer * ClusterWindowBase::_sfComposer
139 /*! \var std::string ClusterWindowBase::_mfAutostart
144 /***************************************************************************\
145 * FieldType/FieldTrait Instantiation *
146 \***************************************************************************/
148 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
149 PointerType FieldTraits
<ClusterWindow
*, nsOSG
>::_type(
152 ClusterWindow::getClassType(),
156 OSG_FIELDTRAITS_GETTYPE_NS(ClusterWindow
*, nsOSG
)
158 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField
,
162 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField
,
166 /***************************************************************************\
167 * Field Description *
168 \***************************************************************************/
170 void ClusterWindowBase::classDescInserter(TypeObject
&oType
)
172 FieldDescriptionBase
*pDesc
= NULL
;
175 pDesc
= new MFString::Description(
176 MFString::getClassType(),
178 "List of all symbolic server names\n",
179 ServersFieldId
, ServersFieldMask
,
181 (Field::MFDefaultFlags
| Field::FStdAccess
),
182 static_cast<FieldEditMethodSig
>(&ClusterWindow::editHandleServers
),
183 static_cast<FieldGetMethodSig
>(&ClusterWindow::getHandleServers
));
185 oType
.addInitialDesc(pDesc
);
187 pDesc
= new MFUInt32::Description(
188 MFUInt32::getClassType(),
191 ServerIdsFieldId
, ServerIdsFieldMask
,
193 (Field::MFDefaultFlags
| Field::FStdAccess
),
194 static_cast<FieldEditMethodSig
>(&ClusterWindow::editHandleServerIds
),
195 static_cast<FieldGetMethodSig
>(&ClusterWindow::getHandleServerIds
));
197 oType
.addInitialDesc(pDesc
);
199 pDesc
= new SFString::Description(
200 SFString::getClassType(),
202 "How to connect to the servers\n",
203 ConnectionTypeFieldId
, ConnectionTypeFieldMask
,
205 (Field::SFDefaultFlags
| Field::FStdAccess
),
206 static_cast<FieldEditMethodSig
>(&ClusterWindow::editHandleConnectionType
),
207 static_cast<FieldGetMethodSig
>(&ClusterWindow::getHandleConnectionType
));
209 oType
.addInitialDesc(pDesc
);
211 pDesc
= new SFString::Description(
212 SFString::getClassType(),
213 "connectionInterface",
214 "Which network interface to use for communication\n",
215 ConnectionInterfaceFieldId
, ConnectionInterfaceFieldMask
,
217 (Field::SFDefaultFlags
| Field::FStdAccess
),
218 static_cast<FieldEditMethodSig
>(&ClusterWindow::editHandleConnectionInterface
),
219 static_cast<FieldGetMethodSig
>(&ClusterWindow::getHandleConnectionInterface
));
221 oType
.addInitialDesc(pDesc
);
223 pDesc
= new SFString::Description(
224 SFString::getClassType(),
225 "connectionDestination",
226 "Multicast address for multicast connections\n",
227 ConnectionDestinationFieldId
, ConnectionDestinationFieldMask
,
229 (Field::SFDefaultFlags
| Field::FStdAccess
),
230 static_cast<FieldEditMethodSig
>(&ClusterWindow::editHandleConnectionDestination
),
231 static_cast<FieldGetMethodSig
>(&ClusterWindow::getHandleConnectionDestination
));
233 oType
.addInitialDesc(pDesc
);
235 pDesc
= new SFString::Description(
236 SFString::getClassType(),
238 "Optional parameters e.g. \"TTL=2\"\n",
239 ConnectionParamsFieldId
, ConnectionParamsFieldMask
,
241 (Field::SFDefaultFlags
| Field::FStdAccess
),
242 static_cast<FieldEditMethodSig
>(&ClusterWindow::editHandleConnectionParams
),
243 static_cast<FieldGetMethodSig
>(&ClusterWindow::getHandleConnectionParams
));
245 oType
.addInitialDesc(pDesc
);
247 pDesc
= new SFUInt32::Description(
248 SFUInt32::getClassType(),
250 "Broadcastport used for server search\n",
251 ServicePortFieldId
, ServicePortFieldMask
,
253 (Field::SFDefaultFlags
| Field::FStdAccess
),
254 static_cast<FieldEditMethodSig
>(&ClusterWindow::editHandleServicePort
),
255 static_cast<FieldGetMethodSig
>(&ClusterWindow::getHandleServicePort
));
257 oType
.addInitialDesc(pDesc
);
259 pDesc
= new SFString::Description(
260 SFString::getClassType(),
262 "Broadcast or Multicast address used for server search\n",
263 ServiceAddressFieldId
, ServiceAddressFieldMask
,
265 (Field::SFDefaultFlags
| Field::FStdAccess
),
266 static_cast<FieldEditMethodSig
>(&ClusterWindow::editHandleServiceAddress
),
267 static_cast<FieldGetMethodSig
>(&ClusterWindow::getHandleServiceAddress
));
269 oType
.addInitialDesc(pDesc
);
271 pDesc
= new SFString::Description(
272 SFString::getClassType(),
274 "Ethernet interface to be used for server search\n",
275 ServiceInterfaceFieldId
, ServiceInterfaceFieldMask
,
277 (Field::SFDefaultFlags
| Field::FStdAccess
),
278 static_cast<FieldEditMethodSig
>(&ClusterWindow::editHandleServiceInterface
),
279 static_cast<FieldGetMethodSig
>(&ClusterWindow::getHandleServiceInterface
));
281 oType
.addInitialDesc(pDesc
);
283 pDesc
= new SFUnrecWindowPtr::Description(
284 SFUnrecWindowPtr::getClassType(),
286 "Window for client rendering\n",
287 ClientWindowFieldId
, ClientWindowFieldMask
,
289 (Field::SFDefaultFlags
| Field::FStdAccess
),
290 static_cast<FieldEditMethodSig
>(&ClusterWindow::editHandleClientWindow
),
291 static_cast<FieldGetMethodSig
>(&ClusterWindow::getHandleClientWindow
));
293 oType
.addInitialDesc(pDesc
);
295 pDesc
= new SFUInt32::Description(
296 SFUInt32::getClassType(),
299 InterleaveFieldId
, InterleaveFieldMask
,
301 (Field::SFDefaultFlags
| Field::FStdAccess
),
302 static_cast<FieldEditMethodSig
>(&ClusterWindow::editHandleInterleave
),
303 static_cast<FieldGetMethodSig
>(&ClusterWindow::getHandleInterleave
));
305 oType
.addInitialDesc(pDesc
);
307 pDesc
= new SFUInt32::Description(
308 SFUInt32::getClassType(),
311 FrameCountFieldId
, FrameCountFieldMask
,
313 (Field::SFDefaultFlags
| Field::FStdAccess
),
314 static_cast<FieldEditMethodSig
>(&ClusterWindow::editHandleFrameCount
),
315 static_cast<FieldGetMethodSig
>(&ClusterWindow::getHandleFrameCount
));
317 oType
.addInitialDesc(pDesc
);
319 pDesc
= new SFUnrecImageComposerPtr::Description(
320 SFUnrecImageComposerPtr::getClassType(),
323 ComposerFieldId
, ComposerFieldMask
,
325 (Field::SFDefaultFlags
| Field::FStdAccess
),
326 static_cast<FieldEditMethodSig
>(&ClusterWindow::editHandleComposer
),
327 static_cast<FieldGetMethodSig
>(&ClusterWindow::getHandleComposer
));
329 oType
.addInitialDesc(pDesc
);
331 pDesc
= new MFString::Description(
332 MFString::getClassType(),
335 AutostartFieldId
, AutostartFieldMask
,
337 (Field::MFDefaultFlags
| Field::FStdAccess
),
338 static_cast<FieldEditMethodSig
>(&ClusterWindow::editHandleAutostart
),
339 static_cast<FieldGetMethodSig
>(&ClusterWindow::getHandleAutostart
));
341 oType
.addInitialDesc(pDesc
);
345 ClusterWindowBase::TypeObject
ClusterWindowBase::_type(
346 ClusterWindowBase::getClassname(),
347 Inherited::getClassname(),
350 reinterpret_cast<PrototypeCreateF
>(&ClusterWindowBase::createEmptyLocal
),
351 reinterpret_cast<InitContainerF
>(&ClusterWindow::initMethod
),
352 reinterpret_cast<ExitContainerF
>(&ClusterWindow::exitMethod
),
353 reinterpret_cast<InitalInsertDescFunc
>(
354 reinterpret_cast<void *>(&ClusterWindow::classDescInserter
)),
357 "<?xml version=\"1.0\"?>\n"
360 " name=\"ClusterWindow\"\n"
361 " parent=\"Window\"\n"
362 " library=\"Cluster\"\n"
363 " pointerfieldtypes=\"both\"\n"
364 " structure=\"concrete\"\n"
365 " systemcomponent=\"true\"\n"
366 " parentsystemcomponent=\"true\"\n"
367 " decoratable=\"false\"\n"
368 " useLocalIncludes=\"false\"\n"
369 " docGroupBase=\"GrpClusterWindow\"\n"
371 " The base class for all windows.\n"
373 "\t name=\"servers\"\n"
374 "\t type=\"std::string\"\n"
375 "\t cardinality=\"multi\"\n"
376 "\t visibility=\"external\"\n"
377 "\t access=\"public\"\n"
379 "\tList of all symbolic server names\n"
382 "\t name=\"serverIds\"\n"
383 "\t type=\"UInt32\"\n"
384 "\t cardinality=\"multi\"\n"
385 "\t visibility=\"external\"\n"
386 "\t access=\"public\"\n"
390 "\t name=\"connectionType\"\n"
391 "\t type=\"std::string\"\n"
392 "\t cardinality=\"single\"\n"
393 "\t visibility=\"external\"\n"
394 "\t access=\"public\"\n"
396 "\tHow to connect to the servers\n"
399 "\t name=\"connectionInterface\"\n"
400 "\t type=\"std::string\"\n"
401 "\t cardinality=\"single\"\n"
402 "\t visibility=\"external\"\n"
403 "\t access=\"public\"\n"
405 "\tWhich network interface to use for communication\n"
408 "\t name=\"connectionDestination\"\n"
409 "\t type=\"std::string\"\n"
410 "\t cardinality=\"single\"\n"
411 "\t visibility=\"external\"\n"
412 "\t access=\"public\"\n"
414 "\tMulticast address for multicast connections\n"
417 "\t name=\"connectionParams\"\n"
418 "\t type=\"std::string\"\n"
419 "\t cardinality=\"single\"\n"
420 "\t visibility=\"external\"\n"
421 "\t access=\"public\"\n"
423 "\tOptional parameters e.g. \"TTL=2\"\n"
426 "\t name=\"servicePort\"\n"
427 "\t type=\"UInt32\"\n"
428 "\t cardinality=\"single\"\n"
429 "\t visibility=\"external\"\n"
430 "\t defaultValue=\"8437\"\n"
431 "\t access=\"public\"\n"
433 "\tBroadcastport used for server search\n"
436 "\t name=\"serviceAddress\"\n"
437 "\t type=\"std::string\"\n"
438 "\t cardinality=\"single\"\n"
439 "\t visibility=\"external\"\n"
440 "\t defaultValue='\"224.245.211.234\"'\n"
441 "\t access=\"public\"\n"
443 "\tBroadcast or Multicast address used for server search\n"
446 "\t name=\"serviceInterface\"\n"
447 "\t type=\"std::string\"\n"
448 "\t cardinality=\"single\"\n"
449 "\t visibility=\"external\"\n"
450 "\t access=\"public\"\n"
452 "\tEthernet interface to be used for server search\n"
455 "\t name=\"clientWindow\"\n"
456 "\t type=\"WindowPtr\"\n"
457 "\t cardinality=\"single\"\n"
458 "\t visibility=\"external\"\n"
459 "\t access=\"public\"\n"
461 "\tWindow for client rendering\n"
464 "\t name=\"interleave\"\n"
465 "\t type=\"UInt32\"\n"
466 "\t cardinality=\"single\"\n"
467 "\t visibility=\"external\"\n"
468 "\t defaultValue=\"0\"\n"
469 "\t access=\"public\"\n"
473 "\t name=\"frameCount\"\n"
474 "\t type=\"UInt32\"\n"
475 "\t cardinality=\"single\"\n"
476 "\t visibility=\"external\"\n"
477 "\t defaultValue=\"0\"\n"
478 "\t access=\"public\"\n"
482 "\t name=\"composer\"\n"
483 "\t type=\"ImageComposerPtr\"\n"
484 "\t cardinality=\"single\"\n"
485 "\t visibility=\"external\"\n"
486 "\t access=\"public\"\n"
490 "\t name=\"autostart\"\n"
491 "\t type=\"std::string\"\n"
492 "\t cardinality=\"multi\"\n"
493 "\t visibility=\"external\"\n"
494 "\t access=\"public\"\n"
499 "\t\tname=\"calibration\"\n"
500 "\t\ttype=\"DisplayCalibrationPtr\"\n"
501 "\t\tcardinality=\"multi\"\n"
502 "\t\tvisibility=\"external\"\n"
503 "\t\taccess=\"public\"\n"
507 "\t\tname=\"filter\"\n"
508 "\t\ttype=\"DisplayFilterForegroundPtr\"\n"
509 "\t\tcardinality=\"multi\"\n"
510 "\t\tvisibility=\"external\"\n"
511 "\t\taccess=\"public\"\n"
513 "\t Display filter foregrounds can be used instead of calibration\n"
516 "\t\tname=\"dirty\"\n"
517 "\t\ttype=\"bool\"\n"
518 "\t\tcardinality=\"single\"\n"
519 "\t\tvisibility=\"external\"\n"
520 "\t\tdefaultValue=\"false\"\n"
521 "\t\taccess=\"protected\"\n"
523 "\t Internally set for forceing re-initialization of foregrounds\n"
526 "</FieldContainer>\n",
527 "The base class for all windows.\n"
530 /*------------------------------ get -----------------------------------*/
532 FieldContainerType
&ClusterWindowBase::getType(void)
537 const FieldContainerType
&ClusterWindowBase::getType(void) const
542 UInt32
ClusterWindowBase::getContainerSize(void) const
544 return sizeof(ClusterWindow
);
547 /*------------------------- decorator get ------------------------------*/
550 MFString
*ClusterWindowBase::editMFServers(void)
552 editMField(ServersFieldMask
, _mfServers
);
557 const MFString
*ClusterWindowBase::getMFServers(void) const
563 MFUInt32
*ClusterWindowBase::editMFServerIds(void)
565 editMField(ServerIdsFieldMask
, _mfServerIds
);
567 return &_mfServerIds
;
570 const MFUInt32
*ClusterWindowBase::getMFServerIds(void) const
572 return &_mfServerIds
;
576 SFString
*ClusterWindowBase::editSFConnectionType(void)
578 editSField(ConnectionTypeFieldMask
);
580 return &_sfConnectionType
;
583 const SFString
*ClusterWindowBase::getSFConnectionType(void) const
585 return &_sfConnectionType
;
589 SFString
*ClusterWindowBase::editSFConnectionInterface(void)
591 editSField(ConnectionInterfaceFieldMask
);
593 return &_sfConnectionInterface
;
596 const SFString
*ClusterWindowBase::getSFConnectionInterface(void) const
598 return &_sfConnectionInterface
;
602 SFString
*ClusterWindowBase::editSFConnectionDestination(void)
604 editSField(ConnectionDestinationFieldMask
);
606 return &_sfConnectionDestination
;
609 const SFString
*ClusterWindowBase::getSFConnectionDestination(void) const
611 return &_sfConnectionDestination
;
615 SFString
*ClusterWindowBase::editSFConnectionParams(void)
617 editSField(ConnectionParamsFieldMask
);
619 return &_sfConnectionParams
;
622 const SFString
*ClusterWindowBase::getSFConnectionParams(void) const
624 return &_sfConnectionParams
;
628 SFUInt32
*ClusterWindowBase::editSFServicePort(void)
630 editSField(ServicePortFieldMask
);
632 return &_sfServicePort
;
635 const SFUInt32
*ClusterWindowBase::getSFServicePort(void) const
637 return &_sfServicePort
;
641 SFString
*ClusterWindowBase::editSFServiceAddress(void)
643 editSField(ServiceAddressFieldMask
);
645 return &_sfServiceAddress
;
648 const SFString
*ClusterWindowBase::getSFServiceAddress(void) const
650 return &_sfServiceAddress
;
654 SFString
*ClusterWindowBase::editSFServiceInterface(void)
656 editSField(ServiceInterfaceFieldMask
);
658 return &_sfServiceInterface
;
661 const SFString
*ClusterWindowBase::getSFServiceInterface(void) const
663 return &_sfServiceInterface
;
667 //! Get the ClusterWindow::_sfClientWindow field.
668 const SFUnrecWindowPtr
*ClusterWindowBase::getSFClientWindow(void) const
670 return &_sfClientWindow
;
673 SFUnrecWindowPtr
*ClusterWindowBase::editSFClientWindow (void)
675 editSField(ClientWindowFieldMask
);
677 return &_sfClientWindow
;
680 //! Get the value of the ClusterWindow::_sfClientWindow field.
681 Window
* ClusterWindowBase::getClientWindow(void) const
683 return _sfClientWindow
.getValue();
686 //! Set the value of the ClusterWindow::_sfClientWindow field.
687 void ClusterWindowBase::setClientWindow(Window
* const value
)
689 editSField(ClientWindowFieldMask
);
691 _sfClientWindow
.setValue(value
);
695 SFUInt32
*ClusterWindowBase::editSFInterleave(void)
697 editSField(InterleaveFieldMask
);
699 return &_sfInterleave
;
702 const SFUInt32
*ClusterWindowBase::getSFInterleave(void) const
704 return &_sfInterleave
;
708 SFUInt32
*ClusterWindowBase::editSFFrameCount(void)
710 editSField(FrameCountFieldMask
);
712 return &_sfFrameCount
;
715 const SFUInt32
*ClusterWindowBase::getSFFrameCount(void) const
717 return &_sfFrameCount
;
721 //! Get the ClusterWindow::_sfComposer field.
722 const SFUnrecImageComposerPtr
*ClusterWindowBase::getSFComposer(void) const
727 SFUnrecImageComposerPtr
*ClusterWindowBase::editSFComposer (void)
729 editSField(ComposerFieldMask
);
734 //! Get the value of the ClusterWindow::_sfComposer field.
735 ImageComposer
* ClusterWindowBase::getComposer(void) const
737 return _sfComposer
.getValue();
740 //! Set the value of the ClusterWindow::_sfComposer field.
741 void ClusterWindowBase::setComposer(ImageComposer
* const value
)
743 editSField(ComposerFieldMask
);
745 _sfComposer
.setValue(value
);
749 MFString
*ClusterWindowBase::editMFAutostart(void)
751 editMField(AutostartFieldMask
, _mfAutostart
);
753 return &_mfAutostart
;
756 const MFString
*ClusterWindowBase::getMFAutostart(void) const
758 return &_mfAutostart
;
766 /*------------------------------ access -----------------------------------*/
768 SizeT
ClusterWindowBase::getBinSize(ConstFieldMaskArg whichField
)
770 SizeT returnValue
= Inherited::getBinSize(whichField
);
772 if(FieldBits::NoField
!= (ServersFieldMask
& whichField
))
774 returnValue
+= _mfServers
.getBinSize();
776 if(FieldBits::NoField
!= (ServerIdsFieldMask
& whichField
))
778 returnValue
+= _mfServerIds
.getBinSize();
780 if(FieldBits::NoField
!= (ConnectionTypeFieldMask
& whichField
))
782 returnValue
+= _sfConnectionType
.getBinSize();
784 if(FieldBits::NoField
!= (ConnectionInterfaceFieldMask
& whichField
))
786 returnValue
+= _sfConnectionInterface
.getBinSize();
788 if(FieldBits::NoField
!= (ConnectionDestinationFieldMask
& whichField
))
790 returnValue
+= _sfConnectionDestination
.getBinSize();
792 if(FieldBits::NoField
!= (ConnectionParamsFieldMask
& whichField
))
794 returnValue
+= _sfConnectionParams
.getBinSize();
796 if(FieldBits::NoField
!= (ServicePortFieldMask
& whichField
))
798 returnValue
+= _sfServicePort
.getBinSize();
800 if(FieldBits::NoField
!= (ServiceAddressFieldMask
& whichField
))
802 returnValue
+= _sfServiceAddress
.getBinSize();
804 if(FieldBits::NoField
!= (ServiceInterfaceFieldMask
& whichField
))
806 returnValue
+= _sfServiceInterface
.getBinSize();
808 if(FieldBits::NoField
!= (ClientWindowFieldMask
& whichField
))
810 returnValue
+= _sfClientWindow
.getBinSize();
812 if(FieldBits::NoField
!= (InterleaveFieldMask
& whichField
))
814 returnValue
+= _sfInterleave
.getBinSize();
816 if(FieldBits::NoField
!= (FrameCountFieldMask
& whichField
))
818 returnValue
+= _sfFrameCount
.getBinSize();
820 if(FieldBits::NoField
!= (ComposerFieldMask
& whichField
))
822 returnValue
+= _sfComposer
.getBinSize();
824 if(FieldBits::NoField
!= (AutostartFieldMask
& whichField
))
826 returnValue
+= _mfAutostart
.getBinSize();
832 void ClusterWindowBase::copyToBin(BinaryDataHandler
&pMem
,
833 ConstFieldMaskArg whichField
)
835 Inherited::copyToBin(pMem
, whichField
);
837 if(FieldBits::NoField
!= (ServersFieldMask
& whichField
))
839 _mfServers
.copyToBin(pMem
);
841 if(FieldBits::NoField
!= (ServerIdsFieldMask
& whichField
))
843 _mfServerIds
.copyToBin(pMem
);
845 if(FieldBits::NoField
!= (ConnectionTypeFieldMask
& whichField
))
847 _sfConnectionType
.copyToBin(pMem
);
849 if(FieldBits::NoField
!= (ConnectionInterfaceFieldMask
& whichField
))
851 _sfConnectionInterface
.copyToBin(pMem
);
853 if(FieldBits::NoField
!= (ConnectionDestinationFieldMask
& whichField
))
855 _sfConnectionDestination
.copyToBin(pMem
);
857 if(FieldBits::NoField
!= (ConnectionParamsFieldMask
& whichField
))
859 _sfConnectionParams
.copyToBin(pMem
);
861 if(FieldBits::NoField
!= (ServicePortFieldMask
& whichField
))
863 _sfServicePort
.copyToBin(pMem
);
865 if(FieldBits::NoField
!= (ServiceAddressFieldMask
& whichField
))
867 _sfServiceAddress
.copyToBin(pMem
);
869 if(FieldBits::NoField
!= (ServiceInterfaceFieldMask
& whichField
))
871 _sfServiceInterface
.copyToBin(pMem
);
873 if(FieldBits::NoField
!= (ClientWindowFieldMask
& whichField
))
875 _sfClientWindow
.copyToBin(pMem
);
877 if(FieldBits::NoField
!= (InterleaveFieldMask
& whichField
))
879 _sfInterleave
.copyToBin(pMem
);
881 if(FieldBits::NoField
!= (FrameCountFieldMask
& whichField
))
883 _sfFrameCount
.copyToBin(pMem
);
885 if(FieldBits::NoField
!= (ComposerFieldMask
& whichField
))
887 _sfComposer
.copyToBin(pMem
);
889 if(FieldBits::NoField
!= (AutostartFieldMask
& whichField
))
891 _mfAutostart
.copyToBin(pMem
);
895 void ClusterWindowBase::copyFromBin(BinaryDataHandler
&pMem
,
896 ConstFieldMaskArg whichField
)
898 Inherited::copyFromBin(pMem
, whichField
);
900 if(FieldBits::NoField
!= (ServersFieldMask
& whichField
))
902 editMField(ServersFieldMask
, _mfServers
);
903 _mfServers
.copyFromBin(pMem
);
905 if(FieldBits::NoField
!= (ServerIdsFieldMask
& whichField
))
907 editMField(ServerIdsFieldMask
, _mfServerIds
);
908 _mfServerIds
.copyFromBin(pMem
);
910 if(FieldBits::NoField
!= (ConnectionTypeFieldMask
& whichField
))
912 editSField(ConnectionTypeFieldMask
);
913 _sfConnectionType
.copyFromBin(pMem
);
915 if(FieldBits::NoField
!= (ConnectionInterfaceFieldMask
& whichField
))
917 editSField(ConnectionInterfaceFieldMask
);
918 _sfConnectionInterface
.copyFromBin(pMem
);
920 if(FieldBits::NoField
!= (ConnectionDestinationFieldMask
& whichField
))
922 editSField(ConnectionDestinationFieldMask
);
923 _sfConnectionDestination
.copyFromBin(pMem
);
925 if(FieldBits::NoField
!= (ConnectionParamsFieldMask
& whichField
))
927 editSField(ConnectionParamsFieldMask
);
928 _sfConnectionParams
.copyFromBin(pMem
);
930 if(FieldBits::NoField
!= (ServicePortFieldMask
& whichField
))
932 editSField(ServicePortFieldMask
);
933 _sfServicePort
.copyFromBin(pMem
);
935 if(FieldBits::NoField
!= (ServiceAddressFieldMask
& whichField
))
937 editSField(ServiceAddressFieldMask
);
938 _sfServiceAddress
.copyFromBin(pMem
);
940 if(FieldBits::NoField
!= (ServiceInterfaceFieldMask
& whichField
))
942 editSField(ServiceInterfaceFieldMask
);
943 _sfServiceInterface
.copyFromBin(pMem
);
945 if(FieldBits::NoField
!= (ClientWindowFieldMask
& whichField
))
947 editSField(ClientWindowFieldMask
);
948 _sfClientWindow
.copyFromBin(pMem
);
950 if(FieldBits::NoField
!= (InterleaveFieldMask
& whichField
))
952 editSField(InterleaveFieldMask
);
953 _sfInterleave
.copyFromBin(pMem
);
955 if(FieldBits::NoField
!= (FrameCountFieldMask
& whichField
))
957 editSField(FrameCountFieldMask
);
958 _sfFrameCount
.copyFromBin(pMem
);
960 if(FieldBits::NoField
!= (ComposerFieldMask
& whichField
))
962 editSField(ComposerFieldMask
);
963 _sfComposer
.copyFromBin(pMem
);
965 if(FieldBits::NoField
!= (AutostartFieldMask
& whichField
))
967 editMField(AutostartFieldMask
, _mfAutostart
);
968 _mfAutostart
.copyFromBin(pMem
);
972 //! create a new instance of the class
973 ClusterWindowTransitPtr
ClusterWindowBase::createLocal(BitVector bFlags
)
975 ClusterWindowTransitPtr fc
;
977 if(getClassType().getPrototype() != NULL
)
979 FieldContainerTransitPtr tmpPtr
=
980 getClassType().getPrototype()-> shallowCopyLocal(bFlags
);
982 fc
= dynamic_pointer_cast
<ClusterWindow
>(tmpPtr
);
988 //! create a new instance of the class, copy the container flags
989 ClusterWindowTransitPtr
ClusterWindowBase::createDependent(BitVector bFlags
)
991 ClusterWindowTransitPtr fc
;
993 if(getClassType().getPrototype() != NULL
)
995 FieldContainerTransitPtr tmpPtr
=
996 getClassType().getPrototype()-> shallowCopyDependent(bFlags
);
998 fc
= dynamic_pointer_cast
<ClusterWindow
>(tmpPtr
);
1004 //! create a new instance of the class
1005 ClusterWindowTransitPtr
ClusterWindowBase::create(void)
1007 ClusterWindowTransitPtr fc
;
1009 if(getClassType().getPrototype() != NULL
)
1011 FieldContainerTransitPtr tmpPtr
=
1012 getClassType().getPrototype()-> shallowCopy();
1014 fc
= dynamic_pointer_cast
<ClusterWindow
>(tmpPtr
);
1020 ClusterWindow
*ClusterWindowBase::createEmptyLocal(BitVector bFlags
)
1022 ClusterWindow
*returnValue
;
1024 newPtr
<ClusterWindow
>(returnValue
, bFlags
);
1026 returnValue
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
1031 //! create an empty new instance of the class, do not copy the prototype
1032 ClusterWindow
*ClusterWindowBase::createEmpty(void)
1034 ClusterWindow
*returnValue
;
1036 newPtr
<ClusterWindow
>(returnValue
, Thread::getCurrentLocalFlags());
1038 returnValue
->_pFieldFlags
->_bNamespaceMask
&=
1039 ~Thread::getCurrentLocalFlags();
1045 FieldContainerTransitPtr
ClusterWindowBase::shallowCopyLocal(
1046 BitVector bFlags
) const
1048 ClusterWindow
*tmpPtr
;
1050 newPtr(tmpPtr
, dynamic_cast<const ClusterWindow
*>(this), bFlags
);
1052 FieldContainerTransitPtr
returnValue(tmpPtr
);
1054 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
1059 FieldContainerTransitPtr
ClusterWindowBase::shallowCopyDependent(
1060 BitVector bFlags
) const
1062 ClusterWindow
*tmpPtr
;
1064 newPtr(tmpPtr
, dynamic_cast<const ClusterWindow
*>(this), ~bFlags
);
1066 FieldContainerTransitPtr
returnValue(tmpPtr
);
1068 tmpPtr
->_pFieldFlags
->_bNamespaceMask
= bFlags
;
1073 FieldContainerTransitPtr
ClusterWindowBase::shallowCopy(void) const
1075 ClusterWindow
*tmpPtr
;
1078 dynamic_cast<const ClusterWindow
*>(this),
1079 Thread::getCurrentLocalFlags());
1081 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~Thread::getCurrentLocalFlags();
1083 FieldContainerTransitPtr
returnValue(tmpPtr
);
1091 /*------------------------- constructors ----------------------------------*/
1093 ClusterWindowBase::ClusterWindowBase(void) :
1097 _sfConnectionType (),
1098 _sfConnectionInterface (),
1099 _sfConnectionDestination (),
1100 _sfConnectionParams (),
1101 _sfServicePort (UInt32(8437)),
1102 _sfServiceAddress (std::string("224.245.211.234")),
1103 _sfServiceInterface (),
1104 _sfClientWindow (NULL
),
1105 _sfInterleave (UInt32(0)),
1106 _sfFrameCount (UInt32(0)),
1112 ClusterWindowBase::ClusterWindowBase(const ClusterWindowBase
&source
) :
1114 _mfServers (source
._mfServers
),
1115 _mfServerIds (source
._mfServerIds
),
1116 _sfConnectionType (source
._sfConnectionType
),
1117 _sfConnectionInterface (source
._sfConnectionInterface
),
1118 _sfConnectionDestination (source
._sfConnectionDestination
),
1119 _sfConnectionParams (source
._sfConnectionParams
),
1120 _sfServicePort (source
._sfServicePort
),
1121 _sfServiceAddress (source
._sfServiceAddress
),
1122 _sfServiceInterface (source
._sfServiceInterface
),
1123 _sfClientWindow (NULL
),
1124 _sfInterleave (source
._sfInterleave
),
1125 _sfFrameCount (source
._sfFrameCount
),
1127 _mfAutostart (source
._mfAutostart
)
1132 /*-------------------------- destructors ----------------------------------*/
1134 ClusterWindowBase::~ClusterWindowBase(void)
1138 void ClusterWindowBase::onCreate(const ClusterWindow
*source
)
1140 Inherited::onCreate(source
);
1144 ClusterWindow
*pThis
= static_cast<ClusterWindow
*>(this);
1146 pThis
->setClientWindow(source
->getClientWindow());
1148 pThis
->setComposer(source
->getComposer());
1152 GetFieldHandlePtr
ClusterWindowBase::getHandleServers (void) const
1154 MFString::GetHandlePtr
returnValue(
1155 new MFString::GetHandle(
1157 this->getType().getFieldDesc(ServersFieldId
),
1158 const_cast<ClusterWindowBase
*>(this)));
1163 EditFieldHandlePtr
ClusterWindowBase::editHandleServers (void)
1165 MFString::EditHandlePtr
returnValue(
1166 new MFString::EditHandle(
1168 this->getType().getFieldDesc(ServersFieldId
),
1172 editMField(ServersFieldMask
, _mfServers
);
1177 GetFieldHandlePtr
ClusterWindowBase::getHandleServerIds (void) const
1179 MFUInt32::GetHandlePtr
returnValue(
1180 new MFUInt32::GetHandle(
1182 this->getType().getFieldDesc(ServerIdsFieldId
),
1183 const_cast<ClusterWindowBase
*>(this)));
1188 EditFieldHandlePtr
ClusterWindowBase::editHandleServerIds (void)
1190 MFUInt32::EditHandlePtr
returnValue(
1191 new MFUInt32::EditHandle(
1193 this->getType().getFieldDesc(ServerIdsFieldId
),
1197 editMField(ServerIdsFieldMask
, _mfServerIds
);
1202 GetFieldHandlePtr
ClusterWindowBase::getHandleConnectionType (void) const
1204 SFString::GetHandlePtr
returnValue(
1205 new SFString::GetHandle(
1207 this->getType().getFieldDesc(ConnectionTypeFieldId
),
1208 const_cast<ClusterWindowBase
*>(this)));
1213 EditFieldHandlePtr
ClusterWindowBase::editHandleConnectionType (void)
1215 SFString::EditHandlePtr
returnValue(
1216 new SFString::EditHandle(
1218 this->getType().getFieldDesc(ConnectionTypeFieldId
),
1222 editSField(ConnectionTypeFieldMask
);
1227 GetFieldHandlePtr
ClusterWindowBase::getHandleConnectionInterface (void) const
1229 SFString::GetHandlePtr
returnValue(
1230 new SFString::GetHandle(
1231 &_sfConnectionInterface
,
1232 this->getType().getFieldDesc(ConnectionInterfaceFieldId
),
1233 const_cast<ClusterWindowBase
*>(this)));
1238 EditFieldHandlePtr
ClusterWindowBase::editHandleConnectionInterface(void)
1240 SFString::EditHandlePtr
returnValue(
1241 new SFString::EditHandle(
1242 &_sfConnectionInterface
,
1243 this->getType().getFieldDesc(ConnectionInterfaceFieldId
),
1247 editSField(ConnectionInterfaceFieldMask
);
1252 GetFieldHandlePtr
ClusterWindowBase::getHandleConnectionDestination (void) const
1254 SFString::GetHandlePtr
returnValue(
1255 new SFString::GetHandle(
1256 &_sfConnectionDestination
,
1257 this->getType().getFieldDesc(ConnectionDestinationFieldId
),
1258 const_cast<ClusterWindowBase
*>(this)));
1263 EditFieldHandlePtr
ClusterWindowBase::editHandleConnectionDestination(void)
1265 SFString::EditHandlePtr
returnValue(
1266 new SFString::EditHandle(
1267 &_sfConnectionDestination
,
1268 this->getType().getFieldDesc(ConnectionDestinationFieldId
),
1272 editSField(ConnectionDestinationFieldMask
);
1277 GetFieldHandlePtr
ClusterWindowBase::getHandleConnectionParams (void) const
1279 SFString::GetHandlePtr
returnValue(
1280 new SFString::GetHandle(
1281 &_sfConnectionParams
,
1282 this->getType().getFieldDesc(ConnectionParamsFieldId
),
1283 const_cast<ClusterWindowBase
*>(this)));
1288 EditFieldHandlePtr
ClusterWindowBase::editHandleConnectionParams(void)
1290 SFString::EditHandlePtr
returnValue(
1291 new SFString::EditHandle(
1292 &_sfConnectionParams
,
1293 this->getType().getFieldDesc(ConnectionParamsFieldId
),
1297 editSField(ConnectionParamsFieldMask
);
1302 GetFieldHandlePtr
ClusterWindowBase::getHandleServicePort (void) const
1304 SFUInt32::GetHandlePtr
returnValue(
1305 new SFUInt32::GetHandle(
1307 this->getType().getFieldDesc(ServicePortFieldId
),
1308 const_cast<ClusterWindowBase
*>(this)));
1313 EditFieldHandlePtr
ClusterWindowBase::editHandleServicePort (void)
1315 SFUInt32::EditHandlePtr
returnValue(
1316 new SFUInt32::EditHandle(
1318 this->getType().getFieldDesc(ServicePortFieldId
),
1322 editSField(ServicePortFieldMask
);
1327 GetFieldHandlePtr
ClusterWindowBase::getHandleServiceAddress (void) const
1329 SFString::GetHandlePtr
returnValue(
1330 new SFString::GetHandle(
1332 this->getType().getFieldDesc(ServiceAddressFieldId
),
1333 const_cast<ClusterWindowBase
*>(this)));
1338 EditFieldHandlePtr
ClusterWindowBase::editHandleServiceAddress (void)
1340 SFString::EditHandlePtr
returnValue(
1341 new SFString::EditHandle(
1343 this->getType().getFieldDesc(ServiceAddressFieldId
),
1347 editSField(ServiceAddressFieldMask
);
1352 GetFieldHandlePtr
ClusterWindowBase::getHandleServiceInterface (void) const
1354 SFString::GetHandlePtr
returnValue(
1355 new SFString::GetHandle(
1356 &_sfServiceInterface
,
1357 this->getType().getFieldDesc(ServiceInterfaceFieldId
),
1358 const_cast<ClusterWindowBase
*>(this)));
1363 EditFieldHandlePtr
ClusterWindowBase::editHandleServiceInterface(void)
1365 SFString::EditHandlePtr
returnValue(
1366 new SFString::EditHandle(
1367 &_sfServiceInterface
,
1368 this->getType().getFieldDesc(ServiceInterfaceFieldId
),
1372 editSField(ServiceInterfaceFieldMask
);
1377 GetFieldHandlePtr
ClusterWindowBase::getHandleClientWindow (void) const
1379 SFUnrecWindowPtr::GetHandlePtr
returnValue(
1380 new SFUnrecWindowPtr::GetHandle(
1382 this->getType().getFieldDesc(ClientWindowFieldId
),
1383 const_cast<ClusterWindowBase
*>(this)));
1388 EditFieldHandlePtr
ClusterWindowBase::editHandleClientWindow (void)
1390 SFUnrecWindowPtr::EditHandlePtr
returnValue(
1391 new SFUnrecWindowPtr::EditHandle(
1393 this->getType().getFieldDesc(ClientWindowFieldId
),
1396 returnValue
->setSetMethod(
1397 boost::bind(&ClusterWindow::setClientWindow
,
1398 static_cast<ClusterWindow
*>(this), _1
));
1400 editSField(ClientWindowFieldMask
);
1405 GetFieldHandlePtr
ClusterWindowBase::getHandleInterleave (void) const
1407 SFUInt32::GetHandlePtr
returnValue(
1408 new SFUInt32::GetHandle(
1410 this->getType().getFieldDesc(InterleaveFieldId
),
1411 const_cast<ClusterWindowBase
*>(this)));
1416 EditFieldHandlePtr
ClusterWindowBase::editHandleInterleave (void)
1418 SFUInt32::EditHandlePtr
returnValue(
1419 new SFUInt32::EditHandle(
1421 this->getType().getFieldDesc(InterleaveFieldId
),
1425 editSField(InterleaveFieldMask
);
1430 GetFieldHandlePtr
ClusterWindowBase::getHandleFrameCount (void) const
1432 SFUInt32::GetHandlePtr
returnValue(
1433 new SFUInt32::GetHandle(
1435 this->getType().getFieldDesc(FrameCountFieldId
),
1436 const_cast<ClusterWindowBase
*>(this)));
1441 EditFieldHandlePtr
ClusterWindowBase::editHandleFrameCount (void)
1443 SFUInt32::EditHandlePtr
returnValue(
1444 new SFUInt32::EditHandle(
1446 this->getType().getFieldDesc(FrameCountFieldId
),
1450 editSField(FrameCountFieldMask
);
1455 GetFieldHandlePtr
ClusterWindowBase::getHandleComposer (void) const
1457 SFUnrecImageComposerPtr::GetHandlePtr
returnValue(
1458 new SFUnrecImageComposerPtr::GetHandle(
1460 this->getType().getFieldDesc(ComposerFieldId
),
1461 const_cast<ClusterWindowBase
*>(this)));
1466 EditFieldHandlePtr
ClusterWindowBase::editHandleComposer (void)
1468 SFUnrecImageComposerPtr::EditHandlePtr
returnValue(
1469 new SFUnrecImageComposerPtr::EditHandle(
1471 this->getType().getFieldDesc(ComposerFieldId
),
1474 returnValue
->setSetMethod(
1475 boost::bind(&ClusterWindow::setComposer
,
1476 static_cast<ClusterWindow
*>(this), _1
));
1478 editSField(ComposerFieldMask
);
1483 GetFieldHandlePtr
ClusterWindowBase::getHandleAutostart (void) const
1485 MFString::GetHandlePtr
returnValue(
1486 new MFString::GetHandle(
1488 this->getType().getFieldDesc(AutostartFieldId
),
1489 const_cast<ClusterWindowBase
*>(this)));
1494 EditFieldHandlePtr
ClusterWindowBase::editHandleAutostart (void)
1496 MFString::EditHandlePtr
returnValue(
1497 new MFString::EditHandle(
1499 this->getType().getFieldDesc(AutostartFieldId
),
1503 editMField(AutostartFieldMask
, _mfAutostart
);
1509 #ifdef OSG_MT_CPTR_ASPECT
1510 void ClusterWindowBase::execSyncV( FieldContainer
&oFrom
,
1511 ConstFieldMaskArg whichField
,
1512 AspectOffsetStore
&oOffsets
,
1513 ConstFieldMaskArg syncMode
,
1514 const UInt32 uiSyncInfo
)
1516 ClusterWindow
*pThis
= static_cast<ClusterWindow
*>(this);
1518 pThis
->execSync(static_cast<ClusterWindow
*>(&oFrom
),
1527 #ifdef OSG_MT_CPTR_ASPECT
1528 FieldContainer
*ClusterWindowBase::createAspectCopy(
1529 const FieldContainer
*pRefAspect
) const
1531 ClusterWindow
*returnValue
;
1533 newAspectCopy(returnValue
,
1534 dynamic_cast<const ClusterWindow
*>(pRefAspect
),
1535 dynamic_cast<const ClusterWindow
*>(this));
1541 void ClusterWindowBase::resolveLinks(void)
1543 Inherited::resolveLinks();
1545 static_cast<ClusterWindow
*>(this)->setClientWindow(NULL
);
1547 static_cast<ClusterWindow
*>(this)->setComposer(NULL
);
1549 #ifdef OSG_MT_CPTR_ASPECT
1550 AspectOffsetStore oOffsets
;
1552 _pAspectStore
->fillOffsetArray(oOffsets
, this);
1555 #ifdef OSG_MT_CPTR_ASPECT
1556 _mfServers
.terminateShare(Thread::getCurrentAspect(),
1559 #ifdef OSG_MT_CPTR_ASPECT
1560 _mfServerIds
.terminateShare(Thread::getCurrentAspect(),
1563 #ifdef OSG_MT_CPTR_ASPECT
1564 _mfAutostart
.terminateShare(Thread::getCurrentAspect(),