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

Function AddAttribute

Filters/ParallelDIY2/vtkProbeLineFilter.cxx:134–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

132 return arclengthArray;
133}
134vtkSmartPointer<vtkAbstractArray> AddAttribute(
135 vtkAbstractArray* attribute, vtkDataSetAttributes* dsAttributes, vtkIdType npts)
136{
137 const char* name = attribute->GetName();
138 vtkSmartPointer<vtkAbstractArray> targetArray;
139 if (!dsAttributes->GetAbstractArray(name))
140 {
141 targetArray = vtk::TakeSmartPointer(attribute->NewInstance());
142 targetArray->SetName(name);
143 targetArray->SetNumberOfComponents(attribute->GetNumberOfComponents());
144 targetArray->SetNumberOfTuples(npts);
145 dsAttributes->AddArray(targetArray);
146 }
147 return targetArray;
148}
149void AddCellData(const std::vector<HitCellInfo>& intersections, vtkCellData* inputCellAttribute,
150 vtkPointData* resultPointData, vtkIdType npts)
151{

Callers 2

AddCellDataFunction · 0.70
IntersectCellsMethod · 0.70

Calls 8

GetAbstractArrayMethod · 0.80
GetNameMethod · 0.45
NewInstanceMethod · 0.45
SetNameMethod · 0.45
SetNumberOfComponentsMethod · 0.45
GetNumberOfComponentsMethod · 0.45
SetNumberOfTuplesMethod · 0.45
AddArrayMethod · 0.45

Tested by

no test coverage detected