()
| 86 | pressureGradient.SetInputConnection(probe_gradient.GetOutputPort()) |
| 87 | pressureGradient.SetScaleFactor(0.00002) |
| 88 | def ExecuteDot(): |
| 89 | # proc for ProgrammableAttributeDataFilter. |
| 90 | inputs = dotProduct.GetInputList() |
| 91 | input0 = inputs.GetDataSet(0) |
| 92 | input1 = inputs.GetDataSet(1) |
| 93 | numPts = input0.GetNumberOfPoints() |
| 94 | vectors0 = input0.GetPointData().GetVectors() |
| 95 | vectors1 = input1.GetPointData().GetVectors() |
| 96 | scalars = vtkFloatArray() |
| 97 | for i in range(numPts): |
| 98 | v0x,v0y,v0z = vectors0.GetTuple3(i) |
| 99 | v1x,v1y,v1z = vectors1.GetTuple3(i) |
| 100 | l0 = math.sqrt(v0x*v0x + v0y*v0y + v0z*v0z) |
| 101 | l1 = math.sqrt(v1x*v1x + v1y*v1y + v1z*v1z) |
| 102 | if l0 > 0.0 and l1 > 0.0: |
| 103 | d = (v0x*v1x + v0y*v1y + v0z*v1z)/(l0*l1) |
| 104 | else: |
| 105 | d = 0.0 |
| 106 | scalars.InsertValue(i,d) |
| 107 | |
| 108 | dotProduct.GetOutput().GetPointData().SetScalars(scalars) |
| 109 | |
| 110 | # |
| 111 | # We use the ProgrammableAttributeDataFilter to compute the cosine |
nothing calls this directly
no test coverage detected