vtkInitializationHelper.h
Go to the documentation of this file.
1 
2 /*=========================================================================
3 
4  Program: ParaView
5  Module: vtkInitializationHelper.h
6 
7  Copyright (c) Kitware, Inc.
8  All rights reserved.
9  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
10 
11  This software is distributed WITHOUT ANY WARRANTY; without even
12  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13  PURPOSE. See the above copyright notice for more information.
14 
15 =========================================================================*/
25 #ifndef vtkInitializationHelper_h
26 #define vtkInitializationHelper_h
27 
28 #include "vtkObject.h"
29 #include "vtkParaViewDeprecation.h" // for PARAVIEW_DEPRECATED_IN_5_10_0
30 #include "vtkRemotingApplicationModule.h" // needed for exports
31 #include <string> // needed for std::string
32 
33 class vtkPVOptions;
34 class vtkCLIOptions;
35 class vtkStringList;
36 
38 {
39 public:
41  void PrintSelf(ostream& os, vtkIndent indent) override;
42 
53  static bool Initialize(int argc, char** argv, int processType, vtkCLIOptions* options = nullptr,
54  bool enableStandardArgs = true);
55 
59  static bool Initialize(vtkStringList* argv, int processType);
60 
64  static bool Initialize(const char* executable, int type);
65 
70  static void Finalize();
71 
75  static int GetExitCode() { return vtkInitializationHelper::ExitCode; }
76 
78 
84  static void StandaloneInitialize();
85  static void StandaloneFinalize();
87 
89 
94  static void SetLoadSettingsFilesDuringInitialization(bool);
95  static bool GetLoadSettingsFilesDuringInitialization();
97 
99 
103  static void SetOrganizationName(const std::string& organizationName);
104  static const std::string& GetOrganizationName();
106 
108 
112  static void SetApplicationName(const std::string& appName);
113  static const std::string& GetApplicationName();
115 
120  static std::string GetUserSettingsDirectory();
121 
125  static std::string GetUserSettingsFilePath();
126 
131  PARAVIEW_DEPRECATED_IN_5_10_0("Use the `vtkCLIOptions` overload")
132  static void Initialize(const char* executable, int type, vtkPVOptions* options);
133  PARAVIEW_DEPRECATED_IN_5_10_0("Use the `vtkCLIOptions` overload")
134  static void Initialize(int argc, char** argv, int type, vtkPVOptions* options);
135 
136 protected:
137  vtkInitializationHelper() = default;
138  ~vtkInitializationHelper() override = default;
139 
143  static void LoadSettings();
144 
145 private:
147  void operator=(const vtkInitializationHelper&) = delete;
148 
149  static bool LoadSettingsFilesDuringInitialization;
150  static bool SaveUserSettingsFileDuringFinalization;
151  static std::string OrganizationName;
152  static std::string ApplicationName;
153  static int ExitCode;
154 };
155 
156 #endif
#define PARAVIEW_DEPRECATED_IN_5_10_0(reason)
type
static int GetExitCode()
Returns the exit code after Initialize.
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
command line options manager
Definition: vtkCLIOptions.h:58
#define VTKREMOTINGAPPLICATION_EXPORT
help class for python modules
ParaView options storage.
Definition: vtkPVOptions.h:38
void operator=(const vtkObjectBase &)
Manages allocation and freeing for a string list.
Definition: vtkStringList.h:30