Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

osg::MultiDisplayWindow Class Reference
[Cluster]

Class to manage multiple displays for clusters, see MultiDisplayWindow for details.

#include <OSGMultiDisplayWindow.h>

Inheritance diagram for osg::MultiDisplayWindow:

osg::MultiDisplayWindowBase osg::ClusterWindow osg::ClusterWindowBase osg::Window osg::WindowBase osg::AttachmentContainer osg::FieldContainer List of all members.

Extension handling

GLExtensionFunction getFunctionByName (const Char8 *s)
bool hasExtension (UInt32 id)
bool hasExtension (const Char8 *s)
void * getFunction (UInt32 id)
void * getFunctionNoCheck (UInt32 id)
void dumpExtensions (void)
Real32 getConstantValue (GLenum val)
const Vec2fgetConstantValuev (GLenum val)
const std::vector< std::string > & getRegisteredFunctions (void)
const std::vector< std::string > & getExtensions (void)
const std::vector< std::string > & getIgnoredExtensions (void)
*static void setGLLibraryName (const Char8 *s)
static Int32 getExtensionId (const Char8 *s)
static bool hasCommonExtension (UInt32 id)
static const std::vector<
std::string > & 
getRegisteredExtensions (void)

asynchronous initialization

bool initAsync (connectioncbfp fp)
void setConnectionCB (connectioncbfp fp)
*typedef bool(* connectioncbfp )(std::string server, Real32 progress)

GL object handling

*void validateGLObject (UInt32 id)
void validateAllGLObjects (void)
GLObjectStatusE getGLObjectStatus (UInt32 id)
void setGLObjectId (UInt32 id, UInt32 id2)
UInt32 getGLObjectId (UInt32 id)
static void refreshGLObject (UInt32 id)
static void reinitializeGLObject (UInt32 id)
static void destroyGLObject (UInt32 id, UInt32 num=1)
static void unpackIdStatus (UInt32 idstatus, UInt32 &id, GLObjectStatusE &status)

GL object handling

void doInitRegisterGLObject (UInt32 id, UInt32 num)
*static void initRegisterGLObject (UInt32 id, UInt32 num)
static UInt32 packIdStatus (UInt32 id, GLObjectStatusE status)

Public Types

typedef MultiDisplayWindowPtr Ptr
enum  {
  HServersFieldId = Inherited::NextFieldId, VServersFieldId = HServersFieldId + 1, ManageClientViewportsFieldId = VServersFieldId + 1, XOverlapFieldId = ManageClientViewportsFieldId + 1,
  YOverlapFieldId = XOverlapFieldId + 1, NextFieldId = YOverlapFieldId + 1
}
typedef ArgsCollector< UInt32GLObjectFunctorArgs
typedef TypedVoidFunctor2Base<
PtrCallArg< Window >, GLObjectFunctorArgs
GLObjectFunctor
typedef void(* GLExtensionFunction )(void)
enum  GLObjectStatusE {
  notused = 1, initialize, reinitialize, initialized,
  needrefresh, destroy, finaldestroy
}
enum  { statusShift = 3, statusMask = 7 }

Public Member Functions

Sync
*virtual void changed (BitVector whichField, UInt32 origin)
Output
*virtual void dump (UInt32 uiIndent=0, const BitVector bvFlags=0) const
FieldContainer Get
*virtual FieldContainerTypegetType (void)
virtual const FieldContainerTypegetType (void) const
virtual UInt32 getContainerSize (void) const
Field Get
*SFUInt32getSFHServers (void)
 Get the MultiDisplayWindow::_sfHServers field.
SFUInt32getSFVServers (void)
 Get the MultiDisplayWindow::_sfVServers field.
SFBoolgetSFManageClientViewports (void)
 Get the MultiDisplayWindow::_sfManageClientViewports field.
SFInt32getSFXOverlap (void)
 Get the MultiDisplayWindow::_sfXOverlap field.
SFInt32getSFYOverlap (void)
 Get the MultiDisplayWindow::_sfYOverlap field.
