1 |
""" |
2 |
@author: John NGUI |
3 |
""" |
4 |
|
5 |
import vtk |
6 |
|
7 |
class CellDataToPointData: |
8 |
""" |
9 |
Class that defines a filter to convert cell data to point data by |
10 |
averaging the data values of all cells using a particular point. |
11 |
""" |
12 |
|
13 |
def __init__(self, object): |
14 |
""" |
15 |
Initialise the cell to point data filter. |
16 |
|
17 |
@type object: vtkUnstructuredGrid, etc |
18 |
@param object: Input for the cell to point data filter |
19 |
""" |
20 |
|
21 |
self.__object = object |
22 |
self.__vtk_cell_to_point = vtk.vtkCellDataToPointData() |
23 |
|
24 |
self.__setInput() |
25 |
|
26 |
def __setInput(self): |
27 |
""" |
28 |
Set the input for the cell to point data filter. |
29 |
""" |
30 |
|
31 |
self.__vtk_cell_to_point.SetInput(self.__object) |
32 |
|
33 |
def _getOutput(self): |
34 |
""" |
35 |
Return the output of the cell to point data filter. |
36 |
|
37 |
@rtype: vtkDataSet |
38 |
@return: Data set |
39 |
""" |
40 |
|
41 |
return self.__vtk_cell_to_point.GetOutput() |
42 |
|
43 |
|