pqLiveInsituManager.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-FileCopyrightText: Copyright (c) Sandia Corporation
3 // SPDX-License-Identifier: BSD-3-Clause
4 #ifndef pqLiveInsituManager_h
5 #define pqLiveInsituManager_h
6 
7 #include "pqComponentsModule.h"
8 #include <QMap>
9 #include <QObject>
10 #include <QPointer>
11 
12 #include "vtkType.h"
13 
15 class pqPipelineSource;
16 class pqProxy;
17 class pqServer;
19 class vtkSMProxy;
20 
28 {
29  Q_OBJECT
30 
31 public:
32  static double INVALID_TIME;
34  static pqLiveInsituManager* instance();
35 
40  static vtkSMLiveInsituLinkProxy* linkProxy(pqServer* insituSession);
42  {
43  return pqLiveInsituManager::linkProxy(this->selectedInsituServer());
44  }
45  static bool isInsituServer(pqServer* server);
46  static bool isInsitu(pqProxy* pipelineSource);
47  static bool isWriterParametersProxy(vtkSMProxy* proxy);
48  static pqPipelineSource* pipelineSource(pqServer* insituSession);
49  static void time(pqPipelineSource* source, double* time, vtkIdType* timeStep);
50 
51 Q_SIGNALS:
52  void connectionInitiated(pqServer* displaySession);
53  void timeUpdated();
54  void breakpointAdded(pqServer* insituSession);
55  void breakpointRemoved(pqServer* insituSession);
56  void breakpointHit(pqServer* insituSession);
57 
58 public:
65  pqServer* selectedInsituServer();
69  bool isDisplayServer(pqServer* server);
74  pqLiveInsituVisualizationManager* managerFromDisplay(pqServer* displaySession);
75  static pqLiveInsituVisualizationManager* managerFromInsitu(pqServer* insituSession);
80  pqLiveInsituVisualizationManager* connect(pqServer* displaySession, int portNumber = -1);
81 
82  double breakpointTime() const { return this->BreakpointTime; }
83  double breakpointTimeStep() const { return this->BreakpointTimeStep; }
84  void setBreakpoint(double time);
85  void setBreakpoint(vtkIdType timeStep);
86  void removeBreakpoint();
87  bool hasBreakpoint() const
88  {
89  return this->breakpointTime() != INVALID_TIME ||
90  this->breakpointTimeStep() != INVALID_TIME_STEP;
91  }
92 
93  double time() const { return this->Time; }
94  vtkIdType timeStep() const { return this->TimeStep; }
95  void waitTimestep(vtkIdType timeStep);
96  void waitBreakpointHit();
97 
98 protected Q_SLOTS:
102  void onCatalystDisconnected();
103  void onBreakpointHit(pqServer* insituSession);
104  void onSourceAdded(pqPipelineSource* source);
105  void onDataUpdated(pqPipelineSource* source);
106 
107 protected: // NOLINT(readability-redundant-access-specifiers)
109  bool isTimeBreakpointHit() const;
110  bool isTimeStepBreakpointHit() const;
111 
113  double Time;
116 
117 private:
118  Q_DISABLE_COPY(pqLiveInsituManager)
119 
120  typedef QMap<void*, QPointer<pqLiveInsituVisualizationManager>> ManagersType;
121  ManagersType Managers;
122 };
123 
124 #endif
Manages the live-coprocessing link.
Performs additional operation on the Live client.
double breakpointTimeStep() const
#define PQCOMPONENTS_EXPORT
int vtkIdType
double breakpointTime() const
static double INVALID_TIME
time
static vtkIdType INVALID_TIME_STEP
source
connect
This class represents any registered Server Manager proxy.
Definition: pqProxy.h:28
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:140
Singleton that provides access to Insitu objects.
PQ representation for a vtkSMProxy that can be involved in a pipeline.
vtkSMLiveInsituLinkProxy * linkProxy()
vtkIdType timeStep() const
pqServer (should be renamed to pqSession) is a pqServerManagerModelItem subclass that represents a vt...
Definition: pqServer.h:35