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)
87  virtual void render();
88 
92  virtual void forceRender();
93 
97  void cancelPendingRenders();
98 
103  virtual void undo() {}
104 
109  virtual void redo() {}
110 
116  virtual void resetDisplay(bool closest = false) { (void)closest; }
117 
118 public: // NOLINT(readability-redundant-access-specifiers)
122  virtual bool canUndo() const { return false; }
123 
127  virtual bool canRedo() const { return false; }
128 
134  virtual QSize getSize();
135 
139  bool hasRepresentation(pqRepresentation* repr) const;
140 
144  int getNumberOfRepresentations() const;
145 
146  // Returns the number of representations currently visible in the view.
147  int getNumberOfVisibleRepresentations() const;
148  int getNumberOfVisibleDataRepresentations() const;
149 
154  pqRepresentation* getRepresentation(int index) const;
155 
159  QList<pqRepresentation*> getRepresentations() const;
160 
166  bool canDisplay(pqOutputPort* opPort) const;
167 
168 Q_SIGNALS:
174  void updateDataEvent();
175 
179  void representationAdded(pqRepresentation*);
180 
184  void representationRemoved(pqRepresentation*);
185 
191  void beginRender();
192 
198  void endRender();
199 
203  void representationVisibilityChanged(pqRepresentation* repr, bool visible);
204 
208  void canUndoChanged(bool);
209 
213  void canRedoChanged(bool);
214 
221  void selected(pqOutputPort* opport);
222 
227  void picked(pqOutputPort* opport);
228 
233  void beginProgress();
234 
239  void endProgress();
240 
246  void progress(const QString& message, int percent_progress);
247 
256  void multipleSelected(QList<pqOutputPort*> opports);
257 
258 private Q_SLOTS:
262  void onRepresentationsChanged();
263 
267  void onRepresentationVisibilityChanged(bool);
268 
273  void representationCreated(pqRepresentation* repr);
274 
281  void tryRender();
282 
289  void onBeginRender();
290  void onEndRender();
291 
292 protected:
302  pqView(const QString& type, const QString& group, const QString& name, vtkSMViewProxy* view,
303  pqServer* server, QObject* parent = nullptr);
304 
311  void initialize() override;
312 
316  virtual QWidget* createWidget() = 0;
317 
318 private:
319  Q_DISABLE_COPY(pqView)
320 
321  pqViewInternal* Internal;
322  QString ViewType;
323 };
324 
325 #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:109
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:122
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:127
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:116
virtual void undo()
Called to undo interaction.
Definition: pqView.h:103
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