/[escript]/temp_trunk_copy/pyvisi/py_src/actor.py
ViewVC logotype

Diff of /temp_trunk_copy/pyvisi/py_src/actor.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1147 by ksteube, Wed May 16 06:39:11 2007 UTC revision 1199 by jongui, Wed Jun 20 05:01:30 2007 UTC
# Line 1  Line 1 
1  """  """
2  @author: John NGUI  @var __author__: name of author
3    @var __copyright__: copyrights
4    @var __license__: licence agreement
5    @var __url__: url entry point on documentation
6    @var __version__: version
7    @var __date__: date of the version
8  """  """
9    
10    __author__="John Ngui, john.ngui@uq.edu.au"
11    __copyright__="""  Copyright (c) 2006 by ACcESS MNRF
12                        http://www.access.edu.au
13                    Primary Business: Queensland, Australia"""
14    __license__="""Licensed under the Open Software License version 3.0
15                 http://www.opensource.org/licenses/osl-3.0.php"""
16    __url__="http://www.iservo.edu.au/esys"
17    __version__="$Revision$"
18    __date__="$Date$"
19    
20    
21  import vtk  import vtk
22    
23  class Actor3D:  class Actor3D:
# Line 9  class Actor3D: Line 25  class Actor3D:
25      Class that defines a 3D actor.      Class that defines a 3D actor.
26      """      """
27            
28      def __init__(self, mapper):      def __init__(self):
29          """          """
30          Initialise the 3D actor.          Initialise the 3D actor.
31            """
32    
33            self.__vtk_actor3D = vtk.vtkActor()
34    
35        def _setupActor3D(self, mapper):
36            """
37            Setup the 3D actor.
38    
39          @type mapper: vtkDataSetMapper          @type mapper: vtkDataSetMapper
40          @param mapper: Mapped data          @param mapper: Mapped data
41          """          """
42    
43          self.__mapper = mapper          self.__mapper = mapper
         self.__vtk_actor3D = vtk.vtkActor()  
44          self.__setMapper()          self.__setMapper()
45            
46      def __setMapper(self):      def __setMapper(self):
47          """          """
48          Set the mapper of the 3D actor.          Set the mapper of the 3D actor.
# Line 59  class Actor3D: Line 81  class Actor3D:
81          # NOTE: Must be used before actor.GetProperty().SetColor()          # NOTE: Must be used before actor.GetProperty().SetColor()
82          # in order for the change of color to take effect.          # in order for the change of color to take effect.
83          self.__mapper.ScalarVisibilityOff()          self.__mapper.ScalarVisibilityOff()
   
         # NOTE: Must be used after mapper.ScalarVisibilityOff()  
         # in order for the change of color to take effect.  
84          self.__vtk_actor3D.GetProperty().SetColor(color)          self.__vtk_actor3D.GetProperty().SetColor(color)
85    
86      def setRepresentationToWireframe(self):      def setRepresentationToWireframe(self):
87          """          """
88          Set the representation of the 3D actor to Wireframe.          Set the representation of the 3D actor to wireframe.
89          """          """
90    
91          self.__vtk_actor3D.GetProperty().SetRepresentationToWireframe()          self.__vtk_actor3D.GetProperty().SetRepresentationToWireframe()
# Line 100  class Actor2D: Line 119  class Actor2D:
119      Class that defines a 2D actor.      Class that defines a 2D actor.
120      """      """
121    
122      def __init__(self, mapper):      def __init__(self):
123          """          """
124          Initialise the 2D actor.          Initialise the 2D actor.
125            """
126    
127            self._vtk_actor2D = vtk.vtkActor2D()
128    
129        def _setupActor2D(self, mapper):
130            """
131            Setup the 2D actor.
132    
133          @type mapper: vtkMapper2D          @type mapper: vtkMapper2D
134          @param mapper: Mapped data          @param mapper: Mapped data
135          """          """
136    
137          self.__mapper = mapper          self.__mapper = mapper
         self._vtk_actor2D = vtk.vtkActor2D()  
138          self.__setMapper()          self.__setMapper()
139    
140      def __setMapper(self):      def __setMapper(self):

Legend:
Removed from v.1147  
changed lines
  Added in v.1199

  ViewVC Help
Powered by ViewVC 1.1.26