1 |
import vtk |
2 |
from constants import * |
3 |
|
4 |
class Style: |
5 |
|
6 |
def __init__(self): |
7 |
self.vtk_text_property = vtk.vtkTextProperty() |
8 |
|
9 |
def setFontFamily(self, family): |
10 |
eval("self.vtk_text_property.SetFontFamilyTo%s()" % family) |
11 |
|
12 |
def setBold(self): |
13 |
self.vtk_text_property.BoldOn() |
14 |
|
15 |
def setItalic(self): |
16 |
self.vtk_text_property.ItalicOn() |
17 |
|
18 |
def setShadow(self): |
19 |
self.vtk_text_property.ShadowOn() |
20 |
|
21 |
def setColor(self, color): |
22 |
self.vtk_text_property.SetColor(color[0], color[1], |
23 |
color[2]) |
24 |
|
25 |
def getStyle(self): |
26 |
return self.vtk_text_property |
27 |
|