1 |
""" |
2 |
@author: John Ngui |
3 |
@author: Lutz Gross |
4 |
""" |
5 |
|
6 |
import vtk |
7 |
from common import Common |
8 |
|
9 |
class Map(Common): |
10 |
""" |
11 |
Class that shows a scalar field by color on the domain surface. |
12 |
""" |
13 |
|
14 |
def __init__(self, scene, data_collector, lut = None): |
15 |
""" |
16 |
@type scene: L{Scene <scene.Scene>} object |
17 |
@param scene: Scene in which components are to be added to |
18 |
@type data_collector: L{DataCollector <datacollector.DataCollector>} |
19 |
object |
20 |
@param data_collector: Source of data for visualization |
21 |
@type lut: L{BlueToRed <colormap.BlueToRed>} object or |
22 |
L{RedToBlue <colormap.RedToBlue>} object |
23 |
@param lut: Lookup table to be used by the mapper |
24 |
""" |
25 |
|
26 |
Common.__init__(self, scene, data_collector) |
27 |
Common.setMapperInput(self, self.data_collector.getReader().GetOutput(), |
28 |
lut) |
29 |
|
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 |
Common.setActorInput(self) |
41 |
Common.addActor(self) |
42 |
|
43 |
|
44 |
from plane import Plane |
45 |
|
46 |
class MapOnPlane(Plane): |
47 |
""" |
48 |
Class that shows a scalar field by color on a given plane. |
49 |
""" |
50 |
|
51 |
def __init__(self, scene, data_collector, transform, lut = None): |
52 |
""" |
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 |
@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 |
""" |
64 |
|
65 |
# "Cut" is used to distinguish cutting from clipping. |
66 |
Plane.__init__(self, scene, data_collector, |
67 |
data_collector.getReader().GetOutput(), transform, lut, "Cut") |
68 |
|
69 |
from plane import Plane |
70 |
|
71 |
class MapOnClip(Plane): |
72 |
""" |
73 |
Class that shows a scalar field by color on a given clip. |
74 |
""" |
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 |
# "Clip" is used to distinguish clipping from cutting. |
91 |
Plane.__init__(self, scene, data_collector, |
92 |
data_collector.getReader().GetOutput(), transform, lut, "Clip") |
93 |
|
94 |
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") |