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 vtkCommand;
49 class vtkObject;
51 class vtkSMSourceProxy;
52 
60 class PQCORE_EXPORT pqPipelineSource : public pqProxy
61 {
62  Q_OBJECT
63  typedef pqProxy Superclass;
64 
65 public:
67  const QString& name, vtkSMProxy* proxy, pqServer* server, QObject* parent = NULL);
68  ~pqPipelineSource() override;
69 
74  int getNumberOfOutputPorts() const;
75 
79  pqOutputPort* getOutputPort(int outputport) const;
80 
84  pqOutputPort* getOutputPort(const QString& portName) const;
85 
89  QList<pqOutputPort*> getOutputPorts() const;
90 
94  int getNumberOfConsumers(int outputport) const;
95 
100  int getNumberOfConsumers() const { return this->getNumberOfConsumers(0); }
101 
105  pqPipelineSource* getConsumer(int outputport, int index) const;
106 
111  pqPipelineSource* getConsumer(int index) const { return this->getConsumer(0, index); }
112 
116  QList<pqPipelineSource*> getAllConsumers() const;
117 
122  QList<pqDataRepresentation*> getRepresentations(int outputport, pqView* view) const;
123  QList<pqDataRepresentation*> getRepresentations(pqView* view) const
124  {
125  return this->getRepresentations(0, view);
126  }
127 
132  pqDataRepresentation* getRepresentation(int outputport, pqView* view) const;
134  {
135  return this->getRepresentation(0, view);
136  }
137 
142  QList<pqView*> getViews() const;
143 
149  void renderAllViews(bool force = false);
150 
154  void updatePipeline();
155 
160  vtkSMSourceProxy* getSourceProxy();
161 
162 Q_SIGNALS:
166  void connectionAdded(pqPipelineSource* source, pqPipelineSource* consumer, int srcOutputPort);
167  void preConnectionAdded(pqPipelineSource* source, pqPipelineSource* consumer, int srcOutputPort);
168 
172  void connectionRemoved(pqPipelineSource* source, pqPipelineSource* consumer, int srcOutputPort);
173  void preConnectionRemoved(
174  pqPipelineSource* source, pqPipelineSource* consumer, int srcOutputPort);
175 
179  void representationAdded(pqPipelineSource* source, pqDataRepresentation* repr, int srcOutputPort);
180 
184  void representationRemoved(
185  pqPipelineSource* source, pqDataRepresentation* repr, int srcOutputPort);
186 
192  void visibilityChanged(pqPipelineSource* source, pqDataRepresentation* repr);
193 
198  void dataUpdated(pqPipelineSource* source);
199 
203  void selectionChanged(pqOutputPort* port);
204 
205 protected Q_SLOTS:
209  void onRepresentationVisibilityChanged();
210 
211 private Q_SLOTS:
216  void prePortConnectionAdded(pqOutputPort* op, pqPipelineSource* cons);
217  void portConnectionAdded(pqOutputPort* op, pqPipelineSource* cons);
218  void prePortConnectionRemoved(pqOutputPort* op, pqPipelineSource* cons);
219  void portConnectionRemoved(pqOutputPort* op, pqPipelineSource* cons);
220  void portRepresentationAdded(pqOutputPort* op, pqDataRepresentation* cons);
221  void portRepresentationRemoved(pqOutputPort* op, pqDataRepresentation* cons);
222  void portVisibilityChanged(pqOutputPort* op, pqDataRepresentation* cons);
223  void dataUpdated();
224 
225  void onSelectionChanged(
226  vtkObject*, unsigned long, void* client_data, void* call_data, vtkCommand*);
227 
228 protected:
229  friend class pqPipelineFilter;
230 
234  void removeConsumer(int outputport, pqPipelineSource*);
235  void addConsumer(int outputport, pqPipelineSource*);
236 
237 private:
238  pqPipelineSourceInternal* Internal;
239 };
240 
241 #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:58
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:54
name
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.
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.
port
index
pqServer (should be renamed to pqSession) is a pqServerManagerModelItem subclass that represents a vt...
Definition: pqServer.h:64