| Home | Trees | Indices | Help |
|---|
|
|
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3 #
4 # This file is part of MBDyn sim suite.
5 # Copyright (C) 2007 André ESPAZE, as part of a Master thesis supervised by
6 # Martin O.L.Hansen (DTU) and Nicolas Chauvat (Logilab)
7
8 # MBDyn sim suite is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
12 #
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
17 #
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
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
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
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
63
64 NODE_CLASS["STRUCTURAL"]["structural"] = StructuralNode
65
66 MAPPER_CLASS = {}
67 MAPPER_CLASS["NODE"] = NODE_CLASS
68
| Home | Trees | Indices | Help |
|---|
| Generated by Epydoc 3.0beta1 on Thu Aug 30 11:45:52 2007 | http://epydoc.sourceforge.net |