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

Method Initialize

Filters/ParallelFlowPaths/vtkPStreamTracer.cxx:433–470  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

431 vtkTypeMacro(ProcessLocator, vtkObject);
432 static ProcessLocator* New();
433 void Initialize(vtkCompositeDataSet* data)
434 {
435 this->SetController(vtkMultiProcessController::GetGlobalController());
436 this->Rank = this->Controller->GetLocalProcessId();
437 this->NumProcs = this->Controller->GetNumberOfProcesses();
438 this->InitBoundingBoxes(this->NumProcs);
439
440 double bb[6];
441 InitBB(bb);
442
443 if (data)
444 {
445 vtkCompositeDataIterator* iter = data->NewIterator();
446 iter->InitTraversal();
447 while (!iter->IsDoneWithTraversal())
448 {
449 vtkDataSet* dataSet = vtkDataSet::SafeDownCast(iter->GetCurrentDataObject());
450 AssertNe(dataSet, nullptr);
451 UpdateBB(bb, dataSet->GetBounds());
452 iter->GoToNextItem();
453 }
454 iter->Delete();
455 }
456
457 PRINT(bb[0] << " " << bb[1] << " " << bb[2] << " " << bb[3] << " " << bb[4] << " " << bb[5]);
458 this->Controller->AllGather(bb, this->BoundingBoxes.data(), 6);
459
460#ifdef DEBUGTRACE
461 std::cout << "(" << Rank << ") BoundingBoxes: ";
462 for (int i = 0; i < NumProcs; i++)
463 {
464 double* box = this->GetBoundingBox(i);
465 std::cout << box[0] << " " << box[1] << " " << box[2] << " " << box[3] << " " << box[4] << " "
466 << box[5] << "; ";
467 }
468 std::cout << endl;
469#endif
470 }
471
472 vtkSetObjectMacro(Controller, vtkMultiProcessController);
473

Callers

nothing calls this directly

Calls 15

InitBoundingBoxesMethod · 0.95
GetBoundingBoxMethod · 0.95
InitBBFunction · 0.85
UpdateBBFunction · 0.85
PRINTFunction · 0.85
GetNumberOfProcessesMethod · 0.80
DeleteMethod · 0.65
SetControllerMethod · 0.45
GetLocalProcessIdMethod · 0.45
NewIteratorMethod · 0.45
InitTraversalMethod · 0.45
IsDoneWithTraversalMethod · 0.45

Tested by

no test coverage detected