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

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

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

revision 947 by jongui, Wed Jan 31 07:17:43 2007 UTC revision 948 by jongui, Thu Feb 1 07:23:34 2007 UTC
# Line 13  class Glyph3D: Line 13  class Glyph3D:
13          """          """
14          Initialise the 3D glyph.          Initialise the 3D glyph.
15    
16          @type object: vtkUnstructuredGrid, etc          @type object: vtkDataSet, etc
17          @param object: Input for the 3D glyph          @param object: Input for the 3D glyph
18          @type source: vtkPolyData            @type source: vtkPolyData  
19          @param source: Source for the 3D glyph (i.e. Arrow2D, Arrow3D, etc)          @param source: Source for the 3D glyph (i.e. Arrow2D, Arrow3D, etc)
# Line 66  class Glyph3D: Line 66  class Glyph3D:
66    
67      def _setColorModeByVector(self):      def _setColorModeByVector(self):
68          """          """
69          Set the 3D glyph to color according to the vector.          Set the 3D glyph color according to the vector.
70          """          """
71    
72          self.__vtk_glyph3D.SetColorModeToColorByVector()          self.__vtk_glyph3D.SetColorModeToColorByVector()
73    
74      def _setColorModeByScalar(self):      def _setColorModeByScalar(self):
75          """          """
76          Set the 3D glyph to color according to the scalar.          Set the 3D glyph color according to the scalar.
77          """          """
78    
79          self.__vtk_glyph3D.SetColorModeToColorByScalar()          self.__vtk_glyph3D.SetColorModeToColorByScalar()
# Line 87  class Glyph3D: Line 87  class Glyph3D:
87    
88      def setScaleFactor(self, scale_factor):      def setScaleFactor(self, scale_factor):
89          """          """
90          Set the 3D glyph scaling factor.          Set the 3D glyph scale factor.
91                    
92          @type scale_factor: Number          @type scale_factor: Number
93          @param scale_factor: Scale factor          @param scale_factor: Scale factor
# Line 111  class Glyph3D: Line 111  class Glyph3D:
111    
112      def __setOrientOn(self):      def __setOrientOn(self):
113          """          """
114          Enable the orienting of the rendered object along vector/normal.              Enable the orientation of the rendered object along the vector/normal.  
115          """          """
116    
117          self.__vtk_glyph3D.OrientOn()          self.__vtk_glyph3D.OrientOn()
118                    
119      def __setRange(self):      def __setRange(self):
120          """          """
121          Set the 3D glyph range to maps scalar values into.          Set the range to map scalar values.
122          """          """
123    
124          self.__vtk_glyph3D.SetRange(self.__range)          self.__vtk_glyph3D.SetRange(self.__range)
125    
126      def _getOutput(self):      def _getOutput(self):
127          """          """
128          Return the 3D glyph.          Return the output of the 3D glyph.
129    
130          @rtype: vtkPolyData          @rtype: vtkPolyData
131          @return Polygonal data          @return Polygonal data
# Line 134  class Glyph3D: Line 134  class Glyph3D:
134          return self.__vtk_glyph3D.GetOutput()          return self.__vtk_glyph3D.GetOutput()
135    
136    
137    ###############################################################################
138    
139    
140  class TensorGlyph:  class TensorGlyph:
141        """
142        Class that defines tensor glyph.
143        """
144    
145      def __init__(self, object, source):      def __init__(self, object, source):
146            """
147            Initialise the tensor glyph.
148    
149            @type object: vtkDataSet, etc
150            @param object: Input for the 3D glyph
151            @type source: vtkPolyData  
152            @param source: Source for the 3D glyph (i.e. Sphere, etc)
153            """
154    
155          self.__object = object          self.__object = object
156          self.__source = source          self.__source = source
157          self.__vtk_tensor_glyph = vtk.vtkTensorGlyph()          self.__vtk_tensor_glyph = vtk.vtkTensorGlyph()
158    
159            self.__setupTensorGlyph()
160    
161        def __setupTensorGlyph(self):
162            """
163            Setup the tensor glyph.
164            """
165    
166          self.__setInput()          self.__setInput()
167          self.__setSource()          self.__setSource()
168    
# Line 160  class TensorGlyph: Line 182  class TensorGlyph:
182    
183      def setScaleFactor(self, scale_factor):      def setScaleFactor(self, scale_factor):
184          """          """
185          Set the tensor glyph scaling factor.          Set the scale factor for the tensor glyph.
186                    
187          @type scale_factor: Number          @type scale_factor: Number
188          @param scale_factor: Scale factor          @param scale_factor: Scale factor
# Line 170  class TensorGlyph: Line 192  class TensorGlyph:
192    
193      def setMaxScaleFactor(self, max_scale_factor):      def setMaxScaleFactor(self, max_scale_factor):
194          """          """
195          Set the maximum allowable scale factor.          Set the maximum allowable scale factor for the tensor glyph.    
196    
197          @type max_scale_factor: Number          @type max_scale_factor: Number
198          @param max_scale_factor: Maximum allowable scale factor.          @param max_scale_factor: Maximum allowable scale factor.
# Line 180  class TensorGlyph: Line 202  class TensorGlyph:
202    
203      def _getOutput(self):      def _getOutput(self):
204          """          """
205          Return the tensor glyph.          Return the output of the tensor glyph.
206    
207          @rtype: vtkPolyData          @rtype: vtkPolyData
208          @return: Polygonal data          @return: Polygonal data
209          """          """
210    
211          return self.__vtk_tensor_glyph.GetOutput()          return self.__vtk_tensor_glyph.GetOutput()
212    

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

  ViewVC Help
Powered by ViewVC 1.1.26