1 |
""" |
2 |
@author: John NGUI |
3 |
""" |
4 |
|
5 |
import vtk |
6 |
|
7 |
class Normals: |
8 |
""" |
9 |
Class that defines normals. Normals are used to average the normals of |
10 |
points in order to generate better sufaces (in the case of tensors, normals |
11 |
avoids the tensors from appearing black in color). |
12 |
""" |
13 |
|
14 |
def __init__(self, object): |
15 |
""" |
16 |
Initialise the normals. |
17 |
|
18 |
@type object: vtkPolyData, etc |
19 |
@param object: Input for the normals |
20 |
""" |
21 |
|
22 |
self.__object = object |
23 |
self.__vtk_poly_data_normals = vtk.vtkPolyDataNormals() |
24 |
self.__setInput() |
25 |
|
26 |
def __setInput(self): |
27 |
""" |
28 |
Set the input for the normals. |
29 |
""" |
30 |
|
31 |
self.__vtk_poly_data_normals.SetInput(self.__object) |
32 |
|
33 |
def _getOutput(self): |
34 |
""" |
35 |
Return the output of the normals. |
36 |
|
37 |
@rtype: vtkPolyData |
38 |
@return: Polygonal data |
39 |
""" |
40 |
|
41 |
return self.__vtk_poly_data_normals.GetOutput() |