Open3D (C++ API)  0.16.0
KDTreeSearchParam.h
Go to the documentation of this file.
1// ----------------------------------------------------------------------------
2// - Open3D: www.open3d.org -
3// ----------------------------------------------------------------------------
4// The MIT License (MIT)
5//
6// Copyright (c) 2018-2021 www.open3d.org
7//
8// Permission is hereby granted, free of charge, to any person obtaining a copy
9// of this software and associated documentation files (the "Software"), to deal
10// in the Software without restriction, including without limitation the rights
11// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12// copies of the Software, and to permit persons to whom the Software is
13// furnished to do so, subject to the following conditions:
14//
15// The above copyright notice and this permission notice shall be included in
16// all copies or substantial portions of the Software.
17//
18// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
24// IN THE SOFTWARE.
25// ----------------------------------------------------------------------------
26
27#pragma once
28
29namespace open3d {
30namespace geometry {
31
36public:
40 enum class SearchType {
41 Knn = 0,
42 Radius = 1,
43 Hybrid = 2,
44 };
45
46public:
47 virtual ~KDTreeSearchParam() {}
48
49protected:
51
52public:
54 SearchType GetSearchType() const { return search_type_; }
55
56private:
57 SearchType search_type_;
58};
59
64public:
70 : KDTreeSearchParam(SearchType::Knn), knn_(knn) {}
71
72public:
74 int knn_;
75};
76
81public:
86 : KDTreeSearchParam(SearchType::Radius), radius_(radius) {}
87
88public:
90 double radius_;
91};
92
97public:
102 KDTreeSearchParamHybrid(double radius, int max_nn)
103 : KDTreeSearchParam(SearchType::Hybrid),
104 radius_(radius),
105 max_nn_(max_nn) {}
106
107public:
109 double radius_;
112};
113
114} // namespace geometry
115} // namespace open3d
Base class for KDTree search parameters.
Definition: KDTreeSearchParam.h:35
SearchType
Specifies the search type for the search.
Definition: KDTreeSearchParam.h:40
virtual ~KDTreeSearchParam()
Definition: KDTreeSearchParam.h:47
SearchType GetSearchType() const
Get the search type (KNN, Radius, Hybrid) for the search parameter.
Definition: KDTreeSearchParam.h:54
KDTreeSearchParam(SearchType type)
Definition: KDTreeSearchParam.h:50
KDTree search parameters for hybrid KNN and radius search.
Definition: KDTreeSearchParam.h:96
KDTreeSearchParamHybrid(double radius, int max_nn)
Default Constructor.
Definition: KDTreeSearchParam.h:102
double radius_
Search radius.
Definition: KDTreeSearchParam.h:109
int max_nn_
At maximum, max_nn neighbors will be searched.
Definition: KDTreeSearchParam.h:111
KDTree search parameters for pure KNN search.
Definition: KDTreeSearchParam.h:63
int knn_
Number of the neighbors that will be searched.
Definition: KDTreeSearchParam.h:74
KDTreeSearchParamKNN(int knn=30)
Default Constructor.
Definition: KDTreeSearchParam.h:69
KDTree search parameters for pure radius search.
Definition: KDTreeSearchParam.h:80
KDTreeSearchParamRadius(double radius)
Default Constructor.
Definition: KDTreeSearchParam.h:85
double radius_
Search radius.
Definition: KDTreeSearchParam.h:90
char type
Definition: FilePCD.cpp:60
Definition: PinholeCameraIntrinsic.cpp:35