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 
55 {
56  Q_OBJECT
57 
58 public:
59  static double INVALID_TIME;
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(pqProxy* 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 Q_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);
107  pqLiveInsituVisualizationManager* connect(pqServer* displaySession, int portNumber = -1);
108 
109  double breakpointTime() const { return this->BreakpointTime; }
110  double breakpointTimeStep() const { return this->BreakpointTimeStep; }
111  void setBreakpoint(double time);
112  void setBreakpoint(vtkIdType timeStep);
113  void removeBreakpoint();
114  bool hasBreakpoint() const
115  {
116  return this->breakpointTime() != INVALID_TIME ||
117  this->breakpointTimeStep() != INVALID_TIME_STEP;
118  }
119 
120  double time() const { return this->Time; }
121  vtkIdType timeStep() const { return this->TimeStep; }
122  void waitTimestep(vtkIdType timeStep);
123  void waitBreakpointHit();
124 
125 protected Q_SLOTS:
129  void onCatalystDisconnected();
130  void onBreakpointHit(pqServer* insituSession);
131  void onSourceAdded(pqPipelineSource* source);
132  void onDataUpdated(pqPipelineSource* source);
133 
134 protected:
136  bool isTimeBreakpointHit() const;
137  bool isTimeStepBreakpointHit() const;
138 
139 protected:
141  double Time;
144 
145 private:
146  Q_DISABLE_COPY(pqLiveInsituManager)
147 
148  typedef QMap<void*, QPointer<pqLiveInsituVisualizationManager> > ManagersType;
149  ManagersType Managers;
150 };
151 
152 #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: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