pqPresetDialog.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 pqPresetDialog_h
5 #define pqPresetDialog_h
6 
7 #include "pqComponentsModule.h" // for exports
8 #include <QDialog>
9 #include <QModelIndex>
10 #include <QScopedPointer> // for QScopedPointer
11 #include <vtk_jsoncpp_fwd.h> // for forward declarations
12 
13 class QModelIndex;
14 
25 class PQCOMPONENTS_EXPORT pqPresetDialog : public QDialog
26 {
27  Q_OBJECT
28  typedef QDialog Superclass;
29 
30 public:
35  enum Modes
36  {
39  SHOW_NON_INDEXED_COLORS_ONLY
40  };
41 
42  pqPresetDialog(QWidget* parent = nullptr, Modes mode = SHOW_ALL);
43  ~pqPresetDialog() override;
44 
48  void setMode(Modes mode);
49 
53  void setCurrentPreset(const char* presetName);
54 
58  const Json::Value& currentPreset();
59 
63  bool loadColors() const;
64 
69  bool loadOpacities() const;
70 
75  bool loadAnnotations() const;
76 
80  QRegularExpression regularExpression();
81 
87  bool usePresetRange() const;
88 
92  void setCustomizableLoadColors(bool state, bool defaultValue = true);
93 
97  void setCustomizableLoadAnnotations(bool state, bool defaultValue = true);
98 
102  void setCustomizableAnnotationsRegexp(bool state, bool defaultValue = false);
103 
107  void setCustomizableLoadOpacities(bool state, bool defaultValue = true);
108 
112  void setCustomizableUsePresetRange(bool state, bool defaultValue = false);
113 
114 Q_SIGNALS:
115  void applyPreset(const Json::Value& preset);
116 
117 protected Q_SLOTS:
118  void updateEnabledStateForSelection();
119  void updateForSelectedIndex(const QModelIndex& proxyIndex);
120  void triggerApply(const QModelIndex& proxyIndex = QModelIndex());
121  void removePreset(const QModelIndex& idx = QModelIndex());
122  void importPresets();
123  void exportPresets();
124 
125  void setPresetIsAdvanced(int newState);
126 
127 private Q_SLOTS:
128  void updateGroups();
129  void updateFiltering();
130 
131 private: // NOLINT(readability-redundant-access-specifiers)
132  Q_DISABLE_COPY(pqPresetDialog)
133  class pqInternals;
134  const QScopedPointer<pqInternals> Internals;
135 };
136 
137 #endif
#define PQCOMPONENTS_EXPORT
pqPresetDialog is the dialog used by to show the user with a choice of color maps/opacity maps/preset...
Modes
Used to control what kinds of presets are shown in the dialog.