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 class QPoint;
44 
59 class PQCOMPONENTS_EXPORT pqProxyWidget : public QWidget
60 {
61  Q_OBJECT
62  typedef QWidget Superclass;
63 
64 public:
65  pqProxyWidget(vtkSMProxy* proxy, const QStringList& properties,
66  std::initializer_list<QString> defaultLabels, std::initializer_list<QString> advancedLabels,
67  bool showHeadersFooters = true, QWidget* parent = nullptr,
68  Qt::WindowFlags flags = Qt::WindowFlags{});
69 
70  pqProxyWidget(vtkSMProxy* proxy, std::initializer_list<QString> defaultLabels,
71  std::initializer_list<QString> advancedLabels, QWidget* parent = nullptr,
72  Qt::WindowFlags flags = Qt::WindowFlags{});
73 
74  pqProxyWidget(vtkSMProxy* proxy, const QStringList& properties, bool showHeadersFooters = true,
75  QWidget* parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags{});
76 
77  pqProxyWidget(vtkSMProxy* proxy, QWidget* parent, Qt::WindowFlags flags = Qt::WindowFlags{});
78 
79  pqProxyWidget(vtkSMProxy* proxy);
80 
81  ~pqProxyWidget() override;
82 
86  vtkSMProxy* proxy() const;
87 
93  void setApplyChangesImmediately(bool value);
94  bool applyChangesImmediately() const { return this->ApplyChangesImmediately; }
95 
102  bool useDocumentationForLabels() const { return this->UseDocumentationForLabels; }
103 
109  static QWidget* newGroupLabelWidget(const QString& label, QWidget* parentWidget,
110  const QList<QWidget*>& buttons = QList<QWidget*>());
111 
117  static bool useDocumentationForLabels(vtkSMProxy* proxy);
118 
120  {
124  USE_LONG_HELP
125  };
126 
131  static QString documentationText(
132  vtkSMProperty* property, DocumentationType type = USE_DESCRIPTION);
133 
138  static QString documentationText(vtkSMProxy* property, DocumentationType type = USE_DESCRIPTION);
139 
145  static DocumentationType showProxyDocumentationInPanel(vtkSMProxy* proxy);
146 
148 
160  const QSet<QString>& defaultVisibilityLabels() const { return this->DefaultVisibilityLabels; }
161  const QSet<QString>& advancedVisibilityLabels() const { return this->AdvancedVisibilityLabels; }
163 
164  void showContextMenu(const QPoint& pt, pqPropertyWidget* propWidget);
165 
166 Q_SIGNALS:
171  void changeAvailable();
172 
177  void changeFinished();
178 
183  void restartRequired();
184 
185 public Q_SLOTS:
192  bool filterWidgets(bool show_advanced = false, const QString& filterText = QString());
193 
198  void showLinkedInteractiveWidget(int portIndex, bool show, bool changeFocus);
199 
203  void apply() const;
204 
208  void reset() const;
209 
213  void setView(pqView*);
214 
219  void updatePanel();
220 
225  virtual bool restoreDefaults();
226 
230  void saveAsDefaults();
231 
235  static pqPropertyWidget* createWidgetForProperty(
236  vtkSMProperty* property, vtkSMProxy* proxy, QWidget* parentObj);
237 
238 protected:
239  void showEvent(QShowEvent* event) override;
240  void hideEvent(QHideEvent* event) override;
241 
242 private Q_SLOTS:
247  void onChangeFinished();
248 
249 private: // NOLINT(readability-redundant-access-specifiers)
253  void createWidgets(const QStringList& properties = QStringList());
254 
258  void createPropertyWidgets(const QStringList& properties = QStringList());
259 
263  void create3DWidgets();
264 
265  Q_DISABLE_COPY(pqProxyWidget);
266 
267  QSet<QString> DefaultVisibilityLabels;
268  QSet<QString> AdvancedVisibilityLabels;
269  bool ApplyChangesImmediately;
270  bool UseDocumentationForLabels;
271  bool ShowHeadersFooters = false;
272  class pqInternals;
273  pqInternals* Internals;
274 };
275 
276 #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:94
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:59