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

Function InitializeArray

Common/DataModel/vtkDataSetAttributesFieldList.cxx:130–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 8

SetComponentNameMethod · 0.80
SetNameMethod · 0.45
emptyMethod · 0.45
c_strMethod · 0.45
SetNumberOfComponentsMethod · 0.45
CopyInformationMethod · 0.45
SetLookupTableMethod · 0.45
AllocateMethod · 0.45

Tested by

no test coverage detected