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

Method testStructured

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

Source from the content-addressed store, hash-verified

176 self.assertEqual(c.GetOutput().GetNumberOfCells(), nCells)
177
178 def testStructured(self):
179 rt = vtkRTAnalyticSource()
180 rt.SetWholeExtent(-5, 5, -5, 5, -5, 5)
181 rt.Update()
182 i = rt.GetOutput()
183
184 st = vtkStructuredGrid()
185 st.SetDimensions(i.GetDimensions())
186
187 nps = i.GetNumberOfPoints()
188 ps = vtkPoints()
189 ps.SetNumberOfPoints(nps)
190 for idx in range(nps):
191 ps.SetPoint(idx, i.GetPoint(idx))
192
193 st.SetPoints(ps)
194
195 s = vtkSphere()
196 s.SetRadius(2)
197 s.SetCenter(0,0,0)
198
199 c = vtkTableBasedClipDataSet()
200 c.SetInputData(st)
201 c.SetClipFunction(s)
202 c.SetInsideOut(1)
203
204 c.Update()
205
206 self.assertEqual(c.GetOutput().GetNumberOfCells(), 64)
207
208 def testUnstructured(self):
209 rt = vtkRTAnalyticSource()

Callers

nothing calls this directly

Calls 15

vtkStructuredGridClass · 0.50
vtkPointsClass · 0.50
rangeClass · 0.50
vtkSphereClass · 0.50
SetWholeExtentMethod · 0.45
UpdateMethod · 0.45
GetOutputMethod · 0.45
SetDimensionsMethod · 0.45
GetDimensionsMethod · 0.45
GetNumberOfPointsMethod · 0.45
SetNumberOfPointsMethod · 0.45
SetPointMethod · 0.45

Tested by

no test coverage detected