MCPcopy Create free account
hub / github.com/Kitware/VTK / SetController

Method SetController

Filters/Parallel/vtkPKdTree.cxx:151–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

149 this->FreeFieldArrayMinMax();
150}
151void vtkPKdTree::SetController(vtkMultiProcessController* c)
152{
153 if (this->Controller == c)
154 {
155 return;
156 }
157
158 if ((c == nullptr) || (c->GetNumberOfProcesses() == 0))
159 {
160 this->NumProcesses = 1;
161 this->MyId = 0;
162 }
163
164 this->Modified();
165
166 if (this->Controller != nullptr)
167 {
168 this->Controller->UnRegister(this);
169 this->Controller = nullptr;
170 }
171
172 if (c == nullptr)
173 {
174 return;
175 }
176
177 vtkSocketController* sc = vtkSocketController::SafeDownCast(c);
178
179 if (sc)
180 {
181 vtkErrorMacro(<< "vtkPKdTree communication will fail with a socket controller");
182
183 return;
184 }
185
186 this->NumProcesses = c->GetNumberOfProcesses();
187
188 this->Controller = c;
189 this->MyId = c->GetLocalProcessId();
190 c->Register(this);
191}
192//------------------------------------------------------------------------------
193// Parallel k-d tree build, Floyd and Rivest (1975) select algorithm
194// for median finding.

Calls 5

GetNumberOfProcessesMethod · 0.80
ModifiedMethod · 0.45
UnRegisterMethod · 0.45
GetLocalProcessIdMethod · 0.45
RegisterMethod · 0.45