| 1291 | // faster. |
| 1292 | template <typename TIds> |
| 1293 | void 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. |
no test coverage detected