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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 826 by gross, Wed Aug 9 09:21:00 2006 UTC revision 827 by jongui, Wed Aug 30 00:08:02 2006 UTC
# Line 18  __url__="http://www.iservo.edu.au/esys" Line 18  __url__="http://www.iservo.edu.au/esys"
18  __version__="$Revision:$"  __version__="$Revision:$"
19  __date__="$Date:$"  __date__="$Date:$"
20    
21  class Property(object):  import vtk
     def __init__(self,val=None):  
        self.setValue(val)  
22    
23      def setValue(self,val):  class Mapper:
        self.__val=val  
        self.__altered=True  
24    
25      def getValue(self):      def __init__(self):
26         return self.__val          self.mapper = None
27    
28      def isAltered(self):      def setMapper(self, component):
29         return self.__altered          self.vtk_mapper = vtk.vtkDataSetMapper()
30            eval("self.vtk_mapper.SetInput(self.%s.GetOutput())" % component)
31    
32      def markAsUsed(self):          
        self.__altered=False  
   
     
 class Component(object):  
     """  
     shows a vector field by arrows  
     """  
     def __init__(self):  
        self.features={} # item must be a Component or Property  
   
     def render(self):  
        for i in self.features:  
           if isinstance(self.features[i],Component):  
              self.features[i].render()  
        self._render()  
   
     def markFeaturesAsUsed(self):  
        for i in self.features:  
           if isinstance(self.features[i],Component):  
              self.features[i].markAsUsed()  
           else:  
              self.features[i].markFeaturesAsUsed()  

Legend:
Removed from v.826  
changed lines
  Added in v.827

  ViewVC Help
Powered by ViewVC 1.1.26