------------------------------------------------------------------------------
| 175 | |
| 176 | //------------------------------------------------------------------------------ |
| 177 | int 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 | //------------------------------------------------------------------------------ |
| 209 | bool vtkAbstractArray::SetNumberOfValues(vtkIdType numValues) |