ParaView
pqTabbedMultiViewWidget.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 pqTabbedMultiViewWidget_h
33 #define pqTabbedMultiViewWidget_h
34 
35 #include "pqComponentsModule.h"
36 #include "vtkType.h" // needed for vtkIdType
37 #include <QStyle> // needed for QStyle:StandardPixmap
38 #include <QTabBar> // needed for QTabBar::ButtonPosition
39 #include <QTabWidget> // needed for QTabWidget.
40 
41 class pqMultiViewWidget;
42 class pqProxy;
43 class pqServer;
45 class pqView;
46 class vtkImageData;
48 
55 class PQCOMPONENTS_EXPORT pqTabbedMultiViewWidget : public QWidget
56 {
57  Q_OBJECT
58  typedef QWidget Superclass;
59  Q_PROPERTY(bool readOnly READ readOnly WRITE setReadOnly)
60 public:
61  pqTabbedMultiViewWidget(QWidget* parent = 0);
62  virtual ~pqTabbedMultiViewWidget();
63 
67  virtual QSize clientSize() const;
68 
73  virtual vtkImageData* captureImage(int width, int height);
74 
79  virtual int prepareForCapture(int width, int height);
80 
84  virtual void cleanupAfterCapture();
85 
89  virtual bool writeImage(const QString& filename, int width, int height, int quality = -1);
90 
95  void setReadOnly(bool val);
96  bool readOnly() const;
97 
98 signals:
102  void viewSizeLocked(bool);
103 
104 public slots:
105  virtual void createTab();
106  virtual void createTab(pqServer*);
107  virtual void createTab(vtkSMViewLayoutProxy*);
108  virtual void closeTab(int);
109 
113  virtual void toggleFullScreen();
114 
118  virtual void toggleWidgetDecoration();
119 
124  virtual void lockViewSize(const QSize&);
125 
129  virtual void reset();
130 
131 protected slots:
135  virtual void proxyAdded(pqProxy*);
136  virtual void proxyRemoved(pqProxy*);
137  virtual void serverRemoved(pqServer*);
138 
143  virtual void currentTabChanged(int);
144 
149  virtual void frameActivated();
150 
155  virtual void onStateLoaded();
156 
163  virtual void aboutToCreateView(pqServer*);
164 
168  void contextMenuRequested(const QPoint&);
169 
170  void onLayoutNameChanged(pqServerManagerModelItem*);
171 
172 protected:
173  virtual bool eventFilter(QObject* obj, QEvent* event);
174 
178  virtual void assignToFrame(pqView*, bool warnIfTabCreated);
179 
183  class pqTabWidget : public QTabWidget
184  {
185  typedef QTabWidget Superclass;
186 
187  public:
188  pqTabWidget(QWidget* parentWdg = NULL);
189  virtual ~pqTabWidget();
190 
194  virtual void setTabButton(int index, QTabBar::ButtonPosition position, QWidget* wdg);
195 
201  virtual int tabButtonIndex(QWidget* wdg, QTabBar::ButtonPosition position) const;
202 
208  virtual int addAsTab(pqMultiViewWidget* wdg, pqTabbedMultiViewWidget* self);
209 
214  static const char* popoutLabelText(bool popped_out);
215 
219  static QStyle::StandardPixmap popoutLabelPixmap(bool popped_out);
220 
225  void setReadOnly(bool val);
226  bool readOnly() const { return this->ReadOnly; }
227 
228  private:
229  Q_DISABLE_COPY(pqTabWidget)
230  bool ReadOnly;
232  };
233 
234 private:
235  Q_DISABLE_COPY(pqTabbedMultiViewWidget)
236 
237  class pqInternals;
238  pqInternals* Internals;
239  friend class pqInternals;
240 };
241 
242 #endif
pqMultiViewWidget is a widget that manages layout of multiple views.
pqServerManagerModelItem is a element maintained by pqServerManagerModel.
This is a PQ abstraction of a generic view module.
Definition: pqView.h:56
pqTabbedMultiViewWidget is used to to enable adding of multiple pqMultiViewWidget instances in tabs...
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
Internal class used as the TabWidget.
pqServer (should be renamed to pqSession) is a pqServerManagerModelItem subclass that represents a vt...
Definition: pqServer.h:64