ParaView
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  virtual ~pqPropertiesPanel();
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 int suggestedHorizontalSpacing() { return 4; }
100  static int suggestedVerticalSpacing() { return 4; }
101 
102  enum
103  {
104  SOURCE_PROPERTIES = 0x01,
105  DISPLAY_PROPERTIES = 0x02,
106  VIEW_PROPERTIES = 0x04,
107  ALL_PROPERTIES = SOURCE_PROPERTIES | DISPLAY_PROPERTIES | VIEW_PROPERTIES
108  };
109 
113  void setPanelMode(int val);
114  int panelMode() const { return this->PanelMode; }
115 
119  void updatePanel(pqOutputPort* port);
120 
121 public slots:
128  void apply();
129 
136  void reset();
137 
144  void showHelp();
145 
152  void propertiesRestoreDefaults();
153 
160  void propertiesSaveAsDefaults();
161 
168  void displayRestoreDefaults();
169 
176  void displaySaveAsDefaults();
177 
184  void viewRestoreDefaults();
185 
192  void viewSaveAsDefaults();
193 
199  void setView(pqView*);
200 
206  void setOutputPort(pqOutputPort*);
207 
213  void setRepresentation(pqDataRepresentation*);
214 signals:
218  void applied();
219 
223  void applied(pqProxy*);
224 
228  void viewChanged(pqView*);
229 
233  void helpRequested(const QString& groupname, const QString& proxyType);
234 
238  void deleteRequested(pqPipelineSource* source);
239 
240 private slots:
246  void deleteProxy();
247 
251  void proxyDeleted(pqPipelineSource*);
252 
257  void updatePanel();
258 
262  void updateDisplayPanel();
263 
267  void renderActiveView();
268 
272  void sourcePropertyChanged(bool change_finished = true);
273  void sourcePropertyChangeAvailable() { this->sourcePropertyChanged(false); }
274 
278  void updateButtonState();
279 
284  void updateButtonEnableState();
285 
290  void generalSettingsChanged();
291 
292  void copyProperties();
293  void pasteProperties();
294  void copyDisplay();
295  void pasteDisplay();
296  void copyView();
297  void pasteView();
298 
299 protected:
300  void updatePropertiesPanel(pqPipelineSource* source);
301  void updateDisplayPanel(pqDataRepresentation* repr);
302  void updateViewPanel(pqView* view);
303 
304 private:
305  static bool AutoApply;
306  static int AutoApplyDelay;
307 
308  class pqInternals;
309  friend class pqInternals;
310 
311  pqInternals* Internals;
312  int PanelMode;
313 
314  Q_DISABLE_COPY(pqPropertiesPanel)
315 };
316 
317 #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:56
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()