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

Method AddCellAttributes

Filters/CellGrid/vtkUnstructuredGridToCellGrid.cxx:137–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

135}
136
137void vtkUnstructuredGridToCellGrid::TranscribeQuery::AddCellAttributes(
138 vtkDataSetAttributes* attributes)
139{
140 int numberOfArrays = attributes->GetNumberOfArrays();
141 for (int aa = 0; aa < numberOfArrays; ++aa)
142 {
143 auto* arrayIn = attributes->GetAbstractArray(aa);
144 if (!arrayIn || !arrayIn->GetName())
145 {
146 vtkWarningMacro("Empty or unnamed array " << aa << ".");
147 continue;
148 }
149 int nc = arrayIn->GetNumberOfComponents();
150 vtkNew<vtkCellAttribute> attribOut;
151 std::string fieldSpace = vtkCellAttribute::EncodeSpace("ℝ", nc);
152 attribOut->Initialize(arrayIn->GetName(), fieldSpace, nc);
153 this->Output->AddCellAttribute(attribOut);
154 }
155}
156
157vtkUnstructuredGridToCellGrid::vtkUnstructuredGridToCellGrid()
158{

Callers

nothing calls this directly

Calls 6

GetAbstractArrayMethod · 0.80
AddCellAttributeMethod · 0.80
GetNumberOfArraysMethod · 0.45
GetNameMethod · 0.45
GetNumberOfComponentsMethod · 0.45
InitializeMethod · 0.45

Tested by

no test coverage detected