pqScalarBarVisibilityReaction.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 pqScalarBarVisibilityReaction_h
5 #define pqScalarBarVisibilityReaction_h
6 
7 #include "pqReaction.h"
8 #include <QPointer>
9 
11 class pqTimer;
12 class vtkSMProxy;
13 
19 {
20  Q_OBJECT
21  typedef pqReaction Superclass;
22 
23 public:
28  pqScalarBarVisibilityReaction(QAction* parent, bool track_active_objects = true);
30 
34  pqDataRepresentation* representation() const;
35 
39  vtkSMProxy* scalarBarProxy() const;
40 
41 public Q_SLOTS: // NOLINT(readability-redundant-access-specifiers)
45  void setRepresentation(pqDataRepresentation*);
46 
50  void setScalarBarVisibility(bool visible);
51 
52 protected Q_SLOTS:
56  void updateEnableState() override;
57 
58 protected: // NOLINT(readability-redundant-access-specifiers)
62  void onTriggered() override { this->setScalarBarVisibility(this->parentAction()->isChecked()); }
63 
64 private:
65  Q_DISABLE_COPY(pqScalarBarVisibilityReaction)
66 
67  bool BlockSignals;
68  bool TrackActiveObjects;
69  QPointer<pqDataRepresentation> CachedRepresentation;
70  QPointer<QObject> CachedScalarBar;
71  QPointer<QObject> CachedView;
72  pqTimer* Timer;
73 };
74 
75 #endif
pqDataRepresentation is the superclass for a display for a pqPipelineSource i.e.
void onTriggered() override
Called when the action is triggered.
virtual void updateEnableState()
Definition: pqReaction.h:48
#define PQAPPLICATIONCOMPONENTS_EXPORT
Reaction to toggle scalar bar visibility.
This is a superclass just to make it easier to collect all such reactions.
Definition: pqReaction.h:25
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:140
QAction * parentAction() const
Provides access to the parent action.
Definition: pqReaction.h:40