------------------------------------------------------------------------------
| 1305 | |
| 1306 | //------------------------------------------------------------------------------ |
| 1307 | void vtkCellTreeLocator::BuildLocatorInternal() |
| 1308 | { |
| 1309 | using namespace detail; |
| 1310 | vtkIdType numCells; |
| 1311 | if (!this->DataSet || (numCells = this->DataSet->GetNumberOfCells() < 1)) |
| 1312 | { |
| 1313 | vtkErrorMacro(<< " No Cells in the data set\n"); |
| 1314 | return; |
| 1315 | } |
| 1316 | this->FreeSearchStructure(); |
| 1317 | this->ComputeCellBounds(); |
| 1318 | // Create sorted cell fragments tuples of (cellId,binId). Depending |
| 1319 | // on problem size, different types are used. |
| 1320 | if (numCells >= VTK_INT_MAX) |
| 1321 | { |
| 1322 | this->LargeIds = true; |
| 1323 | auto tree = new CellTree<vtkIdType>(this); |
| 1324 | CellTreeBuilder<vtkIdType> treeBuilder( |
| 1325 | this, *tree, this->DataSet, this->NumberOfBuckets, this->NumberOfCellsPerNode); |
| 1326 | treeBuilder.Initialize(); |
| 1327 | treeBuilder(); |
| 1328 | treeBuilder.Reduce(); |
| 1329 | this->Tree = tree; |
| 1330 | } |
| 1331 | else |
| 1332 | { |
| 1333 | this->LargeIds = false; |
| 1334 | auto tree = new CellTree<int>(this); |
| 1335 | CellTreeBuilder<int> treeBuilder( |
| 1336 | this, *tree, this->DataSet, this->NumberOfBuckets, this->NumberOfCellsPerNode); |
| 1337 | treeBuilder.Initialize(); |
| 1338 | treeBuilder(); |
| 1339 | treeBuilder.Reduce(); |
| 1340 | this->Tree = tree; |
| 1341 | } |
| 1342 | this->BuildTime.Modified(); |
| 1343 | } |
| 1344 | |
| 1345 | //------------------------------------------------------------------------------ |
| 1346 | vtkIdType vtkCellTreeLocator::FindCell( |
no test coverage detected