Generate two quads and assign scalars 3--4--5 | | | 0--1--2
(scalars)
| 45 | ] |
| 46 | |
| 47 | def generatePoly(scalars): |
| 48 | """ |
| 49 | Generate two quads and assign scalars |
| 50 | 3--4--5 |
| 51 | | | | |
| 52 | 0--1--2 |
| 53 | """ |
| 54 | pts = vtkPoints() |
| 55 | nx=3 |
| 56 | ny=int(len(scalars)/nx) |
| 57 | for y in range(0,ny): |
| 58 | for x in range(0,nx): |
| 59 | pts.InsertNextPoint(x,y,0) |
| 60 | |
| 61 | connectivity=[(0,1,4,3),(1,2,5,4)] |
| 62 | quads = vtkCellArray() |
| 63 | for quad in connectivity: |
| 64 | quads.InsertNextCell(4,quad) |
| 65 | |
| 66 | poly = vtkPolyData() |
| 67 | poly.SetPoints(pts) |
| 68 | poly.SetPolys(quads) |
| 69 | |
| 70 | array=vtkDoubleArray() |
| 71 | for s in scalars: |
| 72 | array.InsertNextValue(s) |
| 73 | poly.GetPointData().SetScalars(array) |
| 74 | return poly |
| 75 | |
| 76 | |
| 77 | def showBandedContours(poly,values,num): |
no test coverage detected