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

Method BuildLocator

Common/DataModel/vtkStaticPointLocator2DPrivate.h:529–552  ·  view source on GitHub ↗

Build the map and other structures to support locator operations

Source from the content-addressed store, hash-verified

527
528 // Build the map and other structures to support locator operations
529 void BuildLocator() override
530 {
531 // Place each point in a bucket
532 auto points = this->DataSet->GetPoints()->GetData();
533 MapPointsArrayWorker worker;
534 if (!vtkArrayDispatch::DispatchByArray<vtkArrayDispatch::AllPointArrays>::Execute(
535 points, worker, this))
536 {
537 worker(points, this);
538 }
539
540 // Now gather the points into contiguous runs in buckets
541 //
542 vtkSMPTools::Sort(this->Map, this->Map + this->NumPts);
543
544 // Build the offsets into the Map. The offsets are the positions of
545 // each bucket into the sorted list. They mark the beginning of the
546 // list of points in each bucket. Amazingly, this can be done in
547 // parallel.
548 //
549 int numBatches = static_cast<int>(ceil(static_cast<double>(this->NumPts) / this->BatchSize));
550 MapOffsets<TIds> offMapper(this);
551 vtkSMPTools::For(0, numBatches, offMapper);
552 }
553}; // BucketList2D
554
555VTK_ABI_NAMESPACE_END

Callers

nothing calls this directly

Calls 6

SortFunction · 0.70
ExecuteFunction · 0.50
ceilFunction · 0.50
ForFunction · 0.50
GetDataMethod · 0.45
GetPointsMethod · 0.45

Tested by

no test coverage detected