vtkRemotingCoreConfiguration.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
17 #ifndef vtkRemotingCoreConfiguration_h
18 #define vtkRemotingCoreConfiguration_h
19 
20 #include "vtkObject.h"
21 #include "vtkProcessModule.h" // for vtkProcessModule::ProcessTypes
22 #include "vtkRemotingCoreModule.h" //needed for exports
23 #include <string> // for std::string
24 #include <utility> // for std::pair
25 #include <vector> // for std::vector
26 
27 class vtkCLIOptions;
29 
31 {
32 public:
34  void PrintSelf(ostream& os, vtkIndent indent) override;
35 
39  static vtkRemotingCoreConfiguration* GetInstance();
40 
41  //---------------------------------------------------------------------------
42  // Options added using `PopulateGlobalOptions`
43  //---------------------------------------------------------------------------
44 
49  vtkGetMacro(TellVersion, bool);
50 
55  vtkGetMacro(DisableRegistry, bool);
56 
61  vtkGetMacro(PrintMonitors, bool);
62 
63  //---------------------------------------------------------------------------
64  // Options added using `PopulateConnectionOptions`.
65  //---------------------------------------------------------------------------
66 
72  const std::string& GetHostName() const { return this->HostName; }
73 
79  const std::string& GetClientHostName() const { return this->ClientHostName; }
80 
87  vtkGetMacro(ServerPort, int);
88 
94  vtkGetMacro(ReverseConnection, bool);
95 
100  vtkGetMacro(ConnectID, int);
101 
106  vtkSetMacro(ConnectID, int);
107 
113  vtkGetMacro(Timeout, int);
114 
119  const std::string& GetTimeoutCommand() const { return this->TimeoutCommand; }
120 
124  vtkGetMacro(TimeoutCommandInterval, int);
125 
132  const std::string& GetServerURL() const { return this->ServerURL; }
133 
138  const std::string& GetServerResourceName() const { return this->ServerResourceName; }
139 
144  const std::vector<std::string>& GetServerConfigurationsFiles() const
145  {
146  return this->ServerConfigurationsFiles;
147  }
149 
150  //---------------------------------------------------------------------------
151  // Options added using `PopulatePluginOptions`.
152  //---------------------------------------------------------------------------
153 
158  const std::vector<std::string>& GetPluginSearchPaths() const { return this->PluginSearchPaths; }
159 
163  const std::vector<std::string>& GetPlugins() const { return this->Plugins; }
165 
166  //---------------------------------------------------------------------------
167  // Options added using `PopulateRenderingOptions`.
168  //---------------------------------------------------------------------------
169 
174  vtkGetMacro(UseStereoRendering, bool);
175 
180  vtkGetMacro(StereoType, int);
181  const char* GetStereoTypeAsString() const;
182 
186  double GetEyeSeparation() const;
187 
191  vtkGetVector2Macro(TileMullions, int);
192 
196  void GetTileDimensions(int dims[2]);
197  const int* GetTileDimensions();
198 
202  bool GetIsInTileDisplay() const;
203 
207  bool GetIsInCave() const;
208 
212  vtkDisplayConfiguration* GetDisplayConfiguration() const { return this->DisplayConfiguration; }
213 
221  vtkGetMacro(DisableXDisplayTests, bool);
222 
227  vtkGetMacro(ForceOffscreenRendering, bool);
228 
232  vtkGetMacro(ForceOnscreenRendering, bool);
233 
239  int GetEGLDeviceIndex();
240 
244  std::string GetDisplay();
245 
246  //---------------------------------------------------------------------------
247  // Options added using `PopulateMiscellaneousOptions`.
248  //---------------------------------------------------------------------------
249 
254  vtkGetMacro(MultiServerMode, bool);
255 
260  vtkGetMacro(MultiClientMode, bool);
261 
266  vtkGetMacro(DisableFurtherConnections, bool);
267 
268  //---------------------------------------------------------------------------
274  bool PopulateOptions(vtkCLIOptions* app, vtkProcessModule::ProcessTypes processType);
275  bool PopulateGlobalOptions(vtkCLIOptions* app, vtkProcessModule::ProcessTypes processType);
276  bool PopulateConnectionOptions(vtkCLIOptions* app, vtkProcessModule::ProcessTypes processType);
277  bool PopulatePluginOptions(vtkCLIOptions* app, vtkProcessModule::ProcessTypes processType);
278  bool PopulateRenderingOptions(vtkCLIOptions* app, vtkProcessModule::ProcessTypes processType);
279  bool PopulateMiscellaneousOptions(vtkCLIOptions* app, vtkProcessModule::ProcessTypes processType);
280 
284  void HandleDisplayEnvironment();
285 
286 protected:
288  ~vtkRemotingCoreConfiguration() override;
289 
290 private:
293  void operator=(const vtkRemotingCoreConfiguration&) = delete;
294 
295  enum DisplaysAssignmentModeEnum
296  {
297  CONTIGUOUS,
298  ROUNDROBIN
299  };
300 
301  bool TellVersion = false;
302  bool DisableRegistry = false;
303  std::string HostName = "localhost";
304  std::string ClientHostName = "localhost";
305  int ServerPort = 11111;
306  bool ReverseConnection = false;
307  int ConnectID = 0;
308  std::string ServerURL;
309  std::string ServerResourceName;
310  int Timeout = 0;
311  std::string TimeoutCommand;
312  int TimeoutCommandInterval = 60;
313  bool UseStereoRendering = false;
314  int StereoType = 0;
315  double EyeSeparation = 0.06;
316  bool DisableXDisplayTests = false;
317  bool ForceOnscreenRendering = false;
318  bool ForceOffscreenRendering = false;
319  int EGLDeviceIndex = -1;
320  DisplaysAssignmentModeEnum DisplaysAssignmentMode = ROUNDROBIN;
321  bool MultiServerMode = false;
322  bool MultiClientMode = false;
323  bool DisableFurtherConnections = false;
324  bool PrintMonitors = false;
325 
326  std::vector<std::string> Displays;
327  std::vector<std::string> PluginSearchPaths;
328  std::vector<std::string> Plugins;
329  std::vector<std::string> ServerConfigurationsFiles;
330  int TileDimensions[2] = { 0, 0 };
331  int TileMullions[2] = { 0, 0 };
332 
333  vtkDisplayConfiguration* DisplayConfiguration = nullptr;
334 };
335 
336 #endif
const std::vector< std::string > & GetServerConfigurationsFiles() const
On client processes, this provides list of server configurations files to use instead of the default ...
const std::string & GetClientHostName() const
Get the hostname for the "client" process.
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
const std::vector< std::string > & GetPluginSearchPaths() const
Get a list of paths to add to plugin search paths.
const std::string & GetTimeoutCommand() const
Get the timeout command, called regularly on server side and giving remaining time available for serv...
command line options manager
Definition: vtkCLIOptions.h:46
const std::string & GetHostName() const
Get the hostname to use.
vtkDisplayConfiguration * GetDisplayConfiguration() const
When in CAVE mode, returns the display configurations.
const std::string & GetServerURL() const
On client processes, this returns the server connection url to use to connect to the server process(e...
display configuration container
const std::string & GetServerResourceName() const
On client processes, this returns the server connection resource name to use to connect to the server...
#define VTKREMOTINGCORE_EXPORT
const std::vector< std::string > & GetPlugins() const
Get a list of names for plugins to load.
runtime configuration options for vtkRemotingCore module.
static vtkObject * New()
void operator=(const vtkObjectBase &)