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 
68 class PQAPPLICATIONCOMPONENTS_EXPORT pqColorOpacityEditorWidget :
69  public pqPropertyWidget
70 {
71  Q_OBJECT
72  Q_PROPERTY(QList<QVariant> xrgbPoints READ xrgbPoints WRITE setXrgbPoints)
73  Q_PROPERTY(QList<QVariant> xvmsPoints READ xvmsPoints WRITE setXvmsPoints)
74  Q_PROPERTY(bool useLogScale READ useLogScale WRITE setUseLogScale)
75  Q_PROPERTY(bool lockScalarRange READ lockScalarRange WRITE setLockScalarRange)
76  Q_PROPERTY(pqSMProxy scalarOpacityFunctionProxy READ scalarOpacityFunctionProxy
77  WRITE setScalarOpacityFunctionProxy)
79 public:
80  pqColorOpacityEditorWidget(vtkSMProxy* proxy, vtkSMPropertyGroup* smgroup, QWidget* parent=0);
81  virtual ~pqColorOpacityEditorWidget();
82 
85  QList<QVariant> xrgbPoints() const;
86 
89  QList<QVariant> xvmsPoints() const;
90 
92  bool useLogScale() const;
93 
95  bool lockScalarRange() const;
96 
99  pqSMProxy scalarOpacityFunctionProxy() const;
100 
101 public slots:
103  void setXvmsPoints(const QList<QVariant>&);
104 
106  void setXrgbPoints(const QList<QVariant>&);
107 
109  void setUseLogScale(bool value);
110 
112  void setLockScalarRange(bool val);
113 
115  void setScalarOpacityFunctionProxy(pqSMProxy sofProxy);
116 
118  void resetRangeToData();
119 
121  void resetRangeToCustom();
122  void resetRangeToCustom(double min, double max);
123 
126  void resetRangeToDataOverTime();
127 
130  void resetRangeToVisibleData();
131 
133  void invertTransferFunctions();
134 
136  void choosePreset(const char* presetName=NULL);
137 
139  void saveAsPreset();
140 
141 signals:
143  void xrgbPointsChanged();
144 
146  void xvmsPointsChanged();
147 
149  void useLogScaleChanged();
150 
152  void lockScalarRangeChanged();
153 
157  void scalarOpacityFunctionProxyChanged();
158 
159 protected slots:
162  void opacityCurrentChanged(vtkIdType);
163  void colorCurrentChanged(vtkIdType);
164 
166  void updatePanel();
167 
169  void updateCurrentData();
170 
172  void currentDataEdited();
173 
175  void presetApplied();
176 
179  void updateIndexedLookupState();
180 
183  void useLogScaleClicked(bool);
184 
188  void updateButtonEnableState();
189 
190 private:
191  Q_DISABLE_COPY(pqColorOpacityEditorWidget)
192 
193  class pqInternals;
194  pqInternals* Internals;
195 };
196 
197 #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:42