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;
38 class vtkPVOptions;
40 class vtkPVXMLElement;
41 class vtkSMApplication;
42 class vtkSMProxy;
45 class vtkSMSession;
47 
48 #include "pqCoreModule.h"
50 #include "pqServerResource.h"
51 #include "pqTimer.h"
52 #include "vtkSMMessageMinimal.h"
53 #include "vtkSmartPointer.h"
54 #include "vtkWeakPointer.h"
55 
56 #include <QPointer>
57 
65 {
66  Q_OBJECT
67 public:
68  pqServer(vtkIdType connectionId, vtkPVOptions*, QObject* parent = NULL);
69  ~pqServer() override;
70 
71  const pqServerResource& getResource();
72  void setResource(const pqServerResource& server_resource);
73 
77  vtkSMSession* session() const;
78 
82  vtkIdType GetConnectionID() const;
83  vtkIdType sessionId() const { return this->GetConnectionID(); }
84 
88  vtkSMSessionProxyManager* proxyManager() const;
89 
94  vtkSMProxySelectionModel* activeSourcesSelectionModel() const;
95 
99  vtkSMProxySelectionModel* activeViewSelectionModel() const;
100 
105  int getNumberOfPartitions();
106 
111  bool isRemote() const;
112 
117  bool isMaster() const;
118 
124  bool isProcessingPending() const;
125 
130  bool isRenderServerSeparate();
131 
135  pqTimeKeeper* getTimeKeeper() const;
136 
140  vtkPVOptions* getOptions() const;
141 
146  vtkPVServerInformation* getServerInformation() const;
147 
152  bool isProgressPending() const;
153 
160  static void setHeartBeatTimeoutSetting(int msec);
161  static int getHeartBeatTimeoutSetting();
162 
166  void setMonitorServerNotifications(bool);
167 
171  int getRemainingLifeTime() const;
172 
176  void setRemainingLifeTime(int value);
177 
178 Q_SIGNALS:
182  void nameChanged(pqServerManagerModelItem*);
183 
190  void fiveMinuteTimeoutWarning();
191 
197  void finalTimeoutWarning();
198 
202  void serverSideDisconnected();
203 
204 protected:
208  static const char* HEARBEAT_TIME_SETTING_KEY();
209 
213  void setHeartBeatTimeout(int msec);
214 
215  // ---- Collaboration client-to-clients communication mechanisme ----
216 
217 Q_SIGNALS:
229  void sentFromOtherClient(pqServer*, vtkSMMessage* msg);
230 
234  void triggeredMasterUser(int);
235  void triggeredUserName(int, QString&);
236  void triggeredUserListChanged();
237  void triggerFollowCamera(int);
238 
239 public Q_SLOTS:
243  void sendToOtherClients(vtkSMMessage* msg);
244 
245  // ---- Collaboration client-to-clients communication mechanisme ----
246 
247 protected Q_SLOTS:
251  void heartBeat();
252 
256  void updateRemainingLifeTime();
257 
261  void processServerNotification();
262 
268  void onCollaborationCommunication(vtkObject*, unsigned long, void*, void*);
269 
274  void onConnectionLost(vtkObject*, unsigned long, void*, void*);
275 
276 private:
277  Q_DISABLE_COPY(pqServer)
278 
279  pqServerResource Resource;
280  vtkIdType ConnectionID;
282 
283  // TODO:
284  // Each connection will eventually have a PVOptions object.
285  // For now, this is same as the vtkProcessModule::Options.
287 
288  pqTimer IdleCollaborationTimer;
289 
290  class pqInternals;
291  pqInternals* Internals;
292 };
293 
294 #endif // !_pqServer_h
vtkSMSession is the default ParaView session.
Definition: vtkSMSession.h:35
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:83
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
ParaView options storage.
Definition: vtkPVOptions.h:37
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:64