Diff for /python/pyvtk/lib/Normals.py between versions 1.2 and 1.3

version 1.2, 2001/05/22 18:29:42 version 1.3, 2001/05/31 17:48:54
Line 1 Line 1
 #!/usr/bin/env python  #!/usr/bin/env python
 """  """
   Normals
   """
   """
   
 Copyright 2001 Pearu Peterson all rights reserved,  Copyright 2001 Pearu Peterson all rights reserved,
 Pearu Peterson <pearu@ioc.ee>            Pearu Peterson <pearu@ioc.ee>          
Line 14  Pearu Peterson Line 17  Pearu Peterson
   
 import DataSetAttr  import DataSetAttr
 import math  import math
   import common
   
 class Normals(DataSetAttr.DataSetAttr):  class Normals(DataSetAttr.DataSetAttr):
     """Holds VTK Normals.      """Holds VTK Normals.
       Usage:
         Normals(<sequence of 3-tuples> ,name = <string>)
       Attributes:
         normals
         name
       Public methods:
         get_size()
         to_string(format = 'ascii')
     """      """
     def __init__(self,normals,name=None):      def __init__(self,normals,name=None):
         self.name = self._get_name(name)          self.name = self._get_name(name)
Line 39  class Normals(DataSetAttr.DataSetAttr): Line 51  class Normals(DataSetAttr.DataSetAttr):
     def get_size(self):      def get_size(self):
         return len(self.normals)          return len(self.normals)
   
   def normals_fromfile(f,n,sl):
       dataname = sl[0]
       datatype = sl[1].lower()
       assert datatype in ['bit','unsigned_char','char','unsigned_short','short','unsigned_int','int','unsigned_long','long','float','double'],`datatype`
       normals = []
       while len(normals) < 3*n:
           normals += map(eval,common._getline(f).split(' '))
       assert len(normals) == 3*n
       return Normals(normals,dataname)
   
 if __name__ == "__main__":  if __name__ == "__main__":
     print Normals([[3,3],[4,3.],240,3,2]).to_string()      print Normals([[3,3],[4,3.],240,3,2]).to_string()

Removed from v.1.2  
changed lines
  Added in v.1.3


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>