summaryrefslogtreecommitdiff
path: root/pcl
diff options
context:
space:
mode:
authorLars Buitinck <l.buitinck@esciencecenter.nl>2014-10-23 13:30:30 +0200
committerLars Buitinck <l.buitinck@esciencecenter.nl>2014-10-23 14:43:59 +0200
commit58531564d961bca3497e9824e14aaccfc038aade (patch)
tree4ce772454186f9995c362373d99d4826ca6ac179 /pcl
parent393313065b309fcdd5c7bfc08cc41d461dc479cf (diff)
copy constructor for point clouds
Diffstat (limited to 'pcl')
-rw-r--r--pcl/_pcl.pyx5
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))