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

Function CreatePoints

Filters/ParallelDIY2/vtkProbeLineFilter.cxx:111–133  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

109
110//------------------------------------------------------------------------------
111vtkSmartPointer<vtkDoubleArray> CreatePoints(
112 const std::vector<HitCellInfo>& intersections, vtkPoints* linePoints, double lengthFactor)
113{
114 linePoints->SetNumberOfPoints(intersections.size() * 2);
115 auto arclengthArray = vtkSmartPointer<vtkDoubleArray>::New();
116 arclengthArray->SetName("arc_length");
117 arclengthArray->SetNumberOfValues(linePoints->GetNumberOfPoints());
118 vtkSMPTools::For(0, intersections.size(),
119 [&](vtkIdType begin, vtkIdType end)
120 {
121 for (vtkIdType i = begin; i < end; ++i)
122 {
123 const auto& inter = intersections[i];
124 linePoints->SetPoint(i * 2, inter.InPos.data());
125 arclengthArray->SetValue(i * 2, inter.InT * lengthFactor);
126
127 linePoints->SetPoint(i * 2 + 1, inter.OutPos.data());
128 arclengthArray->SetValue(i * 2 + 1, inter.OutT * lengthFactor);
129 }
130 });
131
132 return arclengthArray;
133}
134vtkSmartPointer<vtkAbstractArray> AddAttribute(
135 vtkAbstractArray* attribute, vtkDataSetAttributes* dsAttributes, vtkIdType npts)
136{

Callers 1

IntersectCellsMethod · 0.70

Calls 10

NewFunction · 0.50
ForFunction · 0.50
SetNumberOfPointsMethod · 0.45
sizeMethod · 0.45
SetNameMethod · 0.45
SetNumberOfValuesMethod · 0.45
GetNumberOfPointsMethod · 0.45
SetPointMethod · 0.45
dataMethod · 0.45
SetValueMethod · 0.45

Tested by

no test coverage detected