pqPythonManager.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 pqPythonManager_h
5 #define pqPythonManager_h
6 
7 #include "pqPythonModule.h" // for exports
8 #include "vtkType.h" // for vtkTypeUInt32
9 
10 #include <QObject>
11 #include <QVector>
12 
13 class QWidget;
14 class QToolBar;
16 class pqServer;
17 
28 class PQPYTHON_EXPORT pqPythonManager : public QObject
29 {
30  Q_OBJECT
31 
32 public:
33  pqPythonManager(QObject* parent = nullptr);
34  ~pqPythonManager() override;
35 
39  pqPythonMacroSupervisor* macroSupervisor() const;
40 
44  bool initializeInterpreter();
45 
50  bool interpreterIsInitialized();
51 
53 
58  void addWidgetForRunMacros(QWidget* widget);
59  void addWidgetForEditMacros(QWidget* widget);
60  void addWidgetForDeleteMacros(QWidget* widget);
62 
66  void addMacro(const QString& fileName, vtkTypeUInt32 location = 0x10 /*vtkPVSession::CLIENT*/);
67 
72  void updateMacroList();
73 
74 public Q_SLOTS: // NOLINT(readability-redundant-access-specifiers)
75 
83  void executeCode(const QByteArray& code, const QVector<QByteArray>& pre_push = {},
84  const QVector<QByteArray>& post_push = {});
85 
90  void executeScript(
91  const QString& filename, vtkTypeUInt32 location = 0x10 /*vtkPVSession::CLIENT*/);
92 
98  void executeScriptAndRender(
99  const QString& filename, vtkTypeUInt32 location = 0x10 /*vtkPVSession::CLIENT*/);
100 
104  void editMacro(const QString& fileName);
105 
106 private:
107  struct pqInternal;
108  pqInternal* Internal;
109 };
110 #endif
location
#define PQPYTHON_EXPORT
pqPythonManager is a class to facilitate the use of a python interpreter by various paraview GUI comp...
pqServer (should be renamed to pqSession) is a pqServerManagerModelItem subclass that represents a vt...
Definition: pqServer.h:35