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 <QSet>
37 #include <QWidget>
38 
39 class pqPropertyWidget;
40 class pqView;
41 class vtkSMProperty;
42 class vtkSMProxy;
43 
58 class PQCOMPONENTS_EXPORT pqProxyWidget : public QWidget
59 {
60  Q_OBJECT
61  typedef QWidget Superclass;
62 
63 public:
64  pqProxyWidget(vtkSMProxy* proxy, const QStringList& properties,
65  std::initializer_list<QString> defaultLabels, std::initializer_list<QString> advancedLabels,
66  bool showHeadersFooters = true, QWidget* parent = nullptr,
67  Qt::WindowFlags flags = Qt::WindowFlags{});
68 
69  pqProxyWidget(vtkSMProxy* proxy, std::initializer_list<QString> defaultLabels,
70  std::initializer_list<QString> advancedLabels, QWidget* parent = nullptr,
71  Qt::WindowFlags flags = Qt::WindowFlags{});
72 
73  pqProxyWidget(vtkSMProxy* proxy, const QStringList& properties, bool showHeadersFooters = true,
74  QWidget* parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags{});
75 
76  pqProxyWidget(vtkSMProxy* proxy, QWidget* parent, Qt::WindowFlags flags = Qt::WindowFlags{});
77 
78  pqProxyWidget(vtkSMProxy* proxy);
79 
80  ~pqProxyWidget() override;
81 
85  vtkSMProxy* proxy() const;
86 
92  void setApplyChangesImmediately(bool value);
93  bool applyChangesImmediately() const { return this->ApplyChangesImmediately; }
94 
101  bool useDocumentationForLabels() const { return this->UseDocumentationForLabels; }
102 
108  static QWidget* newGroupLabelWidget(const QString& label, QWidget* parentWidget,
109  const QList<QWidget*>& buttons = QList<QWidget*>());
110 
116  static bool useDocumentationForLabels(vtkSMProxy* proxy);
117 
119  {
123  USE_LONG_HELP
124  };
125 
130  static QString documentationText(
131  vtkSMProperty* property, DocumentationType type = USE_DESCRIPTION);
132 
137  static QString documentationText(vtkSMProxy* property, DocumentationType type = USE_DESCRIPTION);
138 
144  static DocumentationType showProxyDocumentationInPanel(vtkSMProxy* proxy);
145 
147 
159  const QSet<QString>& defaultVisibilityLabels() const { return this->DefaultVisibilityLabels; }
160  const QSet<QString>& advancedVisibilityLabels() const { return this->AdvancedVisibilityLabels; }
162 
163 Q_SIGNALS:
168  void changeAvailable();
169 
174  void changeFinished();
175 
180  void restartRequired();
181 
182 public Q_SLOTS:
189  bool filterWidgets(bool show_advanced = false, const QString& filterText = QString());
190 
195  void showLinkedInteractiveWidget(int portIndex, bool show);
196 
200  void apply() const;
201 
205  void reset() const;
206 
210  void setView(pqView*);
211 
216  void updatePanel();
217 
222  virtual bool restoreDefaults();
223 
227  void saveAsDefaults();
228 
232  static pqPropertyWidget* createWidgetForProperty(
233  vtkSMProperty* property, vtkSMProxy* proxy, QWidget* parentObj);
234 
235 protected:
236  void showEvent(QShowEvent* event) override;
237  void hideEvent(QHideEvent* event) override;
238 
239 private Q_SLOTS:
244  void onChangeFinished();
245 
246 private: // NOLINT(readability-redundant-access-specifiers)
250  void createWidgets(const QStringList& properties = QStringList());
251 
255  void createPropertyWidgets(const QStringList& properties = QStringList());
256 
260  void create3DWidgets();
261 
262  Q_DISABLE_COPY(pqProxyWidget);
263 
264  QSet<QString> DefaultVisibilityLabels;
265  QSet<QString> AdvancedVisibilityLabels;
266  bool ApplyChangesImmediately;
267  bool UseDocumentationForLabels;
268  bool ShowHeadersFooters = false;
269  class pqInternals;
270  pqInternals* Internals;
271 };
272 
273 #endif
pqPropertyWidget represents a widget created for each property of a proxy on the pqPropertiesPanel (f...
#define PQCOMPONENTS_EXPORT
bool applyChangesImmediately() const
Definition: pqProxyWidget.h:93
bool useDocumentationForLabels() const
When this is true, the panel uses a descriptive layout where the documentation for properties is used...
superclass for all SM properties
This is a PQ abstraction of a generic view module.
Definition: pqView.h:54
const QSet< QString > & advancedVisibilityLabels() const
pqProxyWidget shows widgets for properties in two configurations: basic and advanced.
const QSet< QString > & defaultVisibilityLabels() const
pqProxyWidget shows widgets for properties in two configurations: basic and advanced.
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:152
value
pqProxyWidget represents a panel for a vtkSMProxy.
Definition: pqProxyWidget.h:58