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 
57 class PQCOMPONENTS_EXPORT pqPropertiesPanel : public QWidget
58 {
59  Q_OBJECT
60  Q_PROPERTY(int panelMode READ panelMode WRITE setPanelMode);
61  typedef QWidget Superclass;
62 public:
63  pqPropertiesPanel(QWidget *parent = 0);
64  virtual ~pqPropertiesPanel();
65 
67  static void setAutoApply(bool enabled);
68 
70  static bool autoApply();
71 
73  static void setAutoApplyDelay(int delay);
74 
76  static int autoApplyDelay();
77 
79  pqView* view() const;
80 
83  static int suggestedMargin() { return 0; }
84  static int suggestedHorizontalSpacing() { return 4; }
85  static int suggestedVerticalSpacing() { return 4; }
86 
87  enum
88  {
89  SOURCE_PROPERTIES=0x01,
90  DISPLAY_PROPERTIES=0x02,
91  VIEW_PROPERTIES=0x04,
92  ALL_PROPERTIES=SOURCE_PROPERTIES|DISPLAY_PROPERTIES|VIEW_PROPERTIES
93  };
94 
96  void setPanelMode(int val);
97  int panelMode() const { return this->PanelMode; }
98 
100  void updatePanel(pqOutputPort* port);
101 
102 public slots:
107  void apply();
108 
113  void reset();
114 
119  void showHelp();
120 
125  void propertiesRestoreDefaults();
126 
131  void propertiesSaveAsDefaults();
132 
137  void displayRestoreDefaults();
138 
143  void displaySaveAsDefaults();
144 
149  void viewRestoreDefaults();
150 
155  void viewSaveAsDefaults();
156 
160  void setView(pqView*);
161 
165  void setOutputPort(pqOutputPort*);
166 
170  void setRepresentation(pqDataRepresentation*);
171 signals:
173  void applied();
174 
176  void applied(pqProxy*);
177 
179  void viewChanged(pqView*);
180 
182  void helpRequested(const QString &groupname, const QString &proxyType);
183 
185  void deleteRequested(pqPipelineSource* source);
186 
187 private slots:
191  void deleteProxy();
192 
194  void proxyDeleted(pqPipelineSource*);
195 
198  void updatePanel();
199 
201  void updateDisplayPanel();
202 
204  void renderActiveView();
205 
207  void sourcePropertyChanged(bool change_finished=true);
208  void sourcePropertyChangeAvailable()
209  { this->sourcePropertyChanged(false); }
210 
212  void updateButtonState();
213 
216  void updateButtonEnableState();
217 
220  void generalSettingsChanged();
221 
222  void copyProperties();
223  void pasteProperties();
224  void copyDisplay();
225  void pasteDisplay();
226  void copyView();
227  void pasteView();
228 
229 protected:
230  void updatePropertiesPanel(pqPipelineSource* source);
231  void updateDisplayPanel(pqDataRepresentation* repr);
232  void updateViewPanel (pqView* view);
233 
234 private:
235  static bool AutoApply;
236  static int AutoApplyDelay;
237 
238  class pqInternals;
239  friend class pqInternals;
240 
241  pqInternals* Internals;
242  int PanelMode;
243 
244  Q_DISABLE_COPY(pqPropertiesPanel)
245 };
246 
247 #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:55
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.
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:55
This class represents any registered Server Manager proxy.
Definition: pqProxy.h:52
static int suggestedVerticalSpacing()
PQ representation for a vtkSMProxy that can be involved in a pipeline.
static int suggestedHorizontalSpacing()