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

Method SetShapeAttribute

Common/DataModel/vtkCellGrid.cxx:677–708  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

675}
676
677bool vtkCellGrid::SetShapeAttribute(vtkCellAttribute* shape)
678{
679 if (!shape)
680 {
681 if (this->HaveShape)
682 {
683 this->HaveShape = false;
684 this->Modified();
685 return true;
686 }
687 return false;
688 }
689 if (shape->GetHash() == this->ShapeAttribute.GetId() && this->HaveShape)
690 {
691 return false; // No change.
692 }
693 // If we don't already own this attribute, add it to this->Attributes:
694 auto it = this->Attributes.find(shape->GetHash());
695 if (it == this->Attributes.end())
696 {
697 this->Attributes[shape->GetHash()] = shape;
698 }
699 else if (it->second != shape)
700 {
701 vtkErrorMacro("Hash collision for shape attribute. Ignoring call to SetShapeAttribute().");
702 return false;
703 }
704 this->HaveShape = true;
705 this->ShapeAttribute = shape->GetHash();
706 this->Modified();
707 return true;
708}
709
710bool vtkCellGrid::Query(vtkCellGridQuery* query)
711{

Callers 7

FromJSONMethod · 0.80
GetShapeFunction · 0.80
InitializeMethod · 0.80
QueryMethod · 0.80
FinalizeMethod · 0.80
AddCoordinatesFunction · 0.80

Calls 5

GetHashMethod · 0.80
ModifiedMethod · 0.45
GetIdMethod · 0.45
findMethod · 0.45
endMethod · 0.45

Tested by 1

AddCoordinatesFunction · 0.64