pqPipelineSource.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-FileCopyrightText: Copyright (c) Sandia Corporation
3 // SPDX-License-Identifier: BSD-3-Clause
4 
10 #ifndef pqPipelineSource_h
11 #define pqPipelineSource_h
12 
13 #include "pqCoreModule.h"
14 #include "pqProxy.h"
15 
17 class pqOutputPort;
18 class pqPipelineSourceInternal;
19 class pqView;
20 class vtkCommand;
21 class vtkObject;
23 class vtkSMSourceProxy;
24 
33 {
34  Q_OBJECT
35  typedef pqProxy Superclass;
36 
37 public:
39  const QString& name, vtkSMProxy* proxy, pqServer* server, QObject* parent = nullptr);
40  ~pqPipelineSource() override;
41 
46  int getNumberOfOutputPorts() const;
47 
51  pqOutputPort* getOutputPort(int outputport) const;
52 
56  pqOutputPort* getOutputPort(const QString& portName) const;
57 
61  QList<pqOutputPort*> getOutputPorts() const;
62 
66  int getNumberOfConsumers(int outputport) const;
67 
72  int getNumberOfConsumers() const { return this->getNumberOfConsumers(0); }
73 
77  pqPipelineSource* getConsumer(int outputport, int index) const;
78 
83  pqPipelineSource* getConsumer(int index) const { return this->getConsumer(0, index); }
84 
88  QList<pqPipelineSource*> getAllConsumers() const;
89 
94  QList<pqDataRepresentation*> getRepresentations(int outputport, pqView* view) const;
95  QList<pqDataRepresentation*> getRepresentations(pqView* view) const
96  {
97  return this->getRepresentations(0, view);
98  }
99 
104  pqDataRepresentation* getRepresentation(int outputport, pqView* view) const;
106  {
107  return this->getRepresentation(0, view);
108  }
109 
114  QList<pqView*> getViews() const;
115 
121  void renderAllViews(bool force = false);
122 
126  void updatePipeline();
127 
132  vtkSMSourceProxy* getSourceProxy();
133 
134 Q_SIGNALS:
138  void connectionAdded(pqPipelineSource* source, pqPipelineSource* consumer, int srcOutputPort);
139  void preConnectionAdded(pqPipelineSource* source, pqPipelineSource* consumer, int srcOutputPort);
140 
144  void connectionRemoved(pqPipelineSource* source, pqPipelineSource* consumer, int srcOutputPort);
145  void preConnectionRemoved(
146  pqPipelineSource* source, pqPipelineSource* consumer, int srcOutputPort);
147 
151  void representationAdded(pqPipelineSource* source, pqDataRepresentation* repr, int srcOutputPort);
152 
156  void representationRemoved(
157  pqPipelineSource* source, pqDataRepresentation* repr, int srcOutputPort);
158 
164  void visibilityChanged(pqPipelineSource* source, pqDataRepresentation* repr);
165 
170  void dataUpdated(pqPipelineSource* source);
171 
175  void selectionChanged(pqOutputPort* port);
176 
177 protected Q_SLOTS:
181  void onRepresentationVisibilityChanged();
182 
183 private Q_SLOTS:
188  void prePortConnectionAdded(pqOutputPort* op, pqPipelineSource* cons);
189  void portConnectionAdded(pqOutputPort* op, pqPipelineSource* cons);
190  void prePortConnectionRemoved(pqOutputPort* op, pqPipelineSource* cons);
191  void portConnectionRemoved(pqOutputPort* op, pqPipelineSource* cons);
192  void portRepresentationAdded(pqOutputPort* op, pqDataRepresentation* cons);
193  void portRepresentationRemoved(pqOutputPort* op, pqDataRepresentation* cons);
194  void portVisibilityChanged(pqOutputPort* op, pqDataRepresentation* cons);
195  void dataUpdated();
196 
197  void onSelectionChanged(
198  vtkObject*, unsigned long, void* client_data, void* call_data, vtkCommand*);
199 
200 protected:
201  friend class pqPipelineFilter;
202 
206  void removeConsumer(int outputport, pqPipelineSource*);
207  void addConsumer(int outputport, pqPipelineSource*);
208 
209 private:
210  pqPipelineSourceInternal* Internal;
211 };
212 
213 #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:29
int getNumberOfConsumers() const
Get the number of consumers connected to output port 0.
provides meta data about a vtkDataObject subclass.
void addConsumer(int outputport, pqPipelineSource *)
This is a PQ abstraction of a generic view module.
Definition: pqView.h:26
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
#define PQCORE_EXPORT
Definition: pqCoreModule.h:15
void removeConsumer(int outputport, pqPipelineSource *)
called by pqPipelineFilter when the connections change.
source
This class represents any registered Server Manager proxy.
Definition: pqProxy.h:28
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:140
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:35