vtkSMCollaborationManager.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkSMCollaborationManager.h
5 
6  Copyright (c) Kitware, Inc.
7  All rights reserved.
8  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
39 #ifndef vtkSMCollaborationManager_h
40 #define vtkSMCollaborationManager_h
41 
42 #include "vtkRemotingServerManagerModule.h" //needed for exports
43 #include "vtkSMMessageMinimal.h" // needed for vtkSMMessage
44 #include "vtkSMRemoteObject.h"
45 
46 class vtkSMProxyLocator;
47 
49 {
50 public:
54  static vtkTypeUInt32 GetReservedGlobalID();
55 
58  void PrintSelf(ostream& os, vtkIndent indent) override;
59 
64  vtkTypeUInt32 GetGlobalID() override;
65 
70  void SetSession(vtkSMSession*) override;
71 
79  virtual void PromoteToMaster(int clientId);
80 
85  virtual void FollowUser(int clientId);
86 
90  int GetFollowedUser();
91 
95  virtual bool IsMaster();
96 
100  virtual int GetMasterId();
101 
105  bool GetDisableFurtherConnections();
106 
110  virtual int GetUserId();
111 
116  virtual int GetUserId(int index);
117 
121  virtual const char* GetUserLabel(int userID);
122 
126  virtual void SetUserLabel(const char* userName);
127 
131  virtual void SetUserLabel(int userId, const char* userName);
132 
137  virtual int GetNumberOfConnectedClients();
138 
142  void UpdateUserInformations();
143 
148  int GetServerConnectID();
149 
153  int GetConnectID();
154 
156  {
157  CollaborationNotification = 12345,
158  UpdateUserName = 12346,
159  UpdateUserList = 12347,
160  UpdateMasterUser = 12348,
161  FollowUserCamera = 12349,
162  CameraChanged = 12350,
163  LastMessageUpdated = 12351
164  };
165 
169  void SendToOtherClients(vtkSMMessage* msg);
170 
174  const vtkSMMessage* GetFullState() override;
175 
180  void LoadState(const vtkSMMessage* msg, vtkSMProxyLocator* locator) override;
181 
186  void DisableFurtherConnections(bool disable);
187 
192  void SetConnectID(int connectID);
193 
198  const char* GetLastReceivedMessage() const;
199 
200 protected:
205 
209  ~vtkSMCollaborationManager() override;
210 
211 private:
212  class vtkInternal;
213  vtkInternal* Internal;
214 
216  void operator=(const vtkSMCollaborationManager&) = delete;
217 };
218 #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:35
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