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

Method StoreCellBounds

Common/DataModel/vtkAbstractCellLocator.cxx:36–64  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

34
35//------------------------------------------------------------------------------
36bool vtkAbstractCellLocator::StoreCellBounds()
37{
38 if (this->CellBounds)
39 {
40 return false;
41 }
42 if (!this->DataSet)
43 {
44 return false;
45 }
46 // Allocate space for cell bounds storage, then fill
47 vtkIdType numCells = this->DataSet->GetNumberOfCells();
48 this->CellBoundsSharedPtr = std::make_shared<std::vector<double>>(numCells * 6);
49 this->CellBounds = this->CellBoundsSharedPtr->data();
50
51 // This is done to cause non-thread safe initialization to occur due to
52 // side effects from GetCellBounds().
53 this->DataSet->GetCellBounds(0, &this->CellBounds[0]);
54
55 vtkSMPTools::For(1, numCells,
56 [&](vtkIdType begin, vtkIdType end)
57 {
58 for (vtkIdType cellId = begin; cellId < end; cellId++)
59 {
60 this->DataSet->GetCellBounds(cellId, &this->CellBounds[cellId * 6]);
61 }
62 });
63 return true;
64}
65
66//------------------------------------------------------------------------------
67void vtkAbstractCellLocator::FreeCellBounds()

Callers 1

ComputeCellBoundsMethod · 0.95

Calls 4

ForFunction · 0.50
GetNumberOfCellsMethod · 0.45
dataMethod · 0.45
GetCellBoundsMethod · 0.45

Tested by

no test coverage detected