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

Contents of /trunk/pyvisi/py_src/style.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 860 - (show annotations)
Thu Sep 28 08:17:29 2006 UTC (14 years, 2 months ago) by jongui
File MIME type: text/x-python
File size: 1071 byte(s)
- added sample drivers on how to use all of the currently available modules.
- completed the epydocs for all the currently available modules.
- added the rotation feature for camera and plane cutting.


1 """
2 @author: John Ngui
3 @author: Lutz Gross
4 """
5
6 import vtk
7 from constants import *
8
9 class Style:
10 """
11 Class that define the style of text.
12 """
13
14 def __init__(self):
15 self.vtk_text_property = vtk.vtkTextProperty()
16
17 def setFontFamily(self, family):
18 """
19 Set the font family (i.e. Times, Arial).
20 @type family: String
21 @param family: Type of font
22 """
23 eval("self.vtk_text_property.SetFontFamilyTo%s()" % family)
24
25 def boldOn(self):
26 """
27 Bold the text.
28 """
29
30 self.vtk_text_property.BoldOn()
31
32 def italicOn(self):
33 """
34 Italize the text.
35 """
36
37 self.vtk_text_property.ItalicOn()
38
39 def shadowOn(self):
40 """
41 Apply shadows on the text.
42 """
43
44 self.vtk_text_property.ShadowOn()
45
46 def setColor(self, color):
47 """
48 Set the text color.
49 @type color: RGB list
50 @param color: Color of the text
51 """
52
53 self.vtk_text_property.SetColor(color[0], color[1],
54 color[2])
55
56 def getStyle(self):
57 """
58 Return the style object.
59 @rtype: vtkTextProperty
60 @return: VTK text property that is used to specify text style
61 """
62
63 return self.vtk_text_property
64

  ViewVC Help
Powered by ViewVC 1.1.26