ParaView
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 <QMap>
37 #include <QObject>
38 #include <QVariant>
39 
40 class pqAnimationCue;
42 class pqOutputPort;
43 class pqPipelineSource;
44 class pqProxy;
45 class pqRepresentation;
47 class pqScalarsToColors;
48 class pqServer;
49 class pqServerResource;
50 class pqView;
51 class vtkSMProxy;
52 
68 class PQCORE_EXPORT pqObjectBuilder : public QObject
69 {
70  Q_OBJECT
71  typedef QObject Superclass;
72 
73 public:
74  pqObjectBuilder(QObject* parent = 0);
75  virtual ~pqObjectBuilder();
76 
89  pqServer* createServer(const pqServerResource& resource);
90 
94  void removeServer(pqServer* server);
95 
100  pqServer* resetServer(pqServer* server);
101 
107  virtual pqPipelineSource* createSource(
108  const QString& sm_group, const QString& sm_name, pqServer* server);
109 
116  virtual pqPipelineSource* createFilter(const QString& group, const QString& name,
117  QMap<QString, QList<pqOutputPort*> > namedInputs, pqServer* server);
118 
122  virtual pqPipelineSource* createFilter(
123  const QString& group, const QString& name, pqPipelineSource* input, int output_port = 0);
124 
130  virtual pqPipelineSource* createReader(
131  const QString& sm_group, const QString& sm_name, const QStringList& files, pqServer* server);
132 
136  virtual pqView* createView(
137  const QString& type, pqServer* server, bool detachedFromLayout = false);
138 
143  virtual void destroy(pqView* view);
144 
149  virtual pqDataRepresentation* createDataRepresentation(
150  pqOutputPort* source, pqView* view, const QString& representationType = "");
151 
158  virtual vtkSMProxy* createProxy(
159  const QString& sm_group, const QString& sm_name, pqServer* server, const QString& reg_group);
160 
165  virtual void destroy(pqRepresentation* repr);
166 
170  // \li removing all displays belonging to the source,
171  // \li breaking any input connections.
172  // \li unregistering the source.
173  // Note that the source must have no consumers, otherwise,
174  // one cannot delete the source.
175  virtual void destroy(pqPipelineSource* source);
176 
180  virtual void destroy(pqAnimationCue* cue);
181 
186  virtual void destroy(pqProxy* proxy);
187 
191  virtual void destroySources(pqServer* server = 0);
192 
196  virtual void destroyLookupTables(pqServer* server = 0);
197 
202  virtual void destroyPipelineProxies(pqServer* server = 0);
203 
209  virtual void destroyAllProxies(pqServer* server);
210 
220  static QString getFileNamePropertyName(vtkSMProxy*);
221 
225  bool waitingForConnection() const { return this->WaitingForConnection; }
226 
227 public slots:
231  void abortPendingConnections();
232 
233 signals:
234 
238  void finishedAddingServer(pqServer* server);
239 
246  void sourceCreated(pqPipelineSource*);
247 
254  void filterCreated(pqPipelineSource*);
255 
262  void readerCreated(pqPipelineSource*, const QString& filename);
263  void readerCreated(pqPipelineSource*, const QStringList& filename);
264 
268  void aboutToCreateView(pqServer* server);
269 
276  void viewCreated(pqView*);
277 
284  void dataRepresentationCreated(pqDataRepresentation*);
285 
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 WaitingForConnection;
348 };
349 
350 #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:57
pqScalarsToColors is a represents a vtkScalarsToColors proxy.
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:56
bool waitingForConnection() const
Returns true while pqObjectBuilder is in createServer() call.
pqScalarBarRepresentation is created for "ScalarBarWidgetRepresentation" proxies. ...
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