VTKFIG  0.20.20181114
Easy VTK based in situ visualization
vtkfig::internals::MainThread::MainThread ( )
private

Definition at line 52 of file vtkfigMainThread-2018-01-26-2205.cxx.

53  {
54  int wtime=5;
55  char* port_string= getenv("VTKFIG_PORT_NUMBER");
56  char* wtime_string=getenv("VTKFIG_WAIT_SECONDS");
57  char *debug_string=getenv("VTKFIG_DEBUG");
58  char *multi_string=getenv("VTKFIG_MULTITHREADED");
59  char *dbuff_string=getenv("VTKFIG_DOUBLEBUFFER");
60 
61 
62 
63  if (debug_string!=0)
64  debug_level=atoi(debug_string);
65 
66 
67 #if XXXCONFIG_APPLE
69  if (multi_string!=0 && atoi(multi_string))
70  {
71  if (debug_level>0)
72  cout << "overriding multithreading default (off) on APPLE" << endl;
74  }
75 #endif
77  if (multi_string!=0 && !atoi(multi_string))
78  {
79  if (debug_level>0)
80  cout << "overriding multithreading default (on) on" << endl;
82  }
83 
84  if (dbuff_string!=0)
85  this->double_buffering=atoi(dbuff_string);
86 
87 
88  if (wtime_string!=0)
89  wtime=atoi(wtime_string);
90 
91 
92  if (port_string!=0)
93  {
94  int port=atoi(port_string);
95  if (port<=0)
96  throw std::runtime_error("Invalid port number for server");
97  OpenConnection(port,wtime);
98  }
99 
100  if (debug_level>0)
101  {
102  char sc='c';
103  if (connection_open)
104  sc='s';
105 
107  cout << sc<< " try running multithreaded" << endl;
108  else
109  cout << sc<<" try running single threaded" << endl;
110  }
111  }
void OpenConnection(int port, int wtime)
Open connection to client.
bool double_buffering
Use of double buffering.
bool connection_open
State of connection to client.
int debug_level
Debug level for client communication.
bool try_running_multithreaded
Toggle multithreaded/single (at startup)

+ Here is the call graph for this function: