Jet  v1.3.3
point_neighbor_searcher2.h
Go to the documentation of this file.
1 // Copyright (c) 2018 Doyub Kim
2 //
3 // I am making my contributions/submissions to this project solely in my
4 // personal capacity and am not conveying any rights to any intellectual
5 // property of any third parties.
6 
7 #ifndef INCLUDE_JET_POINT_NEIGHBOR_SEARCHER2_H_
8 #define INCLUDE_JET_POINT_NEIGHBOR_SEARCHER2_H_
9 
10 #include <jet/array_accessor1.h>
11 #include <jet/serialization.h>
12 #include <jet/vector2.h>
13 #include <functional>
14 #include <memory>
15 #include <string>
16 #include <vector>
17 
18 namespace jet {
19 
29  public:
32  typedef std::function<void(size_t, const Vector2D&)>
34 
37 
40 
42  virtual std::string typeName() const = 0;
43 
45  virtual void build(const ConstArrayAccessor1<Vector2D>& points) = 0;
46 
55  virtual void forEachNearbyPoint(
56  const Vector2D& origin,
57  double radius,
58  const ForEachNearbyPointFunc& callback) const = 0;
59 
69  virtual bool hasNearbyPoint(
70  const Vector2D& origin, double radius) const = 0;
71 
78  virtual std::shared_ptr<PointNeighborSearcher2> clone() const = 0;
79 };
80 
82 typedef std::shared_ptr<PointNeighborSearcher2> PointNeighborSearcher2Ptr;
83 
86  public:
89 };
90 
92 typedef std::shared_ptr<PointNeighborSearcherBuilder2>
94 
95 #define JET_NEIGHBOR_SEARCHER2_TYPE_NAME(DerivedClassName) \
96  std::string typeName() const override { \
97  return #DerivedClassName; \
98  }
99 
100 } // namespace jet
101 
102 #endif // INCLUDE_JET_POINT_NEIGHBOR_SEARCHER2_H_
jet::ConstArrayAccessor< T, 1 >
1-D read-only array accessor class.
Definition: array_accessor1.h:184
jet::PointNeighborSearcher2::hasNearbyPoint
virtual bool hasNearbyPoint(const Vector2D &origin, double radius) const =0
jet::PointNeighborSearcher2Ptr
std::shared_ptr< PointNeighborSearcher2 > PointNeighborSearcher2Ptr
Shared pointer for the PointNeighborSearcher2 type.
Definition: point_neighbor_searcher2.h:82
jet::PointNeighborSearcher2::build
virtual void build(const ConstArrayAccessor1< Vector2D > &points)=0
Builds internal acceleration structure for given points list.
jet::PointNeighborSearcher2::PointNeighborSearcher2
PointNeighborSearcher2()
Default constructor.
jet::PointNeighborSearcher2::clone
virtual std::shared_ptr< PointNeighborSearcher2 > clone() const =0
Creates a new instance of the object with same properties than original.
jet
Definition: advection_solver2.h:18
vector2.h
jet::PointNeighborSearcher2::~PointNeighborSearcher2
virtual ~PointNeighborSearcher2()
Destructor.
jet::Vector< T, 2 >
2-D vector class.
Definition: vector2.h:24
jet::PointNeighborSearcher2::ForEachNearbyPointFunc
std::function< void(size_t, const Vector2D &)> ForEachNearbyPointFunc
Definition: point_neighbor_searcher2.h:33
jet::PointNeighborSearcherBuilder2
Abstract base class for 2-D point neighbor searcher builders.
Definition: point_neighbor_searcher2.h:85
jet::Serializable
Abstract base class for any serializable class.
Definition: serialization.h:17
array_accessor1.h
jet::PointNeighborSearcher2::typeName
virtual std::string typeName() const =0
Returns the type name of the derived class.
jet::PointNeighborSearcherBuilder2::buildPointNeighborSearcher
virtual PointNeighborSearcher2Ptr buildPointNeighborSearcher() const =0
Returns shared pointer of PointNeighborSearcher2 type.
jet::PointNeighborSearcher2
Abstract base class for 2-D neighbor point searcher.
Definition: point_neighbor_searcher2.h:28
serialization.h
jet::PointNeighborSearcherBuilder2Ptr
std::shared_ptr< PointNeighborSearcherBuilder2 > PointNeighborSearcherBuilder2Ptr
Shared pointer for the PointNeighborSearcherBuilder2 type.
Definition: point_neighbor_searcher2.h:93
jet::PointNeighborSearcher2::forEachNearbyPoint
virtual void forEachNearbyPoint(const Vector2D &origin, double radius, const ForEachNearbyPointFunc &callback) const =0