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;
45 class vtkSMLiveInsituLinkProxy;
46 class vtkSMProxy;
47 
48 
53 class PQCOMPONENTS_EXPORT pqLiveInsituManager : public QObject
54 {
55  Q_OBJECT
56 
57 public:
58  static double INVALID_TIME;
59  static vtkIdType INVALID_TIME_STEP;
60  static pqLiveInsituManager* instance();
61 
64  static vtkSMLiveInsituLinkProxy* linkProxy(pqServer* insituSession);
65  vtkSMLiveInsituLinkProxy* linkProxy()
66  {
67  return pqLiveInsituManager::linkProxy(this->selectedInsituServer());
68  }
69  static bool isInsituServer(pqServer* server);
70  static bool isInsitu(pqPipelineSource* pipelineSource);
71  static bool isWriterParametersProxy(vtkSMProxy* proxy);
72  static pqPipelineSource* pipelineSource(pqServer* insituSession);
73  static void time(pqPipelineSource* source, double* time,
74  vtkIdType* timeStep);
75 
76 signals:
77  void connectionInitiated(pqServer* displaySession);
78  void timeUpdated();
79  void breakpointAdded(pqServer* insituSession);
80  void breakpointRemoved(pqServer* insituSession);
81  void breakpointHit(pqServer* insituSession);
82 
83 public:
88  pqServer* selectedInsituServer();
90  bool isDisplayServer(pqServer* server);
93  pqLiveInsituVisualizationManager* managerFromDisplay(pqServer* displaySession);
94  static pqLiveInsituVisualizationManager* managerFromInsitu(
95  pqServer* insituSession);
97  pqLiveInsituVisualizationManager* connect(pqServer* displaySession);
98 
99  double breakpointTime() const
100  {
101  return this->BreakpointTime;
102  }
103  double breakpointTimeStep() const
104  {
105  return this->BreakpointTimeStep;
106  }
107  void setBreakpoint(double time);
108  void setBreakpoint(vtkIdType timeStep);
109  void removeBreakpoint();
110  bool hasBreakpoint() const
111  {
112  return this->breakpointTime() != INVALID_TIME ||
113  this->breakpointTimeStep() != INVALID_TIME_STEP;
114  }
115 
116  double time() const
117  {
118  return this->Time;
119  }
120  vtkIdType timeStep() const
121  {
122  return this->TimeStep;
123  }
124  void waitTimestep(vtkIdType timeStep);
125  void waitBreakpointHit();
126 
127 
128 protected slots:
130  void onCatalystDisconnected();
131  void onBreakpointHit(pqServer* insituSession);
132  void onSourceAdded(pqPipelineSource* source);
133  void onDataUpdated(pqPipelineSource* source);
134 
135 protected:
137  bool isTimeBreakpointHit() const;
138  bool isTimeStepBreakpointHit() const;
139 
140 protected:
142  double Time;
144  vtkIdType TimeStep;
145 
146 private:
147  Q_DISABLE_COPY(pqLiveInsituManager)
148 
149  typedef QMap<void*, QPointer<pqLiveInsituVisualizationManager> > ManagersType;
150  ManagersType Managers;
151 };
152 
153 #endif
Manages the live-coprocessing link.
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:52
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:62