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

Annotation of /trunk/pyvisi/py_src/contourmodule.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 947 - (hide annotations)
Wed Jan 31 07:17:43 2007 UTC (14 years, 2 months ago) by jongui
File MIME type: text/x-python
File size: 1510 byte(s)
added some epydocs.
1 jongui 943 """
2     @author: John NGUI
3     """
4    
5     import vtk
6    
7     class ContourModule:
8     """
9     Class that defines contour.
10     """
11    
12     def __init__(self, object):
13     """
14     Initliase the contour.
15    
16     @type object: vtkUnstructuredGrid, etc
17     @param object: Input for the contour
18     """
19    
20     self.__object = object
21     self.__vtk_contour = vtk.vtkContourFilter()
22    
23     self.__setInput()
24    
25     def __setInput(self):
26     """
27     Set the input for the contour.
28     """
29    
30     self.__vtk_contour.SetInput(self.__object)
31    
32     # lower_range and upper_range by default is assigned to None. This allows
33     # the contours to be altered without necessarily having to alter the
34 jongui 947 # lower_range and upper_range together.
35 jongui 943 def generateContours(self, contours, lower_range = None,
36     upper_range = None):
37     """
38 jongui 947 Generate the specified number of contours within the specified range.
39 jongui 943
40     @type contours: Number
41     @param contours: Number of contours to generate
42     @type lower_range: Number
43 jongui 947 @param lower_range: Lower range of contour values
44 jongui 943 @type upper_range: Number
45 jongui 947 @param upper_range: Upper range of contours values
46 jongui 943 """
47    
48 jongui 947 if(lower_range != None): # True if the lower_range is specified.
49 jongui 943 self.__lower_range = lower_range
50 jongui 947 if(upper_range != None): # True if the upper_range is specified.
51 jongui 943 self.__upper_range = upper_range
52    
53     self.__vtk_contour.GenerateValues(contours, self.__lower_range,
54     self.__upper_range)
55    
56     def _getOutput(self):
57     """
58     Return the output of the contour.
59    
60     @rtype: vtkPolyData
61     @return: Polygonal data
62     """
63    
64     return self.__vtk_contour.GetOutput()
65    

  ViewVC Help
Powered by ViewVC 1.1.26