1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
|
/*=========================================================================
Program: ParaView
Module: vtkInitializationHelper.h
Copyright (c) Kitware, Inc.
All rights reserved.
See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
/**
* @class vtkInitializationHelper
* @brief help class for python modules
*
* This class is used by the python modules when they are loaded from
* python (as opposed to pvpython). It simply initializes the server
* manager so that it can be used.
*/
#ifndef vtkInitializationHelper_h
#define vtkInitializationHelper_h
#include "vtkObject.h"
#include "vtkPVServerManagerApplicationModule.h" // needed for exports
#include <string> // needed for std::string
class vtkPVOptions;
class VTKPVSERVERMANAGERAPPLICATION_EXPORT vtkInitializationHelper : public vtkObject
{
public:
vtkTypeMacro(vtkInitializationHelper, vtkObject);
void PrintSelf(ostream&, vtkIndent) VTK_OVERRIDE;
//@{
/**
* Initializes the server manager. Do not use the server manager
* before calling this.
*/
static void Initialize(const char* executable, int type);
static void Initialize(const char* executable, int type, vtkPVOptions* options);
//@}
/**
* Alternative API to initialize the server manager. This takes in the
* command line arguments and the vtkPVOptions instance to use to process the
* command line options.
*/
static void Initialize(int argc, char** argv, int type, vtkPVOptions* options);
/**
* Finalizes the server manager. Do not use the server manager
* after calling this.
*/
static void Finalize();
//@{
/**
* Initialization for standalone executables linking against a PV
* library. This is needed to insure that linker does not remove object
* factories' auto init during static linking. It also cleans up after
* protobuf.
*/
static void StandaloneInitialize();
static void StandaloneFinalize();
//@}
//@{
/**
* During initialization, vtkInitializationHelper reads "settings" files for
* configuring vtkSMSettings. To disable this processing of the settings file
* for an application (e.g. in Catalyst), turn this off. On by default.
*/
static void SetLoadSettingsFilesDuringInitialization(bool);
static bool GetLoadSettingsFilesDuringInitialization();
//@}
//@{
/**
* Sets the organization producing this application. This is
* "ParaView" by default, but can be different for branded applications.
*/
static void SetOrganizationName(const std::string& organizationName);
static const std::string& GetOrganizationName();
//@}
//@{
/**
* Sets the name of the application. This is "ParaView" by default, but
* can be different for branded applications.
*/
static void SetApplicationName(const std::string& appName);
static const std::string& GetApplicationName();
//@}
protected:
vtkInitializationHelper(){};
virtual ~vtkInitializationHelper(){};
/**
* Load user and site settings
*/
static void LoadSettings();
/**
* Get directory for user settings file. The last character is always the
* file path separator appropriate for the system.
*/
static std::string GetUserSettingsDirectory();
/**
* Get file path for the user settings file.
*/
static std::string GetUserSettingsFilePath();
private:
vtkInitializationHelper(const vtkInitializationHelper&) VTK_DELETE_FUNCTION;
void operator=(const vtkInitializationHelper&) VTK_DELETE_FUNCTION;
static bool LoadSettingsFilesDuringInitialization;
static bool SaveUserSettingsFileDuringFinalization;
static std::string OrganizationName;
static std::string ApplicationName;
};
#endif
|