IKnnQueryDescriptor.hpp
1 #ifndef DM_IKNN_QUERY_DESCRIPTOR_HPP_INCLUDED
2 #define DM_IKNN_QUERY_DESCRIPTOR_HPP_INCLUDED
3 
4 #ifdef _MSC_VER
5  #pragma once
6 #endif
7 
8 #include "DM/config.hpp"
9 #include "DM/Handle.hpp"
10 #include "DM/ObjectBase.hpp"
11 #include "DM/AutoLink.hpp" //enable autolink
12 
13 DM_NAMESPACE_BEGIN
14 
15 
16 struct SelectionMode {
17  enum Type {
18  nearest = int(false), //perform a normal nearest neighbor query
19  quadrant = int(true), //quadrant mode nearest neighbor query
20  octant //octant mode nearest neighbor query
21  };
22 };
23 
24 class DM_API IKnnQueryDescriptor : public ObjectBase
25 {
26 public:
27  ///create knn query descriptor object
28  static IKnnQueryDescriptor* New(int dim, int knnCount, SelectionMode::Type mode = SelectionMode::nearest);
29 
30 protected:
31  virtual ~IKnnQueryDescriptor() {}
32 
33 public:
34  virtual int getDim() const = 0;
35  virtual void setDim(int dim) = 0;
36 
37 
38  virtual int getKnnCount() const = 0;
39  virtual void setKnnCount(int count) = 0;
40 
41  virtual SelectionMode::Type getSelectionMode() const = 0;
42  virtual void setSelectionMode(SelectionMode::Type mode) = 0;
43 };
45 
46 DM_NAMESPACE_END
47 
48 
49 #endif //DM_IKNN_QUERY_DESCRIPTOR_HPP_INCLUDED