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

Function ComputeLength

Filters/ParallelFlowPaths/Testing/Cxx/TestPStreamGeometry.cxx:31–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29};
30
31inline double ComputeLength(vtkIdList* poly, vtkPoints* pts)
32{
33 int n = poly->GetNumberOfIds();
34 if (n == 0)
35 return 0;
36
37 double s(0);
38 double p[3];
39 pts->GetPoint(poly->GetId(0), p);
40 for (int j = 1; j < n; j++)
41 {
42 int pIndex = poly->GetId(j);
43 double q[3];
44 pts->GetPoint(pIndex, q);
45 s += sqrt(vtkMath::Distance2BetweenPoints(p, q));
46 Vec3::copy(p, q);
47 }
48 return s;
49}
50
51int TestPStreamGeometry(int argc, char* argv[])
52{

Callers 1

TestPStreamGeometryFunction · 0.70

Calls 5

copyFunction · 0.70
sqrtFunction · 0.50
GetNumberOfIdsMethod · 0.45
GetPointMethod · 0.45
GetIdMethod · 0.45

Tested by

no test coverage detected