Changeset 1307:47aa99c03689


Ignore:
Timestamp:
09/30/09 09:05:27 (10 months ago)
Author:
Howard Butler <hobu.inc@…>
Branch:
default
Message:

clean up liblas.point.Point creation, ensure that copy semantics are right, and add as LASPoint_Destroy prototype, which not was causing a big problem on snow leopard.

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • .hgignore

    r1306 r1307  
    3737python/dist/* 
    3838python/libLAS.egg-info/* 
     39python/liblas/*.pyc 
  • python/liblas/core.py

    r1252 r1307  
    587587las.LASPoint_SetColor.errcheck = check_return 
    588588 
     589las.LASPoint_Destroy.argtypes = [ctypes.c_void_p] 
     590las.LASPoint_Destroy.errcheck = check_void_done 
     591las.LASPoint_Destroy.restype = None 
     592 
    589593las.LASSRS_Create.errcheck = check_void 
    590594las.LASSRS_Create.restype = ctypes.c_void_p 
  • python/liblas/file.py

    r1223 r1307  
    132132    def read(self, location): 
    133133        if self.mode == 0: 
    134             return point.Point(handle=core.las.LASReader_GetPointAt(self.handle, location), owned= False, copy=True) 
     134            return point.Point(handle=core.las.LASReader_GetPointAt(self.handle, location), copy=True) 
    135135 
    136136    def __iter__(self): 
     
    139139            p = core.las.LASReader_GetNextPoint(self.handle) 
    140140            while p and not self.at_end: 
    141                 yield point.Point(handle=p, owned= False, copy=True) 
     141                yield point.Point(handle=p, copy=True) 
    142142                p = core.las.LASReader_GetNextPoint(self.handle) 
    143143                if not p: 
  • python/liblas/point.py

    r1223 r1307  
    5252            if copy: 
    5353                self.handle = core.las.LASPoint_Copy(handle) 
     54                self._owned = True 
    5455            else: 
    5556                self.handle = handle 
     57                self._owned = False 
    5658        else: 
    5759            self.handle = core.las.LASPoint_Create() 
    58         if not copy: 
    59             self.owned = owned 
    60         else: 
    61             self.owned = True 
     60            self._owned = True 
    6261    def __del__(self): 
    63         if self.owned: 
     62        if self._owned: 
    6463            if self.handle and core: 
    6564                core.las.LASPoint_Destroy(self.handle) 
Note: See TracChangeset for help on using the changeset viewer.