pqPropertiesPanel.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: pqPropertiesPanel.h
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 pqPropertiesPanel_h
33 #define pqPropertiesPanel_h
34 
35 #include "pqComponentsModule.h"
36 #include "vtkParaViewDeprecation.h"
37 
38 #include <QWidget>
39 
41 class pqOutputPort;
42 class pqPipelineSource;
43 class pqPropertyWidget;
44 class pqProxy;
45 class pqView;
46 class vtkSMProperty;
47 class vtkSMProxy;
48 
61 class PQCOMPONENTS_EXPORT pqPropertiesPanel : public QWidget
62 {
63  Q_OBJECT
64  Q_PROPERTY(int panelMode READ panelMode WRITE setPanelMode);
65  typedef QWidget Superclass;
66 
67 public:
68  pqPropertiesPanel(QWidget* parent = nullptr);
69  ~pqPropertiesPanel() override;
70 
74  PARAVIEW_DEPRECATED_IN_5_11_0("Use `vtkPVGeneralSettings::SetAutoApply()` instead")
75  static void setAutoApply(bool enabled);
76 
80  PARAVIEW_DEPRECATED_IN_5_11_0("Use `vtkPVGeneralSettings::GetAutoApply()` instead")
81  static bool autoApply();
82 
86  PARAVIEW_DEPRECATED_IN_5_11_0("Use `pqApplyBehavior::setAutoApplyDelay()` instead")
87  static void setAutoApplyDelay(int delay);
88 
92  PARAVIEW_DEPRECATED_IN_5_11_0("Use `pqApplyBehavior::autoApplyDelay()` instead")
93  static int autoApplyDelay();
94 
98  pqView* view() const;
99 
104  static int suggestedMargin() { return 0; }
105  static QMargins suggestedMargins() { return QMargins(0, 0, 0, 0); }
106  static int suggestedHorizontalSpacing() { return 4; }
107  static int suggestedVerticalSpacing() { return 4; }
108 
109  enum
110  {
111  SOURCE_PROPERTIES = 0x01,
112  DISPLAY_PROPERTIES = 0x02,
113  VIEW_PROPERTIES = 0x04,
114  ALL_PROPERTIES = SOURCE_PROPERTIES | DISPLAY_PROPERTIES | VIEW_PROPERTIES
115  };
116 
120  void setPanelMode(int val);
121  int panelMode() const { return this->PanelMode; }
122 
126  bool canApply();
127 
131  bool canReset();
132 
133 public Q_SLOTS: // NOLINT(readability-redundant-access-specifiers)
140  void apply();
141 
148  void reset();
149 
156  void showHelp();
157 
164  void propertiesRestoreDefaults();
165 
172  void propertiesSaveAsDefaults();
173 
180  void displayRestoreDefaults();
181 
188  void displaySaveAsDefaults();
189 
196  void viewRestoreDefaults();
197 
204  void viewSaveAsDefaults();
205 
210  void setView(pqView*);
211 
217  void setPipelineProxy(pqProxy*);
218 
223  void setRepresentation(pqDataRepresentation*);
224 Q_SIGNALS:
228  void applied();
229 
233  void applied(pqProxy*);
234 
238  void viewChanged(pqView*);
239 
240  void modified();
241  void resetDone();
242 
246  void helpRequested(const QString& groupname, const QString& proxyType);
247 
251  void deleteRequested(pqProxy* source);
252 
258  void applyEnableStateChanged();
259 
260 private Q_SLOTS:
265  void deleteProxy();
266 
270  void proxyDeleted(pqProxy*);
271 
276  void updatePanel();
277 
281  void updateDisplayPanel();
282 
286  void renderActiveView();
287 
291  void sourcePropertyChanged(bool change_finished = true);
292  void sourcePropertyChangeAvailable() { this->sourcePropertyChanged(false); }
293 
297  void updateButtonState();
298 
303  void updateButtonEnableState();
304 
305  void copyProperties();
306  void pasteProperties();
307  void copyDisplay();
308  void pasteDisplay();
309  void copyView();
310  void pasteView();
311 
312 protected:
313  void updatePropertiesPanel(pqProxy* source);
314  void updateDisplayPanel(pqDataRepresentation* repr);
315  void updateViewPanel(pqView* view);
316 
317 private:
318  class pqInternals;
319  friend class pqInternals;
320 
321  pqInternals* Internals;
322  int PanelMode;
323 
324  Q_DISABLE_COPY(pqPropertiesPanel)
325 };
326 
327 #endif
pqDataRepresentation is the superclass for a display for a pqPipelineSource i.e.
pqOutputPort is a server manager model item for an output port of any pqPipelineSource item...
Definition: pqOutputPort.h:57
pqPropertyWidget represents a widget created for each property of a proxy on the pqPropertiesPanel (f...
#define PQCOMPONENTS_EXPORT
superclass for all SM properties
pqPropertiesPanel is the default panel used by paraview to edit source properties and display propert...
This is a PQ abstraction of a generic view module.
Definition: pqView.h:54
static QMargins suggestedMargins()
source
This class represents any registered Server Manager proxy.
Definition: pqProxy.h:56
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:152
static int suggestedVerticalSpacing()
pqApplyBehavior collects the logic that needs to happen after the user hits "Apply" on the pqProperti...
PQ representation for a vtkSMProxy that can be involved in a pipeline.
#define const
Definition: zconf.h:238
static int suggestedHorizontalSpacing()
#define PARAVIEW_DEPRECATED_IN_5_11_0(reason)
object for general options.