ParaView
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 <QUuid>
37 #include <QWidget>
38 
39 class pqProxy;
40 class pqView;
41 class pqViewFrame;
42 class vtkImageData;
43 class vtkSMProxy;
45 class vtkSMViewProxy;
46 
53 class PQCOMPONENTS_EXPORT pqMultiViewWidget : public QWidget
54 {
55  Q_OBJECT
56  typedef QWidget Superclass;
57 
58 public:
59  pqMultiViewWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);
60  virtual ~pqMultiViewWidget();
61 
66  void setLayoutManager(vtkSMViewLayoutProxy*);
67  vtkSMViewLayoutProxy* layoutManager() const;
68 
72  bool isDecorationsVisible() const { return this->DecorationsVisible; }
73 
78  vtkImageData* captureImage(int width, int height);
79 
84  int prepareForCapture(int width, int height);
85 
89  void cleanupAfterCapture();
90 
94  bool writeImage(const QString& filename, int width, int height, int quality = -1);
95 
99  QList<vtkSMViewProxy*> viewProxies() const;
100 
104  bool isViewAssigned(pqView*) const;
105 
112  bool togglePopout();
113 
114 signals:
118  void frameActivated();
119 
120 public slots:
126  void reload();
127 
134  void assignToFrame(pqView*);
135 
141  void makeFrameActive();
142 
146  void setDecorationsVisible(bool);
147  void showDecorations() { this->setDecorationsVisible(true); }
148  void hideDecorations() { this->setDecorationsVisible(false); }
149 
154  void lockViewSize(const QSize&);
155 
159  void reset();
160 
166  void destroyAllViews();
167 
168 protected slots:
174  void standardButtonPressed(int);
175  void splitterMoved();
176 
181  void makeActive(pqViewFrame* frame);
182 
187  void markActive(pqView* view);
188  void markActive(pqViewFrame* frame);
189 
193  void swapPositions(const QString&);
194 
199  void proxyRemoved(pqProxy*);
200 
205  void viewAdded(pqView*);
206 
207 protected:
214  virtual pqViewFrame* newFrame(vtkSMProxy* view);
215 
220  virtual bool eventFilter(QObject* caller, QEvent* evt);
221 
222 private:
223  QWidget* createWidget(int, vtkSMViewLayoutProxy* layout, QWidget* parentWdg, int& maxIndex);
224 
225 private:
226  Q_DISABLE_COPY(pqMultiViewWidget)
227 
228  class pqInternals;
229  pqInternals* Internals;
230 
231  bool DecorationsVisible;
232 
233  QSize LockViewSize;
234 };
235 
236 #endif
pqMultiViewWidget is a widget that manages layout of multiple views.
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:56
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
bool isDecorationsVisible() const
Returns whether window decorations and splitter handles are visible.