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 
35 
36 #ifndef _pqPipelineSource_h
37 #define _pqPipelineSource_h
38 
39 #include "pqCoreModule.h"
40 #include "pqProxy.h"
41 
43 class pqOutputPort;
44 class pqPipelineSourceInternal;
45 class pqView;
46 class vtkObject;
47 class vtkPVDataInformation;
48 class vtkSMSourceProxy;
49 
55 class PQCORE_EXPORT pqPipelineSource : public pqProxy
56 {
57  Q_OBJECT
58  typedef pqProxy Superclass;
59 public:
60  pqPipelineSource(const QString& name, vtkSMProxy *proxy, pqServer* server,
61  QObject* parent=NULL);
62  virtual ~pqPipelineSource();
63 
66  int getNumberOfOutputPorts() const;
67 
69  pqOutputPort* getOutputPort(int outputport) const;
70 
72  pqOutputPort* getOutputPort(const QString& portName) const;
73 
75  QList<pqOutputPort*> getOutputPorts() const;
76 
78  int getNumberOfConsumers(int outputport) const;
79 
83  { return this->getNumberOfConsumers(0); }
84 
86  pqPipelineSource* getConsumer(int outputport, int index) const;
87 
90  pqPipelineSource *getConsumer(int index) const
91  { return this->getConsumer(0, index); }
92 
94  QList<pqPipelineSource*> getAllConsumers() const;
95 
98  QList<pqDataRepresentation*> getRepresentations(int outputport, pqView* view) const;
99  QList<pqDataRepresentation*> getRepresentations(pqView* view) const
100  { return this->getRepresentations(0, view); }
101 
104  pqDataRepresentation* getRepresentation(int outputport, pqView* view) const;
106  {return this->getRepresentation(0, view); }
107 
110  QList<pqView*> getViews() const;
111 
115  void renderAllViews(bool force=false);
116 
118  void updatePipeline();
119 
122  vtkSMSourceProxy* getSourceProxy();
123 
124 signals:
126  void connectionAdded(pqPipelineSource* source,
127  pqPipelineSource* consumer, int srcOutputPort);
128  void preConnectionAdded(pqPipelineSource* source,
129  pqPipelineSource* consumer, int srcOutputPort);
130 
132  void connectionRemoved(pqPipelineSource* source, pqPipelineSource* consumer,
133  int srcOutputPort);
134  void preConnectionRemoved(pqPipelineSource* source,
135  pqPipelineSource* consumer, int srcOutputPort);
136 
138  void representationAdded(pqPipelineSource* source,
139  pqDataRepresentation* repr, int srcOutputPort);
140 
142  void representationRemoved(pqPipelineSource* source,
143  pqDataRepresentation* repr, int srcOutputPort);
144 
148  void visibilityChanged(pqPipelineSource* source, pqDataRepresentation* repr);
149 
152  void dataUpdated(pqPipelineSource* source);
153 
154 protected slots:
156  void onRepresentationVisibilityChanged();
157 
158 private slots:
161  void prePortConnectionAdded(pqOutputPort* op, pqPipelineSource* cons);
162  void portConnectionAdded(pqOutputPort* op, pqPipelineSource* cons);
163  void prePortConnectionRemoved(pqOutputPort* op, pqPipelineSource* cons);
164  void portConnectionRemoved(pqOutputPort* op, pqPipelineSource* cons);
165  void portRepresentationAdded(pqOutputPort* op, pqDataRepresentation* cons);
166  void portRepresentationRemoved(pqOutputPort* op, pqDataRepresentation* cons);
167  void portVisibilityChanged(pqOutputPort* op, pqDataRepresentation* cons);
168  void dataUpdated();
169 
170 protected:
171  friend class pqPipelineFilter;
172 
174  void removeConsumer(int outputport, pqPipelineSource *);
175  void addConsumer(int outputport, pqPipelineSource*);
176 
177 private:
178  pqPipelineSourceInternal *Internal;
179 };
180 
181 #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:55
int getNumberOfConsumers() const
Get the number of consumers connected to output port 0.
void addConsumer(int outputport, pqPipelineSource *)
This is a PQ abstraction of a generic view module.
Definition: pqView.h:55
pqPipelineSource * getConsumer(int index) const
Get consumer at a particular index on output port 0.
pqDataRepresentation * getRepresentation(pqView *view) const
void removeConsumer(int outputport, pqPipelineSource *)
called by pqPipelineFilter when the connections change.
This class represents any registered Server Manager proxy.
Definition: pqProxy.h:52
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:62