vtkRemotingCoreConfiguration.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkRemotingCoreConfiguration.h
5 
6  Copyright (c) Kitware, Inc.
7  All rights reserved.
8  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
29 #ifndef vtkRemotingCoreConfiguration_h
30 #define vtkRemotingCoreConfiguration_h
31 
32 #include "vtkObject.h"
33 #include "vtkProcessModule.h" // for vtkProcessModule::ProcessTypes
34 #include "vtkRemotingCoreModule.h" //needed for exports
35 #include <string> // for std::string
36 #include <utility> // for std::pair
37 #include <vector> // for std::vector
38 
39 class vtkCLIOptions;
41 
43 {
44 public:
46  void PrintSelf(ostream& os, vtkIndent indent) override;
47 
51  static vtkRemotingCoreConfiguration* GetInstance();
52 
53  //---------------------------------------------------------------------------
54  // Options added using `PopulateGlobalOptions`
55  //---------------------------------------------------------------------------
56 
61  vtkGetMacro(TellVersion, bool);
62 
67  vtkGetMacro(DisableRegistry, bool);
68 
73  vtkGetMacro(PrintMonitors, bool);
74 
75  //---------------------------------------------------------------------------
76  // Options added using `PopulateConnectionOptions`.
77  //---------------------------------------------------------------------------
78 
84  const std::string& GetHostName() const { return this->HostName; }
85 
91  const std::string& GetClientHostName() const { return this->ClientHostName; }
92 
99  vtkGetMacro(ServerPort, int);
100 
106  vtkGetMacro(ReverseConnection, bool);
107 
112  vtkGetMacro(ConnectID, int);
113 
118  vtkSetMacro(ConnectID, int);
119 
125  vtkGetMacro(Timeout, int);
126 
131  const std::string& GetTimeoutCommand() const { return this->TimeoutCommand; }
132 
139  const std::string& GetServerURL() const { return this->ServerURL; }
140 
145  const std::string& GetServerResourceName() const { return this->ServerResourceName; }
146 
151  const std::vector<std::string>& GetServerConfigurationsFiles() const
152  {
153  return this->ServerConfigurationsFiles;
154  }
156 
157  //---------------------------------------------------------------------------
158  // Options added using `PopulatePluginOptions`.
159  //---------------------------------------------------------------------------
160 
165  const std::vector<std::string>& GetPluginSearchPaths() const { return this->PluginSearchPaths; }
166 
170  const std::vector<std::string>& GetPlugins() const { return this->Plugins; }
172 
173  //---------------------------------------------------------------------------
174  // Options added using `PopulateRenderingOptions`.
175  //---------------------------------------------------------------------------
176 
181  vtkGetMacro(UseStereoRendering, bool);
182 
187  vtkGetMacro(StereoType, int);
188  const char* GetStereoTypeAsString() const;
189 
193  double GetEyeSeparation() const;
194 
198  vtkGetVector2Macro(TileMullions, int);
199 
203  void GetTileDimensions(int dims[2]);
204  const int* GetTileDimensions();
205 
209  bool GetIsInTileDisplay() const;
210 
214  bool GetIsInCave() const;
215 
219  vtkDisplayConfiguration* GetDisplayConfiguration() const { return this->DisplayConfiguration; }
220 
228  vtkGetMacro(DisableXDisplayTests, bool);
229 
234  vtkGetMacro(ForceOffscreenRendering, bool);
235 
239  vtkGetMacro(ForceOnscreenRendering, bool);
240 
246  int GetEGLDeviceIndex();
247 
251  std::string GetDisplay();
252 
253  //---------------------------------------------------------------------------
254  // Options added using `PopulateMiscellaneousOptions`.
255  //---------------------------------------------------------------------------
256 
261  vtkGetMacro(MultiServerMode, bool);
262 
267  vtkGetMacro(MultiClientMode, bool);
268 
273  vtkGetMacro(DisableFurtherConnections, bool);
274 
275  //---------------------------------------------------------------------------
281  bool PopulateOptions(vtkCLIOptions* app, vtkProcessModule::ProcessTypes processType);
282  bool PopulateGlobalOptions(vtkCLIOptions* app, vtkProcessModule::ProcessTypes processType);
283  bool PopulateConnectionOptions(vtkCLIOptions* app, vtkProcessModule::ProcessTypes processType);
284  bool PopulatePluginOptions(vtkCLIOptions* app, vtkProcessModule::ProcessTypes processType);
285  bool PopulateRenderingOptions(vtkCLIOptions* app, vtkProcessModule::ProcessTypes processType);
286  bool PopulateMiscellaneousOptions(vtkCLIOptions* app, vtkProcessModule::ProcessTypes processType);
287 
291  void HandleDisplayEnvironment();
292 
293 protected:
295  ~vtkRemotingCoreConfiguration() override;
296 
297 private:
300  void operator=(const vtkRemotingCoreConfiguration&) = delete;
301 
302  enum DisplaysAssignmentModeEnum
303  {
304  CONTIGUOUS,
305  ROUNDROBIN
306  };
307 
308  bool TellVersion = false;
309  bool DisableRegistry = false;
310  std::string HostName = "localhost";
311  std::string ClientHostName = "localhost";
312  int ServerPort = 11111;
313  bool ReverseConnection = false;
314  int ConnectID = 0;
315  std::string ServerURL;
316  std::string ServerResourceName;
317  int Timeout = 0;
318  std::string TimeoutCommand;
319  bool UseStereoRendering = false;
320  int StereoType = 0;
321  double EyeSeparation = 0.06;
322  bool DisableXDisplayTests = false;
323  bool ForceOnscreenRendering = false;
324  bool ForceOffscreenRendering = false;
325  int EGLDeviceIndex = -1;
326  DisplaysAssignmentModeEnum DisplaysAssignmentMode = ROUNDROBIN;
327  bool MultiServerMode = false;
328  bool MultiClientMode = false;
329  bool DisableFurtherConnections = false;
330  bool PrintMonitors = false;
331 
332  std::vector<std::string> Displays;
333  std::vector<std::string> PluginSearchPaths;
334  std::vector<std::string> Plugins;
335  std::vector<std::string> ServerConfigurationsFiles;
336  int TileDimensions[2] = { 0, 0 };
337  int TileMullions[2] = { 0, 0 };
338 
339  vtkDisplayConfiguration* DisplayConfiguration = nullptr;
340 };
341 
342 #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:58
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 &)