vtkCPPythonScriptV2Helper.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkCPPythonScriptV2Helper.h
5 
6  Copyright (c) Kitware, Inc.
7  All rights reserved.
8  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
23 #ifndef vtkCPPythonScriptV2Helper_h
24 #define vtkCPPythonScriptV2Helper_h
25 
26 #include "vtkObject.h"
27 #include "vtkPVPythonCatalystModule.h" // For windows import/export of shared libraries
28 
29 class vtkSMProxy;
31 
33 {
34 public:
37  void PrintSelf(ostream& os, vtkIndent indent) override;
38 
43  bool PrepareFromScript(const std::string& fname);
44 
48  bool IsImported() const;
49 
57  bool Import();
58 
62  bool CatalystInitialize();
63 
67  bool CatalystFinalize();
68 
72  bool CatalystExecute(int timestep, double time);
73 
75 
79  bool Import(vtkCPDataDescription* desc);
80  bool CatalystInitialize(vtkCPDataDescription* desc);
81  bool RequestDataDescription(vtkCPDataDescription* desc);
82  bool CatalystExecute(vtkCPDataDescription* desc);
84 
86 
91  static vtkCPPythonScriptV2Helper* GetActiveInstance();
92  void RegisterExtractor(vtkSMProxy* extractor);
93  void RegisterView(vtkSMProxy* view);
94  void SetOptions(vtkSMProxy* catalystOptions);
95  vtkGetObjectMacro(Options, vtkSMProxy);
96  vtkCPDataDescription* GetDataDescription() const { return this->DataDescription; }
97  vtkSMProxy* GetTrivialProducer(const char* inputname);
99 
100 protected:
103 
104  bool IsActivated(int timestep, double time);
105  bool IsLiveActivated();
106  void DoLive(int, double);
107 
108 private:
110  void operator=(const vtkCPPythonScriptV2Helper&) = delete;
111 
112  class vtkInternals;
113  vtkInternals* Internals;
114  vtkSMProxy* Options;
115  std::string Filename;
116  vtkCPDataDescription* DataDescription;
117 
118  static vtkCPPythonScriptV2Helper* ActiveInstance;
119 };
120 
121 #endif
#define VTKPVPYTHONCATALYST_EXPORT
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
an internal class encapsulating logic for Catalyst Python scripts.
vtkCPDataDescription * GetDataDescription() const
Internal methods.
time
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:152
static vtkObject * New()
void operator=(const vtkObjectBase &)
This class provides the description of the data for the coprocessor pipelines.