ParaView
pqProxyWidget.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 pqProxyWidget_h
33 #define pqProxyWidget_h
34 
35 #include "pqComponentsModule.h"
36 #include <QWidget>
37 
38 class pqPropertyWidget;
39 class pqView;
40 class vtkSMProperty;
41 class vtkSMProxy;
42 
55 class PQCOMPONENTS_EXPORT pqProxyWidget : public QWidget
56 {
57  Q_OBJECT
58  typedef QWidget Superclass;
59 public:
60  pqProxyWidget(vtkSMProxy* proxy, QWidget *parent=0, Qt::WindowFlags flags=0);
61  pqProxyWidget(vtkSMProxy* proxy, const QStringList &properties, QWidget *parent=0, Qt::WindowFlags flags=0);
62  virtual ~pqProxyWidget();
63 
65  vtkSMProxy* proxy() const;
66 
70  void setApplyChangesImmediately(bool value);
72  { return this->ApplyChangesImmediately; }
73 
79  { return this->UseDocumentationForLabels; }
80 
84  static QWidget* newGroupLabelWidget(const QString& label, QWidget* parentWidget);
85 
89  static bool useDocumentationForLabels(vtkSMProxy* proxy);
90 
92  {
96  USE_LONG_HELP
97  };
98 
101  static QString documentationText(vtkSMProperty* property, DocumentationType type=USE_DESCRIPTION);
102 
105  static QString documentationText(vtkSMProxy* property, DocumentationType type=USE_DESCRIPTION);
106 
110  static DocumentationType showProxyDocumentationInPanel(vtkSMProxy* proxy);
111 
112 signals:
115  void changeAvailable();
116 
119  void changeFinished();
120 
123  void restartRequired();
124 
125 public slots:
130  bool filterWidgets(
131  bool show_advanced=false, const QString& filterText=QString());
132 
134  void apply() const;
135 
137  void reset() const;
138 
140  void setView(pqView*);
141 
144  void updatePanel();
145 
148  virtual bool restoreDefaults();
149 
151  void saveAsDefaults();
152 
153 protected:
154  void showEvent(QShowEvent *event);
155  void hideEvent(QHideEvent *event);
156 
157 private slots:
160  void onChangeFinished();
161 
162 private:
164  void constructor(
165  vtkSMProxy* proxy, const QStringList &properties, QWidget *parent, Qt::WindowFlags flags);
166 
168  void createWidgets(const QStringList &properties = QStringList());
169 
171  void createPropertyWidgets(const QStringList &properties = QStringList());
172 
174  void create3DWidgets();
175 
177  pqPropertyWidget* createWidgetForProperty(
178  vtkSMProperty *property, vtkSMProxy *proxy, QWidget *parentObj);
179 
180 private:
181  Q_DISABLE_COPY(pqProxyWidget)
182 
183  bool ApplyChangesImmediately;
184  bool UseDocumentationForLabels;
185  class pqInternals;
186  pqInternals* Internals;
187 };
188 
189 #endif
pqPropertyWidget represents a widget created for each property of a proxy on the pqPropertiesPanel (f...
bool applyChangesImmediately() const
Definition: pqProxyWidget.h:71
bool useDocumentationForLabels() const
When this is true, the panel uses a descriptive layout where the documentation for properties is used...
Definition: pqProxyWidget.h:78
This is a PQ abstraction of a generic view module.
Definition: pqView.h:55
pqProxyWidget represents a panel for a vtkSMProxy.
Definition: pqProxyWidget.h:55