Index: OSGMultiDisplayWindow.cpp
===================================================================
RCS file: /cvsroot/opensg/OpenSG/Source/System/Cluster/Window/MultiDisplay/OSGMultiDisplayWindow.cpp,v
retrieving revision 1.26
diff -u -r1.26 OSGMultiDisplayWindow.cpp
--- OSGMultiDisplayWindow.cpp	2 Jul 2010 15:36:40 -0000	1.26
+++ OSGMultiDisplayWindow.cpp	11 Aug 2011 11:04:21 -0000
@@ -57,8 +57,6 @@
 #include "OSGConnection.h"
 #include "OSGNode.h"
 
-#define FAST_SYNC 0
-
 OSG_USING_NAMESPACE
 
 /*! \class osg::MultiDisplayWindow
@@ -104,7 +102,7 @@
 
 /*! output the instance for debug purposes
  */
-void MultiDisplayWindow::dump(      UInt32    , 
+void MultiDisplayWindow::dump(      UInt32    ,
                               const BitVector ) const
 {
     SLOG << "hServers:" << getHServers() << " "
@@ -122,9 +120,9 @@
 }
 
 /*! render server window
- *  
+ *
  *  update all viewport parameters and render local viewports
- *  Width and height of the whole window are calculated by 
+ *  Width and height of the whole window are calculated by
  *  multiplieing the local window size by hServers and vServers.
  */
 void MultiDisplayWindow::serverRender( WindowPtr serverWindow,
@@ -175,7 +173,7 @@
     {
         clientPort    = getPort(cv);
         isVirtualPort = clientPort->getType().isDerivedFrom(FBOViewport::getClassType());
-        
+
         if(isVirtualPort)
         {
             // TODO -- seems wrong to render this on all servers, though rendering
@@ -312,7 +310,7 @@
 void MultiDisplayWindow::serverSwap( WindowPtr window,UInt32 id )
 {
     Connection *connection;
-    
+
     // clear command buffers
     UInt8 pixel[3];
     glReadPixels(0,0,
@@ -321,25 +319,26 @@
                  pixel);
     glFinish();
 
-#if !FAST_SYNC
-    connection=getNetwork()->getMainConnection();
-    if(!getInterleave())
-    {
-        // tell client that we are finish
-        connection->signal();
-        // wait for swap
-        connection->wait();
-    }
-#endif
+	if(!getFastSync())
+	{
+    	connection=getNetwork()->getMainConnection();
+		if(!getInterleave())
+		{
+			// tell client that we are finish
+			connection->signal();
+			// wait for swap
+			connection->wait();
+		}
+	}
     Inherited::serverSwap(window,id);
 }
 
 /*----------------------------- client methods ----------------------------*/
 
 /*! init client window
- *  
+ *
  *  If manageClientViewports is set, then all viewports from the
- *  cluster window are duplcated to the client window. 
+ *  cluster window are duplcated to the client window.
  */
 void MultiDisplayWindow::clientInit( void )
 {
@@ -363,7 +362,7 @@
                 vp->getBottom() != cvp->getBottom() ||
                 vp->getTop() != cvp->getTop() ||
                 vp->getBackground() != cvp->getBackground() ||
-                vp->getMFForegrounds()->size() != 
+                vp->getMFForegrounds()->size() !=
                     cvp->getMFForegrounds()->size() )
                 changed = true;
         }
@@ -391,26 +390,29 @@
         endEditCP(getClientWindow());
     }
 }
-    
+
 /*! render client window
  */
 void MultiDisplayWindow::clientSwap( void )
 {
     Connection *connection=getNetwork()->getMainConnection();
 
-#if FAST_SYNC
-    connection->selectChannel();
-#else
-    if(!getInterleave())
-    {
-        // wait for all servers to finish
-        connection->wait();
-        // initiate swap
-        connection->signal();
-    }
-#endif
+	if(getFastSync())
+	{
+    	connection->selectChannel();
+	}
+	else
+	{
+		if(!getInterleave())
+		{
+			// wait for all servers to finish
+			connection->wait();
+			// initiate swap
+			connection->signal();
+		}
+	}
 
-    // show client window 
+    // show client window
     Inherited::clientSwap();
 }
 
@@ -431,13 +433,13 @@
         return;
     if(serverPort->getType() != serverPort->getType())
         return;
-    
+
     const FieldContainerType &type = serverPort->getType();
     UInt32 fcount = osgMin(serverPort->getType().getNumFieldDescs(),
                            clientPort->getType().getNumFieldDescs());
-    
+
     BitVector ffilter = RemoteAspect::getFieldFilter(type.getId());
-    
+
     for(UInt32 i = 1; i <= fcount; ++i)
     {
         const FieldDescription* fdesc = type.getFieldDescription(i);
@@ -454,13 +456,13 @@
 
         Field *dst_field = serverPort->getField(i);
         Field *src_field = clientPort->getField(i);
-    
+
         const FieldType &dst_ftype = dst_field->getType();
         const FieldType &src_ftype = src_field->getType();
 
         if(dst_ftype != src_ftype)
             continue;
-    
+
         equal = true;
         found = false;
 
@@ -485,30 +487,30 @@
             {
                 UInt32 j, cn = static_cast<MFFieldContainerPtr*>(src_field)->size(),
                           sn = static_cast<MFFieldContainerPtr*>(src_field)->size();
-                          
+
                 if (strcmp(fdesc->getCName(), "foregrounds") == 0)
                 {
                     MFForegroundPtr sFgndBag;
                     MFForegroundPtr::const_iterator sFgndIt, cFgndIt;
                     DisplayFilterForegroundPtr filterFgnd = NullFC;
-                    
+
                     sFgndIt = serverPort->getMFForegrounds()->begin();
                     cFgndIt = clientPort->getMFForegrounds()->begin();
-                    
+
                     while (sFgndIt != serverPort->getMFForegrounds()->end())
                     {
                         filterFgnd = DisplayFilterForegroundPtr::dcast(*sFgndIt);
-                        
-                        if (filterFgnd != NullFC && 
+
+                        if (filterFgnd != NullFC &&
                            !filterFgnd->getServer().empty())
                             found = true;   // loaded filters found
                         else
                             sFgndBag.push_back(*sFgndIt);
-                            
+
                         ++sFgndIt;
                     }
-                    
-                    if (sFgndBag.size() != 
+
+                    if (sFgndBag.size() !=
                             clientPort->getMFForegrounds()->size())
                     {
                         equal = false;
@@ -516,7 +518,7 @@
                     else
                     {
                         sFgndIt = sFgndBag.begin();
-                        
+
                         while (sFgndIt != sFgndBag.end() &&
                                cFgndIt != clientPort->getMFForegrounds()->end() &&
                               *sFgndIt == *cFgndIt)
@@ -524,7 +526,7 @@
                             ++sFgndIt;
                             ++cFgndIt;
                         }
-                        
+
                         if (sFgndIt != sFgndBag.end() ||
                             cFgndIt != clientPort->getMFForegrounds()->end())
                             equal = false;
@@ -552,11 +554,11 @@
             beginEditCP(serverPort, mask);
             dst_field->setAbstrValue(*src_field);
             endEditCP(serverPort, mask);
-            
+
             if (found)
             {
                 ClusterWindowPtr ptr(this);
-        
+
                 beginEditCP(ptr, DirtyFieldMask);
                     setDirty(true);
                 endEditCP(ptr, DirtyFieldMask);
Index: OSGMultiDisplayWindow.fcd
===================================================================
RCS file: /cvsroot/opensg/OpenSG/Source/System/Cluster/Window/MultiDisplay/OSGMultiDisplayWindow.fcd,v
retrieving revision 1.3
diff -u -r1.3 OSGMultiDisplayWindow.fcd
--- OSGMultiDisplayWindow.fcd	17 Oct 2003 13:43:39 -0000	1.3
+++ OSGMultiDisplayWindow.fcd	11 Aug 2011 11:07:41 -0000
@@ -60,4 +60,14 @@
 	>
 	Vertical overlap
 	</Field>
+	<Field
+		name="fastSync"
+		type="bool"
+		cardinality="single"
+		visibility="external"
+		defaultValue="false"
+		access="public"
+	>
+	Enable/Disable cluster swap synchronization
+	</Field>
 </FieldContainer>
Index: OSGMultiDisplayWindowBase.cpp
===================================================================
RCS file: /cvsroot/opensg/OpenSG/Source/System/Cluster/Window/MultiDisplay/OSGMultiDisplayWindowBase.cpp,v
retrieving revision 1.13
diff -u -r1.13 OSGMultiDisplayWindowBase.cpp
--- OSGMultiDisplayWindowBase.cpp	9 Jun 2008 12:28:09 -0000	1.13
+++ OSGMultiDisplayWindowBase.cpp	11 Aug 2011 11:09:50 -0000
@@ -79,6 +79,9 @@
 const OSG::BitVector  MultiDisplayWindowBase::YOverlapFieldMask = 
     (TypeTraits<BitVector>::One << MultiDisplayWindowBase::YOverlapFieldId);
 
+const OSG::BitVector  MultiDisplayWindowBase::FastSyncFieldMask = 
+    (TypeTraits<BitVector>::One << MultiDisplayWindowBase::FastSyncFieldId);
+
 const OSG::BitVector MultiDisplayWindowBase::MTInfluenceMask = 
     (Inherited::MTInfluenceMask) | 
     (static_cast<BitVector>(0x0) << Inherited::NextFieldId); 
@@ -101,6 +104,9 @@
 /*! \var Int32           MultiDisplayWindowBase::_sfYOverlap
     Vertical overlap
 */
+/*! \var bool            MultiDisplayWindowBase::_sfFastSync
+    Enable/Disable cluster swap synchronization
+*/
 
 //! MultiDisplayWindow description
 
@@ -130,7 +136,12 @@
                      "yOverlap", 
                      YOverlapFieldId, YOverlapFieldMask,
                      false,
-                     reinterpret_cast<FieldAccessMethod>(&MultiDisplayWindowBase::editSFYOverlap))
+                     reinterpret_cast<FieldAccessMethod>(&MultiDisplayWindowBase::editSFYOverlap)),
+    new FieldDescription(SFBool::getClassType(), 
+                     "fastSync", 
+                     FastSyncFieldId, FastSyncFieldMask,
+                     false,
+                     reinterpret_cast<FieldAccessMethod>(&MultiDisplayWindowBase::editSFFastSync))
 };
 
 
@@ -212,6 +223,7 @@
     _sfManageClientViewports  (bool(true)), 
     _sfXOverlap               (Int32(0)), 
     _sfYOverlap               (Int32(0)), 
+    _sfFastSync               (bool(false)), 
     Inherited() 
 {
 }
@@ -226,6 +238,7 @@
     _sfManageClientViewports  (source._sfManageClientViewports  ), 
     _sfXOverlap               (source._sfXOverlap               ), 
     _sfYOverlap               (source._sfYOverlap               ), 
+    _sfFastSync               (source._sfFastSync               ), 
     Inherited                 (source)
 {
 }
@@ -267,6 +280,11 @@
         returnValue += _sfYOverlap.getBinSize();
     }
 
+    if(FieldBits::NoField != (FastSyncFieldMask & whichField))
+    {
+        returnValue += _sfFastSync.getBinSize();
+    }
+
 
     return returnValue;
 }
@@ -301,6 +319,11 @@
         _sfYOverlap.copyToBin(pMem);
     }
 
+    if(FieldBits::NoField != (FastSyncFieldMask & whichField))
+    {
+        _sfFastSync.copyToBin(pMem);
+    }
+
 
 }
 
@@ -334,6 +357,11 @@
         _sfYOverlap.copyFromBin(pMem);
     }
 
