pqCopyReaction.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 pqCopyReaction_h
5 #define pqCopyReaction_h
6 
7 #include "pqReaction.h"
8 
9 #include <QMap>
10 #include <QPointer>
11 #include <QSet>
12 
13 #include <iostream>
14 
15 class pqProxy;
16 class vtkSMProxy;
22 {
23  Q_OBJECT
24  typedef pqReaction Superclass;
25 
26 public:
27  pqCopyReaction(QAction* parent, bool paste_mode = false, bool pipeline_mode = false);
28  ~pqCopyReaction() override;
29 
34  static void copy(vtkSMProxy* dest, vtkSMProxy* source);
35 
36  static void copy();
37  static void paste();
38  static void copyPipeline();
39  static void pastePipeline();
40  static pqProxy* getSelectedPipelineRoot();
41  static bool canPastePipeline();
42 
43 public Q_SLOTS: // NOLINT(readability-redundant-access-specifiers)
47  void updateEnableState() override;
48 
49 Q_SIGNALS:
50  void pipelineCopied();
51 
52 protected:
56  void onTriggered() override
57  {
58  if (this->Paste && !this->CreatePipeline)
59  {
61  }
62  else if (this->Paste && this->CreatePipeline)
63  {
64  this->pastePipeline();
65  }
66  else if (!this->Paste && !this->CreatePipeline)
67  {
69  }
70  else
71  {
72  this->copyPipeline();
73  Q_EMIT this->pipelineCopied();
74  }
75  }
76  bool Paste;
78 
80 
87  static QSet<QPointer<pqProxy>> FilterSelection;
90 
92 
97  static QSet<pqCopyReaction*> PastePipelineContainer;
98  static QSet<pqCopyReaction*> CopyPipelineContainer;
99  static QMap<pqProxy*, QMetaObject::Connection> SelectedProxyConnections;
101 
102 private:
103  Q_DISABLE_COPY(pqCopyReaction)
104 };
105 
106 #endif
static pqProxy * SelectionRoot
Used for copy/paste pipeline.
static QSet< pqCopyReaction * > CopyPipelineContainer
Containers storing all instances of pipeline paster / copier.
virtual void updateEnableState()
Definition: pqReaction.h:48
static void paste()
#define PQAPPLICATIONCOMPONENTS_EXPORT
void onTriggered() override
Called when the action is triggered.
static void copy()
static QMap< pqProxy *, QMetaObject::Connection > SelectedProxyConnections
Containers storing all instances of pipeline paster / copier.
This is a superclass just to make it easier to collect all such reactions.
Definition: pqReaction.h:25
static QSet< pqCopyReaction * > PastePipelineContainer
Containers storing all instances of pipeline paster / copier.
static QSet< QPointer< pqProxy > > FilterSelection
Used for copy/paste pipeline.
source
This class represents any registered Server Manager proxy.
Definition: pqProxy.h:28
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:140
Reaction for copying sources/filters.