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

Method ShallowCopy

Common/DataModel/vtkGenericAttributeCollection.cxx:322–340  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Description: Update `this' using fields of `other'.

Source from the content-addressed store, hash-verified

320// Description:
321// Update `this' using fields of `other'.
322void vtkGenericAttributeCollection::ShallowCopy(vtkGenericAttributeCollection* other)
323{
324 assert("pre: other_exists" && other != nullptr);
325 assert("pre: not_self" && other != this);
326
327 this->AttributeInternalVector->Vector = other->AttributeInternalVector->Vector;
328 this->AttributeIndices->Vector = other->AttributeIndices->Vector;
329 int c = static_cast<int>(this->AttributeInternalVector->Vector.size());
330 for (int i = 0; i < c; ++i)
331 {
332 if (this->AttributeInternalVector->Vector[i] != nullptr)
333 {
334 this->AttributeInternalVector->Vector[i]->Register(this);
335 }
336 }
337 this->Modified();
338
339 assert("post: same_size" && this->GetNumberOfAttributes() == other->GetNumberOfAttributes());
340}
341
342//------------------------------------------------------------------------------
343// Description:

Callers

nothing calls this directly

Calls 5

GetNumberOfAttributesMethod · 0.95
assertFunction · 0.50
sizeMethod · 0.45
RegisterMethod · 0.45
ModifiedMethod · 0.45

Tested by

no test coverage detected