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

Method BuildLocator

Common/DataModel/vtkStaticPointLocatorPrivate.h:758–780  ·  view source on GitHub ↗

Build the map and other structures to support locator operations

Source from the content-addressed store, hash-verified

756
757 // Build the map and other structures to support locator operations
758 void BuildLocator() override
759 {
760 // Place each point in a bucket
761 auto points = this->DataSet->GetPoints()->GetData();
762 MapPointsArrayWorker worker;
763 if (!vtkArrayDispatch::DispatchByArray<vtkArrayDispatch::AllPointArrays>::Execute(
764 points, worker, this))
765 {
766 worker(points, this);
767 }
768
769 // Now group the points into contiguous runs within buckets (recall that
770 // sorting is occurring based on bin/bucket id).
771 vtkSMPTools::Sort(this->Map, this->Map + this->NumPts);
772
773 // Build the offsets into the Map. The offsets are the positions of
774 // each bucket into the sorted list. They mark the beginning of the
775 // list of points in each bucket. Amazingly, this can be done in
776 // parallel.
777 int numBatches = static_cast<int>(ceil(static_cast<double>(this->NumPts) / this->BatchSize));
778 MapOffsets<TIds> offMapper(this);
779 vtkSMPTools::For(0, numBatches, offMapper);
780 }
781};
782
783VTK_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