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