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 "vtkLegacy.h" // for legacy macros
37 #include <QWidget>
38 
40 class pqOutputPort;
41 class pqPipelineSource;
42 class pqPropertyWidget;
43 class pqProxy;
44 class pqView;
45 class vtkSMProperty;
46 class vtkSMProxy;
47 
60 class PQCOMPONENTS_EXPORT pqPropertiesPanel : public QWidget
61 {
62  Q_OBJECT
63  Q_PROPERTY(int panelMode READ panelMode WRITE setPanelMode);
64  typedef QWidget Superclass;
65 
66 public:
67  pqPropertiesPanel(QWidget* parent = 0);
68  ~pqPropertiesPanel() override;
69 
73  static void setAutoApply(bool enabled);
74 
78  static bool autoApply();
79 
83  static void setAutoApplyDelay(int delay);
84 
88  static int autoApplyDelay();
89 
93  pqView* view() const;
94 
99  static int suggestedMargin() { return 0; }
100  static QMargins suggestedMargins() { return QMargins(0, 0, 0, 0); }
101  static int suggestedHorizontalSpacing() { return 4; }
102  static int suggestedVerticalSpacing() { return 4; }
103 
104  enum
105  {
106  SOURCE_PROPERTIES = 0x01,
107  DISPLAY_PROPERTIES = 0x02,
108  VIEW_PROPERTIES = 0x04,
109  ALL_PROPERTIES = SOURCE_PROPERTIES | DISPLAY_PROPERTIES | VIEW_PROPERTIES
110  };
111 
115  void setPanelMode(int val);
116  int panelMode() const { return this->PanelMode; }
117 
123  VTK_LEGACY(void updatePanel(pqOutputPort* port));
124 
128  bool canApply();
129 
133  bool canReset();
134 
141  VTK_LEGACY(void setOutputPort(pqOutputPort*));
142 
143 public Q_SLOTS:
150  void apply();
151 
158  void reset();
159 
166  void showHelp();
167 
174  void propertiesRestoreDefaults();
175 
182  void propertiesSaveAsDefaults();
183 
190  void displayRestoreDefaults();
191 
198  void displaySaveAsDefaults();
199 
206  void viewRestoreDefaults();
207 
214  void viewSaveAsDefaults();
215 
221  void setView(pqView*);
222 
228  void setPipelineProxy(pqProxy*);
229 
235  void setRepresentation(pqDataRepresentation*);
236 Q_SIGNALS:
240  void applied();
241 
245  void applied(pqProxy*);
246 
250  void viewChanged(pqView*);
251 
255  void helpRequested(const QString& groupname, const QString& proxyType);
256 
260  void deleteRequested(pqProxy* source);
261 
267  void applyEnableStateChanged();
268 
269 private Q_SLOTS:
275  void deleteProxy();
276 
280  void proxyDeleted(pqProxy*);
281 
286  void updatePanel();
287 
291  void updateDisplayPanel();
292 
296  void renderActiveView();
297 
301  void sourcePropertyChanged(bool change_finished = true);
302  void sourcePropertyChangeAvailable() { this->sourcePropertyChanged(false); }
303 
307  void updateButtonState();
308 
313  void updateButtonEnableState();
314 
319  void generalSettingsChanged();
320 
321  void copyProperties();
322  void pasteProperties();
323  void copyDisplay();
324  void pasteDisplay();
325  void copyView();
326  void pasteView();
327 
328 protected:
329  void updatePropertiesPanel(pqProxy* source);
330  void updateDisplayPanel(pqDataRepresentation* repr);
331  void updateViewPanel(pqView* view);
332 
333 private:
334  static bool AutoApply;
335  static int AutoApplyDelay;
336 
337  class pqInternals;
338  friend class pqInternals;
339 
340  pqInternals* Internals;
341  int PanelMode;
342 
343  Q_DISABLE_COPY(pqPropertiesPanel)
344 };
345 
346 #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:58
pqPropertyWidget represents a widget created for each property of a proxy on the pqPropertiesPanel (f...
static int suggestedMargin()
methods used to obtain the recommended spacing and margins to be used for widgets.
#define PQCOMPONENTS_EXPORT
#define VTK_LEGACY(method)
Definition: vtkLegacy.h:52
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()
PQ representation for a vtkSMProxy that can be involved in a pipeline.
port
static int suggestedHorizontalSpacing()