Open3D (C++ API)  0.18.0+252c867
KDTreeSearchParam.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - Open3D: www.open3d.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2023 www.open3d.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 namespace open3d {
11 namespace geometry {
12 
17 public:
21  enum class SearchType {
22  Knn = 0,
23  Radius = 1,
24  Hybrid = 2,
25  };
26 
27 public:
28  virtual ~KDTreeSearchParam() {}
29 
30 protected:
31  KDTreeSearchParam(SearchType type) : search_type_(type) {}
32 
33 public:
35  SearchType GetSearchType() const { return search_type_; }
36 
37 private:
38  SearchType search_type_;
39 };
40 
45 public:
50  KDTreeSearchParamKNN(int knn = 30)
51  : KDTreeSearchParam(SearchType::Knn), knn_(knn) {}
52 
53 public:
55  int knn_;
56 };
57 
62 public:
66  KDTreeSearchParamRadius(double radius)
67  : KDTreeSearchParam(SearchType::Radius), radius_(radius) {}
68 
69 public:
71  double radius_;
72 };
73 
78 public:
83  KDTreeSearchParamHybrid(double radius, int max_nn)
84  : KDTreeSearchParam(SearchType::Hybrid),
85  radius_(radius),
86  max_nn_(max_nn) {}
87 
88 public:
90  double radius_;
92  int max_nn_;
93 };
94 
95 } // namespace geometry
96 } // namespace open3d
Base class for KDTree search parameters.
Definition: KDTreeSearchParam.h:16
SearchType
Specifies the search type for the search.
Definition: KDTreeSearchParam.h:21
virtual ~KDTreeSearchParam()
Definition: KDTreeSearchParam.h:28
SearchType GetSearchType() const
Get the search type (KNN, Radius, Hybrid) for the search parameter.
Definition: KDTreeSearchParam.h:35
KDTreeSearchParam(SearchType type)
Definition: KDTreeSearchParam.h:31
KDTree search parameters for hybrid KNN and radius search.
Definition: KDTreeSearchParam.h:77
KDTreeSearchParamHybrid(double radius, int max_nn)
Default Constructor.
Definition: KDTreeSearchParam.h:83
double radius_
Search radius.
Definition: KDTreeSearchParam.h:90
int max_nn_
At maximum, max_nn neighbors will be searched.
Definition: KDTreeSearchParam.h:92
KDTree search parameters for pure KNN search.
Definition: KDTreeSearchParam.h:44
int knn_
Number of the neighbors that will be searched.
Definition: KDTreeSearchParam.h:55
KDTreeSearchParamKNN(int knn=30)
Default Constructor.
Definition: KDTreeSearchParam.h:50
KDTree search parameters for pure radius search.
Definition: KDTreeSearchParam.h:61
KDTreeSearchParamRadius(double radius)
Default Constructor.
Definition: KDTreeSearchParam.h:66
double radius_
Search radius.
Definition: KDTreeSearchParam.h:71
char type
Definition: FilePCD.cpp:41
Definition: PinholeCameraIntrinsic.cpp:16