| 29 | }; |
| 30 | |
| 31 | inline 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 | |
| 51 | int TestPStreamGeometry(int argc, char* argv[]) |
| 52 | { |
no test coverage detected