1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 """The VTK mapper description for nodes and elements.
23 Until now only the nodes are described as sphere.
24 Then the L{MAPPER_CLASS} dictionary gathers
25 the available mappers for every class. A module still
26 in heavy development."""
27 import vtk
28
30 """The common class for a mapper"""
31
33 self.mapper = vtk.vtkPolyDataMapper()
34
35 NODE_CLASS = {}
36 NODE_CLASS["STRUCTURAL"] = {}
37
38
40 """The node class mapper, a VTK sphere."""
41
43 Common.__init__(self)
44 self.sphere = vtk.vtkSphereSource()
45 self.mapper.SetInput(self.sphere.GetOutput())
46 self.radius = 3.
47 self.set_radius(self.radius)
48
50 """Set the mapper radius"""
51 self.sphere.SetRadius(value)
52
54 """Set the scale factor for the representation,
55 recalculate the radius"""
56 self.set_radius(scale_factor * self.radius)
57
58 NODE_CLASS["STRUCTURAL"]["general"] = Node
59
61 """The structural node mapper"""
62 pass
63
64 NODE_CLASS["STRUCTURAL"]["structural"] = StructuralNode
65
66 MAPPER_CLASS = {}
67 MAPPER_CLASS["NODE"] = NODE_CLASS
68