1 |
|
2 |
######################################################## |
3 |
# |
4 |
# Copyright (c) 2003-2008 by University of Queensland |
5 |
# Earth Systems Science Computational Center (ESSCC) |
6 |
# http://www.uq.edu.au/esscc |
7 |
# |
8 |
# Primary Business: Queensland, Australia |
9 |
# Licensed under the Open Software License version 3.0 |
10 |
# http://www.opensource.org/licenses/osl-3.0.php |
11 |
# |
12 |
######################################################## |
13 |
|
14 |
__copyright__="""Copyright (c) 2003-2008 by University of Queensland |
15 |
Earth Systems Science Computational Center (ESSCC) |
16 |
http://www.uq.edu.au/esscc |
17 |
Primary Business: Queensland, Australia""" |
18 |
__license__="""Licensed under the Open Software License version 3.0 |
19 |
http://www.opensource.org/licenses/osl-3.0.php""" |
20 |
__url__="http://www.uq.edu.au/esscc/escript-finley" |
21 |
|
22 |
""" |
23 |
@var __author__: name of author |
24 |
@var __copyright__: copyrights |
25 |
@var __license__: licence agreement |
26 |
@var __url__: url entry point on documentation |
27 |
@var __version__: version |
28 |
@var __date__: date of the version |
29 |
""" |
30 |
|
31 |
__author__="John Ngui, john.ngui@uq.edu.au" |
32 |
|
33 |
|
34 |
import vtk |
35 |
|
36 |
class CellDataToPointData: |
37 |
""" |
38 |
Class that defines a filter to convert cell data to point data by |
39 |
averaging the data values of all cells using a particular point. |
40 |
""" |
41 |
|
42 |
def __init__(self, object): |
43 |
""" |
44 |
Initialise the cell to point data filter. |
45 |
|
46 |
@type object: vtkUnstructuredGrid, etc |
47 |
@param object: Input for the cell to point data filter |
48 |
""" |
49 |
|
50 |
self.__object = object |
51 |
self.__vtk_cell_to_point = vtk.vtkCellDataToPointData() |
52 |
|
53 |
self.__setInput() |
54 |
|
55 |
def __setInput(self): |
56 |
""" |
57 |
Set the input for the cell to point data filter. |
58 |
""" |
59 |
|
60 |
self.__vtk_cell_to_point.SetInput(self.__object) |
61 |
|
62 |
def _getCellToPointOutput(self): |
63 |
""" |
64 |
Return the output of the cell to point data filter. |
65 |
|
66 |
@rtype: vtkDataSet |
67 |
@return: Data set |
68 |
""" |
69 |
|
70 |
return self.__vtk_cell_to_point.GetOutput() |
71 |
|
72 |
|