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 <QWidget>
37 
39 class pqOutputPort;
40 class pqPipelineSource;
41 class pqPropertyWidget;
42 class pqProxy;
43 class pqView;
44 class vtkSMProperty;
45 class vtkSMProxy;
46 
59 class PQCOMPONENTS_EXPORT pqPropertiesPanel : public QWidget
60 {
61  Q_OBJECT
62  Q_PROPERTY(int panelMode READ panelMode WRITE setPanelMode);
63  typedef QWidget Superclass;
64 
65 public:
66  pqPropertiesPanel(QWidget* parent = 0);
67  ~pqPropertiesPanel() override;
68 
72  static void setAutoApply(bool enabled);
73 
77  static bool autoApply();
78 
82  static void setAutoApplyDelay(int delay);
83 
87  static int autoApplyDelay();
88 
92  pqView* view() const;
93 
98  static int suggestedMargin() { return 0; }
99  static QMargins suggestedMargins() { return QMargins(0, 0, 0, 0); }
100  static int suggestedHorizontalSpacing() { return 4; }
101  static int suggestedVerticalSpacing() { return 4; }
102 
103  enum
104  {
105  SOURCE_PROPERTIES = 0x01,
106  DISPLAY_PROPERTIES = 0x02,
107  VIEW_PROPERTIES = 0x04,
108  ALL_PROPERTIES = SOURCE_PROPERTIES | DISPLAY_PROPERTIES | VIEW_PROPERTIES
109  };
110 
114  void setPanelMode(int val);
115  int panelMode() const { return this->PanelMode; }
116 
120  void updatePanel(pqOutputPort* port);
121 
125  bool canApply();
126 
130  bool canReset();
131 
132 public slots:
139  void apply();
140 
147  void reset();
148 
155  void showHelp();
156 
163  void propertiesRestoreDefaults();
164 
171  void propertiesSaveAsDefaults();
172 
179  void displayRestoreDefaults();
180 
187  void displaySaveAsDefaults();
188 
195  void viewRestoreDefaults();
196 
203  void viewSaveAsDefaults();
204 
210  void setView(pqView*);
211 
217  void setOutputPort(pqOutputPort*);
218 
224  void setRepresentation(pqDataRepresentation*);
225 signals:
229  void applied();
230 
234  void applied(pqProxy*);
235 
239  void viewChanged(pqView*);
240 
244  void helpRequested(const QString& groupname, const QString& proxyType);
245 
249  void deleteRequested(pqPipelineSource* source);
250 
256  void applyEnableStateChanged();
257 
258 private slots:
264  void deleteProxy();
265 
269  void proxyDeleted(pqPipelineSource*);
270 
275  void updatePanel();
276 
280  void updateDisplayPanel();
281 
285  void renderActiveView();
286 
290  void sourcePropertyChanged(bool change_finished = true);
291  void sourcePropertyChangeAvailable() { this->sourcePropertyChanged(false); }
292 
296  void updateButtonState();
297 
302  void updateButtonEnableState();
303 
308  void generalSettingsChanged();
309 
310  void copyProperties();
311  void pasteProperties();
312  void copyDisplay();
313  void pasteDisplay();
314  void copyView();
315  void pasteView();
316 
317 protected:
318  void updatePropertiesPanel(pqPipelineSource* source);
319  void updateDisplayPanel(pqDataRepresentation* repr);
320  void updateViewPanel(pqView* view);
321 
322 private:
323  static bool AutoApply;
324  static int AutoApplyDelay;
325 
326  class pqInternals;
327  friend class pqInternals;
328 
329  pqInternals* Internals;
330  int PanelMode;
331 
332  Q_DISABLE_COPY(pqPropertiesPanel)
333 };
334 
335 #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...
static int suggestedMargin()
methods used to obtain the recommended spacing and margins to be used for widgets.
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()
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.
static int suggestedHorizontalSpacing()