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 
268  vtkGetMacro(ForceOnscreenRendering, bool);
269 
275  int GetEGLDeviceIndex();
276 
280  std::string GetDisplay();
281 
282  //---------------------------------------------------------------------------
283  // Options added using `PopulateMiscellaneousOptions`.
284  //---------------------------------------------------------------------------
285 
290  vtkGetMacro(MultiServerMode, bool);
291 
296  vtkGetMacro(MultiClientMode, bool);
297 
302  vtkGetMacro(DisableFurtherConnections, bool);
303 
304  //---------------------------------------------------------------------------
310  bool PopulateOptions(vtkCLIOptions* app, vtkProcessModule::ProcessTypes processType);
311  bool PopulateGlobalOptions(vtkCLIOptions* app, vtkProcessModule::ProcessTypes processType);
312  bool PopulateConnectionOptions(vtkCLIOptions* app, vtkProcessModule::ProcessTypes processType);
313  bool PopulatePluginOptions(vtkCLIOptions* app, vtkProcessModule::ProcessTypes processType);
314  bool PopulateRenderingOptions(vtkCLIOptions* app, vtkProcessModule::ProcessTypes processType);
315  bool PopulateMiscellaneousOptions(vtkCLIOptions* app, vtkProcessModule::ProcessTypes processType);
316 
320  void HandleDisplayEnvironment();
321 
322 protected:
324  ~vtkRemotingCoreConfiguration() override;
325 
326 private:
329  void operator=(const vtkRemotingCoreConfiguration&) = delete;
330 
331  enum DisplaysAssignmentModeEnum
332  {
333  CONTIGUOUS,
334  ROUNDROBIN
335  };
336 
337  bool TellVersion = false;
338  bool DisableRegistry = false;
339  std::string HostName = "localhost";
340  std::string ClientHostName = "localhost";
341  std::string BindAddress = "0.0.0.0";
342  int ServerPort = 0;
343  bool ReverseConnection = false;
344  int ConnectID = 0;
345  std::string ServerURL;
346  std::string ServerResourceName;
347  int Timeout = 0;
348  std::string TimeoutCommand;
349  int TimeoutCommandInterval = 60;
350  bool UseStereoRendering = false;
351  int StereoType = 0;
352  double EyeSeparation = 0.06;
353  bool DisableXDisplayTests = false;
354  bool ForceOnscreenRendering = false;
355  bool ForceOffscreenRendering = false;
356  int EGLDeviceIndex = -1;
357  DisplaysAssignmentModeEnum DisplaysAssignmentMode = ROUNDROBIN;
358  bool MultiServerMode = false;
359  bool MultiClientMode = false;
360  bool DisableFurtherConnections = false;
361  bool PrintMonitors = false;
362 
363  std::vector<std::string> Displays;
364  std::vector<std::string> PluginSearchPaths;
365  std::vector<std::string> Plugins;
366  std::vector<std::string> ServerConfigurationsFiles;
367  int TileDimensions[2] = { 0, 0 };
368  int TileMullions[2] = { 0, 0 };
369 
370  vtkDisplayConfiguration* DisplayConfiguration = nullptr;
371 };
372 
373 #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 &)