pqColorAnnotationsWidget.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 pqColorAnnotationsWidget_h
5 #define pqColorAnnotationsWidget_h
6 
8 
9 #include "pqAnnotationsModel.h" // for pqAnnotationsModel::ColumnRoles
10 
11 #include <QWidget>
12 
13 class QItemSelection;
14 class QModelIndex;
15 
16 class vtkSMProxy;
17 
22 {
23  Q_OBJECT;
24  typedef QWidget Superclass;
25 
26 public:
27  pqColorAnnotationsWidget(QWidget* parent = nullptr);
28  ~pqColorAnnotationsWidget() override;
29 
30  void setLookupTableProxy(vtkSMProxy* proxy);
31 
33 
38  QList<QVariant> annotations() const;
39  void setAnnotations(const QList<QVariant>&);
41 
43 
47  QList<QVariant> indexedColors() const;
48  void setIndexedColors(const QList<QVariant>&);
50 
52 
55  QList<QVariant> indexedOpacities() const;
56  void setIndexedOpacities(const QList<QVariant>&);
58 
60 
63  QList<QVariant> visibilities() const;
64  void setVisibilities(const QList<QVariant>&);
66 
68 
71  QVariant opacityMapping() const;
72  void setOpacityMapping(const QVariant&);
74 
78  void applyPreset(const char* presetName);
79 
84  void indexedLookupStateUpdated(bool indexed);
85 
90  bool addActiveAnnotations(bool force);
91 
96  bool addActiveAnnotations(bool force, bool extend);
97 
102  QModelIndex currentIndex();
103 
107  QModelIndexList selectedIndexes();
108 
112  void setAnnotationsModel(pqAnnotationsModel* model);
113 
117  void setSupportsReorder(bool reorder);
118 
122  void sort(int column, Qt::SortOrder order = Qt::AscendingOrder);
123 
128  void allowsUserDefinedValues(bool allow);
129 
136  void allowsRegexpMatching(bool allow);
137 
142  void enablePresets(bool enable);
143 
147  void supportsVisibilityCheck(bool val);
148 
152  void supportsOpacityMapping(bool val);
153 
157  void setColumnVisibility(pqAnnotationsModel::ColumnRoles col, bool visible);
158 
160 
163  const char* currentPresetName();
164  void setCurrentPresetName(const char* name);
166 
170  QString currentAnnotationValue();
171 
175  QStringList selectedAnnotations();
176  void setSelectedAnnotations(const QStringList& annotations);
177 
181  bool presetLoadAnnotations();
182 
186  QRegularExpression presetRegularExpression();
187 
188 Q_SIGNALS:
192  void annotationsChanged();
193 
197  void indexedColorsChanged();
198 
202  void indexedOpacitiesChanged();
203 
207  void visibilitiesChanged();
208 
212  void opacityMappingChanged();
213 
217  void presetChanged(const QString& name);
218 
222  void selectionChanged(const QItemSelection&, const QItemSelection&);
223 
224 protected:
228  bool addActiveAnnotationsFromVisibleSources(bool force);
229 
230 private Q_SLOTS:
232 
236  void addAnnotation();
237  void removeAnnotation();
238  void addActiveAnnotations();
239  void addActiveAnnotationsFromVisibleSources();
240  void removeAllAnnotations();
242 
243  void onPresetApplied(const QString& presetName);
244 
250  void onDataChanged(const QModelIndex& topleft, const QModelIndex& btmright);
251 
257  void onDoubleClicked(const QModelIndex& idx);
258 
264  void onHeaderDoubleClicked(int section);
265 
269  void execGlobalOpacityDialog();
270 
274  void choosePreset(const char* presetName = nullptr);
275 
279  void saveAsNewPreset();
280  void saveAsPreset(const char* name, bool removeAnnotations, bool allowOverride);
281 
286  void updateOpacityColumnState();
287 
291  void editPastLastRow();
292 
293 private: // NOLINT(readability-redundant-access-specifiers)
294  Q_DISABLE_COPY(pqColorAnnotationsWidget)
295 
296  class pqInternals;
297  pqInternals* Internals;
298 };
299 
300 #endif
order
#define PQAPPLICATIONCOMPONENTS_EXPORT
name
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:140
pqColorAnnotationsWidget is used to edit annotations and colors