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

Method InsertAttribute

Common/DataModel/vtkGenericAttributeCollection.cxx:230–250  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Description: Replace attribute at index `i' by `a'.

Source from the content-addressed store, hash-verified

228// Description:
229// Replace attribute at index `i' by `a'.
230void vtkGenericAttributeCollection::InsertAttribute(int i, vtkGenericAttribute* a)
231{
232 assert("pre: not_empty" && !this->IsEmpty());
233 assert("pre: a_exists" && a != nullptr);
234 assert("pre: valid_i" && (i >= 0) && (i < this->GetNumberOfAttributes()));
235
236#ifndef NDEBUG
237 int oldnumber = this->GetNumberOfAttributes();
238#endif
239
240 if (this->AttributeInternalVector->Vector[i] != nullptr)
241 {
242 this->AttributeInternalVector->Vector[i]->Delete();
243 }
244 this->AttributeInternalVector->Vector[i] = a;
245 a->Register(this);
246 this->Modified();
247
248 assert("post: more_items" && this->GetNumberOfAttributes() == oldnumber);
249 assert("post: a_is_set" && this->GetAttribute(i) == a);
250}
251
252//------------------------------------------------------------------------------
253// Description:

Callers

nothing calls this directly

Calls 7

IsEmptyMethod · 0.95
GetNumberOfAttributesMethod · 0.95
GetAttributeMethod · 0.95
DeleteMethod · 0.65
assertFunction · 0.50
RegisterMethod · 0.45
ModifiedMethod · 0.45

Tested by

no test coverage detected