pqParaViewBehaviors.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 pqParaViewBehaviors_h
5 #define pqParaViewBehaviors_h
6 
7 #include "pqApplicationComponentsModule.h"
8 
9 #include "vtkParaViewDeprecation.h" // for PARAVIEW_DEPRECATED_IN_5_13_0
10 #include "vtkSetGet.h" // for VTK_LEGACY.
11 
12 #include <QFlags>
13 #include <QObject>
14 
15 class QMainWindow;
16 
41 #define PQ_BEHAVIOR_DEFINE_METHODS(_name) \
42  static void setEnable##_name(bool val) { pqParaViewBehaviors::_name = val; } \
43  static bool enable##_name() { return pqParaViewBehaviors::_name; }
44 
45 #define PQ_BEHAVIOR_DEFINE_METHODS_LEGACY(_name) \
46  VTK_LEGACY(static void setEnable##_name(bool val) { pqParaViewBehaviors::_name = val; }); \
47  VTK_LEGACY(static bool enable##_name() { return pqParaViewBehaviors::_name; });
48 
49 #define PQ_BEHAVIOR_DECLARE_FLAG(_name) static bool _name;
50 
51 class PQAPPLICATIONCOMPONENTS_EXPORT pqParaViewBehaviors : public QObject
52 {
53  Q_OBJECT
54  typedef QObject Superclass;
55 
56 public:
57  PQ_BEHAVIOR_DEFINE_METHODS(StandardPropertyWidgets);
58  PQ_BEHAVIOR_DEFINE_METHODS(StandardViewFrameActions);
59  PQ_BEHAVIOR_DEFINE_METHODS(StandardRecentlyUsedResourceLoader);
60  PQ_BEHAVIOR_DEFINE_METHODS(DataTimeStepBehavior);
61  PQ_BEHAVIOR_DEFINE_METHODS(SpreadSheetVisibilityBehavior);
62  PQ_BEHAVIOR_DEFINE_METHODS(PipelineContextMenuBehavior);
63  PQ_BEHAVIOR_DEFINE_METHODS(BlockContentMenu);
64  PQ_BEHAVIOR_DEFINE_METHODS(ObjectPickingBehavior);
65  PQ_BEHAVIOR_DEFINE_METHODS(DefaultViewBehavior);
66  PQ_BEHAVIOR_DEFINE_METHODS(UndoRedoBehavior);
67  PQ_BEHAVIOR_DEFINE_METHODS(AlwaysConnectedBehavior);
68  PQ_BEHAVIOR_DEFINE_METHODS(CrashRecoveryBehavior);
69  PQ_BEHAVIOR_DEFINE_METHODS(AutoSaveBehavior);
70  PQ_BEHAVIOR_DEFINE_METHODS(AutoLoadPluginXMLBehavior);
71  PQ_BEHAVIOR_DEFINE_METHODS(PluginDockWidgetsBehavior);
72  PQ_BEHAVIOR_DEFINE_METHODS(VerifyRequiredPluginBehavior);
73  PQ_BEHAVIOR_DEFINE_METHODS(PluginActionGroupBehavior);
74  PQ_BEHAVIOR_DEFINE_METHODS(PluginToolBarBehavior);
75  PQ_BEHAVIOR_DEFINE_METHODS(CommandLineOptionsBehavior);
76  PQ_BEHAVIOR_DEFINE_METHODS(PersistentMainWindowStateBehavior);
77  PQ_BEHAVIOR_DEFINE_METHODS(CollaborationBehavior);
78  PQ_BEHAVIOR_DEFINE_METHODS(ViewStreamingBehavior);
79  PQ_BEHAVIOR_DEFINE_METHODS(PluginSettingsBehavior);
81  PQ_BEHAVIOR_DEFINE_METHODS(QuickLaunchShortcuts);
82  PQ_BEHAVIOR_DEFINE_METHODS(LockPanelsBehavior);
83  PQ_BEHAVIOR_DEFINE_METHODS(PythonShellResetBehavior);
84  PQ_BEHAVIOR_DEFINE_METHODS(CustomShortcutBehavior);
85  PQ_BEHAVIOR_DEFINE_METHODS(MainWindowEventBehavior);
86 
88 
93  PQ_BEHAVIOR_DEFINE_METHODS(UsageLoggingBehavior);
95 
97 
101  PQ_BEHAVIOR_DEFINE_METHODS(LiveSourceBehavior);
103 
105 
113  PQ_BEHAVIOR_DEFINE_METHODS(WheelNeedsFocusBehavior);
115 
116  pqParaViewBehaviors(QMainWindow* window, QObject* parent = nullptr);
117  ~pqParaViewBehaviors() override;
118 
119 private:
120  Q_DISABLE_COPY(pqParaViewBehaviors)
121 
122  PQ_BEHAVIOR_DECLARE_FLAG(StandardPropertyWidgets);
123  PQ_BEHAVIOR_DECLARE_FLAG(StandardViewFrameActions);
124  PQ_BEHAVIOR_DECLARE_FLAG(StandardRecentlyUsedResourceLoader);
125  PQ_BEHAVIOR_DECLARE_FLAG(DataTimeStepBehavior);
126  PQ_BEHAVIOR_DECLARE_FLAG(SpreadSheetVisibilityBehavior);
127  PQ_BEHAVIOR_DECLARE_FLAG(PipelineContextMenuBehavior);
128  PQ_BEHAVIOR_DECLARE_FLAG(BlockContentMenu);
129  PQ_BEHAVIOR_DECLARE_FLAG(ObjectPickingBehavior);
130  PQ_BEHAVIOR_DECLARE_FLAG(DefaultViewBehavior);
131  PQ_BEHAVIOR_DECLARE_FLAG(UndoRedoBehavior);
132  PQ_BEHAVIOR_DECLARE_FLAG(AlwaysConnectedBehavior);
133  PQ_BEHAVIOR_DECLARE_FLAG(CrashRecoveryBehavior);
134  PQ_BEHAVIOR_DECLARE_FLAG(AutoSaveBehavior);
135  PQ_BEHAVIOR_DECLARE_FLAG(AutoLoadPluginXMLBehavior);
136  PQ_BEHAVIOR_DECLARE_FLAG(PluginDockWidgetsBehavior);
137  PQ_BEHAVIOR_DECLARE_FLAG(VerifyRequiredPluginBehavior);
138  PQ_BEHAVIOR_DECLARE_FLAG(PluginActionGroupBehavior);
139  PQ_BEHAVIOR_DECLARE_FLAG(PluginToolBarBehavior);
140  PQ_BEHAVIOR_DECLARE_FLAG(CommandLineOptionsBehavior);
141  PQ_BEHAVIOR_DECLARE_FLAG(PersistentMainWindowStateBehavior);
142  PQ_BEHAVIOR_DECLARE_FLAG(CollaborationBehavior);
143  PQ_BEHAVIOR_DECLARE_FLAG(ViewStreamingBehavior);
144  PQ_BEHAVIOR_DECLARE_FLAG(PluginSettingsBehavior);
145  PQ_BEHAVIOR_DECLARE_FLAG(ApplyBehavior);
146  PQ_BEHAVIOR_DECLARE_FLAG(QuickLaunchShortcuts);
147  PQ_BEHAVIOR_DECLARE_FLAG(LockPanelsBehavior);
148  PQ_BEHAVIOR_DECLARE_FLAG(PythonShellResetBehavior);
149  PQ_BEHAVIOR_DECLARE_FLAG(WheelNeedsFocusBehavior);
150  PQ_BEHAVIOR_DECLARE_FLAG(LiveSourceBehavior);
151  PQ_BEHAVIOR_DECLARE_FLAG(CustomShortcutBehavior);
152  PQ_BEHAVIOR_DECLARE_FLAG(MainWindowEventBehavior);
153  PQ_BEHAVIOR_DECLARE_FLAG(UsageLoggingBehavior);
154 };
155 
156 #undef PQ_BEHAVIOR_DECLARE_FLAG
157 #undef PQ_BEHAVIOR_DEFINE_METHODS
158 
159 #endif
#define PQ_BEHAVIOR_DEFINE_METHODS(_name)
creates all standard ParaView behaviourspqParaViewBehaviors creates all the behaviors used by ParaVie...
#define PQ_BEHAVIOR_DECLARE_FLAG(_name)