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;
39 class vtkPVServerInformation;
40 class vtkPVXMLElement;
41 class vtkSMApplication;
42 class vtkSMProxy;
43 class vtkSMProxySelectionModel;
44 class vtkSMRenderViewProxy;
45 class vtkSMSession;
46 class vtkSMSessionProxyManager;
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 
62 class PQCORE_EXPORT pqServer : public pqServerManagerModelItem
63 {
64  Q_OBJECT
65 public:
66  pqServer(vtkIdType connectionId, vtkPVOptions*, QObject* parent = NULL);
67  virtual ~pqServer();
68 
69  const pqServerResource& getResource();
70  void setResource(const pqServerResource &server_resource);
71 
73  vtkSMSession* session() const;
74 
76  vtkIdType GetConnectionID() const;
77  vtkIdType sessionId() const { return this->GetConnectionID(); }
78 
80  vtkSMSessionProxyManager* proxyManager() const;
81 
84  vtkSMProxySelectionModel* activeSourcesSelectionModel() const;
85 
87  vtkSMProxySelectionModel* activeViewSelectionModel() const;
88 
91  int getNumberOfPartitions();
92 
95  bool isRemote() const;
96 
99  bool isMaster() const;
100 
104  bool isProcessingPending() const;
105 
108  bool isRenderServerSeparate();
109 
111  pqTimeKeeper* getTimeKeeper() const;
112 
114  vtkPVOptions* getOptions() const;
115 
118  vtkPVServerInformation* getServerInformation() const;
119 
122  bool isProgressPending() const;
123 
128  static void setHeartBeatTimeoutSetting(int msec);
129  static int getHeartBeatTimeoutSetting();
130 
132  void setMonitorServerNotifications(bool);
133 
134 signals:
136  void nameChanged(pqServerManagerModelItem*);
137 
142  void fiveMinuteTimeoutWarning();
143 
147  void finalTimeoutWarning();
148 
150  void serverSideDisconnected();
151 
152 protected:
154  static const char* HEARBEAT_TIME_SETTING_KEY();
155 
157  void setHeartBeatTimeout(int msec);
158 
159  // ---- Collaboration client-to-clients communication mechanisme ----
160 
161 signals:
171  void sentFromOtherClient(pqServer*,vtkSMMessage* msg);
172 
174  void triggeredMasterUser(int);
175  void triggeredUserName(int, QString&);
176  void triggeredUserListChanged();
177  void triggerFollowCamera(int);
178 
179 public slots:
181  void sendToOtherClients(vtkSMMessage* msg);
182 
183  // ---- Collaboration client-to-clients communication mechanisme ----
184 
185 protected slots:
187  void heartBeat();
188 
190  void processServerNotification();
191 
195  void onCollaborationCommunication(vtkObject*, unsigned long, void*, void*);
196 
199  void onConnectionLost(vtkObject*, unsigned long, void*, void*);
200 
201 private:
202  Q_DISABLE_COPY(pqServer)
203 
204  pqServerResource Resource;
205  vtkIdType ConnectionID;
206  vtkWeakPointer<vtkSMSession> Session;
207 
208  // TODO:
209  // Each connection will eventually have a PVOptions object.
210  // For now, this is same as the vtkProcessModule::Options.
211  vtkSmartPointer<vtkPVOptions> Options;
212 
213  pqTimer IdleCollaborationTimer;
214 
215  class pqInternals;
216  pqInternals* Internals;
217 };
218 
219 #endif // !_pqServer_h
pqServerManagerModelItem is a element maintained by pqServerManagerModel.
pqTimeKeeper is pqProxy for "TimeKeeper" proxy.
Definition: pqTimeKeeper.h:44
vtkIdType sessionId() const
Definition: pqServer.h:77
pqServerResource encapsulates a resource in ParaView.
pqServer (should be renamed to pqSession) is a pqServerManagerModelItem subclass that represents a vt...
Definition: pqServer.h:62