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

Contents of /trunk/pyvisi/py_src/common.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 802 - (show annotations)
Wed Aug 9 09:21:00 2006 UTC (14 years, 1 month ago) by gross
File MIME type: text/x-python
File size: 1556 byte(s)
some stuff for john
1 """
2 class that shows a vector field by arrows
3
4 @var __author__: name of author
5 @var __license__: licence agreement
6 @var __copyright__: copyrights
7 @var __url__: url entry point on documentation
8 @var __version__: version
9 @var __date__: date of the version
10 """
11 __copyright__=""" Copyright (c) 2006 by ACcESS MNRF
12 http://www.access.edu.au
13 Primary Business: Queensland, Australia"""
14 __license__="""Licensed under the Open Software License version 3.0
15 http://www.opensource.org/licenses/osl-3.0.php"""
16 __author__="Paul Cochrane, L. Gross"
17 __url__="http://www.iservo.edu.au/esys"
18 __version__="$Revision:$"
19 __date__="$Date:$"
20
21 class Property(object):
22 def __init__(self,val=None):
23 self.setValue(val)
24
25 def setValue(self,val):
26 self.__val=val
27 self.__altered=True
28
29 def getValue(self):
30 return self.__val
31
32 def isAltered(self):
33 return self.__altered
34
35 def markAsUsed(self):
36 self.__altered=False
37
38
39 class Component(object):
40 """
41 shows a vector field by arrows
42 """
43 def __init__(self):
44 self.features={} # item must be a Component or Property
45
46 def render(self):
47 for i in self.features:
48 if isinstance(self.features[i],Component):
49 self.features[i].render()
50 self._render()
51
52 def markFeaturesAsUsed(self):
53 for i in self.features:
54 if isinstance(self.features[i],Component):
55 self.features[i].markAsUsed()
56 else:
57 self.features[i].markFeaturesAsUsed()

  ViewVC Help
Powered by ViewVC 1.1.26