| 495 | } |
| 496 | |
| 497 | bool vtkCellGrid::RemoveCellAttribute(vtkCellAttribute* attribute) |
| 498 | { |
| 499 | if (!attribute) |
| 500 | { |
| 501 | return false; |
| 502 | } |
| 503 | // Do not allow the shape attribute to be removed: |
| 504 | if (this->ShapeAttribute.GetId() == attribute->GetHash()) |
| 505 | { |
| 506 | return false; |
| 507 | } |
| 508 | auto it = this->Attributes.find(attribute->GetHash()); |
| 509 | if (it == this->Attributes.end()) |
| 510 | { |
| 511 | return false; |
| 512 | } |
| 513 | // Remove any cache for this cell-attribute's ranges. |
| 514 | this->RangeCache.erase(attribute); |
| 515 | // Now unhook the cell-attribute: |
| 516 | this->Attributes.erase(it); |
| 517 | return true; |
| 518 | } |
| 519 | |
| 520 | bool vtkCellGrid::GetCellAttributeRange( |
| 521 | vtkCellAttribute* attribute, int componentIndex, double range[2], bool finiteRange) const |