/[escript]/trunk/pyvisi/py_src/text.py
ViewVC logotype

Diff of /trunk/pyvisi/py_src/text.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 1158 by jongui, Tue May 22 04:24:01 2007 UTC
# Line 11  from constant import Viewport, Color Line 11  from constant import Viewport, Color
11  class Text2D(Actor2D):  class Text2D(Actor2D):
12      """      """
13      Class that defines a 2D text actor. A two-dimensional text is used to      Class that defines a 2D text actor. A two-dimensional text is used to
14      annotate the rendered object (i.e. adding titles, authors and labels).      annotate the rendered object (i.e. inserting titles, authors and labels).
15      """      """
16    
17      def __init__(self, scene, text, viewport = Viewport.SOUTH_WEST):      def __init__(self, scene, text, viewport = Viewport.SOUTH_WEST):
# Line 26  class Text2D(Actor2D): Line 26  class Text2D(Actor2D):
26          @param viewport: Viewport in which objects are to be rendered on          @param viewport: Viewport in which objects are to be rendered on
27          """          """
28    
         self.__scene = scene  
29          self.__text = text          self.__text = text
30          self.__viewport = viewport          self.__viewport = viewport
31          self._vtk_actor2D = vtk.vtkTextActor()          self._vtk_actor2D = vtk.vtkTextActor()
32    
33          self.__setupText2D()          self.__setupText2D(scene)
34            
35      def __setupText2D(self):      def __setupText2D(self, scene):
36          """          """
37          Setup the 2D text.          Setup the 2D text.
38    
39            @type scene: L{Scene <scene.Scene>} object
40            @param scene: Scene in which objects are to be rendered on
41          """          """
42    
43          self.__setInput()          self.__setInput()
44          # Add the 2D text to the appropriate renderer.          # Add the 2D text to the appropriate renderer.
45          self.__scene._addActor2D(self.__viewport, self._vtk_actor2D)          scene._addActor2D(self.__viewport, self._vtk_actor2D)
46    
47      def __setInput(self):      def __setInput(self):
48          """          """

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

  ViewVC Help
Powered by ViewVC 1.1.26