11 |
from normals import Normals |
from normals import Normals |
12 |
from glyph import TensorGlyph |
from glyph import TensorGlyph |
13 |
from outline import Outline |
from outline import Outline |
14 |
from point import StructuredPoints |
from point import StructuredPoints, MaskPoints |
15 |
from probe import Probe |
from probe import Probe |
16 |
|
from average import CellDataToPointData |
17 |
|
|
18 |
# NOTE: DataSetMapper, Actor3D, Sphere, Normals, TensorGlyph, |
# NOTE: DataSetMapper, Actor3D, Sphere, Normals, TensorGlyph |
19 |
# StructuredPoints and Probe were inherited to allow access to their |
# and MaskPoints were inherited to allow access to their |
20 |
# public methods from the driver. |
# public methods from the driver. |
21 |
class Ellipsoid(DataSetMapper, Actor3D, Sphere, Normals, TensorGlyph, |
class Ellipsoid(DataSetMapper, Actor3D, Sphere, Normals, TensorGlyph, |
22 |
StructuredPoints, Probe): |
MaskPoints): |
23 |
""" |
""" |
24 |
Class that shows a tensor field using ellipsoids. The ellipsoids can either |
Class that shows a tensor field using ellipsoids. The ellipsoids can either |
25 |
be colored or grey-scaled, depending on the lookup table used. |
be colored or grey-scaled, depending on the lookup table used. |
29 |
# This saves the user from specifying the viewport when there is only one. |
# This saves the user from specifying the viewport when there is only one. |
30 |
# If no lut is specified, the color scheme will be used. |
# If no lut is specified, the color scheme will be used. |
31 |
def __init__(self, scene, data_collector, viewport = Viewport.SOUTH_WEST, |
def __init__(self, scene, data_collector, viewport = Viewport.SOUTH_WEST, |
32 |
lut = Lut.COLOR, outline = True): |
lut = Lut.COLOR, cell_to_point = False, outline = True): |
33 |
""" |
""" |
34 |
@type scene: L{Scene <scene.Scene>} object |
@type scene: L{Scene <scene.Scene>} object |
35 |
@param scene: Scene in which objects are to be rendered on |
@param scene: Scene in which objects are to be rendered on |
40 |
@param viewport: Viewport in which objects are to be rendered on |
@param viewport: Viewport in which objects are to be rendered on |
41 |
@type lut : L{Lut <constant.Lut>} constant |
@type lut : L{Lut <constant.Lut>} constant |
42 |
@param lut: Lookup table color scheme |
@param lut: Lookup table color scheme |
43 |
|
@type cell_to_point: Boolean |
44 |
|
@param cell_to_point: Converts cell data to point data (by averaging) |
45 |
@type outline: Boolean |
@type outline: Boolean |
46 |
@param outline: Places an outline around the domain surface |
@param outline: Places an outline around the domain surface |
47 |
""" |
""" |
81 |
lookup_table = LookupTable() |
lookup_table = LookupTable() |
82 |
lookup_table._setLookupTableToGreyScale() |
lookup_table._setLookupTableToGreyScale() |
83 |
|
|
84 |
StructuredPoints.__init__(self, data_collector._getOutput()) |
#StructuredPoints.__init__(self, data_collector._getOutput()) |
85 |
Probe.__init__(self, data_collector._getOutput(), |
#Probe.__init__(self, data_collector._getOutput(), |
86 |
StructuredPoints._getStructuredPoints(self)) |
# StructuredPoints._getStructuredPoints(self)) |
87 |
|
|
88 |
|
if(cell_to_point == True): # Converts cell data to point data. |
89 |
|
c2p = CellDataToPointData(data_collector._getOutput()) |
90 |
|
MaskPoints.__init__(self, c2p._getOutput()) |
91 |
|
elif(cell_to_point == False): # No conversion happens. |
92 |
|
MaskPoints.__init__(self, data_collector._getOutput()) |
93 |
|
|
94 |
Sphere.__init__(self) |
Sphere.__init__(self) |
95 |
TensorGlyph.__init__(self, Probe._getOutput(self), |
#TensorGlyph.__init__(self, Probe._getOutput(self), |
96 |
|
TensorGlyph.__init__(self, MaskPoints._getOutput(self), |
97 |
Sphere._getOutput(self)) |
Sphere._getOutput(self)) |
98 |
Normals.__init__(self, TensorGlyph._getOutput(self)) |
Normals.__init__(self, TensorGlyph._getOutput(self)) |
99 |
|
|