vtkInSituInitializationHelper.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
31 #ifndef vtkInSituInitializationHelper_h
32 #define vtkInSituInitializationHelper_h
33 
34 #include "vtkObject.h"
35 #include "vtkPVInSituModule.h" // For windows import/export of shared libraries
36 
37 class vtkCPCxxHelper;
38 class vtkInSituPipeline;
39 class vtkSMProxy;
40 class vtkSMSourceProxy;
41 // forward declare conduit_node and its typedef.
42 // it has to be identical to the one in conduit.hpp
43 struct conduit_node_impl;
44 typedef struct conduit_node_impl conduit_node;
45 
46 #include <string> // for std::string
47 #include <vector> // for std::vector
48 
50 {
51 public:
53  void PrintSelf(ostream& os, vtkIndent indent) override;
54 
68  static void Initialize(vtkTypeUInt64 comm);
69 
74  static void Finalize();
75 
82  static vtkInSituPipeline* AddPipeline(const std::string& pipeline_name, const std::string& path);
83 
87  static void AddPipeline(vtkInSituPipeline* pipeline);
88 
96  static void SetProducer(const std::string& channelName, vtkSMSourceProxy* producer);
97 
101  static vtkSMSourceProxy* GetProducer(const std::string& channelName);
102 
106  static void UpdateAllProducers(double time);
107 
109 
113  static void MarkProducerModified(const std::string& channelName);
114  static void MarkProducerModified(vtkSMSourceProxy* producer);
116 
120  static bool ExecutePipelines(int timestep, double time,
121  const std::vector<std::string>& pipelines = {},
122  const std::vector<std::string>& parameters = {});
123 
124  // This overload accept the "catalyst/state" node of the ParaView Blueprint.
125  // When using this overload the conduit node will become available also via the catalyst script
126  static bool ExecutePipelines(const conduit_node* catalyst_state);
127 
131  static bool GetResultsFromPipelines(conduit_node* catalyst_params);
132 
134 
138  static int GetTimeStep();
139  static double GetTime();
141 
148  static conduit_node* GetCatalystParameters();
149 
154  static bool IsInitialized() { return vtkInSituInitializationHelper::Internals != nullptr; }
155 
159  static bool IsPythonSupported();
160 
164  static void GetSteerableProxies(std::vector<std::pair<std::string, vtkSMProxy*>>& proxies);
165 
170  static void UpdateSteerableParameters(
171  vtkSMProxy* steerableProxy, const char* steerableSourceName);
172 
173 protected:
175  ~vtkInSituInitializationHelper() override;
176 
177 private:
179  void operator=(const vtkInSituInitializationHelper&) = delete;
180 
181  static void UpdateSteerableProxies();
182  static int GetAttributeTypeFromString(const std::string& associationString);
183 
184  static int WasInitializedOnce;
185  static int WasFinalizedOnce;
186 
187  class vtkInternals;
188  static vtkInternals* Internals;
189 };
190 
191 #endif
struct conduit_node_impl conduit_node
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
static bool IsInitialized()
Returns true if vtkInSituInitializationHelper has been initialized; which means that ParaView is oper...
Singleton class for initializing without python.
proxy for a VTK source on a server
#define VTKPVINSITU_EXPORT
initialization helper for in situ environments.
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:140
abstract base class for all in situ pipelines.
void operator=(const vtkObjectBase &)