ParaView
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions
vtkSMCollaborationManager Class Reference

Class used to broadcast message from one client to the others. More...

#include <vtkSMCollaborationManager.h>

Inheritance diagram for vtkSMCollaborationManager:
Inheritance graph
[legend]
Collaboration diagram for vtkSMCollaborationManager:
Collaboration graph
[legend]

List of all members.

Public Types

enum  EventType {
  CollaborationNotification = 12345, UpdateUserName = 12346, UpdateUserList = 12347, UpdateMasterUser = 12348,
  FollowUserCamera = 12349, CameraChanged = 12350
}

Public Member Functions

virtual const char * GetClassName ()
virtual int IsA (const char *type)
void PrintSelf (ostream &os, vtkIndent indent)
virtual vtkTypeUInt32 GetGlobalID ()
virtual void SetSession (vtkSMSession *)
virtual void PromoteToMaster (int clientId)
virtual void FollowUser (int clientId)
int GetFollowedUser ()
virtual bool IsMaster ()
virtual int GetMasterId ()
virtual int GetUserId ()
virtual int GetUserId (int index)
virtual const char * GetUserLabel (int userID)
virtual void SetUserLabel (const char *userName)
virtual void SetUserLabel (int userId, const char *userName)
virtual int GetNumberOfConnectedClients ()
void UpdateUserInformations ()
void SendToOtherClients (vtkSMMessage *msg)
virtual const vtkSMMessageGetFullState ()
virtual void LoadState (const vtkSMMessage *msg, vtkSMProxyLocator *locator)

Static Public Member Functions

static vtkTypeUInt32 GetReservedGlobalID ()
static vtkSMCollaborationManagerNew ()
static int IsTypeOf (const char *type)
static vtkSMCollaborationManagerSafeDownCast (vtkObject *o)

Protected Member Functions

 vtkSMCollaborationManager ()
virtual ~vtkSMCollaborationManager ()

Detailed Description

Class used to broadcast message from one client to the others.

This class allow to trigger protobuf messages on all the clients that are connected to the server. Those clients can attach listeners and handle those message in the way they want. The message sender do not receive its message again, only other clients do.

To listen collaboration notification messages you should have a code that look like that:

collaborationManager->AddObserver( vtkSMCollaborationManager::CollaborationNotification, callback);

void callback(vtkObject* src, unsigned long event, void* method, void* data) { vtkSMMessage* msg = reinterpret_cast<vtkSMMessage*>(data); => do what you want with the message }

Definition at line 46 of file vtkSMCollaborationManager.h.


Member Enumeration Documentation

Enumerator:
CollaborationNotification 
UpdateUserName 
UpdateUserList 
UpdateMasterUser 
FollowUserCamera 
CameraChanged 

Definition at line 110 of file vtkSMCollaborationManager.h.


Constructor & Destructor Documentation

vtkSMCollaborationManager::vtkSMCollaborationManager ( ) [protected]

Default constructor.

virtual vtkSMCollaborationManager::~vtkSMCollaborationManager ( ) [protected, virtual]

Destructor.


Member Function Documentation

static vtkTypeUInt32 vtkSMCollaborationManager::GetReservedGlobalID ( ) [static]

Return the GlobalID that should be used to refer to the TimeKeeper

static vtkSMCollaborationManager* vtkSMCollaborationManager::New ( ) [static]

Reimplemented from vtkSMSessionObject.

virtual const char* vtkSMCollaborationManager::GetClassName ( ) [virtual]

Reimplemented from vtkSMRemoteObject.

static int vtkSMCollaborationManager::IsTypeOf ( const char *  type) [static]

Reimplemented from vtkSMRemoteObject.

virtual int vtkSMCollaborationManager::IsA ( const char *  type) [virtual]

Reimplemented from vtkSMRemoteObject.

static vtkSMCollaborationManager* vtkSMCollaborationManager::SafeDownCast ( vtkObject o) [static]

Reimplemented from vtkSMRemoteObject.

void vtkSMCollaborationManager::PrintSelf ( ostream &  os,
vtkIndent  indent 
) [virtual]

Reimplemented from vtkSMRemoteObject.

virtual vtkTypeUInt32 vtkSMCollaborationManager::GetGlobalID ( ) [virtual]

Get the global unique id for this object. If none is set and the session is valid, a new global id will be assigned automatically.

Reimplemented from vtkSMRemoteObject.

virtual void vtkSMCollaborationManager::SetSession ( vtkSMSession ) [virtual]

Override the session setting in order to update only once our current local user id

Reimplemented from vtkSMRemoteObject.

virtual void vtkSMCollaborationManager::PromoteToMaster ( int  clientId) [virtual]

This method is used promote a new Master user. Master/Slave user doesn't buy you anything here. It just provide you the information, and it is your call to prevent slaves users to do or achieve some actions inside your client. When you call that method a SMMessage is also propagated to the other client so they could follow who is the Master without fetching the information again.

virtual void vtkSMCollaborationManager::FollowUser ( int  clientId) [virtual]

Share the decision that user should follow that given user if master or follow someone else on your own

int vtkSMCollaborationManager::GetFollowedUser ( )

Return the local followed user

virtual bool vtkSMCollaborationManager::IsMaster ( ) [virtual]

Return true if the current client is the master

virtual int vtkSMCollaborationManager::GetMasterId ( ) [virtual]

Return the userId of the current master

virtual int vtkSMCollaborationManager::GetUserId ( ) [virtual]

Return the id of the current client

virtual int vtkSMCollaborationManager::GetUserId ( int  index) [virtual]

Return the id of the nth connected client. In the list you will find yourself as well.

virtual const char* vtkSMCollaborationManager::GetUserLabel ( int  userID) [virtual]

return the name of the provided userId

virtual void vtkSMCollaborationManager::SetUserLabel ( const char *  userName) [virtual]

Update ou local user name

virtual void vtkSMCollaborationManager::SetUserLabel ( int  userId,
const char *  userName 
) [virtual]

Update any user name

virtual int vtkSMCollaborationManager::GetNumberOfConnectedClients ( ) [virtual]

return the number of currently connected clients. This size is used to bound the GetUserId() method.

void vtkSMCollaborationManager::UpdateUserInformations ( )

Request an update of the user list from the server. (A pull request is done)

void vtkSMCollaborationManager::SendToOtherClients ( vtkSMMessage msg)

Send message to other clients which will trigger Observer

virtual const vtkSMMessage* vtkSMCollaborationManager::GetFullState ( ) [virtual]

This method return the state of the connected clients

Reimplemented from vtkSMRemoteObject.

virtual void vtkSMCollaborationManager::LoadState ( const vtkSMMessage msg,
vtkSMProxyLocator locator 
) [virtual]

This method is used to either load its internal connected clients informations or to forward messages across clients

Reimplemented from vtkSMRemoteObject.


The documentation for this class was generated from the following file: