]> rtime.felk.cvut.cz Git - opencv.git/commitdiff
another small fix for cv::OctTree
authorvp153 <vp153@73c94f0f-984f-4a5f-82bc-2d8db8d8ee08>
Fri, 10 Jul 2009 16:43:38 +0000 (16:43 +0000)
committervp153 <vp153@73c94f0f-984f-4a5f-82bc-2d8db8d8ee08>
Fri, 10 Jul 2009 16:43:38 +0000 (16:43 +0000)
git-svn-id: https://code.ros.org/svn/opencv/trunk@1918 73c94f0f-984f-4a5f-82bc-2d8db8d8ee08

opencv/include/opencv/cvaux.hpp
opencv/src/cvaux/cvocttree.cpp

index 29daa474113f00537471f3f06b5437c0fb9ed933..2f7443e42a713c0544bfe3045ade8ccb3a3ba5ef 100644 (file)
@@ -357,10 +357,10 @@ public:
     };
 
     OctTree();
-    OctTree( Vector<Point3f>& points, int maxLevels = 10, int minPoints = 20 );
+    OctTree( const Vector<Point3f>& points, int maxLevels = 10, int minPoints = 20 );
     virtual ~OctTree();
 
-    virtual void buildTree( Vector<Point3f>& points, int maxLevels = 10, int minPoints = 20 );
+    virtual void buildTree( const Vector<Point3f>& points, int maxLevels = 10, int minPoints = 20 );
     virtual void getPointsWithinSphere( const Point3f& center, float radius,
                                         Vector<Point3f>& points ) const;
     const Vector<Node>& getNodes() const { return nodes; }
index aa4585afb3ced856c843b26ff1ffdb815175172f..59d680f6528a244f2c90fb6675c2115d1432eeb6 100644 (file)
@@ -168,7 +168,7 @@ OctTree::OctTree()
 {
 }
 
-OctTree::OctTree( Vector<Point3f>& points3d, int maxLevels, int minPoints )
+OctTree::OctTree( const Vector<Point3f>& points3d, int maxLevels, int minPoints )
 {
     buildTree(points3d, maxLevels, minPoints);
 }
@@ -253,10 +253,10 @@ void OctTree::getPointsWithinSphere( const Point3f& center, float radius, Vector
     }
 }
 
-void OctTree::buildTree( Vector<Point3f>& points3d, int maxLevels, int minPoints)
+void OctTree::buildTree( const Vector<Point3f>& points3d, int maxLevels, int minPoints)
 {
     assert( (size_t)maxLevels * 8 < MAX_STACK_SIZE );
-    points = points3d;
+    points3d.copyTo(points);
     this->minPoints = minPoints;
 
     nodes.clear();