pqObjectBuilder.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: pqObjectBuilder.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 pqObjectBuilder_h
33 #define pqObjectBuilder_h
34 
35 #include "pqCoreModule.h"
36 #include "vtkSetGet.h" // for VTK_LEGACY
37 #include <QMap>
38 #include <QObject>
39 #include <QVariant>
40 
41 class pqAnimationCue;
43 class pqOutputPort;
44 class pqPipelineSource;
45 class pqProxy;
46 class pqRepresentation;
48 class pqScalarsToColors;
49 class pqServer;
50 class pqServerResource;
51 class pqView;
52 class vtkSMProxy;
53 
69 class PQCORE_EXPORT pqObjectBuilder : public QObject
70 {
71  Q_OBJECT
72  typedef QObject Superclass;
73 
74 public:
75  pqObjectBuilder(QObject* parent = 0);
76  ~pqObjectBuilder() override;
77 
91  pqServer* createServer(const pqServerResource& resource, int connectionTimeout = 60);
92 
96  void removeServer(pqServer* server);
97 
102  pqServer* resetServer(pqServer* server);
103 
109  virtual pqPipelineSource* createSource(
110  const QString& sm_group, const QString& sm_name, pqServer* server);
111 
118  virtual pqPipelineSource* createFilter(const QString& group, const QString& name,
119  QMap<QString, QList<pqOutputPort*> > namedInputs, pqServer* server);
120 
124  virtual pqPipelineSource* createFilter(
125  const QString& group, const QString& name, pqPipelineSource* input, int output_port = 0);
126 
132  virtual pqPipelineSource* createReader(
133  const QString& sm_group, const QString& sm_name, const QStringList& files, pqServer* server);
134 
138  virtual pqView* createView(const QString& type, pqServer* server);
139 
144  VTK_LEGACY(pqView* createView(const QString& type, pqServer* server, bool detachedFromLayout));
145 
150  virtual void destroy(pqView* view);
151 
157  virtual void addToLayout(pqView* view, pqProxy* layout = nullptr);
158 
163  virtual pqDataRepresentation* createDataRepresentation(
164  pqOutputPort* source, pqView* view, const QString& representationType = "");
165 
172  virtual vtkSMProxy* createProxy(
173  const QString& sm_group, const QString& sm_name, pqServer* server, const QString& reg_group);
174 
179  virtual void destroy(pqRepresentation* repr);
180 
184  // \li removing all displays belonging to the source,
185  // \li breaking any input connections.
186  // \li unregistering the source.
187  // Note that the source must have no consumers, otherwise,
188  // one cannot delete the source.
189  virtual void destroy(pqPipelineSource* source);
190 
194  virtual void destroy(pqAnimationCue* cue);
195 
200  virtual void destroy(pqProxy* proxy);
201 
205  virtual void destroySources(pqServer* server = 0);
206 
210  virtual void destroyLookupTables(pqServer* server = 0);
211 
216  virtual void destroyPipelineProxies(pqServer* server = 0);
217 
223  virtual void destroyAllProxies(pqServer* server);
224 
234  static QString getFileNamePropertyName(vtkSMProxy*);
235 
239  bool waitingForConnection() const
240  {
241  return this->ForceWaitingForConnection ? true : this->WaitingForConnection;
242  }
243 
250  bool forceWaitingForConnection(bool force);
251 
252 public Q_SLOTS:
256  void abortPendingConnections();
257 
258 Q_SIGNALS:
259 
263  void finishedAddingServer(pqServer* server);
264 
271  void sourceCreated(pqPipelineSource*);
272 
279  void filterCreated(pqPipelineSource*);
280 
287  void readerCreated(pqPipelineSource*, const QString& filename);
288  void readerCreated(pqPipelineSource*, const QStringList& filename);
289 
293  void aboutToCreateView(pqServer* server);
294 
301  void viewCreated(pqView*);
302 
309  void dataRepresentationCreated(pqDataRepresentation*);
310 
317  void proxyCreated(pqProxy*);
318 
325  void proxyCreated(vtkSMProxy*);
326 
334  void destroying(pqView* view);
335 
343  void destroying(pqRepresentation* display);
344 
352  void destroying(pqPipelineSource* source);
353 
361  void destroying(pqProxy* proxy);
362 
363 protected:
367  virtual void destroyProxyInternal(pqProxy* proxy);
368 
369 private:
370  Q_DISABLE_COPY(pqObjectBuilder)
371 
372  bool ForceWaitingForConnection;
373  bool WaitingForConnection;
374 };
375 
376 #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:58
type
pqScalarsToColors is a represents a vtkScalarsToColors proxy.
#define VTK_LEGACY(method)
Definition: vtkLegacy.h:52
pqObjectBuilder is loosely based on the Builder design pattern.
This is PQ representation for a single representation.
This is a PQ abstraction of a generic view module.
Definition: pqView.h:54
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:56
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:152
PQ representation for a vtkSMProxy that can be involved in a pipeline.
pqServerResource encapsulates a resource in ParaView.
pqServer (should be renamed to pqSession) is a pqServerManagerModelItem subclass that represents a vt...
Definition: pqServer.h:64