pqPresetGroupsManager.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 
5 #ifndef pqPresetGroupsManager_h
6 #define pqPresetGroupsManager_h
7 
8 #include "pqComponentsModule.h" // for exports
9 
10 #include <QList>
11 #include <QMap>
12 #include <QObject>
13 
64 {
65  Q_OBJECT
66  typedef QObject Superclass;
67 
68 public:
73  pqPresetGroupsManager(QObject* p);
74  ~pqPresetGroupsManager() override;
75 
79  int numberOfGroups();
83  int numberOfPresetsInGroup(const QString& groupName);
88  int presetRankInGroup(const QString& presetName, const QString& groupName);
92  QList<QString> groupNames();
96  QString groupName(int i);
97 
105  void loadGroups(const QString& json);
106 
112  void replaceGroups(const QString& json);
113 
118  bool loadGroupsFromSettings();
119 
124  void addToGroup(const QString& groupName, const QString& presetName);
125 
129  void removeFromGroup(const QString& groupName, const QString& presetName);
130 
134  void removeFromAllGroups(const QString& presetName);
135 
136  /*
137  * Get preset groups
138  */
139  static QString getPresetGroupsJson();
140 
141 public Q_SLOTS: // NOLINT(readability-redundant-access-specifiers)
145  void saveGroupsToSettings();
146 
147 Q_SIGNALS:
152  void groupsUpdated();
153 
154 private:
155  QList<QString> GroupNames;
156  QMap<QString, QList<QString>> Groups;
157 
164  void clearGroups();
165 };
166 
167 #endif
pqPresetGroupsManager is an object to manage the groups of color map presets displayed in the pqPrese...
#define PQCOMPONENTS_EXPORT