UInt32getHServers (void)
 Get the value of the MultiDisplayWindow::_sfHServers field.
const UInt32getHServers (void) const
 Get the value of the MultiDisplayWindow::_sfHServers field.
UInt32getVServers (void)
 Get the value of the MultiDisplayWindow::_sfVServers field.
const UInt32getVServers (void) const
 Get the value of the MultiDisplayWindow::_sfVServers field.
bool & getManageClientViewports (void)
 Get the value of the MultiDisplayWindow::_sfManageClientViewports field.
const bool & getManageClientViewports (void) const
 Get the value of the MultiDisplayWindow::_sfManageClientViewports field.
Int32getXOverlap (void)
 Get the value of the MultiDisplayWindow::_sfXOverlap field.
const Int32getXOverlap (void) const
 Get the value of the MultiDisplayWindow::_sfXOverlap field.
Int32getYOverlap (void)
 Get the value of the MultiDisplayWindow::_sfYOverlap field.
const Int32getYOverlap (void) const
 Get the value of the MultiDisplayWindow::_sfYOverlap field.
Field Set
*void setHServers (const UInt32 &value)
 Set the value of the MultiDisplayWindow::_sfHServers field.
void setVServers (const UInt32 &value)
 Set the value of the MultiDisplayWindow::_sfVServers field.
void setManageClientViewports (const bool &value)
 Set the value of the MultiDisplayWindow::_sfManageClientViewports field.
void setXOverlap (const Int32 &value)
 Set the value of the MultiDisplayWindow::_sfXOverlap field.
void setYOverlap (const Int32 &value)
 Set the value of the MultiDisplayWindow::_sfYOverlap field.
Binary Access
*virtual UInt32 getBinSize (const BitVector &whichField)
virtual void copyToBin (BinaryDataHandler &pMem, const BitVector &whichField)
virtual void copyFromBin (BinaryDataHandler &pMem, const BitVector &whichField)
Copy
*virtual FieldContainerPtr shallowCopy (void) const
GL implementation functions
*virtual void(* getFunctionByName (const Char8 *s))()
Window system implementation functions
*virtual void activate (void)
virtual void deactivate (void)
virtual void swap (void)
virtual void init (void)
virtual void render (RenderActionBase *action=NULL)
virtual void renderAllViewports (RenderActionBase *action=NULL)
virtual void frameInit (void)
virtual void frameExit (void)
connection pool
*ClusterNetworkgetNetwork (void)
Statistics
*StatCollectorgetStatistics (void) const
void setStatistics (StatCollector *stat)
Calibration
*bool loadCalibration (std::istream &in)
bool saveCalibration (std::ostream &out)
Field Get
*MFStringgetMFServers (void)
 Get the ClusterWindow::_mfServers field.
SFStringgetSFConnectionType (void)
 Get the ClusterWindow::_sfConnectionType field.
SFStringgetSFConnectionInterface (void)
 Get the ClusterWindow::_sfConnectionInterface field.
SFStringgetSFConnectionDestination (void)
 Get the ClusterWindow::_sfConnectionDestination field.
SFStringgetSFConnectionParams (void)
 Get the ClusterWindow::_sfConnectionParams field.
SFUInt32getSFServicePort (void)
 Get the ClusterWindow::_sfServicePort field.
SFStringgetSFServiceAddress (void)
 Get the ClusterWindow::_sfServiceAddress field.
SFWindowPtrgetSFClientWindow (void)
 Get the ClusterWindow::_sfClientWindow field.
SFUInt32getSFInterleave (void)
 Get the ClusterWindow::_sfInterleave field.
SFUInt32getSFFrameCount (void)
 Get the ClusterWindow::_sfFrameCount field.
SFImageComposerPtrgetSFComposer (void)
 Get the ClusterWindow::_sfComposer field.
MFStringgetMFAutostart (void)
 Get the ClusterWindow::_mfAutostart field.
MFDisplayCalibrationPtrgetMFCalibration (void)
 Get the ClusterWindow::_mfCalibration field.
