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 
68 
74  vtkSetMacro(HostName, std::string);
75  vtkGetMacro(HostName, std::string);
77 
79 
85  vtkSetMacro(ClientHostName, std::string);
86  vtkGetMacro(ClientHostName, std::string);
88 
90 
98  vtkSetMacro(ServerPort, int);
99  vtkGetMacro(ServerPort, int);
101 
103 
107  vtkSetMacro(BindAddress, std::string);
108  vtkGetMacro(BindAddress, std::string);
110 
112 
118  vtkSetMacro(ReverseConnection, bool);
119  vtkGetMacro(ReverseConnection, bool);
121 
123 
128  vtkSetMacro(ConnectID, int);
129  vtkGetMacro(ConnectID, int);
131 
133 
138  vtkSetMacro(Timeout, int);
139  vtkGetMacro(Timeout, int);
141 
143 
148  vtkSetMacro(TimeoutCommand, std::string);
149  vtkGetMacro(TimeoutCommand, std::string);
151 
153 
157  vtkSetMacro(TimeoutCommandInterval, int);
158  vtkGetMacro(TimeoutCommandInterval, int);
160 
167  vtkGetMacro(ServerURL, std::string);
168 
173  vtkGetMacro(ServerResourceName, std::string);
174 
179  const std::vector<std::string>& GetServerConfigurationsFiles() const
180  {
181  return this->ServerConfigurationsFiles;
182  }
183 
185 
186  //---------------------------------------------------------------------------
187  // Options added using `PopulatePluginOptions`.
188  //---------------------------------------------------------------------------
189 
194  const std::vector<std::string>& GetPluginSearchPaths() const { return this->PluginSearchPaths; }
195 
199  const std::vector<std::string>& GetPlugins() const { return this->Plugins; }
201 
202  //---------------------------------------------------------------------------
203  // Options added using `PopulateRenderingOptions`.
204  //---------------------------------------------------------------------------
205 
210  vtkGetMacro(UseStereoRendering, bool);
211 
216  vtkGetMacro(StereoType, int);
217  const char* GetStereoTypeAsString() const;
218 
222  double GetEyeSeparation() const;
223 
227  vtkGetVector2Macro(TileMullions, int);
228 
232  void GetTileDimensions(int dims[2]);
233  const int* GetTileDimensions();
234 
238  bool GetIsInTileDisplay() const;
239 
243  bool GetIsInCave() const;
244 
248  vtkDisplayConfiguration* GetDisplayConfiguration() const { return this->DisplayConfiguration; }
249 
257  vtkGetMacro(DisableXDisplayTests, bool);
258 
263  vtkGetMacro(ForceOffscreenRendering, bool);
264 
266  {
272  };
278  vtkGetMacro(OpenGLWindowBackend, OpenGLWindowBackendEnum);
279 
283  vtkGetMacro(ForceOnscreenRendering, bool);
284 
290  int GetEGLDeviceIndex();
291 
295  std::string GetDisplay();
296 
297  //---------------------------------------------------------------------------
298  // Options added using `PopulateMiscellaneousOptions`.
299  //---------------------------------------------------------------------------
300 
305  vtkGetMacro(MultiServerMode, bool);
306 
311  vtkGetMacro(MultiClientMode, bool);
312 
317  vtkGetMacro(DisableFurtherConnections, bool);
318 
319  //---------------------------------------------------------------------------
325  bool PopulateOptions(vtkCLIOptions* app, vtkProcessModule::ProcessTypes processType);
326  bool PopulateGlobalOptions(vtkCLIOptions* app, vtkProcessModule::ProcessTypes processType);
327  bool PopulateConnectionOptions(vtkCLIOptions* app, vtkProcessModule::ProcessTypes processType);
328  bool PopulatePluginOptions(vtkCLIOptions* app, vtkProcessModule::ProcessTypes processType);
329  bool PopulateRenderingOptions(vtkCLIOptions* app, vtkProcessModule::ProcessTypes processType);
330  bool PopulateMiscellaneousOptions(vtkCLIOptions* app, vtkProcessModule::ProcessTypes processType);
331 
335  void HandleDisplayEnvironment();
336 
337 protected:
339  ~vtkRemotingCoreConfiguration() override;
340 
341 private:
344  void operator=(const vtkRemotingCoreConfiguration&) = delete;
345 
346  enum DisplaysAssignmentModeEnum
347  {
348  CONTIGUOUS,
349  ROUNDROBIN
350  };
351 
352  bool TellVersion = false;
353  bool DisableRegistry = false;
354  std::string HostName = "localhost";
355  std::string ClientHostName = "localhost";
356  std::string BindAddress = "0.0.0.0";
357  int ServerPort = 0;
358  bool ReverseConnection = false;
359  int ConnectID = 0;
360  std::string ServerURL;
361  std::string ServerResourceName;
362  int Timeout = 0;
363  std::string TimeoutCommand;
364  int TimeoutCommandInterval = 60;
365  bool UseStereoRendering = false;
366  int StereoType = 0;
367  double EyeSeparation = 0.06;
368  bool DisableXDisplayTests = false;
369  bool ForceOnscreenRendering = false;
370  bool ForceOffscreenRendering = false;
371  OpenGLWindowBackendEnum OpenGLWindowBackend = OPENGL_WINDOW_BACKEND_DEFAULT;
372  int EGLDeviceIndex = -1;
373  DisplaysAssignmentModeEnum DisplaysAssignmentMode = ROUNDROBIN;
374  bool MultiServerMode = false;
375  bool MultiClientMode = false;
376  bool DisableFurtherConnections = false;
377  bool PrintMonitors = false;
378 
379  std::vector<std::string> Displays;
380  std::vector<std::string> PluginSearchPaths;
381  std::vector<std::string> Plugins;
382  std::vector<std::string> ServerConfigurationsFiles;
383  int TileDimensions[2] = { 0, 0 };
384  int TileMullions[2] = { 0, 0 };
385 
386  vtkDisplayConfiguration* DisplayConfiguration = nullptr;
387 };
388 
389 #endif
const std::vector< std::string > & GetServerConfigurationsFiles() const
On client processes, this provides list of server configurations files to use instead of the default ...
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.
command line options manager
Definition: vtkCLIOptions.h:46
vtkDisplayConfiguration * GetDisplayConfiguration() const
When in CAVE mode, returns the display configurations.
display configuration container
#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 &)