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  bool GetUseOffAxisProjection() const;
228 
232  vtkGetVector2Macro(TileMullions, int);
233 
237  void GetTileDimensions(int dims[2]);
238  const int* GetTileDimensions();
239 
243  bool GetIsInTileDisplay() const;
244 
248  bool GetIsInCave() const;
249 
253  vtkDisplayConfiguration* GetDisplayConfiguration() const { return this->DisplayConfiguration; }
254 
262  vtkGetMacro(DisableXDisplayTests, bool);
263 
268  vtkGetMacro(ForceOffscreenRendering, bool);
269 
271  {
277  };
283  vtkGetMacro(OpenGLWindowBackend, OpenGLWindowBackendEnum);
284 
288  vtkGetMacro(ForceOnscreenRendering, bool);
289 
295  int GetEGLDeviceIndex();
296 
300  std::string GetDisplay();
301 
302  //---------------------------------------------------------------------------
303  // Options added using `PopulateMiscellaneousOptions`.
304  //---------------------------------------------------------------------------
305 
310  vtkGetMacro(MultiServerMode, bool);
311 
316  vtkGetMacro(MultiClientMode, bool);
317 
322  vtkGetMacro(DisableFurtherConnections, bool);
323 
324  //---------------------------------------------------------------------------
330  bool PopulateOptions(vtkCLIOptions* app, vtkProcessModule::ProcessTypes processType);
331  bool PopulateGlobalOptions(vtkCLIOptions* app, vtkProcessModule::ProcessTypes processType);
332  bool PopulateConnectionOptions(vtkCLIOptions* app, vtkProcessModule::ProcessTypes processType);
333  bool PopulatePluginOptions(vtkCLIOptions* app, vtkProcessModule::ProcessTypes processType);
334  bool PopulateRenderingOptions(vtkCLIOptions* app, vtkProcessModule::ProcessTypes processType);
335  bool PopulateMiscellaneousOptions(vtkCLIOptions* app, vtkProcessModule::ProcessTypes processType);
336 
340  void HandleDisplayEnvironment();
341 
342 protected:
344  ~vtkRemotingCoreConfiguration() override;
345 
346 private:
349  void operator=(const vtkRemotingCoreConfiguration&) = delete;
350 
351  enum DisplaysAssignmentModeEnum
352  {
353  CONTIGUOUS,
354  ROUNDROBIN
355  };
356 
357  bool TellVersion = false;
358  bool DisableRegistry = false;
359  std::string HostName = "localhost";
360  std::string ClientHostName = "localhost";
361  std::string BindAddress = "0.0.0.0";
362  int ServerPort = 0;
363  bool ReverseConnection = false;
364  int ConnectID = 0;
365  std::string ServerURL;
366  std::string ServerResourceName;
367  int Timeout = 0;
368  std::string TimeoutCommand;
369  int TimeoutCommandInterval = 60;
370  bool UseStereoRendering = false;
371  int StereoType = 0;
372  double EyeSeparation = 0.06;
373  bool DisableXDisplayTests = false;
374  bool ForceOnscreenRendering = false;
375  bool ForceOffscreenRendering = false;
376  OpenGLWindowBackendEnum OpenGLWindowBackend = OPENGL_WINDOW_BACKEND_DEFAULT;
377  int EGLDeviceIndex = -1;
378  DisplaysAssignmentModeEnum DisplaysAssignmentMode = ROUNDROBIN;
379  bool MultiServerMode = false;
380  bool MultiClientMode = false;
381  bool DisableFurtherConnections = false;
382  bool PrintMonitors = false;
383 
384  std::vector<std::string> Displays;
385  std::vector<std::string> PluginSearchPaths;
386  std::vector<std::string> Plugins;
387  std::vector<std::string> ServerConfigurationsFiles;
388  int TileDimensions[2] = { 0, 0 };
389  int TileMullions[2] = { 0, 0 };
390 
391  vtkDisplayConfiguration* DisplayConfiguration = nullptr;
392 };
393 
394 #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 &)