std::string & getConnectionType (void)
 Get the value of the ClusterWindow::_sfConnectionType field.
const std::string & getConnectionType (void) const
 Get the value of the ClusterWindow::_sfConnectionType field.
std::string & getConnectionInterface (void)
 Get the value of the ClusterWindow::_sfConnectionInterface field.
const std::string & getConnectionInterface (void) const
 Get the value of the ClusterWindow::_sfConnectionInterface field.
std::string & getConnectionDestination (void)
 Get the value of the ClusterWindow::_sfConnectionDestination field.
const std::string & getConnectionDestination (void) const
 Get the value of the ClusterWindow::_sfConnectionDestination field.
std::string & getConnectionParams (void)
 Get the value of the ClusterWindow::_sfConnectionParams field.
const std::string & getConnectionParams (void) const
 Get the value of the ClusterWindow::_sfConnectionParams field.
UInt32getServicePort (void)
 Get the value of the ClusterWindow::_sfServicePort field.
const UInt32getServicePort (void) const
 Get the value of the ClusterWindow::_sfServicePort field.
std::string & getServiceAddress (void)
 Get the value of the ClusterWindow::_sfServiceAddress field.
const std::string & getServiceAddress (void) const
 Get the value of the ClusterWindow::_sfServiceAddress field.
WindowPtrgetClientWindow (void)
 Get the value of the ClusterWindow::_sfClientWindow field.
const WindowPtrgetClientWindow (void) const
 Get the value of the ClusterWindow::_sfClientWindow field.
UInt32getInterleave (void)
 Get the value of the ClusterWindow::_sfInterleave field.
const UInt32getInterleave (void) const
 Get the value of the ClusterWindow::_sfInterleave field.
UInt32getFrameCount (void)
 Get the value of the ClusterWindow::_sfFrameCount field.
const UInt32getFrameCount (void) const
 Get the value of the ClusterWindow::_sfFrameCount field.
ImageComposerPtrgetComposer (void)
 Get the value of the ClusterWindow::_sfComposer field.
const ImageComposerPtrgetComposer (void) const
 Get the value of the ClusterWindow::_sfComposer field.
std::string & getServers (const UInt32 index)
 Get the value of the index element the ClusterWindow::_mfServers field.
MFStringgetServers (void)
 Get the ClusterWindow::_mfServers field.
const MFStringgetServers (void) const
 Get the ClusterWindow::_mfServers field.
std::string & getAutostart (const UInt32 index)
 Get the value of the index element the ClusterWindow::_mfAutostart field.
MFStringgetAutostart (void)
 Get the ClusterWindow::_mfAutostart field.
const MFStringgetAutostart (void) const
 Get the ClusterWindow::_mfAutostart field.
DisplayCalibrationPtrgetCalibration (const UInt32 index)
 Get the value of the index element the ClusterWindow::_mfCalibration field.
MFDisplayCalibrationPtrgetCalibration (void)
 Get the ClusterWindow::_mfCalibration field.
const MFDisplayCalibrationPtrgetCalibration (void) const
 Get the ClusterWindow::_mfCalibration field.
Field Set
*void setConnectionType (const std::string &value)
 Set the value of the ClusterWindow::_sfConnectionType field.
void setConnectionInterface (const std::string &value)
 Set the value of the ClusterWindow::_sfConnectionInterface field.
void setConnectionDestination (const std::string &value)
 Set the value of the ClusterWindow::_sfConnectionDestination field.
void setConnectionParams (const std::string &value)
 Set the value of the ClusterWindow::_sfConnectionParams field.
void setServicePort (const UInt32 &value)
 Set the value of the ClusterWindow::_sfServicePort field.
void setServiceAddress (const std::string &value)
 Set the value of the ClusterWindow::_sfServiceAddress field.
void setClientWindow (const WindowPtr &value)
 Set the value of the ClusterWindow::_sfClientWindow field.
void setInterleave (const UInt32 &value)
 Set the value of the ClusterWindow::_sfInterleave field.
