Open3D (C++ API)
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 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 
29 namespace open3d {
30 namespace geometry {
31 
33 public:
34  enum class SearchType {
35  Knn = 0,
36  Radius = 1,
37  Hybrid = 2,
38  };
39 
40 public:
41  virtual ~KDTreeSearchParam() {}
42 
43 protected:
44  KDTreeSearchParam(SearchType type) : search_type_(type) {}
45 
46 public:
47  SearchType GetSearchType() const { return search_type_; }
48 
49 private:
50  SearchType search_type_;
51 };
52 
54 public:
55  KDTreeSearchParamKNN(int knn = 30)
56  : KDTreeSearchParam(SearchType::Knn), knn_(knn) {}
57 
58 public:
59  int knn_;
60 };
61 
63 public:
64  KDTreeSearchParamRadius(double radius)
65  : KDTreeSearchParam(SearchType::Radius), radius_(radius) {}
66 
67 public:
68  double radius_;
69 };
70 
72 public:
73  KDTreeSearchParamHybrid(double radius, int max_nn)
75  radius_(radius),
76  max_nn_(max_nn) {}
77 
78 public:
79  double radius_;
80  int max_nn_;
81 };
82 
83 } // namespace geometry
84 } // namespace open3d
int max_nn_
Definition: KDTreeSearchParam.h:80
double radius_
Definition: KDTreeSearchParam.h:68
KDTreeSearchParamKNN(int knn=30)
Definition: KDTreeSearchParam.h:55
KDTreeSearchParamHybrid(double radius, int max_nn)
Definition: KDTreeSearchParam.h:73
double radius_
Definition: KDTreeSearchParam.h:79
Definition: KDTreeSearchParam.h:71
virtual ~KDTreeSearchParam()
Definition: KDTreeSearchParam.h:41
SearchType
Definition: KDTreeSearchParam.h:34
Definition: KDTreeSearchParam.h:32
SearchType GetSearchType() const
Definition: KDTreeSearchParam.h:47
char type
Definition: FilePCD.cpp:56
int knn_
Definition: KDTreeSearchParam.h:59
Definition: KDTreeSearchParam.h:62
Definition: PinholeCameraIntrinsic.cpp:34
KDTreeSearchParam(SearchType type)
Definition: KDTreeSearchParam.h:44
Definition: KDTreeSearchParam.h:53
KDTreeSearchParamRadius(double radius)
Definition: KDTreeSearchParam.h:64