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

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

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

revision 1052 by jongui, Wed Mar 21 21:56:54 2007 UTC revision 1053 by jongui, Thu Mar 22 01:14:43 2007 UTC
# Line 211  class StructuredPoints: Line 211  class StructuredPoints:
211    
212    
213  class MaskPoints:  class MaskPoints:
214        """
215        Class that the masking of points. It is possible to mask every n'th point.
216        This is useful to prevent the rendered object from being cluttered with
217        arrows or ellipsoids.
218        """
219    
220      def __init__(self, object):      def __init__(self, object):
221            """
222            Initialise the mask points.
223    
224            @type object: vtkDataSet (i.e. vtkUnstructuredGrid, etc)
225            @param object: Data source to mask points from
226            """
227    
228          self.__object = object          self.__object = object
229          self.__vtk_mask_points = vtk.vtkMaskPoints()          self.__vtk_mask_points = vtk.vtkMaskPoints()
230    
231          self.__setupMaskPoints()          self.__setupMaskPoints()
232    
233      def __setupMaskPoints(self):      def __setupMaskPoints(self):
234            """
235            Setup the mask points.
236            """
237          self.__setInput()          self.__setInput()
238    
239      def __setInput(self):      def __setInput(self):
240            """
241            Set the input for the mask points.
242            """
243    
244          self.__vtk_mask_points.SetInput(self.__object)          self.__vtk_mask_points.SetInput(self.__object)
245    
246      def setRatio(self, ratio):      def setRatio(self, ratio):
247            """
248            Mask every nth point.
249    
250            @type ratio: Number
251            @param ratio: Masking ratio
252            """
253    
254          self.__vtk_mask_points.SetOnRatio(ratio)          self.__vtk_mask_points.SetOnRatio(ratio)
255    
256      def randomOn(self):      def randomOn(self):
257            """
258            Enables the randomization of the points selected for masking.
259            """
260    
261          self.__vtk_mask_points.RandomModeOn()          self.__vtk_mask_points.RandomModeOn()
262    
263      def randomOff(self):      def randomOff(self):
264            """
265            Disables the randomization of the points selected for masking.
266            """
267    
268          self.__vtk_mask_points.RandomModeOff()          self.__vtk_mask_points.RandomModeOff()
269            
270      def _getOutput(self):      def _getOutput(self):
271            """
272            Return the output of the masked points.
273    
274            @rtype: vtkPolyData
275            @return: Polygonal datda
276            """
277    
278          return self.__vtk_mask_points.GetOutput()          return self.__vtk_mask_points.GetOutput()
279    
280    

Legend:
Removed from v.1052  
changed lines
  Added in v.1053

  ViewVC Help
Powered by ViewVC 1.1.26