void setFrameCount (const UInt32 &value)
 Set the value of the ClusterWindow::_sfFrameCount field.
void setComposer (const ImageComposerPtr &value)
 Set the value of the ClusterWindow::_sfComposer field.

Static Public Member Functions

Class Get
*static FieldContainerTypegetClassType (void)
 access the type of the class
static UInt32 getClassTypeId (void)
 access the numerical type of the class
Construction
*static MultiDisplayWindowPtr create (void)
 create a new instance of the class
static MultiDisplayWindowPtr createEmpty (void)
 create an empty new instance of the class, do not copy the prototype

Static Public Attributes

static const osg::BitVector HServersFieldMask
static const osg::BitVector VServersFieldMask
static const osg::BitVector ManageClientViewportsFieldMask
static const osg::BitVector XOverlapFieldMask
static const osg::BitVector YOverlapFieldMask
static const osg::BitVector MTInfluenceMask
static const osg::BitVector ServersFieldMask
static const osg::BitVector ConnectionTypeFieldMask
static const osg::BitVector ConnectionInterfaceFieldMask
static const osg::BitVector ConnectionDestinationFieldMask
static const osg::BitVector ConnectionParamsFieldMask
static const osg::BitVector ServicePortFieldMask
static const osg::BitVector ServiceAddressFieldMask
static const osg::BitVector ClientWindowFieldMask
static const osg::BitVector InterleaveFieldMask
static const osg::BitVector FrameCountFieldMask
static const osg::BitVector ComposerFieldMask
static const osg::BitVector AutostartFieldMask
static const osg::BitVector CalibrationFieldMask
static const Real32 unknownConstant = -1e100
static const osg::BitVector WidthFieldMask
static const osg::BitVector HeightFieldMask
static const osg::BitVector PortFieldMask
static const osg::BitVector ResizePendingFieldMask
static const osg::BitVector GlObjectEventCounterFieldMask
static const osg::BitVector GlObjectLastRefreshFieldMask
static const osg::BitVector GlObjectLastReinitializeFieldMask
static const BitVector AttachmentsFieldMask
static const BitVector NextFieldMask

Protected Member Functions

server window funcitons
*virtual void serverInit (WindowPtr window, UInt32 id)
virtual void serverRender (WindowPtr window, UInt32 id, RenderActionBase *action)
virtual void serverSwap (WindowPtr window, UInt32 id)
client window funcitons
*virtual void clientInit (void)
virtual void clientSwap (void)
Constructors
MultiDisplayWindow (void)
 MultiDisplayWindow (const MultiDisplayWindow &source)
Destructors
*virtual ~MultiDisplayWindow (void)
Helper
*void updateViewport (ViewportPtr &serverPort, ViewportPtr &clientPort)
Sync
*void executeSyncImpl (MultiDisplayWindowBase *pOther, const BitVector &whichField)
virtual void executeSync (FieldContainer &other, const BitVector &whichField)
Sync
*void executeSyncImpl (ClusterWindowBase *pOther, const BitVector &whichField)
client window funcitons
virtual void clientPreSync (void)
virtual void clientRender (RenderActionBase *action)

Protected Attributes

Fields
*SFUInt32 _sfHServers
SFUInt32 _sfVServers
SFBool _sfManageClientViewports
SFInt32 _sfXOverlap
SFInt32 _sfYOverlap
unsynced thread variables
*bool _firstFrame
StatCollector_statistics
Fields
*MFString _mfServers
SFString _sfConnectionType
SFString _sfConnectionInterface
SFString _sfConnectionDestination
SFString _sfConnectionParams
SFUInt32 _sfServicePort
SFString _sfServiceAddress
SFWindowPtr _sfClientWindow
SFUInt32 _sfInterleave
SFUInt32 _sfFrameCount
SFImageComposerPtr _sfComposer
MFString _mfAutostart
MFDisplayCalibrationPtr _mfCalibration

Private Types

typedef MultiDisplayWindowBase Inherited

Private Member Functions

void operator= (const MultiDisplayWindow &source)

Static Private Member Functions

