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

Method GenerateBlockLevel

Common/DataModel/vtkAMRMetaData.cxx:116–137  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

114
115//------------------------------------------------------------------------------
116void vtkAMRMetaData::GenerateBlockLevel()
117{
118 if (this->BlockLevel)
119 {
120 return;
121 }
122
123 this->BlockLevel = vtkSmartPointer<vtkUnsignedIntArray>::New();
124 this->BlockLevel->SetNumberOfValues(static_cast<vtkIdType>(this->GetNumberOfBlocks()));
125 assert(this->NumBlocks.size() == this->GetNumberOfLevels() + 1);
126
127 vtkIdType index(0);
128 for (std::size_t level = 0; level < this->NumBlocks.size() - 1; level++)
129 {
130 unsigned int begin = this->NumBlocks[level];
131 unsigned int end = this->NumBlocks[level + 1];
132 for (unsigned int id = begin; id != end; id++)
133 {
134 this->BlockLevel->SetValue(index++, static_cast<unsigned int>(level));
135 }
136 }
137}
138
139//------------------------------------------------------------------------------
140bool vtkAMRMetaData::operator==(const vtkAMRMetaData& other) const

Callers 1

ComputeIndexPairMethod · 0.95

Calls 7

GetNumberOfBlocksMethod · 0.95
GetNumberOfLevelsMethod · 0.95
NewFunction · 0.50
assertFunction · 0.50
SetNumberOfValuesMethod · 0.45
sizeMethod · 0.45
SetValueMethod · 0.45

Tested by

no test coverage detected