+    if(FieldBits::NoField != (FastSyncFieldMask & whichField))
+    {
+        _sfFastSync.copyFromBin(pMem);
+    }
+
 
 }
 
@@ -359,6 +387,9 @@
     if(FieldBits::NoField != (YOverlapFieldMask & whichField))
         _sfYOverlap.syncWith(pOther->_sfYOverlap);
 
+    if(FieldBits::NoField != (FastSyncFieldMask & whichField))
+        _sfFastSync.syncWith(pOther->_sfFastSync);
+
 
 }
 #else
@@ -384,6 +415,9 @@
     if(FieldBits::NoField != (YOverlapFieldMask & whichField))
         _sfYOverlap.syncWith(pOther->_sfYOverlap);
 
+    if(FieldBits::NoField != (FastSyncFieldMask & whichField))
+        _sfFastSync.syncWith(pOther->_sfFastSync);
+
 
 
 }
Index: OSGMultiDisplayWindowBase.h
===================================================================
RCS file: /cvsroot/opensg/OpenSG/Source/System/Cluster/Window/MultiDisplay/OSGMultiDisplayWindowBase.h,v
retrieving revision 1.14
diff -u -r1.14 OSGMultiDisplayWindowBase.h
--- OSGMultiDisplayWindowBase.h	9 Jun 2008 12:28:09 -0000	1.14
+++ OSGMultiDisplayWindowBase.h	11 Aug 2011 11:07:50 -0000
@@ -72,6 +72,7 @@
 #include <OSGBoolFields.h> // ManageClientViewports type
 #include <OSGInt32Fields.h> // XOverlap type
 #include <OSGInt32Fields.h> // YOverlap type
