vtkSMCollaborationManager.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
27 #ifndef vtkSMCollaborationManager_h
28 #define vtkSMCollaborationManager_h
29 
30 #include "vtkRemotingServerManagerModule.h" //needed for exports
31 #include "vtkSMMessageMinimal.h" // needed for vtkSMMessage
32 #include "vtkSMRemoteObject.h"
33 
34 class vtkSMProxyLocator;
35 
37 {
38 public:
42  static vtkTypeUInt32 GetReservedGlobalID();
43 
46  void PrintSelf(ostream& os, vtkIndent indent) override;
47 
52  vtkTypeUInt32 GetGlobalID() override;
53 
58  void SetSession(vtkSMSession*) override;
59 
67  virtual void PromoteToMaster(int clientId);
68 
73  virtual void FollowUser(int clientId);
74 
78  int GetFollowedUser();
79 
83  virtual bool IsMaster();
84 
88  virtual int GetMasterId();
89 
93  bool GetDisableFurtherConnections();
94 
98  virtual int GetUserId();
99 
104  virtual int GetUserId(int index);
105 
109  virtual const char* GetUserLabel(int userID);
110 
114  virtual void SetUserLabel(const char* userName);
115 
119  virtual void SetUserLabel(int userId, const char* userName);
120 
125  virtual int GetNumberOfConnectedClients();
126 
130  void UpdateUserInformations();
131 
136  int GetServerConnectID();
137 
141  int GetConnectID();
142 
144  {
145  CollaborationNotification = 12345,
146  UpdateUserName = 12346,
147  UpdateUserList = 12347,
148  UpdateMasterUser = 12348,
149  FollowUserCamera = 12349,
150  CameraChanged = 12350,
151  LastMessageUpdated = 12351
152  };
153 
157  void SendToOtherClients(vtkSMMessage* msg);
158 
162  const vtkSMMessage* GetFullState() override;
163 
168  void LoadState(const vtkSMMessage* msg, vtkSMProxyLocator* locator) override;
169 
174  void DisableFurtherConnections(bool disable);
175 
180  void SetConnectID(int connectID);
181 
186  const char* GetLastReceivedMessage() const;
187 
188 protected:
193 
197  ~vtkSMCollaborationManager() override;
198 
199 private:
200  class vtkInternal;
201  vtkInternal* Internal;
202 
204  void operator=(const vtkSMCollaborationManager&) = delete;
205 };
206 #endif // #ifndef vtkSMCollaborationManager_h
void SetSession(vtkSMSession *) override
Override the SetSession so if the object already have an ID we automatically register it to the assoc...
virtual void LoadState(const vtkSMMessage *msg, vtkSMProxyLocator *locator)
This method is used to initialise the object to the given state If the definitionOnly Flag is set to ...
#define VTKREMOTINGSERVERMANAGER_EXPORT
vtkSMSession is the default ParaView session.
Definition: vtkSMSession.h:22
Class used to broadcast message from one client to the others.
Header class that setup every thing in order to use Protobuf messages in a transparent manner...
virtual const vtkSMMessage * GetFullState()
This method return the full object state that can be used to create that object from scratch...
is used to locate proxies referred to in state xmls while loading state files.
baseclass for all proxy-objects that have counter parts on server as well as client processes...
virtual vtkTypeUInt32 GetGlobalID()
Get the global unique id for this object.
static vtkSMSessionObject * New()
void PrintSelf(ostream &os, vtkIndent indent) override