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

Diff of /trunk/pyvisi/py_src/lookuptable.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 17  class LookupTable: Line 17  class LookupTable:
17          self.__vtk_lookup_table = vtk.vtkLookupTable()          self.__vtk_lookup_table = vtk.vtkLookupTable()
18          self.__vtk_inverse_lookup_table = vtk.vtkLookupTable()          self.__vtk_inverse_lookup_table = vtk.vtkLookupTable()
19          self.__build()          self.__build()
         #self._setTableValue()  
20    
21      def __build(self):      def __build(self):
22          """          """
23          Generates the lookup table.          Generates the lookup table.
24          """          """
25    
26          # NOTE: Build have to be executed prior to using SetTableValue.          # NOTE: Build have to be executed prior to using SetTableValue (if any).
27          self.__vtk_lookup_table.Build()          self.__vtk_lookup_table.Build()
28          self.__vtk_inverse_lookup_table.Build()          self.__vtk_inverse_lookup_table.Build()
29    
# Line 33  class LookupTable: Line 32  class LookupTable:
32          Setup the lookup table with colors.          Setup the lookup table with colors.
33          """          """
34    
35          # NOTE: The color values are inversed because VTK's default lookup          # NOTE: The color values are inversed because VTK's default lookup
36          # table is inversed by itself. SetTableValue have to be executed after          # table is inversed by itself. SetTableValue have to be executed after
37          # the Build.          # the Build.
38          for i in range(256):          for i in range(256):
39              self.__vtk_lookup_table.SetTableValue(              self.__vtk_lookup_table.SetTableValue(
40                  i, self.__vtk_inverse_lookup_table.GetTableValue(255 - i))                      i, self.__vtk_inverse_lookup_table.GetTableValue(255 - i))
41    
42      def _setLookupTableToGreyScale(self):      def _setLookupTableToGreyScale(self):
43          """          """
44          Setup the lookup table with grey scale.          Setup the lookup table with grey scale.
45          """          """
46    
         #self.__vtk_lookup_table = vtk.vtkLookupTable()  
47          self.__setHueRange(0,0)          self.__setHueRange(0,0)
48          self.__setSaturationRange(0,0)          self.__setSaturationRange(0,0)
49          self.__setValueRange(1,0)          self.__setValueRange(1,0)
50          self.__setNumberOfTableValues(256)          self.__setNumberOfTableValues(256)
51          self.__setRampToSQRT()          self.__setRampToSQRT()
         #self.__vtk_lookup_table.Build()  
52    
53      def __setValueRange(self, lower_range, upper_range):      def __setValueRange(self, lower_range, upper_range):
54          """          """

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

  ViewVC Help
Powered by ViewVC 1.1.26