+#include <OSGBoolFields.h> // FastSync type
 
 #include <OSGMultiDisplayWindowFields.h>
 
@@ -100,7 +101,8 @@
         ManageClientViewportsFieldId = VServersFieldId              + 1,
         XOverlapFieldId              = ManageClientViewportsFieldId + 1,
         YOverlapFieldId              = XOverlapFieldId              + 1,
-        NextFieldId                  = YOverlapFieldId              + 1
+        FastSyncFieldId              = YOverlapFieldId              + 1,
+        NextFieldId                  = FastSyncFieldId              + 1
     };
 
     static const OSG::BitVector HServersFieldMask;
@@ -108,6 +110,7 @@
     static const OSG::BitVector ManageClientViewportsFieldMask;
     static const OSG::BitVector XOverlapFieldMask;
     static const OSG::BitVector YOverlapFieldMask;
+    static const OSG::BitVector FastSyncFieldMask;
 
 
     static const OSG::BitVector MTInfluenceMask;
@@ -165,6 +168,12 @@
            SFInt32             *getSFYOverlap       (void);
 #endif
 
+           SFBool              *editSFFastSync       (void);
+     const SFBool              *getSFFastSync       (void) const;
+#ifndef OSG_2_PREP
+           SFBool              *getSFFastSync       (void);
+#endif
+
 
            UInt32              &editHServers       (void);
      const UInt32              &getHServers       (void) const;
