/[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 1148 by jongui, Wed May 16 22:45:33 2007 UTC revision 1189 by jongui, Thu Jun 7 05:31:25 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    
     # 'lookup_table = None' is used only by the Outline.  
12      def __init__(self):      def __init__(self):
13          """          """
14          Initialise the data set mapper.          Initialise the data set mapper.
15          """          """
16    
17          self.__vtk_data_set_mapper = vtk.vtkDataSetMapper()          self.__vtk_data_set_mapper = vtk.vtkDataSetMapper()
18            # Keeps track whether the scalar range has been specified
19            # by the user.
20            self.__scalar_range_set = False
21    
22        # 'lookup_table = None' is used only by the Outline and ScalarBar.
23      def _setupDataSetMapper(self, object, lookup_table = None):      def _setupDataSetMapper(self, object, lookup_table = None):
24          """          """
25          Setup the data set mapper.            Setup the data set mapper.  
# Line 50  class DataSetMapper: Line 53  class DataSetMapper:
53    
54          self.__vtk_data_set_mapper.SetLookupTable(lookup_table)          self.__vtk_data_set_mapper.SetLookupTable(lookup_table)
55    
56        def setScalarRange(self, lower_range, upper_range):
57            """
58            Set the minimum and maximium scalar range for the data set mapper. This
59            method is called when the range has been specified by the user.
60            Therefore, the scalar range read from the source will be ignored.
61            
62            @type lower_range: Lower range of scalar value
63            @param lower_range: Number
64            @type upper_range: Upper range of scalar value
65            @param upper_range: Number
66            """
67    
68            self.__scalar_range_set = True
69            self.__vtk_data_set_mapper.SetScalarRange(lower_range, upper_range)
70    
71      def _setScalarRange(self, range):      def _setScalarRange(self, range):
72          """          """
73          Set the minimum and maximum scalar range for the data set mapper.          Set the minimum and maximum scalar range for the data set mapper. This
74            method is called when the range has NOT been specified by the user.
75            Therefore, the scalar range read from the source will be used instead.
76                    
77          @type range: Two column tuple containing numbers          @type range: Two column tuple containing numbers
78          @param range: Minimum and maximum data set mapper scalar range          @param range: Minimum and maximum data set mapper scalar range
# Line 76  class DataSetMapper: Line 96  class DataSetMapper:
96          """          """
97    
98          return self.__vtk_data_set_mapper          return self.__vtk_data_set_mapper
99        
100        def _getDataSetMapperLookupTable(self):
101            """
102            Return the data set mapper's lookup table.
103    
104            @rtype: vtkScalarsToColors  
105            @return: Converts scalar data to colors
106            """
107    
108            return self.__vtk_data_set_mapper.GetLookupTable()
109        
110        def _isScalarRangeSet(self):
111            """
112            Return whether the data set mapper's scalar range has been specified \
113            by the user.
114    
115            @rtype: Boolean
116            @return: True or False
117            """
118    
119            return self.__scalar_range_set
120        
121        def _getDataSetMapperRange(self):
122            """
123            Return the mapper's scalar range.
124    
125            @rtype: Two column tuple containing numbers
126            @return: Minimum and maximum data set mapper scalar range
127            """
128    
129            return self.__vtk_data_set_mapper.GetScalarRange()
130    
131    
132  ###############################################################################  ###############################################################################
# Line 139  class ImageMapper: Line 190  class ImageMapper:
190          """          """
191    
192          return self.__vtk_image_mapper          return self.__vtk_image_mapper
193        

Legend:
Removed from v.1148  
changed lines
  Added in v.1189

  ViewVC Help
Powered by ViewVC 1.1.26