static void initMethod (void)

Friends

class FieldContainer
class MultiDisplayWindowBase

Detailed Description

Definition at line 55 of file OSGMultiDisplayWindow.h.


Member Typedef Documentation

typedef MultiDisplayWindowBase osg::MultiDisplayWindow::Inherited [private]
 

Reimplemented from osg::MultiDisplayWindowBase.

Definition at line 59 of file OSGMultiDisplayWindow.h.

typedef MultiDisplayWindowPtr osg::MultiDisplayWindowBase::Ptr [inherited]
 

Reimplemented from osg::ClusterWindowBase.

Definition at line 94 of file OSGMultiDisplayWindowBase.h.

typedef ArgsCollector<UInt32> osg::Window::GLObjectFunctorArgs [inherited]
 

Definition at line 96 of file OSGWindow.h.

typedef TypedVoidFunctor2Base<PtrCallArg<Window> , GLObjectFunctorArgs> osg::Window::GLObjectFunctor [inherited]
 

Definition at line 99 of file OSGWindow.h.

typedef void(* osg::Window::GLExtensionFunction)(void) [inherited]
 

Definition at line 101 of file OSGWindow.h.


Member Enumeration Documentation

anonymous enum [inherited]
 

Enumerator:
HServersFieldId 
VServersFieldId 
ManageClientViewportsFieldId 
XOverlapFieldId 
YOverlapFieldId 
NextFieldId 

Reimplemented from osg::ClusterWindowBase.

Definition at line 96 of file OSGMultiDisplayWindowBase.h.

00097     {
00098         HServersFieldId              = Inherited::NextFieldId,
00099         VServersFieldId              = HServersFieldId              + 1,
00100         ManageClientViewportsFieldId = VServersFieldId              + 1,
00101         XOverlapFieldId              = ManageClientViewportsFieldId + 1,
00102         YOverlapFieldId              = XOverlapFieldId              + 1,
00103         NextFieldId                  = YOverlapFieldId              + 1
00104     };

enum osg::Window::GLObjectStatusE [inherited]
 

Enumeration values for the status of the GL objects. This is primarily used to signal the object's callback functions what to do. See OpenGL Objects & Extension Handling for a description.

Enumerator:
notused  Object is not used at all right now.
initialize  The object is being initialized for the first time.
reinitialize  The object is being re-initialized, i.e. it has changed significantly.
initialized  The object is initialized and valid.
needrefresh  The object is initialized but needs a refresh.
destroy  The object is to be destroyed, i.e. removed from the current OpenGL context.
finaldestroy  The object has been removed from all OpenGL contexts and used ressources but be freed now.

Definition at line 78 of file OSGWindow.h.

00079     {
00080         notused      = 1, 
00081         initialize, 
00082         reinitialize, 
00083         initialized,
00084         needrefresh, 
00085         destroy, 
00086         finaldestroy 
00087     };

anonymous enum [inherited]
 

Enumerator:
statusShift  Shift value to transform object id and status into asingle int.
statusMask  Mask value to transform object id and status into asingle int.

Definition at line 92 of file OSGWindow.h.

00092 { statusShift = 3, statusMask = 7 }; 


Constructor & Destructor Documentation

MultiDisplayWindow::MultiDisplayWindow void   )  [protected]
 

Constructor

Definition at line 69 of file OSGMultiDisplayWindow.cpp.

00069                                            :
00070     Inherited()
00071 {
00072 }

MultiDisplayWindow::MultiDisplayWindow const MultiDisplayWindow source  )  [protected]
 

Copy Constructor

Definition at line 76 of file OSGMultiDisplayWindow.cpp.

00076                                                                        :
00077     Inherited(source)
00078 {
00079 }

MultiDisplayWindow::~MultiDisplayWindow void   )  [protected, virtual]
 

Destructor

Definition at line 83 of file OSGMultiDisplayWindow.cpp.

00084 {
00085 }


Member Function Documentation

void MultiDisplayWindow::changed BitVector  whichField,
UInt32  origin
[virtual]
 

