pqObjectBuilder.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 pqObjectBuilder_h
5 #define pqObjectBuilder_h
6 
7 #include "pqCoreModule.h"
8 #include "vtkNetworkAccessManager.h" // needed for vtkNetworkAccessManager::ConnectionResult.
9 
10 #include <QMap>
11 #include <QObject>
12 #include <QVariant>
13 
14 class pqAnimationCue;
16 class pqOutputPort;
17 class pqPipelineSource;
18 class pqProxy;
19 class pqRepresentation;
21 class pqScalarsToColors;
22 class pqServer;
23 class pqServerResource;
24 class pqView;
25 class vtkSMProxy;
26 
42 class PQCORE_EXPORT pqObjectBuilder : public QObject
43 {
44  Q_OBJECT
45  typedef QObject Superclass;
46 
47 public:
48  pqObjectBuilder(QObject* parent = nullptr);
49  ~pqObjectBuilder() override;
50 
52 
67  pqServer* createServer(const pqServerResource& resource, int connectionTimeout = 60)
68  {
70  return this->createServer(resource, connectionTimeout, result);
71  }
72  pqServer* createServer(const pqServerResource& resource, int connectionTimeout,
75 
79  void removeServer(pqServer* server);
80 
85  pqServer* resetServer(pqServer* server);
86 
92  virtual pqPipelineSource* createSource(
93  const QString& sm_group, const QString& sm_name, pqServer* server);
94 
101  virtual pqPipelineSource* createFilter(const QString& group, const QString& name,
102  QMap<QString, QList<pqOutputPort*>> namedInputs, pqServer* server);
103 
107  virtual pqPipelineSource* createFilter(
108  const QString& group, const QString& name, pqPipelineSource* input, int output_port = 0);
109 
115  virtual pqPipelineSource* createReader(
116  const QString& sm_group, const QString& sm_name, const QStringList& files, pqServer* server);
117 
121  virtual pqView* createView(const QString& type, pqServer* server);
122 
127  virtual void destroy(pqView* view);
128 
134  virtual void addToLayout(pqView* view, pqProxy* layout = nullptr);
135 
140  virtual pqDataRepresentation* createDataRepresentation(
141  pqOutputPort* source, pqView* view, const QString& representationType = "");
142 
149  virtual vtkSMProxy* createProxy(
150  const QString& sm_group, const QString& sm_name, pqServer* server, const QString& reg_group);
151 
156  virtual void destroy(pqRepresentation* repr);
157 
161  // \li removing all displays belonging to the source,
162  // \li breaking any input connections.
163  // \li unregistering the source.
164  // Note that the source must have no consumers, otherwise,
165  // one cannot delete the source.
166  virtual void destroy(pqPipelineSource* source);
167 
171  virtual void destroy(pqAnimationCue* cue);
172 
177  virtual void destroy(pqProxy* proxy);
178 
182  virtual void destroySources(pqServer* server = nullptr);
183 
187  virtual void destroyLookupTables(pqServer* server = nullptr);
188 
193  virtual void destroyPipelineProxies(pqServer* server = nullptr);
194 
199  virtual void destroyAllProxies(pqServer* server);
200 
210  static QString getFileNamePropertyName(vtkSMProxy*);
211 
215  bool waitingForConnection() const
216  {
217  return this->ForceWaitingForConnection ? true : this->WaitingForConnection;
218  }
219 
226  bool forceWaitingForConnection(bool force);
227 
228 public Q_SLOTS: // NOLINT(readability-redundant-access-specifiers)
232  void abortPendingConnections();
233 
234 Q_SIGNALS:
235 
239  void finishedAddingServer(pqServer* server);
240 
247  void sourceCreated(pqPipelineSource*);
248 
255  void filterCreated(pqPipelineSource*);
256 
263  void readerCreated(pqPipelineSource*, const QString& filename);
264  void readerCreated(pqPipelineSource*, const QStringList& filename);
265 
269  void aboutToCreateView(pqServer* server);
270 
277  void viewCreated(pqView*);
278 
285  void dataRepresentationCreated(pqDataRepresentation*);
286 
292  void proxyCreated(pqProxy*);
293 
300  void proxyCreated(vtkSMProxy*);
301 
309  void destroying(pqView* view);
310 
318  void destroying(pqRepresentation* display);
319 
327  void destroying(pqPipelineSource* source);
328 
336  void destroying(pqProxy* proxy);
337 
338 protected:
342  virtual void destroyProxyInternal(pqProxy* proxy);
343 
344 private:
345  Q_DISABLE_COPY(pqObjectBuilder)
346 
347  bool ForceWaitingForConnection;
348  bool WaitingForConnection;
349 };
350 
351 #endif
pqDataRepresentation is the superclass for a display for a pqPipelineSource i.e.
pqOutputPort is a server manager model item for an output port of any pqPipelineSource item...
Definition: pqOutputPort.h:29
type
pqScalarsToColors is a represents a vtkScalarsToColors proxy.
pqObjectBuilder is loosely based on the Builder design pattern.
This is PQ representation for a single representation.
pqAnimationCue is the pqProxy wrapping an animation proxy.
This is a PQ abstraction of a generic view module.
Definition: pqView.h:26
name
bool waitingForConnection() const
Returns true while pqObjectBuilder is in createServer() call.
pqScalarBarRepresentation is created for "ScalarBarWidgetRepresentation" proxies. ...
#define PQCORE_EXPORT
Definition: pqCoreModule.h:15
source
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
PQ representation for a vtkSMProxy that can be involved in a pipeline.
pqServer * createServer(const pqServerResource &resource, int connectionTimeout=60)
Create a server connection give a server resource.
ConnectionResult
Possible result of connection when creating a new connection CONNECTION_SUCCESS: Connection was suces...
pqServerResource encapsulates a resource in ParaView.
pqServer (should be renamed to pqSession) is a pqServerManagerModelItem subclass that represents a vt...
Definition: pqServer.h:35