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

Function ComputeLength

Filters/ParallelFlowPaths/Testing/Cxx/TestPStreamAMR.cxx:26–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24#include <iostream>
25
26inline double ComputeLength(vtkIdList* poly, vtkPoints* pts)
27{
28 int n = poly->GetNumberOfIds();
29 if (n == 0)
30 return 0;
31
32 double s(0);
33 double p[3];
34 pts->GetPoint(poly->GetId(0), p);
35 for (int j = 1; j < n; j++)
36 {
37 int pIndex = poly->GetId(j);
38 double q[3];
39 pts->GetPoint(pIndex, q);
40 s += sqrt(vtkMath::Distance2BetweenPoints(p, q));
41 memcpy(p, q, 3 * sizeof(double));
42 }
43 return s;
44}
45
46class TestAMRVectorSource : public vtkOverlappingAMRAlgorithm
47{

Callers 1

TestPStreamAMRFunction · 0.70

Calls 4

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

Tested by

no test coverage detected