react to field changes

Reimplemented from osg::ClusterWindow.

Definition at line 97 of file OSGMultiDisplayWindow.cpp.

References osg::ClusterWindow::changed().

Referenced by clientInit().

00098 {
00099     Inherited::changed(whichField, origin);
00100 }

void MultiDisplayWindow::dump UInt32  uiIndent = 0,
const BitVector  bvFlags = 0
const [virtual]
 

output the instance for debug purposes

Reimplemented from osg::ClusterWindow.

Definition at line 104 of file OSGMultiDisplayWindow.cpp.

References osg::MultiDisplayWindowBase::getHServers(), osg::MultiDisplayWindowBase::getVServers(), and SLOG.

00106 {
00107     SLOG << "hServers:" << getHServers() << " "
00108          << "vServers:" << getVServers() << std::endl;
00109 }

void MultiDisplayWindow::serverInit WindowPtr  window,
UInt32  id
[protected, virtual]
 

initialise the cluster window on the server side. This method is called after the first sync.

Reimplemented from osg::ClusterWindow.

Definition at line 116 of file OSGMultiDisplayWindow.cpp.

00118 {
00119 }

void MultiDisplayWindow::serverRender WindowPtr  serverWindow,
UInt32  id,
RenderActionBase action
[protected, virtual]
 

render server window

update all viewport parameters and render local viewports Width and height of the whole window are calculated by multiplieing the local window size by hServers and vServers.

Reimplemented from osg::ClusterWindow.

Definition at line 127 of file OSGMultiDisplayWindow.cpp.

References osg::beginEditCP(), osg::ViewportBase::BottomFieldMask, osg::TileCameraDecoratorBase::create(), osg::AttachmentContainerPtr::dcast(), osg::endEditCP(), osg::WindowBase::getHeight(), osg::MultiDisplayWindowBase::getHServers(), osg::WindowBase::getPort(), osg::ClusterWindowBase::getServers(), osg::MultiDisplayWindowBase::getVServers(), osg::WindowBase::getWidth(), osg::MultiDisplayWindowBase::getXOverlap(), osg::MultiDisplayWindowBase::getYOverlap(), osg::ViewportBase::LeftFieldMask, osg::osgMax(), osg::osgMin(), osg::ViewportBase::RightFieldMask, osg::ClusterWindow::serverRender(), osg::WindowBase::setHeight(), osg::MultiDisplayWindowBase::setHServers(), osg::MultiDisplayWindowBase::setVServers(), osg::WindowBase::setWidth(), osg::MField< FieldTypeT, fieldNameSpace >::size(), osg::subRefCP(), osg::ViewportBase::TopFieldMask, and updateViewport().

00130 {
00131     TileCameraDecoratorPtr deco;
00132     ViewportPtr serverPort;
00133     ViewportPtr clientPort;
00134     StereoBufferViewportPtr clientStereoPort;
00135     UInt32 sv,cv;
00136     Int32 l,r,t,b;
00137     Int32 cleft,cright,ctop,cbottom;
00138 
00139     if(!getHServers())
00140     {
00141         setHServers(getServers().size());
00142     }
00143     if(!getVServers())
00144     {
00145         setVServers(1);
00146     }
00147     UInt32 row   =id/getHServers();
00148     UInt32 column=id%getHServers();
00149     // calculate width and height from local width and height
00150     UInt32 width  = serverWindow->getWidth() ;
00151     UInt32 height = serverWindow->getHeight();
00152     if(getWidth()==0)
00153     {
00154         setWidth( width*getHServers() );
00155     }
00156     if(getHeight()==0)
00157     {
00158         setHeight( height*getVServers() );
00159     }
00160     Int32 left   = column * width  - column * getXOverlap();
00161     Int32 bottom = row    * height - row    * getYOverlap();
00162     Int32 right  = left   + width  - 1;
00163     Int32 top    = bottom + height - 1;
00164     Real64 scaleCWidth  = ((width - getXOverlap()) * (getHServers() - 1) + width) / (float)