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 
57 class PQCOMPONENTS_EXPORT pqProxyWidget : public QWidget
58 {
59  Q_OBJECT
60  typedef QWidget Superclass;
61 
62 public:
63  pqProxyWidget(vtkSMProxy* proxy, QWidget* parent = 0, Qt::WindowFlags flags = 0);
64  pqProxyWidget(vtkSMProxy* proxy, const QStringList& properties, QWidget* parent = 0,
65  Qt::WindowFlags flags = 0);
66  ~pqProxyWidget() override;
67 
71  vtkSMProxy* proxy() const;
72 
78  void setApplyChangesImmediately(bool value);
79  bool applyChangesImmediately() const { return this->ApplyChangesImmediately; }
80 
87  bool useDocumentationForLabels() const { return this->UseDocumentationForLabels; }
88 
94  static QWidget* newGroupLabelWidget(const QString& label, QWidget* parentWidget);
95 
101  static bool useDocumentationForLabels(vtkSMProxy* proxy);
102 
104  {
108  USE_LONG_HELP
109  };
110 
115  static QString documentationText(
116  vtkSMProperty* property, DocumentationType type = USE_DESCRIPTION);
117 
122  static QString documentationText(vtkSMProxy* property, DocumentationType type = USE_DESCRIPTION);
123 
129  static DocumentationType showProxyDocumentationInPanel(vtkSMProxy* proxy);
130 
131 signals:
136  void changeAvailable();
137 
142  void changeFinished();
143 
148  void restartRequired();
149 
150 public slots:
157  bool filterWidgets(bool show_advanced = false, const QString& filterText = QString());
158 
162  void apply() const;
163 
167  void reset() const;
168 
172  void setView(pqView*);
173 
178  void updatePanel();
179 
184  virtual bool restoreDefaults();
185 
189  void saveAsDefaults();
190 
191 protected:
192  void showEvent(QShowEvent* event) override;
193  void hideEvent(QHideEvent* event) override;
194 
195 private slots:
200  void onChangeFinished();
201 
202 private:
206  void constructor(
207  vtkSMProxy* proxy, const QStringList& properties, QWidget* parent, Qt::WindowFlags flags);
208 
212  void createWidgets(const QStringList& properties = QStringList());
213 
217  void createPropertyWidgets(const QStringList& properties = QStringList());
218 
222  void create3DWidgets();
223 
227  pqPropertyWidget* createWidgetForProperty(
228  vtkSMProperty* property, vtkSMProxy* proxy, QWidget* parentObj);
229 
230 private:
231  Q_DISABLE_COPY(pqProxyWidget)
232 
233  bool ApplyChangesImmediately;
234  bool UseDocumentationForLabels;
235  class pqInternals;
236  pqInternals* Internals;
237 };
238 
239 #endif
pqPropertyWidget represents a widget created for each property of a proxy on the pqPropertiesPanel (f...
bool applyChangesImmediately() const
Definition: pqProxyWidget.h:79
bool useDocumentationForLabels() const
When this is true, the panel uses a descriptive layout where the documentation for properties is used...
Definition: pqProxyWidget.h:87
superclass for all SM properties
This is a PQ abstraction of a generic view module.
Definition: pqView.h:54
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:152
value
pqProxyWidget represents a panel for a vtkSMProxy.
Definition: pqProxyWidget.h:57