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

Method AddCellMetadata

Common/DataModel/vtkCellGrid.cxx:326–345  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

324}
325
326vtkCellMetadata* vtkCellGrid::AddCellMetadata(vtkCellMetadata* cellType)
327{
328 if (!cellType)
329 {
330 return cellType;
331 }
332 auto it = this->Cells.find(cellType->Hash());
333 if (it != this->Cells.end())
334 {
335 // Do not take ownership of cellType; return the instance we own.
336 return it->second;
337 }
338 // OK, we don't already have this type... insert it.
339 vtkSmartPointer<vtkCellMetadata> owner = cellType;
340 this->Cells[owner->Hash()] = owner;
341 owner->SetCellGrid(this);
342 // Because we have added cells, clear any cell-attribute ranges cached.
343 this->RangeCache.clear();
344 return cellType;
345}
346
347vtkCellMetadata* vtkCellGrid::AddCellMetadata(vtkStringToken cellTypeName)
348{

Callers 5

GetElementBlockMethod · 0.80
GetNodeSetMethod · 0.80
GetCellMetadataFunction · 0.80
NewInstanceMethod · 0.80
TestDGCellTypeFunction · 0.80

Calls 7

GetCellTypeMethod · 0.95
SetCellGridMethod · 0.80
NewInstanceFunction · 0.70
findMethod · 0.45
endMethod · 0.45
clearMethod · 0.45
IsValidMethod · 0.45

Tested by 1

TestDGCellTypeFunction · 0.64