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;
44 class vtkSMViewLayoutProxy;
45 class vtkSMViewProxy;
46 
51 class PQCOMPONENTS_EXPORT pqMultiViewWidget : public QWidget
52 {
53  Q_OBJECT
54  typedef QWidget Superclass;
55 public:
56  pqMultiViewWidget(QWidget * parent=0, Qt::WindowFlags f=0);
57  virtual ~pqMultiViewWidget();
58 
61  void setLayoutManager(vtkSMViewLayoutProxy*);
62  vtkSMViewLayoutProxy* layoutManager() const;
63 
65  bool isDecorationsVisible() const
66  { return this->DecorationsVisible; }
67 
70  vtkImageData* captureImage(int width, int height);
71 
74  int prepareForCapture(int width, int height);
75 
77  void cleanupAfterCapture();
78 
80  bool writeImage(const QString& filename, int width, int height, int quality=-1);
81 
83  QList<vtkSMViewProxy*> viewProxies() const;
84 
86  bool isViewAssigned(pqView*) const;
87 
92  bool togglePopout();
93 
94 signals:
96  void frameActivated();
97 
98 public slots:
102  void reload();
103 
108  void assignToFrame(pqView*);
109 
113  void makeFrameActive();
114 
116  void setDecorationsVisible(bool);
117  void showDecorations() { this->setDecorationsVisible(true); }
118  void hideDecorations() { this->setDecorationsVisible(false); }
119 
122  void lockViewSize(const QSize&);
123 
125  void reset();
126 
130  void destroyAllViews();
131 
132 protected slots:
136  void standardButtonPressed(int);
137  void splitterMoved();
138 
141  void makeActive(pqViewFrame* frame);
142 
145  void markActive(pqView* view);
146  void markActive(pqViewFrame* frame);
147 
149  void swapPositions(const QString&);
150 
153  void proxyRemoved(pqProxy*);
154 
157  void viewAdded(pqView*);
158 
159 protected:
164  virtual pqViewFrame* newFrame(vtkSMProxy* view);
165 
168  virtual bool eventFilter(QObject* caller, QEvent* evt);
169 
170 private:
171  QWidget* createWidget(int, vtkSMViewLayoutProxy* layout, QWidget* parentWdg,
172  int& maxIndex);
173 
174 private:
175  Q_DISABLE_COPY(pqMultiViewWidget)
176 
177  class pqInternals;
178  pqInternals* Internals;
179 
180  bool DecorationsVisible;
181 
182  QSize LockViewSize;
183 };
184 
185 #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:57
This is a PQ abstraction of a generic view module.
Definition: pqView.h:55
This class represents any registered Server Manager proxy.
Definition: pqProxy.h:52
bool isDecorationsVisible() const
Returns whether window decorations and splitter handles are visible.