pqInteractivePropertyWidgetAbstract.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-FileCopyrightText: Copyright (c) Sandia Corporation
3 // SPDX-License-Identifier: BSD-3-Clause
4 #ifndef pqInteractivePropertyWidgetAbstract_h
5 #define pqInteractivePropertyWidgetAbstract_h
6 
8 #include "pqPropertyWidget.h"
9 #include "pqSMProxy.h"
10 #include "vtkBoundingBox.h"
11 #include <QScopedPointer>
12 
13 class pqServer;
14 class vtkObject;
16 class vtkSMPropertyGroup;
18 
31 {
32  Q_OBJECT
34  Q_PROPERTY(pqSMProxy dataSource READ dataSource WRITE setDataSource);
35 
36 public:
37  pqInteractivePropertyWidgetAbstract(const char* widget_smgroup, const char* widget_smname,
38  vtkSMProxy* proxy, vtkSMPropertyGroup* smgroup, QWidget* parent = nullptr);
40 
44  void reset() override;
45 
49  void setView(pqView* view) override;
50 
58  bool isWidgetVisible() const;
59 
63  vtkSMProxy* dataSource() const;
64 
66 
72  void select() override;
73  void deselect() override;
74  void selectPort(int portIndex) final;
76 
83  vtkBoundingBox dataBounds(bool visibleOnly = false) const;
84 
88  vtkSMPropertyGroup* propertyGroup() const;
89 
93  void hideEvent(QHideEvent*) override;
94 
98  void showEvent(QShowEvent*) override;
99 
100 public Q_SLOTS: // NOLINT(readability-redundant-access-specifiers)
106  virtual void setWidgetVisible(bool val);
107 
113  void setDataSource(vtkSMProxy* dataSource);
114 
115 protected Q_SLOTS:
119  virtual void placeWidget() = 0;
120 
124  void render();
125 
131  virtual void updateWidgetVisibility();
132 
133 Q_SIGNALS:
137  void widgetVisibilityToggled(bool);
138 
143  void widgetVisibilityUpdated(bool);
144 
146 
150  void startInteraction();
151  void interaction();
152  void endInteraction();
154 
155 protected:
161  virtual vtkSMNewWidgetRepresentationProxyAbstract* internalWidgetProxy() = 0;
162 
167  void setupConnections(vtkSMNewWidgetRepresentationProxyAbstract* widget,
168  vtkSMPropertyGroup* smgroup, vtkSMProxy* smproxy);
169 
170  void setupUserObserver(vtkSMProxy* smproxy);
171 
172  bool VisibleState = true;
173  bool WidgetVisibility = false;
174  int LinkedPortIndex = -1;
175 
176 private:
178 
179  void handleUserEvent(vtkObject*, unsigned long, void*);
180 
181  struct pqInternals;
182  QScopedPointer<pqInternals> Internals;
183 };
184 
185 #endif
virtual void selectPort(int portIndex)
These methods are called by pqPropertiesPanel when the panel for proxy becomes active/deactive.
pqPropertyWidget represents a widget created for each property of a proxy on the pqPropertiesPanel (f...
virtual void deselect()
These methods are called by pqPropertiesPanel when the panel for proxy becomes active/deactive.
#define PQAPPLICATIONCOMPONENTS_EXPORT
virtual void select()
These methods are called by pqPropertiesPanel when the panel for proxy becomes active/deactive.
This is a PQ abstraction of a generic view module.
Definition: pqView.h:26
proxy for 3D widgets and their representations in ParaView.
virtual void reset()
virtual void setView(pqView *)
called to set the active view.
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:140
pqInteractivePropertyWidgetAbstract is an abstract pqPropertyWidget subclass designed to serve as the...
Abstract class for proxies for 2D and 3D widgets.
pqServer (should be renamed to pqSession) is a pqServerManagerModelItem subclass that represents a vt...
Definition: pqServer.h:35