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

Method testRectilinear

Filters/General/Testing/Python/tableBasedClip.py:94–135  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

92 self.assertEqual(c.GetOutput().GetNumberOfCells(), 64)
93
94 def testRectilinear(self):
95 rt = vtkRTAnalyticSource()
96 rt.SetWholeExtent(-5, 5, -5, 5, -5, 5)
97 rt.Update()
98 i = rt.GetOutput()
99
100 r = vtkRectilinearGrid()
101 dims = i.GetDimensions()
102 r.SetDimensions(dims)
103 exts = i.GetExtent()
104 orgs = i.GetOrigin()
105
106 xs = vtkFloatArray()
107 xs.SetNumberOfTuples(dims[0])
108 for d in range(dims[0]):
109 xs.SetTuple1(d, orgs[0] + exts[0] + d)
110 r.SetXCoordinates(xs)
111
112 ys = vtkFloatArray()
113 ys.SetNumberOfTuples(dims[1])
114 for d in range(dims[1]):
115 ys.SetTuple1(d, orgs[1] + exts[2] + d)
116 r.SetYCoordinates(ys)
117
118 zs = vtkFloatArray()
119 zs.SetNumberOfTuples(dims[2])
120 for d in range(dims[2]):
121 zs.SetTuple1(d, orgs[2] + exts[4] + d)
122 r.SetZCoordinates(zs)
123
124 s = vtkSphere()
125 s.SetRadius(2)
126 s.SetCenter(0,0,0)
127
128 c = vtkTableBasedClipDataSet()
129 c.SetInputData(r)
130 c.SetClipFunction(s)
131 c.SetInsideOut(1)
132
133 c.Update()
134
135 self.assertEqual(c.GetOutput().GetNumberOfCells(), 64)
136
137 def testStructured2D(self):
138 planes = ['XY', 'XZ', 'YZ']

Callers

nothing calls this directly

Calls 15

SetTuple1Method · 0.80
vtkRectilinearGridClass · 0.50
vtkFloatArrayClass · 0.50
rangeClass · 0.50
vtkSphereClass · 0.50
SetWholeExtentMethod · 0.45
UpdateMethod · 0.45
GetOutputMethod · 0.45
GetDimensionsMethod · 0.45
SetDimensionsMethod · 0.45
GetExtentMethod · 0.45
GetOriginMethod · 0.45

Tested by

no test coverage detected