};
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; }
{
}
-OctTree::OctTree( Vector<Point3f>& points3d, int maxLevels, int minPoints )
+OctTree::OctTree( const Vector<Point3f>& points3d, int maxLevels, int minPoints )
{
buildTree(points3d, maxLevels, minPoints);
}
}
}
-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();