23 |
|
|
24 |
def __setMapper(self): |
def __setMapper(self): |
25 |
""" |
""" |
26 |
Set the mapper for the 3D actor. |
Set the mapper of the 3D actor. |
27 |
""" |
""" |
28 |
|
|
29 |
self.__vtk_actor3D.SetMapper(self.__mapper) |
self.__vtk_actor3D.SetMapper(self.__mapper) |
30 |
|
|
31 |
def _setTexture(self, texture): |
def _setTexture(self, texture): |
32 |
""" |
""" |
33 |
Set the texture for the 3D actor. |
Set the texture of the 3D actor. |
34 |
|
|
35 |
|
@type texture: vtkTexture |
36 |
|
@param texture: Texture of the rendered object |
37 |
""" |
""" |
38 |
|
|
39 |
self.__vtk_actor3D.SetTexture(texture) |
self.__vtk_actor3D.SetTexture(texture) |
53 |
Set the color of the 3D actor. |
Set the color of the 3D actor. |
54 |
|
|
55 |
@type color: L{Color <constant.Color>} constant |
@type color: L{Color <constant.Color>} constant |
56 |
@param color: 3D actor color |
@param color: Color of the 3D actor |
57 |
""" |
""" |
58 |
|
|
59 |
# NOTE: Must be used before actor.GetProperty().SetColor() |
# NOTE: Must be used before actor.GetProperty().SetColor() |
60 |
# in order for the change of color to rendered objects to take effect. |
# in order for the change of color of the rendered objects to take |
61 |
|
# effect. |
62 |
self.__mapper.ScalarVisibilityOff() |
self.__mapper.ScalarVisibilityOff() |
63 |
|
|
64 |
# NOTE: Must be used after mapper.ScalarVisibilityOff() |
# NOTE: Must be used after mapper.ScalarVisibilityOff() |
65 |
# in order for the change of color rendered objects to take effect. |
# in order for the change of color of the rendered objects to take |
66 |
|
# effect. |
67 |
self.__vtk_actor3D.GetProperty().SetColor(color) |
self.__vtk_actor3D.GetProperty().SetColor(color) |
68 |
|
|
69 |
def setRepresentationToWireframe(self): |
def setRepresentationToWireframe(self): |
83 |
|
|
84 |
self.__vtk_actor3D.GetProperty().SetLineWidth(line_width) |
self.__vtk_actor3D.GetProperty().SetLineWidth(line_width) |
85 |
|
|
|
|
|
86 |
def _getActor3D(self): |
def _getActor3D(self): |
87 |
""" |
""" |
88 |
Return the 3D actor. |
Return the 3D actor. |
94 |
return self.__vtk_actor3D |
return self.__vtk_actor3D |
95 |
|
|
96 |
|
|
97 |
############################################################################ |
############################################################################### |
|
|
|
98 |
|
|
99 |
|
|
100 |
class Actor2D: |
class Actor2D: |
106 |
""" |
""" |
107 |
Initialise the 2D actor. |
Initialise the 2D actor. |
108 |
|
|
109 |
@type mapper: vtkImageMapper, etc |
@type mapper: vtkMapper2D, etc |
110 |
@param mapper: Mapped data |
@param mapper: Mapped data |
111 |
""" |
""" |
112 |
|
|
124 |
def setPosition(self, position): |
def setPosition(self, position): |
125 |
""" |
""" |
126 |
Set the position of the 2D actor. Default position is the lower left |
Set the position of the 2D actor. Default position is the lower left |
127 |
hand corner. |
hand corner of the window. |
128 |
|
|
129 |
@type position: L{LocalPosition <position.LocalPosition>} object |
@type position: L{LocalPosition <position.LocalPosition>} object |
130 |
@param position: 2D actor position |
@param position: Position of the 2D actor |
131 |
""" |
""" |
132 |
|
|
133 |
self._vtk_actor2D.SetPosition(position._getLocalPosition()) |
self._vtk_actor2D.SetPosition(position._getLocalPosition()) |
142 |
|
|
143 |
return self._vtk_actor2D |
return self._vtk_actor2D |
144 |
|
|
|
|
|