------------------------------------------------------------------------------
| 131 | |
| 132 | //------------------------------------------------------------------------------ |
| 133 | int vtkPassSelectedArrays::HandleCellGridAttributes(vtkCellGrid* output) |
| 134 | { |
| 135 | if (!output) |
| 136 | { |
| 137 | return 0; |
| 138 | } |
| 139 | |
| 140 | auto* shape = output->GetShapeAttribute(); |
| 141 | auto* selection = this->GetCellDataArraySelection(); |
| 142 | std::set<vtkCellAttribute*> removeAttributes; |
| 143 | for (const auto& attribute : output->GetCellAttributeList()) |
| 144 | { |
| 145 | // Never remove the shape attribute: |
| 146 | if (attribute == shape) |
| 147 | { |
| 148 | continue; |
| 149 | } |
| 150 | if (!selection->ArrayIsEnabled(attribute->GetName().Data().c_str())) |
| 151 | { |
| 152 | removeAttributes.insert(attribute); |
| 153 | } |
| 154 | } |
| 155 | for (const auto& attribute : removeAttributes) |
| 156 | { |
| 157 | output->RemoveCellAttribute(attribute); |
| 158 | } |
| 159 | return 1; |
| 160 | } |
| 161 | |
| 162 | //------------------------------------------------------------------------------ |
| 163 | void vtkPassSelectedArrays::PrintSelf(ostream& os, vtkIndent indent) |
no test coverage detected