ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ecvKDTreeSearchParam.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include "CV_db.h"
11 
12 namespace cloudViewer {
13 namespace geometry {
14 
19 public:
23  enum class SearchType {
24  Knn = 0,
25  Radius = 1,
26  Hybrid = 2,
27  };
28 
29 public:
30  virtual ~KDTreeSearchParam() {}
31 
32 protected:
33  KDTreeSearchParam(SearchType type) : search_type_(type) {}
34 
35 public:
37  SearchType GetSearchType() const { return search_type_; }
38 
39 private:
40  SearchType search_type_;
41 };
42 
47 public:
52  KDTreeSearchParamKNN(int knn = 30)
53  : KDTreeSearchParam(SearchType::Knn), knn_(knn) {}
54 
55 public:
57  int knn_;
58 };
59 
64 public:
68  KDTreeSearchParamRadius(double radius)
69  : KDTreeSearchParam(SearchType::Radius), radius_(radius) {}
70 
71 public:
73  double radius_;
74 };
75 
80 public:
85  KDTreeSearchParamHybrid(double radius, int max_nn)
86  : KDTreeSearchParam(SearchType::Hybrid),
87  radius_(radius),
88  max_nn_(max_nn) {}
89 
90 public:
92  double radius_;
94  int max_nn_;
95 };
96 
97 } // namespace geometry
98 } // namespace cloudViewer
#define CV_DB_LIB_API
Definition: CV_db.h:15
char type
KDTree search parameters for hybrid KNN and radius search.
int max_nn_
At maximum, max_nn neighbors will be searched.
KDTreeSearchParamHybrid(double radius, int max_nn)
Default Cosntructor.
KDTree search parameters for pure KNN search.
KDTreeSearchParamKNN(int knn=30)
Default Cosntructor.
int knn_
Number of the neighbors that will be searched.
KDTree search parameters for pure radius search.
KDTreeSearchParamRadius(double radius)
Default Cosntructor.
Base class for KDTree search parameters.
SearchType
Specifies the search type for the search.
SearchType GetSearchType() const
Get the search type (KNN, Radius, Hybrid) for the search parameter.
Generic file read and write utility for python interface.