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

Method GetPoints

Common/DataModel/vtkDataSet.cxx:148–168  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

146
147//------------------------------------------------------------------------------
148vtkPoints* vtkDataSet::GetPoints()
149{
150 vtkWarningMacro("GetPoints() called on a dataset that does not define GetPoints."
151 "Don't modify this object.");
152 this->TempPoints = vtkSmartPointer<vtkPoints>::New();
153 vtkNew<vtkDoubleArray> array;
154 array->SetNumberOfComponents(3);
155 array->SetNumberOfTuples(this->GetNumberOfPoints());
156 vtkSMPTools::For(0, this->GetNumberOfPoints(),
157 [&](vtkIdType begin, vtkIdType end)
158 {
159 double x[3];
160 for (vtkIdType pointId = begin; pointId < end; ++pointId)
161 {
162 this->GetPoint(pointId, x);
163 array->SetTypedTuple(pointId, x);
164 }
165 });
166 this->TempPoints->SetData(array);
167 return this->TempPoints;
168}
169
170//------------------------------------------------------------------------------
171// Compute the data bounding box from data points.

Callers

nothing calls this directly

Calls 8

GetPointMethod · 0.95
NewFunction · 0.50
ForFunction · 0.50
SetNumberOfComponentsMethod · 0.45
SetNumberOfTuplesMethod · 0.45
GetNumberOfPointsMethod · 0.45
SetTypedTupleMethod · 0.45
SetDataMethod · 0.45

Tested by

no test coverage detected