pqMultiViewWidget.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: $RCSfile$
5 
6  Copyright (c) 2005,2006 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 pqMultiViewWidget_h
33 #define pqMultiViewWidget_h
34 
35 #include "pqComponentsModule.h"
36 #include "vtkSetGet.h" // for VTK_LEGACY
37 #include <QWidget>
38 
39 class pqProxy;
40 class pqView;
41 class pqViewFrame;
42 class vtkImageData;
43 class vtkObject;
44 class vtkSMProxy;
46 class vtkSMViewProxy;
47 
57 class PQCOMPONENTS_EXPORT pqMultiViewWidget : public QWidget
58 {
59  Q_OBJECT;
60  typedef QWidget Superclass;
61  Q_PROPERTY(bool decorationsVisibility READ decorationsVisibility WRITE setDecorationsVisibility
62  NOTIFY decorationsVisibilityChanged);
63 
64 public:
65  pqMultiViewWidget(QWidget* parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags{});
66  ~pqMultiViewWidget() override;
67 
72  void setLayoutManager(vtkSMViewLayoutProxy*);
73  vtkSMViewLayoutProxy* layoutManager() const;
74 
78  bool decorationsVisibility() const;
79 
83  QList<vtkSMViewProxy*> viewProxies() const;
84 
88  bool isViewAssigned(pqView*) const;
89 
96  bool togglePopout();
97 
116  QSize preview(const QSize& previewSize = QSize());
117 
121  int activeFrameLocation() const;
122 
126  VTK_LEGACY(bool isDecorationsVisible() const);
127 
131  VTK_LEGACY(void setDecorationsVisible(bool val));
132 
133 Q_SIGNALS:
137  void frameActivated();
138 
143  void decorationsVisibilityChanged(bool visible);
144 
145 public Q_SLOTS:
151  void reload();
152 
158  void makeFrameActive();
159 
161 
164  void setDecorationsVisibility(bool);
165  void showDecorations() { this->setDecorationsVisibility(true); }
166  void hideDecorations() { this->setDecorationsVisibility(false); }
168 
173  void lockViewSize(const QSize&);
174 
178  void reset();
179 
185  void destroyAllViews();
186 
187 protected Q_SLOTS:
193  void standardButtonPressed(int);
194 
199  void makeActive(pqViewFrame* frame);
200 
205  void markActive(pqView* view);
206  void markActive(pqViewFrame* frame);
207 
211  void swapPositions(const QString&);
212 
217  void proxyRemoved(pqProxy*);
218 
223  void viewAdded(pqView*);
224 
226 
231  void resizeEvent(QResizeEvent* evt) override;
233 
234 protected:
241  virtual pqViewFrame* newFrame(vtkSMProxy* view);
242 
247  bool eventFilter(QObject* caller, QEvent* evt) override;
248 
249 private:
250  void layoutPropertyModified(vtkObject*, unsigned long, void*);
251 
252 private:
253  Q_DISABLE_COPY(pqMultiViewWidget)
254 
255  class pqInternals;
256  pqInternals* Internals;
257  friend class pqInternals;
258 };
259 
260 #endif
pqMultiViewWidget is a widget that manages layout of multiple views.
#define PQCOMPONENTS_EXPORT
#define VTK_LEGACY(method)
Definition: vtkLegacy.h:52
pqViewFrame is used to represent a frame for any ParaView view shown in the pqMultiViewWidget.
Definition: pqViewFrame.h:59
Superclass for all view proxies.
This is a PQ abstraction of a generic view module.
Definition: pqView.h:54
void showDecorations()
Set the visibility for frame decorations and splitter handles.
void hideDecorations()
Set the visibility for frame decorations and splitter handles.
vtkSMViewLayoutProxy is used by ParaView to layout multiple views in a 2D KD-Tree layout...
This class represents any registered Server Manager proxy.
Definition: pqProxy.h:56
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:152