pqTransferFunctionWidget.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-FileCopyrightText: Copyright (c) Sandia Corporation
3 // SPDX-License-Identifier: BSD-3-Clause
4 #ifndef pqTransferFunctionWidget_h
5 #define pqTransferFunctionWidget_h
6 
7 #include "pqComponentsModule.h"
8 #include "vtkType.h"
9 #include <QWidget>
10 
12 class vtkScalarsToColors;
13 class vtkTable;
14 
22 {
23  Q_OBJECT
24  typedef QWidget Superclass;
25 
26 public:
27  pqTransferFunctionWidget(QWidget* parent = nullptr);
28  ~pqTransferFunctionWidget() override;
29 
36  void initialize(
37  vtkScalarsToColors* stc, bool stc_editable, vtkPiecewiseFunction* pwf, bool pwf_editable);
38 
42  vtkIdType currentPoint() const;
43 
47  vtkIdType numberOfControlPoints() const;
48 
50 
53  void SetLogScaleXAxis(bool logScale);
54  bool GetLogScaleXAxis() const;
56 
58 
62  vtkScalarsToColors* scalarsToColors() const;
63  vtkPiecewiseFunction* piecewiseFunction() const;
65 
67 
70  void SetControlPointsFreehandDrawing(bool use);
71  bool GetControlPointsFreehandDrawing() const;
73 
74 public Q_SLOTS: // NOLINT(readability-redundant-access-specifiers)
78  void setCurrentPoint(vtkIdType index);
79 
85  void setCurrentPointPosition(double xpos);
86 
91  void render();
92 
97  void setHistogramTable(vtkTable* table);
98 
99 Q_SIGNALS:
103  void currentPointChanged(vtkIdType index);
104 
109  void controlPointsModified();
110 
114  void chartRangeModified();
115 
119  void rangeHandlesRangeChanged(double rangeMin, double rangeMax);
120 
124  void rangeHandlesDoubleClicked();
125 
126 protected Q_SLOTS:
131  void onCurrentChangedEvent();
132 
137  void onRangeHandlesRangeChanged();
138 
142  void showUsageStatus();
143 
147  void editColorAtCurrentControlPoint();
148 
149 protected: // NOLINT(readability-redundant-access-specifiers)
154  void onCurrentPointEditEvent();
155 
156 private:
157  Q_DISABLE_COPY(pqTransferFunctionWidget)
158 
159  class pqInternals;
160  pqInternals* Internals;
161 };
162 
163 #endif
#define PQCOMPONENTS_EXPORT
pqTransferFunctionWidget provides a widget that can edit the control points in a vtkPiecewiseFunction...
int vtkIdType
index