pqCameraUndoRedoReaction.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 pqCameraUndoRedoReaction_h
5 #define pqCameraUndoRedoReaction_h
6 
7 #include "pqReaction.h"
8 #include <QPointer>
9 
10 class pqView;
11 
17 {
18  Q_OBJECT
19  typedef pqReaction Superclass;
20 
21 public:
27  pqCameraUndoRedoReaction(QAction* parent, bool undo, pqView* view = nullptr);
28 
32  static void undo(pqView* view);
33 
37  static void redo(pqView* view);
38 
39 protected Q_SLOTS:
40  void setEnabled(bool enable) { this->parentAction()->setEnabled(enable); }
41  void setActiveView(pqView*);
42 
43 protected: // NOLINT(readability-redundant-access-specifiers)
47  void onTriggered() override;
48 
49 private:
50  Q_DISABLE_COPY(pqCameraUndoRedoReaction)
51  QPointer<pqView> LastView;
52  bool Undo;
53 };
54 
55 #endif
#define PQAPPLICATIONCOMPONENTS_EXPORT
This is a PQ abstraction of a generic view module.
Definition: pqView.h:26
This is a superclass just to make it easier to collect all such reactions.
Definition: pqReaction.h:25
Reaction for camera undo or redo.
QAction * parentAction() const
Provides access to the parent action.
Definition: pqReaction.h:40
virtual void onTriggered()
Called when the action is triggered.
Definition: pqReaction.h:46