@@ -196,6 +205,12 @@
            Int32               &getYOverlap       (void);
 #endif
 
+           bool                &editFastSync       (void);
+     const bool                &getFastSync       (void) const;
+#ifndef OSG_2_PREP
+           bool                &getFastSync       (void);
+#endif
+
     /*! \}                                                                 */
     /*---------------------------------------------------------------------*/
     /*! \name                    Field Set                                 */
@@ -206,6 +221,7 @@
      void setManageClientViewports( const bool &value );
      void setXOverlap       ( const Int32 &value );
      void setYOverlap       ( const Int32 &value );
+     void setFastSync       ( const bool &value );
 
     /*! \}                                                                 */
     /*---------------------------------------------------------------------*/
@@ -253,6 +269,7 @@
     SFBool              _sfManageClientViewports;
     SFInt32             _sfXOverlap;
     SFInt32             _sfYOverlap;
+    SFBool              _sfFastSync;
 
     /*! \}                                                                 */
     /*---------------------------------------------------------------------*/
@@ -330,6 +347,6 @@
 
 OSG_END_NAMESPACE
 
-#define OSGMULTIDISPLAYWINDOWBASE_HEADER_CVSID "@(#)$Id: FCBaseTemplate_h.h,v 1.41 2008/06/09 07:30:44 vossg Exp $"
+#define OSGMULTIDISPLAYWINDOWBASE_HEADER_CVSID "@(#)$Id: FCBaseTemplate_h.h,v 1.42 2008/06/09 12:26:59 vossg Exp $"
 
 #endif /* _OSGMULTIDISPLAYWINDOWBASE_H_ */
