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 <memory> // for std::unique_ptr
24 #include <string> // for std::string
25 #include <utility> // for std::pair
26 #include <vector> // for std::vector
27 
28 class vtkCLIOptions;
30 
32 {
33 public:
35  void PrintSelf(ostream& os, vtkIndent indent) override;
36 
40  static vtkRemotingCoreConfiguration* GetInstance();
41 
42  //---------------------------------------------------------------------------
43  // Options added using `PopulateGlobalOptions`
44  //---------------------------------------------------------------------------
45 
50  vtkGetMacro(TellVersion, bool);
51 
56  vtkGetMacro(DisableRegistry, bool);
57 
62  vtkGetMacro(PrintMonitors, bool);
63 
64  //---------------------------------------------------------------------------
65  // Options added using `PopulateConnectionOptions`.
66  //---------------------------------------------------------------------------
67 
69 
75  vtkSetMacro(HostName, std::string);
76  vtkGetMacro(HostName, std::string);
78 
80 
86  vtkSetMacro(ClientHostName, std::string);
87  vtkGetMacro(ClientHostName, std::string);
89 
91 
99  vtkSetMacro(ServerPort, int);
100  vtkGetMacro(ServerPort, int);
102 
104 
108  vtkSetMacro(BindAddress, std::string);
109  vtkGetMacro(BindAddress, std::string);
111 
113 
119  vtkSetMacro(ReverseConnection, bool);
120  vtkGetMacro(ReverseConnection, bool);
122 
124 
129  vtkSetMacro(ConnectID, int);
130  vtkGetMacro(ConnectID, int);
132 
134 
139  vtkSetMacro(Timeout, int);
140  vtkGetMacro(Timeout, int);
142 
144 
149  vtkSetMacro(TimeoutCommand, std::string);
150  vtkGetMacro(TimeoutCommand, std::string);
152 
154 
158  vtkSetMacro(TimeoutCommandInterval, int);
159  vtkGetMacro(TimeoutCommandInterval, int);
161 
168  vtkGetMacro(ServerURL, std::string);
169 
174  vtkGetMacro(ServerResourceName, std::string);
175 
180  const std::vector<std::string>& GetServerConfigurationsFiles() const
181  {
182  return this->ServerConfigurationsFiles;
183  }
184 
186 
187  //---------------------------------------------------------------------------
188  // Options added using `PopulatePluginOptions`.
189  //---------------------------------------------------------------------------
190 
195  const std::vector<std::string>& GetPluginSearchPaths() const { return this->PluginSearchPaths; }
196 
200  const std::vector<std::string>& GetPlugins() const { return this->Plugins; }
202 
203  //---------------------------------------------------------------------------
204  // Options added using `PopulateRenderingOptions`.
205  //---------------------------------------------------------------------------
206 
211  bool GetUseStereoRendering();
212 
219  int GetStereoType();
220  const char* GetStereoTypeAsString();
221 
225  double GetEyeSeparation() const;
226 
230  bool GetUseOffAxisProjection() const;
231 
235  vtkGetVector2Macro(TileMullions, int);
236 
240  void GetTileDimensions(int dims[2]);
241  const int* GetTileDimensions();
242 
246  bool GetIsInTileDisplay() const;
247 
251  bool GetIsInCave() const;
252 
256  vtkDisplayConfiguration* GetDisplayConfiguration() const { return this->DisplayConfiguration; }
257 
265  vtkGetMacro(DisableXDisplayTests, bool);
266 
271  vtkGetMacro(ForceOffscreenRendering, bool);
272 
274  {
280  };
286  vtkGetMacro(OpenGLWindowBackend, OpenGLWindowBackendEnum);
287 
291  vtkGetMacro(ForceOnscreenRendering, bool);
292 
298  int GetEGLDeviceIndex();
299 
303  std::string GetDisplay();
304 
305  //---------------------------------------------------------------------------
306  // Options added using `PopulateMiscellaneousOptions`.
307  //---------------------------------------------------------------------------
308 
313  vtkGetMacro(MultiServerMode, bool);
314 
319  vtkGetMacro(MultiClientMode, bool);
320 
325  vtkGetMacro(DisableFurtherConnections, bool);
326 
327  //---------------------------------------------------------------------------
333  bool PopulateOptions(vtkCLIOptions* app, vtkProcessModule::ProcessTypes processType);
334  bool PopulateGlobalOptions(vtkCLIOptions* app, vtkProcessModule::ProcessTypes processType);
335  bool PopulateConnectionOptions(vtkCLIOptions* app, vtkProcessModule::ProcessTypes processType);
336  bool PopulatePluginOptions(vtkCLIOptions* app, vtkProcessModule::ProcessTypes processType);
337  bool PopulateRenderingOptions(vtkCLIOptions* app, vtkProcessModule::ProcessTypes processType);
338  bool PopulateMiscellaneousOptions(vtkCLIOptions* app, vtkProcessModule::ProcessTypes processType);
339 
343  void HandleDisplayEnvironment();
344 
345 protected:
347  ~vtkRemotingCoreConfiguration() override;
348 
349 private:
352  void operator=(const vtkRemotingCoreConfiguration&) = delete;
353 
354  enum DisplaysAssignmentModeEnum
355  {
356  CONTIGUOUS,
357  ROUNDROBIN
358  };
359 
360  bool TellVersion = false;
361  bool DisableRegistry = false;
362  std::string HostName = "localhost";
363  std::string ClientHostName = "localhost";
364  std::string BindAddress = "0.0.0.0";
365  int ServerPort = 0;
366  bool ReverseConnection = false;
367  int ConnectID = 0;
368  std::string ServerURL;
369  std::string ServerResourceName;
370  int Timeout = 0;
371  std::string TimeoutCommand;
372  int TimeoutCommandInterval = 60;
373  int StereoType = 0;
374  double EyeSeparation = 0.06;
375  bool DisableXDisplayTests = false;
376  bool ForceOnscreenRendering = false;
377  bool ForceOffscreenRendering = false;
378  OpenGLWindowBackendEnum OpenGLWindowBackend = OPENGL_WINDOW_BACKEND_DEFAULT;
379  int EGLDeviceIndex = -1;
380  DisplaysAssignmentModeEnum DisplaysAssignmentMode = ROUNDROBIN;
381  bool MultiServerMode = false;
382  bool MultiClientMode = false;
383  bool DisableFurtherConnections = false;
384  bool PrintMonitors = false;
385 
386  std::vector<std::string> Displays;
387  std::vector<std::string> PluginSearchPaths;
388  std::vector<std::string> Plugins;
389  std::vector<std::string> ServerConfigurationsFiles;
390  int TileDimensions[2] = { 0, 0 };
391  int TileMullions[2] = { 0, 0 };
392 
393  vtkDisplayConfiguration* DisplayConfiguration = nullptr;
394 
395  class vtkInternals;
396  std::unique_ptr<vtkInternals> Internals;
397 };
398 
399 #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 &)