vtkInitializationHelper.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
12 #ifndef vtkInitializationHelper_h
13 #define vtkInitializationHelper_h
14 
15 #include "vtkObject.h"
16 #include "vtkParaViewDeprecation.h" // for deprecation macros
17 #include "vtkRemotingApplicationModule.h" // needed for exports
18 #include <string> // needed for std::string
19 
20 #if PARAVIEW_USE_PYTHON
21 #include "vtkPythonInterpreter.h"
22 #endif
23 
24 class vtkCLIOptions;
26 class vtkStringList;
27 
29 {
30 public:
32  void PrintSelf(ostream& os, vtkIndent indent) override;
33 
51  static bool Initialize(int argc, char** argv, int processType, vtkCLIOptions* options = nullptr,
52  bool enableStandardArgs = true);
53 
57  static bool Initialize(vtkStringList* argv, int processType);
58 
62  static bool Initialize(const char* executable, int type);
63 
77  static bool InitializeProcessModule(int argc, char** argv, int type);
78 
93  static bool InitializeGlobalOptions(int argc, char** argv, int processType,
94  vtkCLIOptions* options = nullptr, bool enableStandardArgs = true);
95 
112  static bool InitializeOtherOptions(int argc, char** argv, int processType,
113  vtkCLIOptions* options = nullptr, bool enableStandardArgs = true);
114 
129  static bool InitializeOptions(int argc, char** argv, int processType,
130  vtkCLIOptions* options = nullptr, bool enableStandardArgs = true);
131 
145  static bool InitializeSettings(int type, bool defaultCoreConfig);
146 
157  static bool InitializeOthers();
158 
163  PARAVIEW_DEPRECATED_IN_5_13_0("Use InitializeSettings and InitializeOthers instead")
164  static bool InitializeMiscellaneous(int type);
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 
227  static std::string GetUserSettingsDirectory();
228 
232  static std::string GetUserSettingsFilePath();
233 
234 protected:
235  vtkInitializationHelper() = default;
236  ~vtkInitializationHelper() override = default;
237 
241  static void LoadSettings();
242 
243 private:
245  void operator=(const vtkInitializationHelper&) = delete;
246 
251  static bool ParseOptions(int argc, char** argv, vtkCLIOptions* options,
252  vtkRemotingCoreConfiguration* coreConfig, bool checkForExit);
253 
254  static bool LoadSettingsFilesDuringInitialization;
255  static bool SaveUserSettingsFileDuringFinalization;
256  static std::string OrganizationName;
257  static std::string ApplicationName;
258  static int ExitCode;
259 };
260 
261 #endif
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
command line options manager
Definition: vtkCLIOptions.h:46
#define PARAVIEW_DEPRECATED_IN_5_13_0(reason)
#define VTKREMOTINGAPPLICATION_EXPORT
runtime configuration options for vtkRemotingCore module.
help class for python modules
void operator=(const vtkObjectBase &)
Manages allocation and freeing for a string list.
Definition: vtkStringList.h:18