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, LastMessageUpdated = 12351
}
 
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) override
 
vtkTypeUInt32 GetGlobalID () override
 Get the global unique id for this object. More...
 
void SetSession (vtkSMSession *) override
 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...
 
bool GetDisableFurtherConnections ()
 Return true if further connections are disabled. 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...
 
int GetServerConnectID ()
 Return the server connect id if this is the master. More...
 
int GetConnectID ()
 Return the client connect id. More...
 
void SendToOtherClients (vtkSMMessage *msg)
 Send message to other clients which will trigger Observer. More...
 
const vtkSMMessageGetFullState () override
 This method return the state of the connected clients. More...
 
void LoadState (const vtkSMMessage *msg, vtkSMProxyLocator *locator) override
 This method is used to either load its internal connected clients information or to forward messages across clients. More...
 
void DisableFurtherConnections (bool disable)
 Enable or disable further connections to the server. More...
 
void SetConnectID (int connectID)
 Change the connect-id. More...
 
const char * GetLastReceivedMessage () const
 Allow to get the last received message from the chat. More...
 
- Public Member Functions inherited from vtkSMRemoteObject
void PrintSelf (ostream &os, vtkIndent indent) override
 
void SetSession (vtkSMSession *) override
 Override the SetSession so if the object already have an ID we automatically register it to the associated session. More...
 
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 normally 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) override
 
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 vtkObject
 vtkBaseTypeMacro (vtkObject, vtkObjectBase)
 
virtual void DebugOn ()
 
virtual void DebugOff ()
 
bool GetDebug ()
 
void SetDebug (bool debugFlag)
 
virtual void Modified ()
 
virtual vtkMTimeType GetMTime ()
 
void RemoveObserver (unsigned long tag)
 
void RemoveObservers (unsigned long event)
 
void RemoveObservers (const char *event)
 
void RemoveAllObservers ()
 
int HasObserver (unsigned long event)
 
int HasObserver (const char *event)
 
int InvokeEvent (unsigned long event)
 
int InvokeEvent (const char *event)
 
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
 
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
 
vtkCommandGetCommand (unsigned long tag)
 
void RemoveObserver (vtkCommand *)
 
void RemoveObservers (unsigned long event, vtkCommand *)
 
void RemoveObservers (const char *event, vtkCommand *)
 
int HasObserver (unsigned long event, vtkCommand *)
 
int HasObserver (const char *event, vtkCommand *)
 
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f)
 
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
unsigned long AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
int InvokeEvent (unsigned long event, void *callData)
 
int InvokeEvent (const char *event, void *callData)
 
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
 
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
 
vtkCommandGetCommand (unsigned long tag)
 
void RemoveObserver (vtkCommand *)
 
void RemoveObservers (unsigned long event, vtkCommand *)
 
void RemoveObservers (const char *event, vtkCommand *)
 
int HasObserver (unsigned long event, vtkCommand *)
 
int HasObserver (const char *event, vtkCommand *)
 
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f)
 
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
unsigned long AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
int InvokeEvent (unsigned long event, void *callData)
 
int InvokeEvent (const char *event, void *callData)
 
- Public Member Functions inherited from vtkObjectBase
const char * GetClassName () const
 
virtual void Delete ()
 
virtual void FastDelete ()
 
void Print (ostream &os)
 
virtual void Register (vtkObjectBase *o)
 
virtual void UnRegister (vtkObjectBase *o)
 
void SetReferenceCount (int)
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 
int GetReferenceCount ()
 
void PrintRevisions (ostream &)
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 
int GetReferenceCount ()
 
void PrintRevisions (ostream &)
 

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)
 
- Static Public Member Functions inherited from vtkObject
static vtkObjectNew ()
 
static void BreakOnError ()
 
static void SetGlobalWarningDisplay (int val)
 
static void GlobalWarningDisplayOn ()
 
static void GlobalWarningDisplayOff ()
 
static int GetGlobalWarningDisplay ()
 
static void SetGlobalWarningDisplay (int val)
 
static void GlobalWarningDisplayOn ()
 
static void GlobalWarningDisplayOff ()
 
static int GetGlobalWarningDisplay ()
 
- Static Public Member Functions inherited from vtkObjectBase
static vtkTypeBool IsTypeOf (const char *name)
 
static vtkObjectBaseNew ()
 
static vtkObjectBaseNew ()
 

