pqColorTableModel.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 pqColorTableModel_h
5 #define pqColorTableModel_h
6 
7 #include "pqApplicationComponentsModule.h"
8 #include <QAbstractTableModel>
9 
10 #include "vtkVector.h"
11 
13 
14 // QAbstractTableModel subclass for viewing and manipulating color transfer
15 // function control points through a table interface.
16 // First column is control point scalar value and the second through fourth
17 // columns are r,g,b colors, respectively.
18 class PQAPPLICATIONCOMPONENTS_EXPORT pqColorTableModel : public QAbstractTableModel
19 {
20  Q_OBJECT
21  typedef QAbstractTableModel Superclass;
22 
23 public:
24  pqColorTableModel(pqColorOpacityEditorWidget* widget, QObject* parentObject = nullptr);
25 
26  ~pqColorTableModel() override;
27 
32  Qt::ItemFlags flags(const QModelIndex& idx) const override;
33 
34  bool setData(const QModelIndex& idx, const QVariant& value, int role = Qt::EditRole) override;
35 
36  int rowCount(const QModelIndex& parent = QModelIndex()) const override;
37 
38  int columnCount(const QModelIndex& parent = QModelIndex()) const override;
39 
40  QVariant data(const QModelIndex& idx, int role = Qt::DisplayRole) const override;
41 
42  QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
43 
44  std::vector<vtkVector<double, 6>> points() const;
45 
46  size_t insertPoint(size_t loc);
47 
48  bool setPoints(const std::vector<vtkVector<double, 6>>& pts);
49 
50 protected Q_SLOTS:
51 
52  void controlPointsChanged();
53 
54  void updatePoint(const QModelIndex& idx);
55 
56 private:
57  Q_DISABLE_COPY(pqColorTableModel)
58 
60 
61  double Range[2];
62 
63  class pqInternals;
64  pqInternals* Internals;
65 };
66 
67 #endif
data
pqColorOpacityEditorWidget provides an in-line editor widget for editing the color and opacity transf...
points
value
orientation