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

Method CopyComponentNames

Common/Core/vtkAbstractArray.cxx:177–206  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

175
176//------------------------------------------------------------------------------
177int vtkAbstractArray::CopyComponentNames(vtkAbstractArray* da)
178{
179 if (da && da != this && da->ComponentNames)
180 {
181 // clear the vector of the all data
182 if (!this->ComponentNames)
183 {
184 this->ComponentNames = new vtkAbstractArray::vtkInternalComponentNames();
185 }
186
187 // copy the passed in components
188 for (unsigned int i = 0; i < this->ComponentNames->size(); ++i)
189 {
190 delete this->ComponentNames->at(i);
191 }
192 this->ComponentNames->clear();
193 this->ComponentNames->reserve(da->ComponentNames->size());
194 const char* name;
195 for (unsigned int i = 0; i < da->ComponentNames->size(); ++i)
196 {
197 name = da->GetComponentName(i);
198 if (name)
199 {
200 this->SetComponentName(i, name);
201 }
202 }
203 return 1;
204 }
205 return 0;
206}
207
208//------------------------------------------------------------------------------
209bool vtkAbstractArray::SetNumberOfValues(vtkIdType numValues)

Callers 9

DeepCopyMethod · 0.95
InternalCopyAllocateMethod · 0.80
CopyAttributeArraysMethod · 0.80
ProcessDataArrayMethod · 0.80
InitializeArrayMethod · 0.80
operator()Method · 0.80
InterpolateFieldsMethod · 0.80
deepCopyFunction · 0.80

Calls 6

SetComponentNameMethod · 0.95
GetComponentNameMethod · 0.80
sizeMethod · 0.45
atMethod · 0.45
clearMethod · 0.45
reserveMethod · 0.45

Tested by 1