pqView.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 #ifndef pqView_h
5 #define pqView_h
6 
7 #include "pqProxy.h"
8 #include <QSize> // needed for QSize.
9 
10 class pqOutputPort;
11 class pqPipelineSource;
12 class pqRepresentation;
13 class pqServer;
14 class pqUndoStack;
15 class pqViewInternal;
16 class QWidget;
17 class vtkSMSourceProxy;
18 class vtkSMViewProxy;
19 class vtkView;
20 
27 {
28  Q_OBJECT
29  typedef pqProxy Superclass;
30 
31 public:
33  {
34  PV_SELECTION_DEFAULT = 0,
37  PV_SELECTION_TOGGLE
38  };
39 
40  ~pqView() override;
41 
45  vtkSMViewProxy* getViewProxy() const;
46 
51  virtual vtkView* getClientSideView() const;
52 
62  QWidget* widget();
63 
70  virtual bool supportsUndo() const { return false; }
71 
76  virtual bool supportsCapture() const { return false; }
77 
81  QString getViewType() const { return this->ViewType; }
82 
83 public Q_SLOTS: // NOLINT(readability-redundant-access-specifiers)
88  virtual void render();
89 
93  virtual void forceRender();
94 
98  void cancelPendingRenders();
99 
104  virtual void undo() {}
105 
110  virtual void redo() {}
111 
117  virtual void resetDisplay(bool closest = false) { (void)closest; }
118 
119 public: // NOLINT(readability-redundant-access-specifiers)
123  virtual bool canUndo() const { return false; }
124 
128  virtual bool canRedo() const { return false; }
129 
135  virtual QSize getSize();
136 
140  bool hasRepresentation(pqRepresentation* repr) const;
141 
145  int getNumberOfRepresentations() const;
146 
147  // Returns the number of representations currently visible in the view.
148  int getNumberOfVisibleRepresentations() const;
149  int getNumberOfVisibleDataRepresentations() const;
150 
155  pqRepresentation* getRepresentation(int index) const;
156 
160  QList<pqRepresentation*> getRepresentations() const;
161 
167  bool canDisplay(pqOutputPort* opPort) const;
168 
169 Q_SIGNALS:
175  void updateDataEvent();
176 
180  void representationAdded(pqRepresentation*);
181 
185  void representationRemoved(pqRepresentation*);
186 
192  void beginRender();
193 
199  void endRender();
200 
204  void representationVisibilityChanged(pqRepresentation* repr, bool visible);
205 
209  void canUndoChanged(bool);
210 
214  void canRedoChanged(bool);
215 
222  void selected(pqOutputPort* opport);
223 
228  void picked(pqOutputPort* opport);
229 
234  void beginProgress();
235 
240  void endProgress();
241 
247  void progress(const QString& message, int percent_progress);
248 
257  void multipleSelected(QList<pqOutputPort*> opports);
258 
259 private Q_SLOTS:
263  void onRepresentationsChanged();
264 
268  void onRepresentationVisibilityChanged(bool);
269 
274  void representationCreated(pqRepresentation* repr);
275 
282  void tryRender();
283 
290  void onBeginRender();
291  void onEndRender();
292 
293 protected:
303  pqView(const QString& type, const QString& group, const QString& name, vtkSMViewProxy* view,
304  pqServer* server, QObject* parent = nullptr);
305 
312  void initialize() override;
313 
317  virtual QWidget* createWidget() = 0;
318 
319 private:
320  Q_DISABLE_COPY(pqView)
321 
322  pqViewInternal* Internal;
323  QString ViewType;
324 };
325 
326 #endif
pqOutputPort is a server manager model item for an output port of any pqPipelineSource item...
Definition: pqOutputPort.h:29
type
SelectionModifier
Definition: pqView.h:32
virtual void redo()
Called to redo interaction.
Definition: pqView.h:110
Superclass for all view proxies.
virtual bool supportsCapture() const
Returns if this view module can support image capture.
Definition: pqView.h:76
This is PQ representation for a single representation.
progress
This is a PQ abstraction of a generic view module.
Definition: pqView.h:26
name
virtual bool canUndo() const
Returns true if undo can be done.
Definition: pqView.h:123
proxy for a VTK source on a server
#define PQCORE_EXPORT
Definition: pqCoreModule.h:15
This class represents any registered Server Manager proxy.
Definition: pqProxy.h:28
virtual bool canRedo() const
Returns true if redo can be done.
Definition: pqView.h:128
QString getViewType() const
Returns the type of this view module.
Definition: pqView.h:81
virtual void initialize()
PQ representation for a vtkSMProxy that can be involved in a pipeline.
virtual void resetDisplay(bool closest=false)
Called to reset the view&#39;s display.
Definition: pqView.h:117
virtual void undo()
Called to undo interaction.
Definition: pqView.h:104
index
virtual bool supportsUndo() const
Returns if this view module can support undo/redo.
Definition: pqView.h:70
pqUndoStack represents a vtkSMUndoStack along with a a vtkSMUndoStackBuilder.
Definition: pqUndoStack.h:28
pqServer (should be renamed to pqSession) is a pqServerManagerModelItem subclass that represents a vt...
Definition: pqServer.h:35