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

Method HandleCellGridAttributes

Filters/General/vtkPassSelectedArrays.cxx:133–160  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

131
132//------------------------------------------------------------------------------
133int 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//------------------------------------------------------------------------------
163void vtkPassSelectedArrays::PrintSelf(ostream& os, vtkIndent indent)

Callers 1

RequestDataMethod · 0.95

Calls 9

GetShapeAttributeMethod · 0.80
GetCellAttributeListMethod · 0.80
RemoveCellAttributeMethod · 0.80
ArrayIsEnabledMethod · 0.45
c_strMethod · 0.45
DataMethod · 0.45
GetNameMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected