/[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 947 by jongui, Wed Jan 31 03:08:04 2007 UTC revision 948 by jongui, Thu Feb 1 07:23:34 2007 UTC
# Line 28  class PointSource: Line 28  class PointSource:
28    
29          # Default number of points to generate is 10.          # Default number of points to generate is 10.
30          self.setPointSourceNumberOfPoints(10)          self.setPointSourceNumberOfPoints(10)
31          # Default center is of the sphere is the center of the data object.          # Default center of the sphere is the center of the data object.
32          center = self.__object.GetCenter()          center = self.__object.GetCenter()
33          self.setPointSourceCenter(GlobalPosition(center[0], center[1], center[2]))          self.setPointSourceCenter(
34          # Default radius of the sphere is 0.5.                  GlobalPosition(center[0], center[1], center[2]))
35    
36            # Default radius of the sphere is 0.1.
37          self.setPointSourceRadius(0.1)          self.setPointSourceRadius(0.1)
38          self.__vtk_point_source.Update()          self.__vtk_point_source.Update()
39    
# Line 68  class PointSource: Line 70  class PointSource:
70    
71      def _getOutput(self):      def _getOutput(self):
72          """          """
73          Return the point source.          Return the output of the point source.
74    
75          @rtype: vtkPolyData          @rtype: vtkPolyData
76          @return: Polygonal data          @return: Polygonal data
# Line 77  class PointSource: Line 79  class PointSource:
79          return self.__vtk_point_source.GetOutput()          return self.__vtk_point_source.GetOutput()
80    
81    
82    ###############################################################################
83    
84    
85  class StructuredPoints:  class StructuredPoints:
86      """      """
87      Class that defines the structured points.      Class that defines the structured points.
88      """      """
89            
90      # NOTE: The algorithm of this class was extracted from Mayavi's      # NOTE: The algorithm of this class was extracted from Mayavi's
91      # online source code.      # online source code. Does NOT work for second-order (non-linear) elements.
92      def __init__(self, object):      def __init__(self, object):
93          """          """
94          Initialise the structured points.          Initialise the structured points.
# Line 123  class StructuredPoints: Line 128  class StructuredPoints:
128          @param z1: Index of the last point on the z-axis          @param z1: Index of the last point on the z-axis
129          """          """
130    
131          self.__vtk_structured_points.SetExtent(x0, x1, y0, y1, z0, z1)          # NOTE: setExtent and setUpdateExtent MUST be used together.
132            #self.__vtk_structured_points.SetExtent(x0, x1, y0, y1, z0, z1)
133    
134      def __setUpdateExtent(self, x0, x1, y0, y1, z0, z1):      def __setUpdateExtent(self, x0, x1, y0, y1, z0, z1):
135          """          """
# Line 137  class StructuredPoints: Line 143  class StructuredPoints:
143          @param z1: Index of the last point on the z-axis          @param z1: Index of the last point on the z-axis
144          """          """
145    
146          self.__vtk_structured_points.SetUpdateExtent(x0, x1, y0, y1, z0, z1)          # NOTE: setUpdateExtent and setExtent MUST be used together.
147            #self.__vtk_structured_points.SetUpdateExtent(x0, x1, y0, y1, z0, z1)
     #def __setWholeExtent(self, x0, x1, y0, y1, z0, z1):  
     #   self.__vtk_structured_points.SetWholeExtent(x0, x1, y0, y1, z0, z1)  
148    
149      def setDimension(self, x, y, z):      def setDimension(self, x, y, z):
150          """          """
151          Set the dimension (number of points) on the x, y and z axes. The          Set the dimension on the x, y and z axes. The
152          smaller the dimension, the more points are populated.          smaller the dimension, the more points are populated.
153    
154          @type x: Number          @type x: Number
155          @param x: Number of points on the x-axis          @param x: Dimension on the x-axis
156          @type y: Number          @type y: Number
157          @param y: Number of points on the y-axis          @param y: Dimension on the y-axis
158          @type z: Number          @type z: Number
159          @param z: Number of points on the z-axis          @param z: Dimension on the z-axis
160          """          """
161    
162          self.__dims = [int((self.__l[0]*self.__fac)/x) + 1,          self.__dims = [int((self.__l[0]*self.__fac)/x) + 1,

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

  ViewVC Help
Powered by ViewVC 1.1.26