/[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 948 by jongui, Wed Jan 31 03:08:04 2007 UTC revision 949 by jongui, Fri Feb 2 05:33:05 2007 UTC
# Line 6  import vtk Line 6  import vtk
6  from actor import Actor2D  from actor import Actor2D
7  from constant import Viewport, Color  from constant import Viewport, Color
8    
9    # NOTE: Actor2D was inherited to allow access to its public methods from
10    # the driver.
11  class Text2D(Actor2D):  class Text2D(Actor2D):
12      """      """
13      Class that defines a 2D text actor.      Class that defines a 2D text actor.
# Line 15  class Text2D(Actor2D): Line 17  class Text2D(Actor2D):
17          """          """
18          Initialise the 2D text actor.          Initialise the 2D text actor.
19    
20            @type scene: L{Scene <scene.Scene>} object
21            @param scene: Scene in which objects are to be rendered on
22          @type text: String          @type text: String
23          @param text: 2D text to be displayed          @param text: 2D text to be displayed
24            @type viewport: L{Viewport <constant.Viewport>} constant
25            @param viewport: Viewport in which objects are to be rendered on
26          """          """
27    
28          self.__scene = scene          self.__scene = scene
# Line 37  class Text2D(Actor2D): Line 43  class Text2D(Actor2D):
43    
44      def __setInput(self):      def __setInput(self):
45          """          """
46          Set the 2D text to be displayed.          Set the input for the 2D text.
47          """          """
48    
49          self._vtk_actor2D.SetInput(self.__text)          self._vtk_actor2D.SetInput(self.__text)
 #       self._vtk_actor2D.GetPositionCoordinate().SetCoordinateSystemToViewport()  
       
50    
51      def setFontSize(self, size):      def setFontSize(self, size):
52          """          """
# Line 75  class Text2D(Actor2D): Line 79  class Text2D(Actor2D):
79    
80          self._vtk_actor2D.GetTextProperty().SetFontFamilyToCourier()          self._vtk_actor2D.GetTextProperty().SetFontFamilyToCourier()
81    
     def setJustificationToCenter(self):  
         """  
         Set the 2D text to center justification.  
         """  
   
         self._vtk_actor2D.GetTextProperty().SetJustificationToCentered()  
   
82      def boldOn(self):      def boldOn(self):
83          """          """
84          Bold the 2D text.          Bold the 2D text.

Legend:
Removed from v.948  
changed lines
  Added in v.949

  ViewVC Help
Powered by ViewVC 1.1.26