PointSimpleListSearcher3.h
Go to the documentation of this file.
1 /*************************************************************************
2 > File Name: PointSimpleListSearcher3.h
3 > Project Name: CubbyFlow
4 > Author: Chan-Ho Chris Ohk
5 > Purpose: Simple ad-hoc 3-D point searcher.
6 > Created Time: 2017/05/25
7 > Copyright (c) 2018, Chan-Ho Chris Ohk
8 *************************************************************************/
9 #ifndef CUBBYFLOW_POINT_SIMPLE_LIST_SEARCHER3_H
10 #define CUBBYFLOW_POINT_SIMPLE_LIST_SEARCHER3_H
11 
13 
14 namespace CubbyFlow
15 {
24  {
25  public:
27 
28  class Builder;
29 
32 
35 
44  void Build(const ConstArrayAccessor1<Vector3D>& points) override;
45 
54  void ForEachNearbyPoint(
55  const Vector3D& origin,
56  double radius,
57  const ForEachNearbyPointFunc& callback) const override;
58 
68  bool HasNearbyPoint(const Vector3D& origin, double radius) const override;
69 
76  PointNeighborSearcher3Ptr Clone() const override;
77 
80 
82  void Set(const PointSimpleListSearcher3& other);
83 
85  void Serialize(std::vector<uint8_t>* buffer) const override;
86 
88  void Deserialize(const std::vector<uint8_t>& buffer) override;
89 
91  static Builder GetBuilder();
92 
93  private:
94  std::vector<Vector3D> m_points;
95  };
96 
98  using PointSimpleListSearcher3Ptr = std::shared_ptr<PointSimpleListSearcher3>;
99 
104  {
105  public:
108 
111 
114  };
115 }
116 
117 #endif
3-D vector class.
Definition: Vector3.h:26
std::function< void(size_t, const Vector3D &)> ForEachNearbyPointFunc
Definition: PointNeighborSearcher3.h:34
PointNeighborSearcher3Ptr Clone() const override
Creates a new instance of the object with same properties than original.
void Serialize(std::vector< uint8_t > *buffer) const override
Serializes the neighbor searcher into the buffer.
std::shared_ptr< PointNeighborSearcher3 > PointNeighborSearcher3Ptr
Shared pointer for the PointNeighborSearcher3 type.
Definition: PointNeighborSearcher3.h:79
PointSimpleListSearcher3Ptr MakeShared() const
Builds shared pointer of PointSimpleListSearcher3 instance.
PointSimpleListSearcher3()
Default constructor.
bool HasNearbyPoint(const Vector3D &origin, double radius) const override
PointSimpleListSearcher3 & operator=(const PointSimpleListSearcher3 &other)
Assignment operator.
void Build(const ConstArrayAccessor1< Vector3D > &points) override
Builds internal structure for given points list.
static Builder GetBuilder()
Returns builder fox PointSimpleListSearcher3.
1-D read-only array accessor class.
Definition: ArrayAccessor1.h:185
Front-end to create PointSimpleListSearcher3 objects step by step.
Definition: PointSimpleListSearcher3.h:103
void Deserialize(const std::vector< uint8_t > &buffer) override
Deserializes the neighbor searcher from the buffer.
std::shared_ptr< PointSimpleListSearcher3 > PointSimpleListSearcher3Ptr
Shared pointer for the PointSimpleListSearcher3 type.
Definition: PointSimpleListSearcher3.h:98
Definition: pybind11Utils.h:24
void ForEachNearbyPoint(const Vector3D &origin, double radius, const ForEachNearbyPointFunc &callback) const override
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
void Set(const PointSimpleListSearcher3 &other)
Copy from the other instance.
PointNeighborSearcher3Ptr BuildPointNeighborSearcher() const override
Returns shared pointer of PointNeighborSearcher3 type.
#define CUBBYFLOW_NEIGHBOR_SEARCHER3_TYPE_NAME(DerivedClassName)
Definition: PointNeighborSearcher3.h:94
Simple ad-hoc 3-D point searcher.
Definition: PointSimpleListSearcher3.h:23
PointSimpleListSearcher3 Build() const
Builds PointSimpleListSearcher3 instance.