| 128 | } |
| 129 | |
| 130 | void InitializeArray(vtkAbstractArray* array, vtkIdType sz, vtkIdType ext) const |
| 131 | { |
| 132 | if (array) |
| 133 | { |
| 134 | array->SetName(this->Name.empty() ? nullptr : this->Name.c_str()); |
| 135 | array->SetNumberOfComponents(this->NumberOfComponents); |
| 136 | int cc = 0; |
| 137 | for (const auto& cname : this->ComponentNames) |
| 138 | { |
| 139 | if (!cname.empty()) |
| 140 | { |
| 141 | array->SetComponentName(cc, cname.c_str()); |
| 142 | } |
| 143 | ++cc; |
| 144 | } |
| 145 | |
| 146 | if (this->Information) |
| 147 | { |
| 148 | array->CopyInformation(this->Information, /*deep=*/1); |
| 149 | } |
| 150 | |
| 151 | if (auto darray = vtkDataArray::SafeDownCast(array)) |
| 152 | { |
| 153 | darray->SetLookupTable(this->LUT); |
| 154 | } |
| 155 | array->Allocate(sz, ext); |
| 156 | } |
| 157 | } |
| 158 | |
| 159 | bool IsSimilar(const FieldInfo& other) const |
| 160 | { |
nothing calls this directly
no test coverage detected