PointNeighborSearcher3.h
Go to the documentation of this file.
1 /*************************************************************************
2 > File Name: PointNeighborSearcher3.h
3 > Project Name: CubbyFlow
4 > Author: Chan-Ho Chris Ohk
5 > Purpose: Abstract base class for 3-D neighbor point searcher.
6 > Created Time: 2017/05/07
7 > Copyright (c) 2018, Chan-Ho Chris Ohk
8 *************************************************************************/
9 #ifndef CUBBYFLOW_POINT_NEIGHBOR_SEARCHER3_H
10 #define CUBBYFLOW_POINT_NEIGHBOR_SEARCHER3_H
11 
13 #include <Core/Vector/Vector3.h>
14 
15 #include <functional>
16 #include <memory>
17 #include <string>
18 
19 namespace CubbyFlow
20 {
30  {
31  public:
34  using ForEachNearbyPointFunc = std::function<void(size_t, const Vector3D&)>;
35 
38 
40  virtual ~PointNeighborSearcher3();
41 
43  virtual std::string TypeName() const = 0;
44 
46  virtual void Build(const ConstArrayAccessor1<Vector3D>& points) = 0;
47 
56  virtual void ForEachNearbyPoint(const Vector3D& origin, double radius, const ForEachNearbyPointFunc& callback) const = 0;
57 
67  virtual bool HasNearbyPoint(const Vector3D& origin, double radius) const = 0;
68 
75  virtual std::shared_ptr<PointNeighborSearcher3> Clone() const = 0;
76  };
77 
79  using PointNeighborSearcher3Ptr = std::shared_ptr<PointNeighborSearcher3>;
80 
83  {
84  public:
86 
89  };
90 
92  using PointNeighborSearcherBuilder3Ptr = std::shared_ptr<PointNeighborSearcherBuilder3>;
93 
94 #define CUBBYFLOW_NEIGHBOR_SEARCHER3_TYPE_NAME(DerivedClassName) \
95  std::string TypeName() const override \
96  { \
97  return #DerivedClassName; \
98  }
99 }
100 
101 #endif
3-D vector class.
Definition: Vector3.h:26
virtual ~PointNeighborSearcher3()
Destructor.
Abstract base class for any serializable class.
Definition: Serialization.h:20
virtual std::shared_ptr< PointNeighborSearcher3 > Clone() const =0
Creates a new instance of the object with same properties than original.
PointNeighborSearcher3()
Default constructor.
std::function< void(size_t, const Vector3D &)> ForEachNearbyPointFunc
Definition: PointNeighborSearcher3.h:34
std::shared_ptr< PointNeighborSearcher3 > PointNeighborSearcher3Ptr
Shared pointer for the PointNeighborSearcher3 type.
Definition: PointNeighborSearcher3.h:79
virtual PointNeighborSearcher3Ptr BuildPointNeighborSearcher() const =0
Returns shared pointer of PointNeighborSearcher3 type.
1-D read-only array accessor class.
Definition: ArrayAccessor1.h:185
Definition: pybind11Utils.h:24
std::shared_ptr< PointNeighborSearcherBuilder3 > PointNeighborSearcherBuilder3Ptr
Shared pointer for the PointNeighborSearcherBuilder3 type.
Definition: PointNeighborSearcher3.h:92
virtual bool HasNearbyPoint(const Vector3D &origin, double radius) const =0
Abstract base class for 3-D point neighbor searcher builders.
Definition: PointNeighborSearcher3.h:82
Abstract base class for 3-D neighbor point searcher.
Definition: PointNeighborSearcher3.h:29
virtual std::string TypeName() const =0
Returns the type name of the derived class.
virtual void ForEachNearbyPoint(const Vector3D &origin, double radius, const ForEachNearbyPointFunc &callback) const =0
virtual void Build(const ConstArrayAccessor1< Vector3D > &points)=0
Builds internal acceleration structure for given points list.