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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 886 - (hide annotations)
Thu Nov 2 01:34:58 2006 UTC (13 years, 11 months ago) by jongui
File MIME type: text/x-python
File size: 3475 byte(s)
- Fixed a couple of minor bugs but the bug relating to the plane normal still exists.
- Updated the documentation.

1 gross 792 """
2 jongui 839 @author: John Ngui
3     @author: Lutz Gross
4 gross 792 """
5    
6 jongui 822 import vtk
7 jongui 849 from common import Common
8 gross 792
9 jongui 828 class Map(Common):
10 jongui 835 """
11 jongui 879 Class that shows a scalar field by color on the domain surface.
12 jongui 835 """
13 gross 792
14 jongui 839 def __init__(self, scene, data_collector, lut = None):
15 jongui 835 """
16 jongui 845 @type scene: L{Scene <scene.Scene>} object
17 jongui 839 @param scene: Scene in which components are to be added to
18 jongui 835 @type data_collector: L{DataCollector <datacollector.DataCollector>}
19     object
20     @param data_collector: Source of data for visualization
21 jongui 839 @type lut: L{BlueToRed <colormap.BlueToRed>} object or
22     L{RedToBlue <colormap.RedToBlue>} object
23 jongui 860 @param lut: Lookup table to be used by the mapper
24 jongui 835 """
25    
26 jongui 839 Common.__init__(self, scene, data_collector)
27 jongui 849 Common.setMapperInput(self, self.data_collector.getReader().GetOutput(),
28 jongui 839 lut)
29 jongui 886
30     #print "in Map class"
31     #bound = self.data_collector.getReader().GetOutput().GetBounds()
32     #print bound
33     #print bound[0]
34     #print bound[1]
35     #print bound[2]
36     #print bound[3]
37     #print bound[4]
38     #print bound[5]
39    
40 jongui 849 Common.setActorInput(self)
41 jongui 828 Common.addActor(self)
42 jongui 822
43 jongui 840
44 jongui 849 from plane import Plane
45 jongui 840
46 jongui 849 class MapOnPlane(Plane):
47 jongui 840 """
48 jongui 879 Class that shows a scalar field by color on a given plane.
49 jongui 840 """
50    
51 jongui 860 def __init__(self, scene, data_collector, transform, lut = None):
52 jongui 845 """
53     @type scene: L{Scene <scene.Scene>} object
54     @param scene: Scene in which components are to be added to
55     @type data_collector: L{DataCollector <datacollector.DataCollector>}
56     object
57 jongui 860 @param data_collector: Source of data for visualization
58     @type transform: L{Transform <geo.Transform>} object
59     @param transform: Orientation of the plane
60     @type lut: L{BlueToRed <colormap.BlueToRed>} or
61     L{RedToBlue <colormap.RedToBlue>} object
62     @param lut: Lookup table to be used by the mapper
63 jongui 845 """
64    
65 jongui 860 # "Cut" is used to distinguish cutting from clipping.
66 jongui 840 Plane.__init__(self, scene, data_collector,
67 jongui 860 data_collector.getReader().GetOutput(), transform, lut, "Cut")
68 jongui 840
69 jongui 860 from plane import Plane
70    
71     class MapOnClip(Plane):
72     """
73 jongui 879 Class that shows a scalar field by color on a given clip.
74 jongui 860 """
75    
76     def __init__(self, scene, data_collector, transform, lut = None):
77     """
78     @type scene: L{Scene <scene.Scene>} object
79     @param scene: Scene in which components are to be added to
80     @type data_collector: L{DataCollector <datacollector.DataCollector>}
81     object
82     @param data_collector: Source of data for visualization
83     @type transform: L{Transform <geo.Transform>} object
84     @param transform: Orientation of the plane
85     @type lut: L{BlueToRed <colormap.BlueToRed>} or
86     L{RedToBlue <colormap.RedToBlue>} object
87     @param lut: Lookup table to be used by the mapper
88     """
89    
90 jongui 886 # "Clip" is used to distinguish clipping from cutting.
91 jongui 860 Plane.__init__(self, scene, data_collector,
92     data_collector.getReader().GetOutput(), transform, lut, "Clip")
93    
94 jongui 886 from plane import Plane
95    
96     class MapOnScalarClip(Plane):
97    
98     def __init__(self, scene, data_collector, lut = None):
99     """
100     @type scene: L{Scene <scene.Scene>} object
101     @param scene: Scene in which components are to be added to
102     @type data_collector: L{DataCollector <datacollector.DataCollector>}
103     object
104     @param data_collector: Source of data for visualization
105     @type lut: L{BlueToRed <colormap.BlueToRed>} or
106     L{RedToBlue <colormap.RedToBlue>} object
107     @param lut: Lookup table to be used by the mapper
108     """
109    
110     # "ScalarClip" is used to distinguish clipping from cutting.
111     Plane.__init__(self, scene, data_collector,
112     data_collector.getReader().GetOutput(), None, lut,
113     "ScalarClip")

  ViewVC Help
Powered by ViewVC 1.1.26