diff options
author | Lars Buitinck <l.buitinck@esciencecenter.nl> | 2014-10-23 13:30:30 +0200 |
---|---|---|
committer | Lars Buitinck <l.buitinck@esciencecenter.nl> | 2014-10-23 14:43:59 +0200 |
commit | 58531564d961bca3497e9824e14aaccfc038aade (patch) | |
tree | 4ce772454186f9995c362373d99d4826ca6ac179 /pcl | |
parent | 393313065b309fcdd5c7bfc08cc41d461dc479cf (diff) |
copy constructor for point clouds
Diffstat (limited to 'pcl')
-rw-r--r-- | pcl/_pcl.pyx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/pcl/_pcl.pyx b/pcl/_pcl.pyx index 3fa62f4..4a00af3 100644 --- a/pcl/_pcl.pyx +++ b/pcl/_pcl.pyx @@ -135,6 +135,8 @@ cdef class PointCloud: To load a point cloud from disk, use pcl.load. """ def __cinit__(self, init=None): + cdef BasePointCloud other + sp_assign(self.thisptr_shared, new cpp.PointCloud[cpp.PointXYZ]()) if init is None: @@ -145,6 +147,9 @@ cdef class PointCloud: self.from_array(init) elif isinstance(init, Sequence): self.from_list(init) + elif isinstance(init, type(self)): + other = init + self.thisptr()[0] = other.thisptr()[0] else: raise TypeError("Can't initialize a PointCloud from a %s" % type(init)) |