ParaView
|
Class used to broadcast message from one client to the others. More...
#include <vtkSMCollaborationManager.h>
Public Types | |
enum | EventType { CollaborationNotification = 12345, UpdateUserName = 12346, UpdateUserList = 12347, UpdateMasterUser = 12348, FollowUserCamera = 12349, CameraChanged = 12350 } |
typedef vtkSMRemoteObject | Superclass |
![]() | |
typedef vtkSMSessionObject | Superclass |
![]() | |
typedef vtkSMObject | Superclass |
![]() | |
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 vtkSMMessage * | GetFullState () |
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... | |
![]() | |
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... | |
![]() | |
void | PrintSelf (ostream &os, vtkIndent indent) |
virtual vtkSMSessionProxyManager * | GetSessionProxyManager () |
Return the corresponding ProxyManager if any. More... | |
virtual vtkSMSession * | GetSession () |
Get/Set the session on wihch this object exists. More... | |
![]() | |
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 vtkSMCollaborationManager * | New () |
static int | IsTypeOf (const char *type) |
static vtkSMCollaborationManager * | SafeDownCast (vtkObject *o) |
![]() | |
static int | IsTypeOf (const char *type) |
static vtkSMRemoteObject * | SafeDownCast (vtkObject *o) |
![]() | |
static vtkSMSessionObject * | New () |
static int | IsTypeOf (const char *type) |
static vtkSMSessionObject * | SafeDownCast (vtkObject *o) |
![]() | |
static vtkSMObject * | New () |
static int | IsTypeOf (const char *type) |
static vtkSMObject * | SafeDownCast (vtkObject *o) |
Protected Member Functions | |
vtkSMCollaborationManager () | |
Default constructor. More... | |
virtual | ~vtkSMCollaborationManager () |
Destructor. More... | |
![]() | |
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 () |
![]() | |
vtkSMSessionObject () | |
~vtkSMSessionObject () | |
![]() | |
vtkSMObject () | |
~vtkSMObject () | |
Additional Inherited Members | |
![]() | |
vtkTypeUInt32 | GlobalID |
vtkTypeUInt32 | Location |
bool | Prototype |
bool | ClientOnlyLocationFlag |
![]() | |
vtkWeakPointer< vtkSMSession > | Session |
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.
Definition at line 57 of file vtkSMCollaborationManager.h.
Enumerator | |
---|---|
CollaborationNotification | |
UpdateUserName | |
UpdateUserList | |
UpdateMasterUser | |
FollowUserCamera | |
CameraChanged |
Definition at line 139 of file vtkSMCollaborationManager.h.
|
protected |
Default constructor.
|
protectedvirtual |
Destructor.
|
static |
Return the GlobalID that should be used to refer to the TimeKeeper.
|
static |
|
virtual |
Reimplemented from vtkSMRemoteObject.
|
static |
|
virtual |
Reimplemented from vtkSMRemoteObject.
|
static |
void vtkSMCollaborationManager::PrintSelf | ( | ostream & | os, |
vtkIndent | indent | ||
) |
|
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 |
Override the session setting in order to update only once our current local user id.
Reimplemented from vtkSMRemoteObject.
|
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 |
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 |
Return true if the current client is the master.
|
virtual |
Return the userId of the current master.
|
virtual |
Return the id of the current client.
|
virtual |
Return the id of the nth connected client.
In the list you will find yourself as well.
|
virtual |
return the name of the provided userId
|
virtual |
Update ou local user name.
|
virtual |
Update any user name.
|
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 |
This method return the state of the connected clients.
Reimplemented from vtkSMRemoteObject.
|
virtual |
This method is used to either load its internal connected clients informations or to forward messages across clients.
Reimplemented from vtkSMRemoteObject.