vtkInitializationHelper.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
19 #ifndef vtkInitializationHelper_h
20 #define vtkInitializationHelper_h
21 
22 #include "vtkObject.h"
23 #include "vtkParaViewDeprecation.h" // for deprecation macros
24 #include "vtkRemotingApplicationModule.h" // needed for exports
25 #include <string> // needed for std::string
26 
27 #if PARAVIEW_USE_PYTHON
28 #include "vtkPythonInterpreter.h"
29 #endif
30 
31 class vtkCLIOptions;
33 class vtkStringList;
34 
36 {
37 public:
39  void PrintSelf(ostream& os, vtkIndent indent) override;
40 
58  static bool Initialize(int argc, char** argv, int processType, vtkCLIOptions* options = nullptr,
59  bool enableStandardArgs = true);
60 
64  static bool Initialize(vtkStringList* argv, int processType);
65 
69  static bool Initialize(const char* executable, int type);
70 
84  static bool InitializeProcessModule(int argc, char** argv, int type);
85 
100  static bool InitializeGlobalOptions(int argc, char** argv, int processType,
101  vtkCLIOptions* options = nullptr, bool enableStandardArgs = true);
102 
119  static bool InitializeOtherOptions(int argc, char** argv, int processType,
120  vtkCLIOptions* options = nullptr, bool enableStandardArgs = true);
121 
136  static bool InitializeOptions(int argc, char** argv, int processType,
137  vtkCLIOptions* options = nullptr, bool enableStandardArgs = true);
138 
152  static bool InitializeSettings(int type, bool defaultCoreConfig);
153 
164  static bool InitializeOthers();
165 
171  static void InitializePythonVirtualEnvironment();
172 
177  static void Finalize();
178 
182  static int GetExitCode() { return vtkInitializationHelper::ExitCode; }
183 
185 
191  static void StandaloneInitialize();
192  static void StandaloneFinalize();
194 
196 
201  static void SetLoadSettingsFilesDuringInitialization(bool);
202  static bool GetLoadSettingsFilesDuringInitialization();
204 
206 
210  static void SetOrganizationName(const std::string& organizationName);
211  static const std::string& GetOrganizationName();
213 
215 
219  static void SetApplicationName(const std::string& appName);
220  static const std::string& GetApplicationName();
222 
223 protected:
224  vtkInitializationHelper() = default;
225  ~vtkInitializationHelper() override = default;
226 
230  static void LoadSettings();
231 
232 private:
234  void operator=(const vtkInitializationHelper&) = delete;
235 
240  static bool ParseOptions(int argc, char** argv, vtkCLIOptions* options,
241  vtkRemotingCoreConfiguration* coreConfig, bool checkForExit);
242 
243  static bool LoadSettingsFilesDuringInitialization;
244  static bool SaveUserSettingsFileDuringFinalization;
245  static std::string OrganizationName;
246  static std::string ApplicationName;
247  static int ExitCode;
248 };
249 
250 #endif
static int GetExitCode()
Returns the exit code after Initialize.
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
command line options manager
Definition: vtkCLIOptions.h:46
#define VTKREMOTINGAPPLICATION_EXPORT
runtime configuration options for vtkRemotingCore module.
Helpers class to initialize ParaView Clients.
void operator=(const vtkObjectBase &)
Manages allocation and freeing for a string list.
Definition: vtkStringList.h:20