Protected Member Functions

 vtkSMCollaborationManager ()
 Default constructor. More...
 
 ~vtkSMCollaborationManager () override
 Destructor. More...
 
- Protected Member Functions inherited from vtkSMRemoteObject
 vtkSMRemoteObject ()
 Default constructor. More...
 
 ~vtkSMRemoteObject () override
 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 () override
 
- Protected Member Functions inherited from vtkSMObject
 vtkSMObject ()
 
 ~vtkSMObject () override
 
- Protected Member Functions inherited from vtkObject
 vtkObject ()
 
virtual ~vtkObject ()
 
void RegisterInternal (vtkObjectBase *, vtkTypeBool check) VTK_OVERRIDE
 
void UnRegisterInternal (vtkObjectBase *, vtkTypeBool check) VTK_OVERRIDE
 
void InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL)
 
void InternalReleaseFocus ()
 
void InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL)
 
void InternalReleaseFocus ()
 
- Protected Member Functions inherited from vtkObjectBase
 vtkObjectBase ()
 
virtual ~vtkObjectBase ()
 
virtual void CollectRevisions (ostream &)
 
virtual void ReportReferences (vtkGarbageCollector *)
 
 vtkObjectBase (const vtkObjectBase &)
 
void operator= (const vtkObjectBase &)
 

Additional Inherited Members

- Protected Attributes inherited from vtkSMRemoteObject
vtkTypeUInt32 GlobalID
 
vtkTypeUInt32 Location
 
bool Prototype
 
bool ClientOnlyLocationFlag
 
- Protected Attributes inherited from vtkSMSessionObject
vtkWeakPointer< vtkSMSessionSession
 Identifies the session id to which this object is related. More...
 
- Protected Attributes inherited from vtkObject
bool Debug
 
vtkTimeStamp MTime
 
vtkSubjectHelper * SubjectHelper
 
- Protected Attributes inherited from vtkObjectBase
vtkAtomicInt32 ReferenceCount
 
vtkWeakPointerBase ** WeakPointers
 

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 
LastMessageUpdated 

Definition at line 155 of file vtkSMCollaborationManager.h.

Constructor & Destructor Documentation

◆ vtkSMCollaborationManager()

vtkSMCollaborationManager::vtkSMCollaborationManager ( )
protected

Default constructor.

◆ ~vtkSMCollaborationManager()

vtkSMCollaborationManager::~vtkSMCollaborationManager ( )
overrideprotected

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 
)
overridevirtual

Reimplemented from vtkObject.

◆ GetGlobalID()

vtkTypeUInt32 vtkSMCollaborationManager::GetGlobalID ( )
overridevirtual

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()

void vtkSMCollaborationManager::SetSession ( vtkSMSession )
overridevirtual

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

Reimplemented from vtkSMSessionObject.

◆ 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.

◆ GetDisableFurtherConnections()

bool vtkSMCollaborationManager::GetDisableFurtherConnections ( )

Return true if further connections are disabled.

◆ 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)

◆ GetServerConnectID()

int vtkSMCollaborationManager::GetServerConnectID ( )

Return the server connect id if this is the master.

Else return -1.

◆ GetConnectID()

int vtkSMCollaborationManager::GetConnectID ( )

Return the client connect id.

◆ SendToOtherClients()

void vtkSMCollaborationManager::SendToOtherClients ( vtkSMMessage msg)

Send message to other clients which will trigger Observer.

◆ GetFullState()

const vtkSMMessage* vtkSMCollaborationManager::GetFullState ( )
overridevirtual

This method return the state of the connected clients.

Reimplemented from vtkSMRemoteObject.

◆ LoadState()

void vtkSMCollaborationManager::LoadState ( const vtkSMMessage msg,
vtkSMProxyLocator locator 
)
overridevirtual

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

Reimplemented from vtkSMRemoteObject.

◆ DisableFurtherConnections()

void vtkSMCollaborationManager::DisableFurtherConnections ( bool  disable)

Enable or disable further connections to the server.

Already connected clients stay connected.

◆ SetConnectID()

void vtkSMCollaborationManager::SetConnectID ( int  connectID)

Change the connect-id.

Already connected clients stay connected.

Parameters
connectIDthe new connect-id for the server.

◆ GetLastReceivedMessage()

const char* vtkSMCollaborationManager::GetLastReceivedMessage ( ) const

Allow to get the last received message from the chat.

Easy API to be wrapped and used in python scripting.


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