/[escript]/trunk/pycad/py_src/design.py
ViewVC logotype

Diff of /trunk/pycad/py_src/design.py

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

revision 996 by ksteube, Wed Feb 21 04:27:52 2007 UTC revision 997 by gross, Mon Feb 26 06:31:45 2007 UTC
# Line 74  class TagMap(object): Line 74  class TagMap(object):
74          returns the name of a tag          returns the name of a tag
75          """          """
76          return self.__map[tag]          return self.__map[tag]
77        def getNames(self):
78            """
79            returns the name keys
80            """
81            return self.__map.values()
82    
83      def getMapping(self):      def getMapping(self):
84          """          """
85          returns a dictionary where the tags define the keys and the values the corresposnding names.          returns a dictionary where the tags define the keys and the values the corresposnding names.
86          """          """
87          return self.__map          return self.__map
88    
89      def map(self,default=0,**kwargs):      def map(self,default=0,**kwargs):
90          """          """
91          returns a dictionary where the tags define the keys and the values give the values assigned to the tag via name          returns a dictionary where the tags define the keys and the values give the values assigned to the tag via name
# Line 301  class Design(object): Line 308  class Design(object):
308             if isinstance(p, PropertySet):             if isinstance(p, PropertySet):
309                if p.getDim() == 1: m[ p.getTag() ] = p.getName()                if p.getDim() == 1: m[ p.getTag() ] = p.getName()
310          return TagMap(m)          return TagMap(m)
311      def getSurfaceTagMap(self):      def getTagMap(self):
         """  
         returns a L{TagMap} to map the name of L{Manifold2D} L{PropertySet}s to tags  
         """  
         m={}  
         for p in self.getAllPrimitives():  
            if isinstance(p, PropertySet):  
               if p.getDim() == 2: m[ p.getTag() ] = p.getName()  
         return TagMap(m)  
     def getVolumeTagMap(self):  
312          """          """
313          returns a L{TagMap} to map the name of L{Manifold3D} L{PropertySet}s to tags          returns a L{TagMap} to map the name of L{Manifold3D} L{PropertySet}s to tags
314          """          """
315          m={}          m={}
316          for p in self.getAllPrimitives():          for p in self.getAllPrimitives():
317             if isinstance(p, PropertySet):             if isinstance(p, PropertySet): m[ p.getTag() ] = p.getName()
               if p.getDim() == 3: m[ p.getTag() ] = p.getName()  
318          return TagMap(m)          return TagMap(m)

Legend:
Removed from v.996  
changed lines
  Added in v.997

  ViewVC Help
Powered by ViewVC 1.1.26