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

Method MergePoints

Common/DataModel/vtkStaticPointLocator.cxx:1293–1321  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1291// faster.
1292template <typename TIds>
1293void BucketList<TIds>::MergePoints(double tol, vtkIdType* mergeMap, int orderingMode)
1294{
1295 // First mark all points as uninitialized
1296 std::fill_n(mergeMap, this->NumPts, (-1));
1297
1298 // If tol=0, then just process points bucket by bucket. Don't have to worry
1299 // about points in other buckets.
1300 if (tol <= 0.0)
1301 {
1302 MergePrecise<TIds> merge(this, mergeMap);
1303 vtkSMPTools::For(0, this->NumBuckets, merge);
1304 return;
1305 }
1306
1307 // Merge within a tolerance. Different algorithms are used
1308 // depending on how points are merged / ordering mode. BTW, TBB is
1309 // much faster than std::thread due to the work stealing / load
1310 // balancing features of TBB.
1311 if (orderingMode == vtkStaticPointLocator::POINT_ORDER)
1312 {
1313 MergePointOrder<TIds> merge(this, tol, mergeMap);
1314 merge(this->NumPts); // this is sequential to avoid race conditions
1315 }
1316 else // orderingMode == vtkStaticPointLocator::BIN_ORDER
1317 {
1318 MergeBinOrder<TIds> merge(this, tol, mergeMap);
1319 merge.Execute(); // this is checkerboard threaded
1320 }
1321}
1322
1323//------------------------------------------------------------------------------
1324// Merge points with precisely equal position and data values.

Callers 5

GenerateMergeMapMethod · 0.45
RequestDataMethod · 0.45
RequestDataMethod · 0.45
RequestDataMethod · 0.45

Calls 5

BuildLocatorMethod · 0.95
fill_nFunction · 0.85
mergeFunction · 0.85
ForFunction · 0.50
ExecuteMethod · 0.45

Tested by

no test coverage detected