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 
66 class PQCORE_EXPORT pqObjectBuilder : public QObject
67 {
68  Q_OBJECT
69  typedef QObject Superclass;
70 
71 public:
72  pqObjectBuilder(QObject* parent=0);
73  virtual ~pqObjectBuilder();
74 
85  pqServer* createServer(const pqServerResource& resource);
86 
88  void removeServer(pqServer *server);
89 
92  pqServer* resetServer(pqServer* server);
93 
97  virtual pqPipelineSource* createSource(const QString& sm_group,
98  const QString& sm_name, pqServer* server);
99 
104  virtual pqPipelineSource* createFilter(
105  const QString& group, const QString& name,
106  QMap<QString, QList<pqOutputPort*> > namedInputs, pqServer* server);
107 
109  virtual pqPipelineSource* createFilter(
110  const QString& group, const QString& name,
111  pqPipelineSource* input, int output_port = 0);
112 
116  virtual pqPipelineSource* createReader(const QString& sm_group,
117  const QString& sm_name, const QStringList& files, pqServer* server);
118 
120  virtual pqView* createView(const QString& type,
121  pqServer* server, bool detachedFromLayout = false);
122 
125  virtual void destroy(pqView* view);
126 
129  virtual pqDataRepresentation* createDataRepresentation(
130  pqOutputPort* source, pqView* view, const QString &representationType="");
131 
136  virtual vtkSMProxy* createProxy(const QString& sm_group,
137  const QString& sm_name, pqServer* server,
138  const QString& reg_group);
139 
142  virtual void destroy(pqRepresentation* repr);
143 
145  // \li removing all displays belonging to the source,
146  // \li breaking any input connections.
147  // \li unregistering the source.
148  // Note that the source must have no consumers, otherwise,
149  // one cannot delete the source.
150  virtual void destroy(pqPipelineSource* source);
151 
153  virtual void destroy(pqAnimationCue* cue);
154 
157  virtual void destroy(pqProxy* proxy);
158 
160  virtual void destroySources(pqServer* server=0);
161 
163  virtual void destroyLookupTables(pqServer* server=0);
164 
167  virtual void destroyPipelineProxies(pqServer* server=0);
168 
172  virtual void destroyAllProxies(pqServer* server);
173 
181  static QString getFileNamePropertyName(vtkSMProxy*);
182 
184  bool waitingForConnection() const
185  { return this->WaitingForConnection; }
186 
187 public slots:
189  void abortPendingConnections();
190 
191 signals:
192 
194  void finishedAddingServer(pqServer *server);
195 
200  void sourceCreated(pqPipelineSource*);
201 
206  void filterCreated(pqPipelineSource*);
207 
212  void readerCreated(pqPipelineSource*, const QString& filename);
213  void readerCreated(pqPipelineSource*, const QStringList& filename);
214 
216  void aboutToCreateView(pqServer* server);
217 
222  void viewCreated(pqView*);
223 
228  void dataRepresentationCreated(pqDataRepresentation*);
229 
234  void proxyCreated(pqProxy*);
235 
240  void proxyCreated(vtkSMProxy*);
241 
247  void destroying(pqView* view);
248 
254  void destroying(pqRepresentation* display);
255 
261  void destroying(pqPipelineSource* source);
262 
268  void destroying(pqProxy* proxy);
269 
270 protected:
272  virtual void destroyProxyInternal(pqProxy* proxy);
273 
274 private:
275  Q_DISABLE_COPY(pqObjectBuilder)
276 
277  bool WaitingForConnection;
278 
279 };
280 
281 #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:55
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:55
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:52
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:62