pqView.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: pqView.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 #ifndef pqView_h
33 #define pqView_h
34 
35 #include "pqProxy.h"
36 #include <QSize> // needed for QSize.
37 
38 class pqOutputPort;
39 class pqPipelineSource;
40 class pqRepresentation;
41 class pqServer;
42 class pqUndoStack;
43 class pqViewInternal;
44 class QWidget;
45 class vtkSMSourceProxy;
46 class vtkSMViewProxy;
47 class vtkView;
48 
55 {
56  Q_OBJECT
57  typedef pqProxy Superclass;
58 
59 public:
61  {
62  PV_SELECTION_DEFAULT = 0,
65  PV_SELECTION_TOGGLE
66  };
67 
68  ~pqView() override;
69 
73  vtkSMViewProxy* getViewProxy() const;
74 
79  virtual vtkView* getClientSideView() const;
80 
90  QWidget* widget();
91 
98  virtual bool supportsUndo() const { return false; }
99 
104  virtual bool supportsCapture() const { return false; }
105 
109  QString getViewType() const { return this->ViewType; }
110 
111 public Q_SLOTS: // NOLINT(readability-redundant-access-specifiers)
115  virtual void render();
116 
120  virtual void forceRender();
121 
125  void cancelPendingRenders();
126 
131  virtual void undo() {}
132 
137  virtual void redo() {}
138 
144  virtual void resetDisplay(bool closest = false) { (void)closest; }
145 
146 public: // NOLINT(readability-redundant-access-specifiers)
150  virtual bool canUndo() const { return false; }
151 
155  virtual bool canRedo() const { return false; }
156 
162  virtual QSize getSize();
163 
167  bool hasRepresentation(pqRepresentation* repr) const;
168 
172  int getNumberOfRepresentations() const;
173 
174  // Returns the number of representations currently visible in the view.
175  int getNumberOfVisibleRepresentations() const;
176  int getNumberOfVisibleDataRepresentations() const;
177 
182  pqRepresentation* getRepresentation(int index) const;
183 
187  QList<pqRepresentation*> getRepresentations() const;
188 
194  bool canDisplay(pqOutputPort* opPort) const;
195 
196 Q_SIGNALS:
202  void updateDataEvent();
203 
207  void representationAdded(pqRepresentation*);
208 
212  void representationRemoved(pqRepresentation*);
213 
219  void beginRender();
220 
226  void endRender();
227 
231  void representationVisibilityChanged(pqRepresentation* repr, bool visible);
232 
236  void canUndoChanged(bool);
237 
241  void canRedoChanged(bool);
242 
249  void selected(pqOutputPort* opport);
250 
255  void picked(pqOutputPort* opport);
256 
261  void beginProgress();
262 
267  void endProgress();
268 
274  void progress(const QString& message, int percent_progress);
275 
284  void multipleSelected(QList<pqOutputPort*> opports);
285 
286 private Q_SLOTS:
290  void onRepresentationsChanged();
291 
295  void onRepresentationVisibilityChanged(bool);
296 
301  void representationCreated(pqRepresentation* repr);
302 
309  void tryRender();
310 
317  void onBeginRender();
318  void onEndRender();
319 
320 protected:
330  pqView(const QString& type, const QString& group, const QString& name, vtkSMViewProxy* view,
331  pqServer* server, QObject* parent = nullptr);
332 
339  void initialize() override;
340 
344  virtual QWidget* createWidget() = 0;
345 
346 private:
347  Q_DISABLE_COPY(pqView)
348 
349  pqViewInternal* Internal;
350  QString ViewType;
351 };
352 
353 #endif
pqOutputPort is a server manager model item for an output port of any pqPipelineSource item...
Definition: pqOutputPort.h:57
type
SelectionModifier
Definition: pqView.h:60
virtual void redo()
Called to redo interaction.
Definition: pqView.h:137
Superclass for all view proxies.
virtual bool supportsCapture() const
Returns if this view module can support image capture.
Definition: pqView.h:104
This is PQ representation for a single representation.
progress
This is a PQ abstraction of a generic view module.
Definition: pqView.h:54
name
virtual bool canUndo() const
Returns true if undo can be done.
Definition: pqView.h:150
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:56
virtual bool canRedo() const
Returns true if redo can be done.
Definition: pqView.h:155
QString getViewType() const
Returns the type of this view module.
Definition: pqView.h:109
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:144
virtual void undo()
Called to undo interaction.
Definition: pqView.h:131
index
virtual bool supportsUndo() const
Returns if this view module can support undo/redo.
Definition: pqView.h:98
pqUndoStack represents a vtkSMUndoStack along with a a vtkSMUndoStackBuilder.
Definition: pqUndoStack.h:56
pqServer (should be renamed to pqSession) is a pqServerManagerModelItem subclass that represents a vt...
Definition: pqServer.h:63