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

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

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

revision 947 by jongui, Mon Jan 29 07:22:43 2007 UTC revision 948 by jongui, Thu Feb 1 07:23:34 2007 UTC
# Line 9  class DataSetMapper: Line 9  class DataSetMapper:
9      Class that defines a data set mapper.      Class that defines a data set mapper.
10      """      """
11    
12      # lookup_table = None is used by the outline object.      # lookup_table = None is used only by the outline.
13      def __init__(self, object, lookup_table = None):      def __init__(self, object, lookup_table = None):
14          """          """
15          Initialise the data set mapper.          Initialise the data set mapper.
# Line 17  class DataSetMapper: Line 17  class DataSetMapper:
17          @type object: vtkDataSet (i.e. vtkUnstructuredGrid, vtkPolyData, etc)          @type object: vtkDataSet (i.e. vtkUnstructuredGrid, vtkPolyData, etc)
18          @param object: Data source map          @param object: Data source map
19          @type lookup_table: vtkLookupTable          @type lookup_table: vtkLookupTable
20          @param lookup_table: Maps scalar values to a color          @param lookup_table: Maps scalar values to colors
21          """          """
22    
23          self.__object = object          self.__object = object
24          self.__vtk_data_set_mapper = vtk.vtkDataSetMapper()          self.__vtk_data_set_mapper = vtk.vtkDataSetMapper()
25          self.__setInput()          self.__setInput()
26          if(lookup_table != None):  
27            if(lookup_table != None): # True for the outline.
28              self.__setLookupTable(lookup_table)              self.__setLookupTable(lookup_table)
29    
30      def __setInput(self):      def __setInput(self):
31          """          """
32          Set the the input for the data set mapper.          Set the input for the data set mapper.
33          """          """
34    
35          self.__vtk_data_set_mapper.SetInput(self.__object)          self.__vtk_data_set_mapper.SetInput(self.__object)
36    
37      def __setLookupTable(self, lookup_table):      def __setLookupTable(self, lookup_table):
38          """          """
39          Set the lookup table for the data set mapper.          Set the lookup table to the data set mapper.
40            
41          @type lookup_table: vtkLookupTable          @type lookup_table: vtkLookupTable
42          @param lookup_table: Map scalar values to a color          @param lookup_table: Map scalar values to colors
43          """          """
44    
45          self.__vtk_data_set_mapper.SetLookupTable(lookup_table)          self.__vtk_data_set_mapper.SetLookupTable(lookup_table)
46    
47      def _setScalarRange(self, range):      def _setScalarRange(self, range):
48          """          """
49          Set the minimum and maximum scalar range to be mapped into the lookup          Set the minimum and maximum scalar range for the data set mapper.
         table for the data set mapper.  
50                    
51          @type range: tuple          @type range: Two column tuple
52          @param range: Maximum and mimimum scalar range          @param range: Maximum and minimum data set mapper scalar range
53          """          """
54    
55          self.__vtk_data_set_mapper.SetScalarRange(range)          self.__vtk_data_set_mapper.SetScalarRange(range)

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

  ViewVC Help
Powered by ViewVC 1.1.26