ParaView
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 
64 class PQCORE_EXPORT pqServer : public pqServerManagerModelItem
65 {
66  Q_OBJECT
67 public:
68  pqServer(vtkIdType connectionId, vtkPVOptions*, QObject* parent = NULL);
69  virtual ~pqServer();
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 
168 signals:
172  void nameChanged(pqServerManagerModelItem*);
173 
180  void fiveMinuteTimeoutWarning();
181 
187  void finalTimeoutWarning();
188 
192  void serverSideDisconnected();
193 
194 protected:
198  static const char* HEARBEAT_TIME_SETTING_KEY();
199 
203  void setHeartBeatTimeout(int msec);
204 
205  // ---- Collaboration client-to-clients communication mechanisme ----
206 
207 signals:
219  void sentFromOtherClient(pqServer*, vtkSMMessage* msg);
220 
224  void triggeredMasterUser(int);
225  void triggeredUserName(int, QString&);
226  void triggeredUserListChanged();
227  void triggerFollowCamera(int);
228 
229 public slots:
233  void sendToOtherClients(vtkSMMessage* msg);
234 
235  // ---- Collaboration client-to-clients communication mechanisme ----
236 
237 protected slots:
241  void heartBeat();
242 
246  void processServerNotification();
247 
253  void onCollaborationCommunication(vtkObject*, unsigned long, void*, void*);
254 
259  void onConnectionLost(vtkObject*, unsigned long, void*, void*);
260 
261 private:
262  Q_DISABLE_COPY(pqServer)
263 
264  pqServerResource Resource;
265  vtkIdType ConnectionID;
266  vtkWeakPointer<vtkSMSession> Session;
267 
268  // TODO:
269  // Each connection will eventually have a PVOptions object.
270  // For now, this is same as the vtkProcessModule::Options.
271  vtkSmartPointer<vtkPVOptions> Options;
272 
273  pqTimer IdleCollaborationTimer;
274 
275  class pqInternals;
276  pqInternals* Internals;
277 };
278 
279 #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
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.
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
ParaView options storage.
Definition: vtkPVOptions.h:33
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