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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 948 - (show annotations)
Thu Feb 1 07:23:34 2007 UTC (12 years, 2 months ago) by jongui
File MIME type: text/x-python
File size: 1469 byte(s)
fixed some bugs in pyvisi and added more epydocs.
1 """
2 @author: John NGUI
3 """
4
5 import vtk
6
7 class DataSetMapper:
8 """
9 Class that defines a data set mapper.
10 """
11
12 # lookup_table = None is used only by the outline.
13 def __init__(self, object, lookup_table = None):
14 """
15 Initialise the data set mapper.
16
17 @type object: vtkDataSet (i.e. vtkUnstructuredGrid, vtkPolyData, etc)
18 @param object: Data source map
19 @type lookup_table: vtkLookupTable
20 @param lookup_table: Maps scalar values to colors
21 """
22
23 self.__object = object
24 self.__vtk_data_set_mapper = vtk.vtkDataSetMapper()
25 self.__setInput()
26
27 if(lookup_table != None): # True for the outline.
28 self.__setLookupTable(lookup_table)
29
30 def __setInput(self):
31 """
32 Set the input for the data set mapper.
33 """
34
35 self.__vtk_data_set_mapper.SetInput(self.__object)
36
37 def __setLookupTable(self, lookup_table):
38 """
39 Set the lookup table to the data set mapper.
40
41 @type lookup_table: vtkLookupTable
42 @param lookup_table: Map scalar values to colors
43 """
44
45 self.__vtk_data_set_mapper.SetLookupTable(lookup_table)
46
47 def _setScalarRange(self, range):
48 """
49 Set the minimum and maximum scalar range for the data set mapper.
50
51 @type range: Two column tuple
52 @param range: Maximum and minimum data set mapper scalar range
53 """
54
55 self.__vtk_data_set_mapper.SetScalarRange(range)
56
57 def _getDataSetMapper(self):
58 """
59 Return the data set mapper.
60
61 @rtype: vtkDataSetMapper
62 @return: Data set mapper
63 """
64
65 return self.__vtk_data_set_mapper
66
67

  ViewVC Help
Powered by ViewVC 1.1.26