ParaView
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
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]

Public Types

enum  EventType {
  CollaborationNotification = 12345, UpdateUserName = 12346, UpdateUserList = 12347, UpdateMasterUser = 12348,
  FollowUserCamera = 12349, CameraChanged = 12350
}
 
typedef vtkSMRemoteObject Superclass
 
- Public Types inherited from vtkSMRemoteObject
typedef vtkSMSessionObject Superclass
 
- Public Types inherited from vtkSMSessionObject
typedef vtkSMObject Superclass
 
- Public Types inherited from vtkSMObject
typedef vtkObject Superclass
 

Public Member Functions

virtual const char * GetClassName ()
 
virtual int IsA (const char *type)
 
void PrintSelf (ostream &os, vtkIndent indent)
 
virtual vtkTypeUInt32 GetGlobalID ()
 Get the global unique id for this object. More...
 
virtual void SetSession (vtkSMSession *)
 Override the session setting in order to update only once our current local user id. More...
 
virtual void PromoteToMaster (int clientId)
 This method is used promote a new Master user. More...
 
virtual void FollowUser (int clientId)
 Share the decision that user should follow that given user if master or follow someone else on your own. More...
 
int GetFollowedUser ()
 Return the local followed user. More...
 
virtual bool IsMaster ()
 Return true if the current client is the master. More...
 
virtual int GetMasterId ()
 Return the userId of the current master. More...
 
virtual int GetUserId ()
 Return the id of the current client. More...
 
virtual int GetUserId (int index)
 Return the id of the nth connected client. More...
 
virtual const char * GetUserLabel (int userID)
 return the name of the provided userId More...
 
virtual void SetUserLabel (const char *userName)
 Update ou local user name. More...
 
virtual void SetUserLabel (int userId, const char *userName)
 Update any user name. More...
 
virtual int GetNumberOfConnectedClients ()
 return the number of currently connected clients. More...
 
void UpdateUserInformations ()
 Request an update of the user list from the server. More...
 
void SendToOtherClients (vtkSMMessage *msg)
 Send message to other clients which will trigger Observer. More...
 
virtual const vtkSMMessageGetFullState ()
 This method return the state of the connected clients. More...
 
virtual void LoadState (const vtkSMMessage *msg, vtkSMProxyLocator *locator)
 This method is used to either load its internal connected clients informations or to forward messages across clients. More...
 
- Public Member Functions inherited from vtkSMRemoteObject
void PrintSelf (ostream &os, vtkIndent indent)
 
bool HasGlobalID ()
 Allow the user to test if the RemoteObject has already a GlobalID without assigning a new one to it. More...
 
virtual void EnableLocalPushOnly ()
 Allow to switch off any push of state change to the server for that particular object. More...
 
virtual void DisableLocalPushOnly ()
 Enable the given remote object to communicate its state normaly to the server location. More...
 
virtual bool IsLocalPushOnly ()
 Let the session be aware that even if the Location is client only, the message should not be send to the server for a general broadcast. More...
 
virtual void SetLocation (vtkTypeUInt32)
 Get/Set the location where the underlying VTK-objects are created. More...
 
virtual vtkTypeUInt32 GetLocation ()
 Get/Set the location where the underlying VTK-objects are created. More...
 
const char * GetGlobalIDAsString ()
 Get the global unique id for this object. More...
 
virtual void PrototypeOn ()
 Allow user to set the remote object to be discard for Undo/Redo action. More...
 
virtual void PrototypeOff ()
 Allow user to set the remote object to be discard for Undo/Redo action. More...
 
bool IsPrototype ()
 Allow user to set the remote object to be discard for Undo/Redo action. More...
 
virtual void SetPrototype (bool)
 Allow user to set the remote object to be discard for Undo/Redo action. More...
 
- Public Member Functions inherited from vtkSMSessionObject
void PrintSelf (ostream &os, vtkIndent indent)
 
virtual vtkSMSessionProxyManagerGetSessionProxyManager ()
 Return the corresponding ProxyManager if any. More...
 
virtual vtkSMSessionGetSession ()
 Get/Set the session on wihch this object exists. More...
 
- Public Member Functions inherited from vtkSMObject
void PrintSelf (ostream &os, vtkIndent indent)
 

Static Public Member Functions

static vtkTypeUInt32 GetReservedGlobalID ()
 Return the GlobalID that should be used to refer to the TimeKeeper. More...
 
static vtkSMCollaborationManagerNew ()
 
static int IsTypeOf (const char *type)
 
static vtkSMCollaborationManagerSafeDownCast (vtkObject *o)
 
- Static Public Member Functions inherited from vtkSMRemoteObject
static int IsTypeOf (const char *type)
 
static vtkSMRemoteObjectSafeDownCast (vtkObject *o)
 
- Static Public Member Functions inherited from vtkSMSessionObject
static vtkSMSessionObjectNew ()
 
static int IsTypeOf (const char *type)
 
static vtkSMSessionObjectSafeDownCast (vtkObject *o)
 
