# class cogs::KdTree

## Overview

Space-partitioning data structure for point clouds. More…

    #include <KdTree.h>

    class KdTree {
    public:
        // structs

        struct TreeNode;

        // construction

        KdTree();
        KdTree(const cogs::PointCloud& cloud);
        KdTree(const std::vector<const cogs::PointCloud*> clouds);

        // methods

        void Initialize(const cogs::PointCloud& cloud);
        void Initialize(const std::vector<const cogs::PointCloud*> clouds);
        bool IsPointInRange(const geom::Aabb3& search_range) const;
        void GetPointsInRange(const geom::Aabb3& search_range, std::vector<uint32_t>* output) const;
    };

## Detailed Documentation

Space-partitioning data structure for point clouds.

### Methods

    void Initialize(const cogs::PointCloud& cloud)

Initializes the KdTree with points of the input cloud.

    void Initialize(const std::vector<const cogs::PointCloud*> clouds)

Initializes the KdTree with points of the input clouds.

    bool IsPointInRange(const geom::Aabb3& search_range) const

Returns true if any of included points is included in the input AABB, else returns false.

    void GetPointsInRange(const geom::Aabb3& search_range, std::vector<uint32_t>* output) const

Returns vector of points that are included in the input AABB.