ParaView
pqColorOpacityEditorWidget.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: $RCSfile$
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 pqColorOpacityEditorWidget_h
33 #define pqColorOpacityEditorWidget_h
34 
35 #include "pqApplicationComponentsModule.h"
36 #include "pqPropertyWidget.h"
37 #include "pqSMProxy.h"
38 #include <QList>
39 #include <QVariant>
40 
41 class vtkSMPropertyGroup;
42 class pqColorMapModel;
43 
70 class PQAPPLICATIONCOMPONENTS_EXPORT pqColorOpacityEditorWidget : public pqPropertyWidget
71 {
72  Q_OBJECT
73  Q_PROPERTY(QList<QVariant> xrgbPoints READ xrgbPoints WRITE setXrgbPoints)
74  Q_PROPERTY(QList<QVariant> xvmsPoints READ xvmsPoints WRITE setXvmsPoints)
75  Q_PROPERTY(bool useLogScale READ useLogScale WRITE setUseLogScale)
76  Q_PROPERTY(bool lockScalarRange READ lockScalarRange WRITE setLockScalarRange)
77  Q_PROPERTY(pqSMProxy scalarOpacityFunctionProxy READ scalarOpacityFunctionProxy WRITE
78  setScalarOpacityFunctionProxy)
80 
81 public:
82  pqColorOpacityEditorWidget(vtkSMProxy* proxy, vtkSMPropertyGroup* smgroup, QWidget* parent = 0);
83  virtual ~pqColorOpacityEditorWidget();
84 
89  QList<QVariant> xrgbPoints() const;
90 
95  QList<QVariant> xvmsPoints() const;
96 
100  bool useLogScale() const;
101 
105  bool lockScalarRange() const;
106 
111  pqSMProxy scalarOpacityFunctionProxy() const;
112 
113 public slots:
117  void setXvmsPoints(const QList<QVariant>&);
118 
122  void setXrgbPoints(const QList<QVariant>&);
123 
127  void setUseLogScale(bool value);
128 
132  void setLockScalarRange(bool val);
133 
137  void setScalarOpacityFunctionProxy(pqSMProxy sofProxy);
138 
142  void resetRangeToData();
143 
147  void resetRangeToCustom();
148  void resetRangeToCustom(double min, double max);
149 
154  void resetRangeToDataOverTime();
155 
160  void resetRangeToVisibleData();
161 
165  void invertTransferFunctions();
166 
170  void choosePreset(const char* presetName = NULL);
171 
175  void saveAsPreset();
176 
177 signals:
181  void xrgbPointsChanged();
182 
186  void xvmsPointsChanged();
187 
191  void useLogScaleChanged();
192 
196  void lockScalarRangeChanged();
197 
203  void scalarOpacityFunctionProxyChanged();
204 
205 protected slots:
210  void opacityCurrentChanged(vtkIdType);
211  void colorCurrentChanged(vtkIdType);
212 
216  void updatePanel();
217 
221  void updateCurrentData();
222 
226  void currentDataEdited();
227 
231  void presetApplied();
232 
237  void updateIndexedLookupState();
238 
243  void useLogScaleClicked(bool);
244 
250  void updateButtonEnableState();
251 
252 private:
253  Q_DISABLE_COPY(pqColorOpacityEditorWidget)
254 
255  class pqInternals;
256  pqInternals* Internals;
257 };
258 
259 #endif
pqPropertyWidget represents a widget created for each property of a proxy on the pqPropertiesPanel (f...
pqColorOpacityEditorWidget provides an in-line editor widget for editing the color and opacity transf...
vtkSmartPointer< vtkSMProxy > pqSMProxy
make pqSMProxy synonymous to a smart pointer of a vtkSMProxy
Definition: pqSMProxy.h:44
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:152