Open3D (C++ API)  0.17.0
NNSIndex.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 #include <vector>
11 
12 #include "open3d/core/Tensor.h"
13 
14 namespace open3d {
15 namespace core {
16 namespace nns {
17 
21 class NNSIndex {
22 public:
24  NNSIndex() {}
25  virtual ~NNSIndex() {}
26  NNSIndex(const NNSIndex &) = delete;
27  NNSIndex &operator=(const NNSIndex &) = delete;
28 
29 public:
35  virtual bool SetTensorData(const Tensor &dataset_points,
36  const Dtype &index_dtype) = 0;
37 
43  virtual bool SetTensorData(const Tensor &dataset_points,
44  double radius,
45  const Dtype &index_dtype) = 0;
46 
55  virtual std::pair<Tensor, Tensor> SearchKnn(const Tensor &query_points,
56  int knn) const = 0;
57 
68  virtual std::tuple<Tensor, Tensor, Tensor> SearchRadius(
69  const Tensor &query_points,
70  const Tensor &radii,
71  bool sort) const = 0;
72 
83  virtual std::tuple<Tensor, Tensor, Tensor> SearchRadius(
84  const Tensor &query_points, double radius, bool sort) const = 0;
85 
96  virtual std::tuple<Tensor, Tensor, Tensor> SearchHybrid(
97  const Tensor &query_points, double radius, int max_knn) const = 0;
98 
101  int GetDimension() const;
102 
105  size_t GetDatasetSize() const;
106 
109  Dtype GetDtype() const;
110 
113  Device GetDevice() const;
114 
117  Dtype GetIndexDtype() const;
118 
119 protected:
122 };
123 } // namespace nns
124 } // namespace core
125 } // namespace open3d
Definition: Device.h:18
Definition: Dtype.h:20
Definition: Tensor.h:32
Definition: NNSIndex.h:21
Dtype index_dtype_
Definition: NNSIndex.h:121
Dtype GetDtype() const
Definition: NNSIndex.cpp:24
virtual std::tuple< Tensor, Tensor, Tensor > SearchHybrid(const Tensor &query_points, double radius, int max_knn) const =0
virtual ~NNSIndex()
Definition: NNSIndex.h:25
NNSIndex(const NNSIndex &)=delete
NNSIndex & operator=(const NNSIndex &)=delete
size_t GetDatasetSize() const
Definition: NNSIndex.cpp:19
Device GetDevice() const
Definition: NNSIndex.cpp:26
virtual std::tuple< Tensor, Tensor, Tensor > SearchRadius(const Tensor &query_points, double radius, bool sort) const =0
virtual std::tuple< Tensor, Tensor, Tensor > SearchRadius(const Tensor &query_points, const Tensor &radii, bool sort) const =0
virtual bool SetTensorData(const Tensor &dataset_points, const Dtype &index_dtype)=0
virtual std::pair< Tensor, Tensor > SearchKnn(const Tensor &query_points, int knn) const =0
Tensor dataset_points_
Definition: NNSIndex.h:120
NNSIndex()
Default Constructor.
Definition: NNSIndex.h:24
Dtype GetIndexDtype() const
Definition: NNSIndex.cpp:28
int GetDimension() const
Definition: NNSIndex.cpp:14
virtual bool SetTensorData(const Tensor &dataset_points, double radius, const Dtype &index_dtype)=0
Definition: PinholeCameraIntrinsic.cpp:16