pqServer.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: pqServer.h
5 
6  Copyright (c) 2005-2008 Sandia Corporation, Kitware Inc.
7  All rights reserved.
8 
9  ParaView is a free software; you can redistribute it and/or modify it
10  under the terms of the ParaView license version 1.2.
11 
12  See License_v1.2.txt for the full ParaView license.
13  A copy of this license can be obtained by contacting
14  Kitware Inc.
15  28 Corporate Drive
16  Clifton Park, NY 12065
17  USA
18 
19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
23 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
26 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
27 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 
31 =========================================================================*/
32 #ifndef pqServer_h
33 #define pqServer_h
34 
35 class vtkObject;
36 class pqTimeKeeper;
37 class vtkProcessModule;
39 class vtkPVXMLElement;
40 class vtkSMApplication;
41 class vtkSMProxy;
44 class vtkSMSession;
46 
47 #include "pqCoreModule.h"
49 #include "pqServerResource.h"
50 #include "pqTimer.h"
51 #include "vtkSMMessageMinimal.h"
52 #include "vtkSmartPointer.h"
53 #include "vtkWeakPointer.h"
54 
55 #include <QPointer>
56 
64 {
65  Q_OBJECT
66 public:
67  pqServer(vtkIdType connectionId, QObject* parent = nullptr);
68  ~pqServer() override;
69 
70  const pqServerResource& getResource();
71  void setResource(const pqServerResource& server_resource);
72 
76  vtkSMSession* session() const;
77 
81  vtkIdType GetConnectionID() const;
82  vtkIdType sessionId() const { return this->GetConnectionID(); }
83 
87  vtkSMSessionProxyManager* proxyManager() const;
88 
93  vtkSMProxySelectionModel* activeSourcesSelectionModel() const;
94 
98  vtkSMProxySelectionModel* activeViewSelectionModel() const;
99 
104  int getNumberOfPartitions();
105 
110  bool isRemote() const;
111 
116  bool isMaster() const;
117 
123  bool isProcessingPending() const;
124 
129  bool isRenderServerSeparate();
130 
134  pqTimeKeeper* getTimeKeeper() const;
135 
140  vtkPVServerInformation* getServerInformation() const;
141 
146  bool isProgressPending() const;
147 
154  static void setHeartBeatTimeoutSetting(int msec);
155  static int getHeartBeatTimeoutSetting();
156 
160  void setMonitorServerNotifications(bool);
161 
165  int getRemainingLifeTime() const;
166 
170  void setRemainingLifeTime(int value);
171 
172 Q_SIGNALS:
176  void nameChanged(pqServerManagerModelItem*);
177 
184  void fiveMinuteTimeoutWarning();
185 
191  void finalTimeoutWarning();
192 
196  void serverSideDisconnected();
197 
198 protected:
202  static const char* HEARBEAT_TIME_SETTING_KEY();
203 
207  void setHeartBeatTimeout(int msec);
208 
209  // ---- Collaboration client-to-clients communication mechanisme ----
210 
211 Q_SIGNALS:
223  void sentFromOtherClient(pqServer*, vtkSMMessage* msg);
224 
228  void triggeredMasterUser(int);
229  void triggeredUserName(int, QString&);
230  void triggeredUserListChanged();
231  void triggerFollowCamera(int);
232 
233 public Q_SLOTS:
237  void sendToOtherClients(vtkSMMessage* msg);
238 
239  // ---- Collaboration client-to-clients communication mechanisme ----
240 
241 protected Q_SLOTS:
245  void heartBeat();
246 
250  void updateRemainingLifeTime();
251 
255  void processServerNotification();
256 
262  void onCollaborationCommunication(vtkObject*, unsigned long, void*, void*);
263 
268  void onConnectionLost(vtkObject*, unsigned long, void*, void*);
269 
270 private:
271  Q_DISABLE_COPY(pqServer)
272 
273  pqServerResource Resource;
274  vtkIdType ConnectionID;
276  vtkSmartPointer<vtkSMProxy> ExecutableRunnerProxy;
277 
278  pqTimer IdleCollaborationTimer;
279 
280  class pqInternals;
281  pqInternals* Internals;
282 };
283 
284 #endif // !pqServer_h
vtkSMSession is the default ParaView session.
Definition: vtkSMSession.h:34
Gets features of the server.
pqServerManagerModelItem is a element maintained by pqServerManagerModel.
pqTimeKeeper is pqProxy for "TimeKeeper" proxy.
Definition: pqTimeKeeper.h:46
int vtkIdType
vtkIdType sessionId() const
Definition: pqServer.h:82
Header class that setup every thing in order to use Protobuf messages in a transparent manner...
implementation for View that includes render window and renderers.
#define PQCORE_EXPORT
Definition: pqCoreModule.h:15
The vtkSMSessionProxyManager is esponsible for creating and managing proxies for a given session...
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:152
value
This is used by vtkPVXMLParser to represent an XML document starting at the root element.
pqServerResource encapsulates a resource in ParaView.
process initialization and management core for ParaView processes.
pqServer (should be renamed to pqSession) is a pqServerManagerModelItem subclass that represents a vt...
Definition: pqServer.h:63