1 |
""" |
2 |
@author: John NGUI |
3 |
""" |
4 |
|
5 |
import vtk |
6 |
|
7 |
class Texture: |
8 |
""" |
9 |
Class that defines the texture for the rendered object. |
10 |
""" |
11 |
|
12 |
def __init__(self, image): |
13 |
""" |
14 |
Initialise the texture. |
15 |
|
16 |
@type image: vtkImageData |
17 |
@param image: Image from which data is to be read |
18 |
""" |
19 |
|
20 |
self.__image = image |
21 |
self.__vtk_texture = vtk.vtkTexture() |
22 |
|
23 |
self.__setInput() |
24 |
|
25 |
def __setInput(self): |
26 |
""" |
27 |
Set the input for the texture. |
28 |
""" |
29 |
|
30 |
self.__vtk_texture.SetInput(self.__image) |
31 |
|
32 |
def _getTexture(self): |
33 |
""" |
34 |
Return the texture. |
35 |
|
36 |
@rtype: vtkTexture |
37 |
@return: Texture of the rendered object |
38 |
""" |
39 |
|
40 |
return self.__vtk_texture |
41 |
|