pqChooseColorPresetReaction.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 pqChooseColorPresetReaction_h
5 #define pqChooseColorPresetReaction_h
6 
7 #include "pqReaction.h"
8 #include "vtkWeakPointer.h" // needed for vtkWeakPointer.
9 #include <QPointer> // needed for QPointer
10 #include <QRegularExpression> // needed for QRegularExpression.
11 
13 class pqPresetDialog;
14 class vtkSMProxy;
15 
44 {
45  Q_OBJECT
46  typedef pqReaction Superclass;
47 
48 public:
49  pqChooseColorPresetReaction(QAction* parent, bool track_active_objects = true);
50  ~pqChooseColorPresetReaction() override;
51 
52 public Q_SLOTS: // NOLINT(readability-redundant-access-specifiers)
58  bool choosePreset(const char* presetName = nullptr);
59 
63  void setRepresentation(pqDataRepresentation* repr);
64 
70  void setTransferFunction(vtkSMProxy* lut);
71 
75  void updateEnableState() override;
76 
82  void setAllowsRegexpMatching(bool allow) { this->AllowsRegexpMatching = allow; }
83 
87  QRegularExpression regularExpression();
88 
92  bool loadAnnotations();
93 
94 Q_SIGNALS:
98  void presetApplied(const QString&);
99 
100 private Q_SLOTS:
101  void applyCurrentPreset();
102 
107  void updateTransferFunction();
108 
109 protected:
113  void onTriggered() override;
114 
115 private:
116  Q_DISABLE_COPY(pqChooseColorPresetReaction)
117  QPointer<pqDataRepresentation> Representation;
118  vtkWeakPointer<vtkSMProxy> TransferFunctionProxy;
119  static QPointer<pqPresetDialog> PresetDialog;
120  bool AllowsRegexpMatching;
121 };
122 
123 #endif
pqDataRepresentation is the superclass for a display for a pqPipelineSource i.e.
pqPresetDialog is the dialog used by to show the user with a choice of color maps/opacity maps/preset...
virtual void updateEnableState()
Definition: pqReaction.h:48
#define PQAPPLICATIONCOMPONENTS_EXPORT
This is a superclass just to make it easier to collect all such reactions.
Definition: pqReaction.h:25
Reaction to pop up a color palette chooser dialog.
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:140
virtual void onTriggered()
Called when the action is triggered.
Definition: pqReaction.h:46
void setAllowsRegexpMatching(bool allow)
Show/hide widget in the dialog.