File: TestProbeLineFilterLeaks.py

package info (click to toggle)
vtk9 9.5.2%2Bdfsg3-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 205,916 kB
  • sloc: cpp: 2,336,565; ansic: 327,116; python: 111,200; yacc: 4,104; java: 3,977; sh: 3,032; xml: 2,771; perl: 2,189; lex: 1,787; makefile: 178; javascript: 165; objc: 153; tcl: 59
file content (42 lines) | stat: -rw-r--r-- 1,118 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
from vtkmodules.vtkFiltersSources import vtkLineSource,vtkCellTypeSource,vtkRandomHyperTreeGridSource
from vtkmodules.vtkImagingCore import vtkRTAnalyticSource
from vtkmodules.vtkFiltersParallelDIY2 import vtkProbeLineFilter
from vtkmodules.vtkParallelCore import vtkDummyController



def common(source):
  line = vtkLineSource()
  line.SetPoint1(0,0,0)
  line.SetPoint2(10,10,10)
  line.SetResolution(1)
  dc = vtkDummyController()
  probe = vtkProbeLineFilter()
  probe.SetController(dc)
  probe.SetLineResolution(1000)
  probe.SetInputConnection(source.GetOutputPort(0))
  probe.SetSourceConnection(line.GetOutputPort())
  probe.SetSamplingPattern(2)
  probe.Update()
  assert probe.GetOutputDataObject(0).GetNumberOfPoints() == 1001

def Test_UnstructuredGrid():
  grid = vtkCellTypeSource()
  grid.SetBlocksDimensions(10,10,10)
  grid.Update()
  common(grid)

def Test_ImageData():
  image = vtkRTAnalyticSource()
  image.Update()
  common(image)

def Test_HyperTreeGrid():
  hgrid = vtkRandomHyperTreeGridSource()
  hgrid.Update()
  common(hgrid)


Test_ImageData()
Test_UnstructuredGrid()
Test_HyperTreeGrid()