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;
47 class vtkSMViewLayoutProxy;
48 
53 class PQCOMPONENTS_EXPORT pqTabbedMultiViewWidget : public QWidget
54 {
55  Q_OBJECT
56  typedef QWidget Superclass;
57  Q_PROPERTY(bool readOnly READ readOnly WRITE setReadOnly)
58 public:
59  pqTabbedMultiViewWidget(QWidget* parent=0);
60  virtual ~pqTabbedMultiViewWidget();
61 
63  virtual QSize clientSize() const;
64 
67  virtual vtkImageData* captureImage(int width, int height);
68 
71  virtual int prepareForCapture(int width, int height);
72 
74  virtual void cleanupAfterCapture();
75 
77  virtual bool writeImage(const QString& filename, int width, int height, int quality=-1);
78 
81  void setReadOnly(bool val);
82  bool readOnly() const;
83 
84 signals:
86  void viewSizeLocked(bool);
87 
88 public slots:
89  virtual void createTab();
90  virtual void createTab(pqServer*);
91  virtual void createTab(vtkSMViewLayoutProxy*);
92  virtual void closeTab(int);
93 
95  virtual void toggleFullScreen();
96 
98  virtual void toggleWidgetDecoration();
99 
102  virtual void lockViewSize(const QSize&);
103 
105  virtual void reset();
106 
107 protected slots:
109  virtual void proxyAdded(pqProxy*);
110  virtual void proxyRemoved(pqProxy*);
111  virtual void serverRemoved(pqServer*);
112 
115  virtual void currentTabChanged(int);
116 
119  virtual void frameActivated();
120 
123  virtual void onStateLoaded();
124 
129  virtual void aboutToCreateView(pqServer*);
130 
132  void contextMenuRequested(const QPoint&);
133 
134  void onLayoutNameChanged(pqServerManagerModelItem*);
135 
136 protected:
137  virtual bool eventFilter(QObject *obj, QEvent *event);
138 
140  virtual void assignToFrame(pqView*, bool warnIfTabCreated);
141 
143  class pqTabWidget : public QTabWidget
144  {
145  typedef QTabWidget Superclass;
146  public:
147  pqTabWidget(QWidget* parentWdg = NULL);
148  virtual ~pqTabWidget();
149 
151  virtual void setTabButton(int index, QTabBar::ButtonPosition position, QWidget* wdg);
152 
156  virtual int tabButtonIndex(QWidget* wdg, QTabBar::ButtonPosition position) const;
157 
161  virtual int addAsTab(pqMultiViewWidget* wdg, pqTabbedMultiViewWidget* self);
162 
165  static const char* popoutLabelText(bool popped_out);
166 
168  static QStyle::StandardPixmap popoutLabelPixmap(bool popped_out);
169 
172  void setReadOnly(bool val);
173  bool readOnly() const
174  { return this->ReadOnly;}
175 
176  private:
177  Q_DISABLE_COPY(pqTabWidget)
178  bool ReadOnly;
180  };
181 
182 private:
183  Q_DISABLE_COPY(pqTabbedMultiViewWidget)
184 
185  class pqInternals;
186  pqInternals* Internals;
187  friend class pqInternals;
188 };
189 
190 #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:55
pqTabbedMultiViewWidget is used to to enable adding of multiple pqMultiViewWidget instances in tabs...
This class represents any registered Server Manager proxy.
Definition: pqProxy.h:52
Internal class used as the TabWidget.
pqServer (should be renamed to pqSession) is a pqServerManagerModelItem subclass that represents a vt...
Definition: pqServer.h:62