1 |
""" |
2 |
@author: John NGUI |
3 |
""" |
4 |
|
5 |
import vtk |
6 |
|
7 |
class Probe: |
8 |
""" |
9 |
Class that defines the probe. The class sample data values at |
10 |
specified point locations. |
11 |
""" |
12 |
|
13 |
def __init__(self, object, source): |
14 |
""" |
15 |
Initialise the probe. |
16 |
|
17 |
@type object: vtkUnstructuredGrid, etc |
18 |
@param object: Inpur for the probe |
19 |
@type source: vtkDataSet (i.e. vtkStructuredPoints) |
20 |
@param source: Source for the probe |
21 |
""" |
22 |
|
23 |
self.__object = object |
24 |
self.__source = source |
25 |
self.__vtk_probe_filter = vtk.vtkProbeFilter() |
26 |
self.__setInput() |
27 |
self.__setSource() |
28 |
|
29 |
def __setInput(self): |
30 |
""" |
31 |
Set the input for the probe. |
32 |
""" |
33 |
|
34 |
self.__vtk_probe_filter.SetInput(self.__source) |
35 |
|
36 |
def __setSource(self): |
37 |
""" |
38 |
Set the source for the probe. |
39 |
""" |
40 |
|
41 |
self.__vtk_probe_filter.SetSource(self.__object) |
42 |
|
43 |
def _getOutput(self): |
44 |
""" |
45 |
Return the probe. |
46 |
|
47 |
@rtype: vtkDataSet |
48 |
@return: Data set |
49 |
""" |
50 |
|
51 |
return self.__vtk_probe_filter.GetOutput() |
52 |
|