ParaView
pqLiveInsituManager.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: pqLiveInsituManager.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 pqLiveInsituManager_h
33 #define pqLiveInsituManager_h
34 
35 #include "pqComponentsModule.h"
36 #include <QMap>
37 #include <QPointer>
38 
39 #include "vtkType.h"
40 
42 class pqPipelineSource;
43 class pqProxy;
44 class pqServer;
46 class vtkSMProxy;
47 
54 class PQCOMPONENTS_EXPORT pqLiveInsituManager : public QObject
55 {
56  Q_OBJECT
57 
58 public:
59  static double INVALID_TIME;
60  static vtkIdType INVALID_TIME_STEP;
61  static pqLiveInsituManager* instance();
62 
67  static vtkSMLiveInsituLinkProxy* linkProxy(pqServer* insituSession);
69  {
70  return pqLiveInsituManager::linkProxy(this->selectedInsituServer());
71  }
72  static bool isInsituServer(pqServer* server);
73  static bool isInsitu(pqPipelineSource* pipelineSource);
74  static bool isWriterParametersProxy(vtkSMProxy* proxy);
75  static pqPipelineSource* pipelineSource(pqServer* insituSession);
76  static void time(pqPipelineSource* source, double* time, vtkIdType* timeStep);
77 
78 signals:
79  void connectionInitiated(pqServer* displaySession);
80  void timeUpdated();
81  void breakpointAdded(pqServer* insituSession);
82  void breakpointRemoved(pqServer* insituSession);
83  void breakpointHit(pqServer* insituSession);
84 
85 public:
92  pqServer* selectedInsituServer();
96  bool isDisplayServer(pqServer* server);
101  pqLiveInsituVisualizationManager* managerFromDisplay(pqServer* displaySession);
102  static pqLiveInsituVisualizationManager* managerFromInsitu(pqServer* insituSession);
106  pqLiveInsituVisualizationManager* connect(pqServer* displaySession);
107 
108  double breakpointTime() const { return this->BreakpointTime; }
109  double breakpointTimeStep() const { return this->BreakpointTimeStep; }
110  void setBreakpoint(double time);
111  void setBreakpoint(vtkIdType timeStep);
112  void removeBreakpoint();
113  bool hasBreakpoint() const
114  {
115  return this->breakpointTime() != INVALID_TIME ||
116  this->breakpointTimeStep() != INVALID_TIME_STEP;
117  }
118 
119  double time() const { return this->Time; }
120  vtkIdType timeStep() const { return this->TimeStep; }
121  void waitTimestep(vtkIdType timeStep);
122  void waitBreakpointHit();
123 
124 protected slots:
128  void onCatalystDisconnected();
129  void onBreakpointHit(pqServer* insituSession);
130  void onSourceAdded(pqPipelineSource* source);
131  void onDataUpdated(pqPipelineSource* source);
132 
133 protected:
135  bool isTimeBreakpointHit() const;
136  bool isTimeStepBreakpointHit() const;
137 
138 protected:
140  double Time;
142  vtkIdType TimeStep;
143 
144 private:
145  Q_DISABLE_COPY(pqLiveInsituManager)
146 
147  typedef QMap<void*, QPointer<pqLiveInsituVisualizationManager> > ManagersType;
148  ManagersType Managers;
149 };
150 
151 #endif
Manages the live-coprocessing link.
Performs additional operation on the Live client.
double breakpointTimeStep() const
double breakpointTime() const
static double INVALID_TIME
static vtkIdType INVALID_TIME_STEP
This class represents any registered Server Manager proxy.
Definition: pqProxy.h:56
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:152
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:64