- Static Public Member Functions inherited from vtkSMObject
static vtkSMObjectNew ()
 
static int IsTypeOf (const char *type)
 
static vtkSMObjectSafeDownCast (vtkObject *o)
 

Protected Member Functions

 vtkSMCollaborationManager ()
 Default constructor. More...
 
virtual ~vtkSMCollaborationManager ()
 Destructor. More...
 
- Protected Member Functions inherited from vtkSMRemoteObject
 vtkSMRemoteObject ()
 Default constructor. More...
 
virtual ~vtkSMRemoteObject ()
 Destructor. More...
 
void PushState (vtkSMMessage *msg)
 Subclasses can call this method to send a message to its state object on the server processes specified. More...
 
bool PullState (vtkSMMessage *msg)
 Subclasses can call this method to pull the state from the state-object on the server processes specified. More...
 
void SetGlobalID (vtkTypeUInt32 guid)
 Set the GlobalUniqueId. More...
 
vtkTypeUInt32 GetFilteredLocation ()
 
- Protected Member Functions inherited from vtkSMSessionObject
 vtkSMSessionObject ()
 
 ~vtkSMSessionObject ()
 
- Protected Member Functions inherited from vtkSMObject
 vtkSMObject ()
 
 ~vtkSMObject ()
 

Additional Inherited Members

- Protected Attributes inherited from vtkSMRemoteObject
vtkTypeUInt32 GlobalID
 
vtkTypeUInt32 Location
 
bool Prototype
 
bool ClientOnlyLocationFlag
 
- Protected Attributes inherited from vtkSMSessionObject
vtkWeakPointer< vtkSMSessionSession
 

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 48 of file vtkSMCollaborationManager.h.

Member Typedef Documentation

◆ Superclass

Definition at line 57 of file vtkSMCollaborationManager.h.

Member Enumeration Documentation

◆ EventType

Enumerator
CollaborationNotification 
UpdateUserName 
UpdateUserList 
UpdateMasterUser 
FollowUserCamera 
CameraChanged 

Definition at line 139 of file vtkSMCollaborationManager.h.

Constructor & Destructor Documentation

◆ vtkSMCollaborationManager()

vtkSMCollaborationManager::vtkSMCollaborationManager ( )
protected

Default constructor.

◆ ~vtkSMCollaborationManager()

virtual vtkSMCollaborationManager::~vtkSMCollaborationManager ( )
protectedvirtual

Destructor.

Member Function Documentation

◆ GetReservedGlobalID()

static vtkTypeUInt32 vtkSMCollaborationManager::GetReservedGlobalID ( )
static

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

◆ New()

static vtkSMCollaborationManager* vtkSMCollaborationManager::New ( )
static

◆ GetClassName()

virtual const char* vtkSMCollaborationManager::GetClassName ( )
virtual

Reimplemented from vtkSMRemoteObject.

◆ IsTypeOf()

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

◆ IsA()

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

Reimplemented from vtkSMRemoteObject.

◆ SafeDownCast()

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

◆ PrintSelf()

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

◆ GetGlobalID()

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.

◆ SetSession()

virtual void vtkSMCollaborationManager::SetSession ( vtkSMSession )
virtual

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

Reimplemented from vtkSMRemoteObject.

◆ PromoteToMaster()

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.

◆ FollowUser()

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.

◆ GetFollowedUser()

int vtkSMCollaborationManager::GetFollowedUser ( )

Return the local followed user.

◆ IsMaster()

virtual bool vtkSMCollaborationManager::IsMaster ( )
virtual

Return true if the current client is the master.

◆ GetMasterId()

virtual int vtkSMCollaborationManager::GetMasterId ( )
virtual

Return the userId of the current master.

◆ GetUserId() [1/2]

virtual int vtkSMCollaborationManager::GetUserId ( )
virtual

Return the id of the current client.

◆ GetUserId() [2/2]

virtual int vtkSMCollaborationManager::GetUserId ( int  index)
virtual

Return the id of the nth connected client.

In the list you will find yourself as well.

◆ GetUserLabel()

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

return the name of the provided userId

◆ SetUserLabel() [1/2]

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

Update ou local user name.

◆ SetUserLabel() [2/2]

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

Update any user name.

◆ GetNumberOfConnectedClients()

virtual int vtkSMCollaborationManager::GetNumberOfConnectedClients ( )
virtual

return the number of currently connected clients.

This size is used to bound the GetUserId() method.

◆ UpdateUserInformations()

void vtkSMCollaborationManager::UpdateUserInformations ( )

Request an update of the user list from the server.

(A pull request is done)

◆ SendToOtherClients()

void vtkSMCollaborationManager::SendToOtherClients ( vtkSMMessage msg)

Send message to other clients which will trigger Observer.

◆ GetFullState()

virtual const vtkSMMessage* vtkSMCollaborationManager::GetFullState ( )
virtual

This method return the state of the connected clients.

Reimplemented from vtkSMRemoteObject.

◆ LoadState()

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: