Jet  v1.3.3
point_kdtree_searcher3.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_KDTREE_SEARCHER3_H
8 #define INCLUDE_JET_POINT_KDTREE_SEARCHER3_H
9 
10 #include <jet/kdtree.h>
11 #include <jet/point3.h>
13 #include <jet/size3.h>
14 
15 #include <vector>
16 
17 namespace jet {
18 
26  public:
28 
29  class Builder;
30 
33 
36 
38  void build(const ConstArrayAccessor1<Vector3D>& points) override;
39 
49  const Vector3D& origin, double radius,
50  const ForEachNearbyPointFunc& callback) const override;
51 
61  bool hasNearbyPoint(const Vector3D& origin, double radius) const override;
62 
69  PointNeighborSearcher3Ptr clone() const override;
70 
73 
75  void set(const PointKdTreeSearcher3& other);
76 
78  void serialize(std::vector<uint8_t>* buffer) const override;
79 
81  void deserialize(const std::vector<uint8_t>& buffer) override;
82 
84  static Builder builder();
85 
86  private:
87  KdTree<double, 3> _tree;
88 };
89 
91 typedef std::shared_ptr<PointKdTreeSearcher3> PointKdTreeSearcher3Ptr;
92 
98  public:
101 
104 
107 };
108 
109 } // namespace jet
110 
111 #endif // INCLUDE_JET_POINT_KDTREE_SEARCHER3_H
jet::KdTree< double, 3 >
jet::PointKdTreeSearcher3::forEachNearbyPoint
void forEachNearbyPoint(const Vector3D &origin, double radius, const ForEachNearbyPointFunc &callback) const override
jet::PointKdTreeSearcher3Ptr
std::shared_ptr< PointKdTreeSearcher3 > PointKdTreeSearcher3Ptr
Shared pointer for the PointKdTreeSearcher3 type.
Definition: point_kdtree_searcher3.h:91
jet::PointKdTreeSearcher3
KdTree-based 3-D point searcher.
Definition: point_kdtree_searcher3.h:25
jet::PointKdTreeSearcher3::set
void set(const PointKdTreeSearcher3 &other)
Copy from the other instance.
jet::PointKdTreeSearcher3::operator=
PointKdTreeSearcher3 & operator=(const PointKdTreeSearcher3 &other)
Assignment operator.
jet::PointKdTreeSearcher3::hasNearbyPoint
bool hasNearbyPoint(const Vector3D &origin, double radius) const override
jet::ConstArrayAccessor< T, 1 >
1-D read-only array accessor class.
Definition: array_accessor1.h:184
jet::PointKdTreeSearcher3::clone
PointNeighborSearcher3Ptr clone() const override
Creates a new instance of the object with same properties than original.
size3.h
jet::PointKdTreeSearcher3::deserialize
void deserialize(const std::vector< uint8_t > &buffer) override
Deserializes the neighbor searcher from the buffer.
jet::PointKdTreeSearcher3::Builder
Front-end to create PointKdTreeSearcher3 objects step by step.
Definition: point_kdtree_searcher3.h:97
jet::PointKdTreeSearcher3::serialize
void serialize(std::vector< uint8_t > *buffer) const override
Serializes the neighbor searcher into the buffer.
point_neighbor_searcher3.h
point3.h
jet
Definition: advection_solver2.h:18
kdtree.h
jet::PointKdTreeSearcher3::Builder::buildPointNeighborSearcher
PointNeighborSearcher3Ptr buildPointNeighborSearcher() const override
Returns shared pointer of PointNeighborSearcher3 type.
jet::PointKdTreeSearcher3::PointKdTreeSearcher3
PointKdTreeSearcher3(const PointKdTreeSearcher3 &other)
Copy constructor.
jet::PointKdTreeSearcher3::Builder::makeShared
PointKdTreeSearcher3Ptr makeShared() const
Builds shared pointer of PointKdTreeSearcher3 instance.
jet::PointKdTreeSearcher3::PointKdTreeSearcher3
PointKdTreeSearcher3()
Constructs an empty kD-tree instance.
jet::PointNeighborSearcher3
Abstract base class for 3-D neighbor point searcher.
Definition: point_neighbor_searcher3.h:28
jet::PointNeighborSearcher3::ForEachNearbyPointFunc
std::function< void(size_t, const Vector3D &)> ForEachNearbyPointFunc
Definition: point_neighbor_searcher3.h:33
jet::PointKdTreeSearcher3::build
void build(const ConstArrayAccessor1< Vector3D > &points) override
Builds internal acceleration structure for given points list.
JET_NEIGHBOR_SEARCHER3_TYPE_NAME
#define JET_NEIGHBOR_SEARCHER3_TYPE_NAME(DerivedClassName)
Definition: point_neighbor_searcher3.h:95
jet::PointKdTreeSearcher3::Builder::build
PointKdTreeSearcher3 build() const
Builds PointKdTreeSearcher3 instance.
jet::PointNeighborSearcher3Ptr
std::shared_ptr< PointNeighborSearcher3 > PointNeighborSearcher3Ptr
Shared pointer for the PointNeighborSearcher3 type.
Definition: point_neighbor_searcher3.h:82
jet::Vector< T, 3 >
3-D vector class.
Definition: vector3.h:25
jet::PointNeighborSearcherBuilder3
Abstract base class for 3-D point neighbor searcher builders.
Definition: point_neighbor_searcher3.h:85
jet::PointKdTreeSearcher3::builder
static Builder builder()
Returns builder fox PointKdTreeSearcher3.