ParaView
pqPipelineSource.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: pqPipelineSource.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 
38 #ifndef _pqPipelineSource_h
39 #define _pqPipelineSource_h
40 
41 #include "pqCoreModule.h"
42 #include "pqProxy.h"
43 
45 class pqOutputPort;
46 class pqPipelineSourceInternal;
47 class pqView;
48 class vtkObject;
50 class vtkSMSourceProxy;
51 
59 class PQCORE_EXPORT pqPipelineSource : public pqProxy
60 {
61  Q_OBJECT
62  typedef pqProxy Superclass;
63 
64 public:
66  const QString& name, vtkSMProxy* proxy, pqServer* server, QObject* parent = NULL);
67  virtual ~pqPipelineSource();
68 
73  int getNumberOfOutputPorts() const;
74 
78  pqOutputPort* getOutputPort(int outputport) const;
79 
83  pqOutputPort* getOutputPort(const QString& portName) const;
84 
88  QList<pqOutputPort*> getOutputPorts() const;
89 
93  int getNumberOfConsumers(int outputport) const;
94 
99  int getNumberOfConsumers() const { return this->getNumberOfConsumers(0); }
100 
104  pqPipelineSource* getConsumer(int outputport, int index) const;
105 
110  pqPipelineSource* getConsumer(int index) const { return this->getConsumer(0, index); }
111 
115  QList<pqPipelineSource*> getAllConsumers() const;
116 
121  QList<pqDataRepresentation*> getRepresentations(int outputport, pqView* view) const;
122  QList<pqDataRepresentation*> getRepresentations(pqView* view) const
123  {
124  return this->getRepresentations(0, view);
125  }
126 
131  pqDataRepresentation* getRepresentation(int outputport, pqView* view) const;
133  {
134  return this->getRepresentation(0, view);
135  }
136 
141  QList<pqView*> getViews() const;
142 
148  void renderAllViews(bool force = false);
149 
153  void updatePipeline();
154 
159  vtkSMSourceProxy* getSourceProxy();
160 
161 signals:
165  void connectionAdded(pqPipelineSource* source, pqPipelineSource* consumer, int srcOutputPort);
166  void preConnectionAdded(pqPipelineSource* source, pqPipelineSource* consumer, int srcOutputPort);
167 
171  void connectionRemoved(pqPipelineSource* source, pqPipelineSource* consumer, int srcOutputPort);
172  void preConnectionRemoved(
173  pqPipelineSource* source, pqPipelineSource* consumer, int srcOutputPort);
174 
178  void representationAdded(pqPipelineSource* source, pqDataRepresentation* repr, int srcOutputPort);
179 
183  void representationRemoved(
184  pqPipelineSource* source, pqDataRepresentation* repr, int srcOutputPort);
185 
191  void visibilityChanged(pqPipelineSource* source, pqDataRepresentation* repr);
192 
197  void dataUpdated(pqPipelineSource* source);
198 
199 protected slots:
203  void onRepresentationVisibilityChanged();
204 
205 private slots:
210  void prePortConnectionAdded(pqOutputPort* op, pqPipelineSource* cons);
211  void portConnectionAdded(pqOutputPort* op, pqPipelineSource* cons);
212  void prePortConnectionRemoved(pqOutputPort* op, pqPipelineSource* cons);
213  void portConnectionRemoved(pqOutputPort* op, pqPipelineSource* cons);
214  void portRepresentationAdded(pqOutputPort* op, pqDataRepresentation* cons);
215  void portRepresentationRemoved(pqOutputPort* op, pqDataRepresentation* cons);
216  void portVisibilityChanged(pqOutputPort* op, pqDataRepresentation* cons);
217  void dataUpdated();
218 
219 protected:
220  friend class pqPipelineFilter;
221 
225  void removeConsumer(int outputport, pqPipelineSource*);
226  void addConsumer(int outputport, pqPipelineSource*);
227 
228 private:
229  pqPipelineSourceInternal* Internal;
230 };
231 
232 #endif
pqDataRepresentation is the superclass for a display for a pqPipelineSource i.e.
QList< pqDataRepresentation * > getRepresentations(pqView *view) const
pqOutputPort is a server manager model item for an output port of any pqPipelineSource item...
Definition: pqOutputPort.h:57
int getNumberOfConsumers() const
Get the number of consumers connected to output port 0.
Light object for holding data information.
void addConsumer(int outputport, pqPipelineSource *)
This is a PQ abstraction of a generic view module.
Definition: pqView.h:56
pqPipelineSource * getConsumer(int index) const
Get consumer at a particular index on output port 0.
pqDataRepresentation * getRepresentation(pqView *view) const
proxy for a VTK source on a server
void removeConsumer(int outputport, pqPipelineSource *)
called by pqPipelineFilter when the connections change.
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.
pqServer (should be renamed to pqSession) is a pqServerManagerModelItem subclass that represents a vt...
Definition: pqServer.h:64