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

Function ComputeLength

Filters/ParallelFlowPaths/vtkPStreamTracer.cxx:850–868  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

848
849#ifdef DEBUGTRACE
850inline double ComputeLength(vtkIdList* poly, vtkPoints* pts)
851{
852 int n = poly->GetNumberOfIds();
853 if (n == 0)
854 return 0;
855
856 double s(0);
857 double p[3];
858 pts->GetPoint(poly->GetId(0), p);
859 for (int j = 1; j < n; j++)
860 {
861 int pIndex = poly->GetId(j);
862 double q[3];
863 pts->GetPoint(pIndex, q);
864 s += sqrt(vtkMath::Distance2BetweenPoints(p, q));
865 memcpy(p, q, 3 * sizeof(double));
866 }
867 return s;
868}
869
870inline void PrintNames(ostream& out, vtkPointData* a)
871{

Callers 1

RequestDataMethod · 0.70

Calls 4

sqrtFunction · 0.50
GetNumberOfIdsMethod · 0.45
GetPointMethod · 0.45
GetIdMethod · 0.45

Tested by

no test coverage detected