Index: OSGMultiDisplayWindowBase.inl
===================================================================
RCS file: /cvsroot/opensg/OpenSG/Source/System/Cluster/Window/MultiDisplay/OSGMultiDisplayWindowBase.inl,v
retrieving revision 1.11
diff -u -r1.11 OSGMultiDisplayWindowBase.inl
--- OSGMultiDisplayWindowBase.inl	9 Jun 2008 12:28:09 -0000	1.11
+++ OSGMultiDisplayWindowBase.inl	11 Aug 2011 11:07:50 -0000
@@ -211,6 +211,29 @@
 }
 #endif
 
+//! Get the MultiDisplayWindow::_sfFastSync field.
+inline
+const SFBool *MultiDisplayWindowBase::getSFFastSync(void) const
+{
+    return &_sfFastSync;
+}
+
+//! Get the MultiDisplayWindow::_sfFastSync field.
+inline
+SFBool *MultiDisplayWindowBase::editSFFastSync(void)
+{
+    return &_sfFastSync;
+}
+
+#ifndef OSG_2_PREP
+//! Get the MultiDisplayWindow::_sfFastSync field.
+inline
+SFBool *MultiDisplayWindowBase::getSFFastSync(void)
+{
+    return &_sfFastSync;
+}
+#endif
+
 
 //! Get the value of the MultiDisplayWindow::_sfHServers field.
 inline
@@ -362,8 +385,38 @@
     _sfYOverlap.setValue(value);
 }
 
+//! Get the value of the MultiDisplayWindow::_sfFastSync field.
+inline
+bool &MultiDisplayWindowBase::editFastSync(void)
+{
+    return _sfFastSync.getValue();
+}
+
+//! Get the value of the MultiDisplayWindow::_sfFastSync field.
+inline
+const bool &MultiDisplayWindowBase::getFastSync(void) const
+{
+    return _sfFastSync.getValue();
+}
+
+#ifndef OSG_2_PREP
+//! Get the value of the MultiDisplayWindow::_sfFastSync field.
+inline
+bool &MultiDisplayWindowBase::getFastSync(void)
+{
+    return _sfFastSync.getValue();
+}
+#endif
+
+//! Set the value of the MultiDisplayWindow::_sfFastSync field.
+inline
+void MultiDisplayWindowBase::setFastSync(const bool &value)
+{
+    _sfFastSync.setValue(value);
+}
+
 
 OSG_END_NAMESPACE
 
-#define OSGMULTIDISPLAYWINDOWBASE_INLINE_CVSID "@(#)$Id: FCBaseTemplate_inl.h,v 1.21 2008/06/09 07:30:44 vossg Exp $"
+#define OSGMULTIDISPLAYWINDOWBASE_INLINE_CVSID "@(#)$Id: FCBaseTemplate_inl.h,v 1.22 2008/06/09 12:26:59 vossg Exp $"
 

