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

Method AddCellAttribute

Common/DataModel/vtkCellGrid.cxx:473–495  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

471}
472
473bool vtkCellGrid::AddCellAttribute(vtkCellAttribute* attribute)
474{
475 if (!attribute)
476 {
477 return false;
478 }
479 auto it = this->Attributes.find(attribute->GetHash());
480 if (it != this->Attributes.end())
481 {
482 // Either we have a hash collision or the attribute already exists.
483 if (it->second != attribute)
484 {
485 vtkWarningMacro("Attempting to add attribute "
486 << attribute << " (" << attribute->GetName().Data() << "), but " << it->second << " ("
487 << it->second->GetName().Data() << ") already exists with the same hash "
488 << it->second->GetHash() << ". Ignoring.");
489 }
490 return false;
491 }
492 this->Attributes[attribute->GetHash()] = attribute;
493 attribute->SetId(this->NextAttribute++);
494 return true;
495}
496
497bool vtkCellGrid::RemoveCellAttribute(vtkCellAttribute* attribute)
498{

Callers 11

FromJSONMethod · 0.80
GetNodalAttributesMethod · 0.80
GetElementAttributesMethod · 0.80
GetShapeFunction · 0.80
InitializeMethod · 0.80
CreateCellAttributeMethod · 0.80
RequestDataMethod · 0.80
AddCellAttributesMethod · 0.80
AddDeRhamFieldsFunction · 0.80

Calls 6

GetHashMethod · 0.80
findMethod · 0.45
endMethod · 0.45
DataMethod · 0.45
GetNameMethod · 0.45
SetIdMethod · 0.45

Tested by 1

AddDeRhamFieldsFunction · 0.64