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

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

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

revision 945 by jongui, Mon Jan 29 07:22:43 2007 UTC revision 946 by jongui, Wed Jan 31 03:08:04 2007 UTC
# Line 140  class Actor2D: Line 140  class Actor2D:
140          return self._vtk_actor2D          return self._vtk_actor2D
141    
142    
 class TextActor(Actor2D):  
     """  
     Class that defines a 2D text actor.  
     """  
   
     def __init__(self, text):  
         """  
         Initialise the 2D text actor.  
   
         @type text: String  
         @param text: 2D text to be displayed  
         """  
   
         self.__text = text  
         self._vtk_actor2D = vtk.vtkTextActor()  
   
         self.__setInput()  
           
     def __setInput(self):  
         """  
         Set the 2D text to be displayed.  
         """  
   
         self._vtk_actor2D.SetInput(self.__text)  
   
     def setFontSize(self, size):  
         """  
         Set the 2D text size.  
   
         @type size: Number  
         @param size: Size of the 2D text  
         """  
   
         self._vtk_actor2D.GetTextProperty().SetFontSize(size)  
   
     def setFontToTimes(self):  
         """  
         Set the 2D text font type to times new roman.  
         """  
   
         self._vtk_actor2D.GetTextProperty().SetFontFamilyToTimes()  
   
     def setFontToArial(self):  
         """  
         Set the 2D text font type to arial.  
         """  
   
         self._vtk_actor2D.GetTextProperty().SetFontFamilyToArial()  
   
     def setFontToCourier(self):  
         """  
         Set the 2D text front type to courier.  
         """  
   
         self._vtk_actor2D.GetTextProperty().SetFontFamilyToCourier()  
   
     def setJustificationToCenter(self):  
         """  
         Set the 2D text to center justification.  
         """  
   
         self._vtk_actor2D.GetTextProperty().SetJustificationToCentered()  
   
     def setJustificationToLeft(self):  
         """  
         Set the 2D text to left justification.  
         """  
   
         self._vtk_actor2D.GetTextProperty().SetJustificationToLeft()  
   
     def setJustificationToRight(self):  
         """  
         Set the 2D text to right justification.  
         """  
   
         self._vtk_actor2D.GetTextProperty().SetJustificationToRight()  
   
     def boldOn(self):  
         """  
         Bold the 2D text.  
         """  
   
         self._vtk_actor2D.GetTextProperty().BoldOn()  
   
     def shadowOn(self):  
         """  
         Apply shadow onto the 2D text to ease visibility.  
         """  
   
         self._vtk_actor2D.GetTextProperty().ShadowOn()  
   
     def setColor(self, color):  
         """  
         Set the color of the text.  
   
         @type color: L{Color <constant.Color>} constant  
         @param color: 2D text color  
         """  
   
         self._vtk_actor2D.GetTextProperty().SetColor(color)  
   

Legend:
Removed from v.945  
changed lines
  Added in v.946

  ViewVC Help
Powered by ViewVC 1.1.26