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

Method BuildLocatorInternal

Common/DataModel/vtkCellTreeLocator.cxx:1307–1343  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

1305
1306//------------------------------------------------------------------------------
1307void 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//------------------------------------------------------------------------------
1346vtkIdType vtkCellTreeLocator::FindCell(

Callers 2

BuildLocatorMethod · 0.95
ForceBuildLocatorMethod · 0.95

Calls 6

FreeSearchStructureMethod · 0.95
ComputeCellBoundsMethod · 0.80
GetNumberOfCellsMethod · 0.45
InitializeMethod · 0.45
ReduceMethod · 0.45
ModifiedMethod · 0.45

Tested by

no test coverage detected