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 
54 class PQCORE_EXPORT pqView : public pqProxy
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 
99  virtual bool supportsUndo() const { return false; }
100 
106  virtual bool supportsCapture() const { return false; }
107 
111  QString getViewType() const { return this->ViewType; }
112 
113 public Q_SLOTS:
117  virtual void render();
118 
122  virtual void forceRender();
123 
127  void cancelPendingRenders();
128 
133  virtual void undo() {}
134 
139  virtual void redo() {}
140 
146  virtual void resetDisplay() {}
147 
148 public:
152  virtual bool canUndo() const { return false; }
153 
157  virtual bool canRedo() const { return false; }
158 
164  virtual QSize getSize();
165 
169  bool hasRepresentation(pqRepresentation* repr) const;
170 
174  int getNumberOfRepresentations() const;
175 
176  // Returns the number of representations currently visible in the view.
177  int getNumberOfVisibleRepresentations() const;
178  int getNumberOfVisibleDataRepresentations() const;
179 
184  pqRepresentation* getRepresentation(int index) const;
185 
189  QList<pqRepresentation*> getRepresentations() const;
190 
196  bool canDisplay(pqOutputPort* opPort) const;
197 
202  virtual void emitSelectionSignals(bool frustum);
203 
204 Q_SIGNALS:
210  void updateDataEvent();
211 
215  void representationAdded(pqRepresentation*);
216 
220  void representationRemoved(pqRepresentation*);
221 
227  void beginRender();
228 
234  void endRender();
235 
239  void representationVisibilityChanged(pqRepresentation* repr, bool visible);
240 
244  void canUndoChanged(bool);
245 
249  void canRedoChanged(bool);
250 
257  void selected(pqOutputPort* opport);
258 
263  void selectionModeChanged(bool frustum);
264 
269  void picked(pqOutputPort* opport);
270 
275  void beginProgress();
276 
281  void endProgress();
282 
288  void progress(const QString& message, int percent_progress);
289 
298  void multipleSelected(QList<pqOutputPort*> opports);
299 
300 private Q_SLOTS:
304  void onRepresentationsChanged();
305 
309  void onRepresentationVisibilityChanged(bool);
310 
315  void representationCreated(pqRepresentation* repr);
316 
323  void tryRender();
324 
331  void onBeginRender();
332  void onEndRender();
333 
334 protected:
344  pqView(const QString& type, const QString& group, const QString& name, vtkSMViewProxy* view,
345  pqServer* server, QObject* parent = NULL);
346 
353  void initialize() override;
354 
358  virtual QWidget* createWidget() = 0;
359 
360 private:
361  Q_DISABLE_COPY(pqView)
362 
363  pqViewInternal* Internal;
364  QString ViewType;
365 };
366 
367 #endif
pqOutputPort is a server manager model item for an output port of any pqPipelineSource item...
Definition: pqOutputPort.h:58
type
SelectionModifier
Definition: pqView.h:60
virtual void redo()
Called to redo interaction.
Definition: pqView.h:139
Superclass for all view proxies.
virtual bool supportsCapture() const
Returns if this view module can support image capture.
Definition: pqView.h:106
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:152
proxy for a VTK source on a server
virtual void resetDisplay()
Called to reset the view&#39;s display.
Definition: pqView.h:146
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:157
QString getViewType() const
Returns the type of this view module.
Definition: pqView.h:111
virtual void initialize()
PQ representation for a vtkSMProxy that can be involved in a pipeline.
virtual void undo()
Called to undo interaction.
Definition: pqView.h:133
index
virtual bool supportsUndo() const
Returns if this view module can support undo/redo.
Definition: pqView.h:99
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:64