------------------------------------------------------------------------------
| 114 | |
| 115 | //------------------------------------------------------------------------------ |
| 116 | void 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 | //------------------------------------------------------------------------------ |
| 140 | bool vtkAMRMetaData::operator==(const vtkAMRMetaData& other) const |
no test coverage detected