ListQueryEngine3.h
Go to the documentation of this file.
1 /*************************************************************************
2 > File Name: ListQueryEngine3.h
3 > Project Name: CubbyFlow
4 > Author: Chan-Ho Chris Ohk
5 > Purpose: Ad-hoc list-based 3-D intersection/nearest-neighbor query engine.
6 > Created Time: 2017/10/14
7 > Copyright (c) 2018, Chan-Ho Chris Ohk
8 *************************************************************************/
9 #ifndef CUBBYFLOW_LIST_QUERY_ENGINE3_H
10 #define CUBBYFLOW_LIST_QUERY_ENGINE3_H
11 
14 
15 namespace CubbyFlow
16 {
18  template <typename T>
20  {
21  public:
23  void Add(const T& item);
24 
26  void Add(const std::vector<T>& items);
27 
29  bool IsIntersects(const BoundingBox3D& box,
30  const BoxIntersectionTestFunc3<T>& testFunc) const override;
31 
33  bool IsIntersects(const Ray3D& ray,
34  const RayIntersectionTestFunc3<T>& testFunc) const override;
35 
38  const BoundingBox3D& box, const BoxIntersectionTestFunc3<T>& testFunc,
39  const IntersectionVisitorFunc3<T>& visitorFunc) const override;
40 
43  const Ray3D& ray, const RayIntersectionTestFunc3<T>& testFunc,
44  const IntersectionVisitorFunc3<T>& visitorFunc) const override;
45 
48  const Ray3D& ray,
49  const GetRayIntersectionFunc3<T>& testFunc) const override;
50 
53  const Vector3D& pt,
54  const NearestNeighborDistanceFunc3<T>& distanceFunc) const override;
55 
56  private:
57  std::vector<T> m_items;
58  };
59 }
60 
62 
63 #endif
3-D vector class.
Definition: Vector3.h:26
Abstract base class for 3-D nearest neighbor query engine.
Definition: NearestNeighborQueryEngine3.h:30
ClosestIntersectionQueryResult3< T > GetClosestIntersection(const Ray3D &ray, const GetRayIntersectionFunc3< T > &testFunc) const override
Returns the closest intersection for given ray.
Definition: ListQueryEngine3-Impl.h:86
std::function< bool(const T &, const BoundingBox3D &)> BoxIntersectionTestFunc3
Box-item intersection test function.
Definition: IntersectionQueryEngine3.h:31
std::function< double(const T &, const Ray3D &)> GetRayIntersectionFunc3
Ray-item closest intersection evaluation function.
Definition: IntersectionQueryEngine3.h:39
Definition: pybind11Utils.h:24
void ForEachIntersectingItem(const BoundingBox3D &box, const BoxIntersectionTestFunc3< T > &testFunc, const IntersectionVisitorFunc3< T > &visitorFunc) const override
Invokes visitorFunc for every intersecting items.
Definition: ListQueryEngine3-Impl.h:58
Ad-hoc list-based 3-D intersection/nearest-neighbor query engine.
Definition: ListQueryEngine3.h:19
3-D axis-aligned bounding box class.
Definition: BoundingBox3.h:44
Closest intersection query result.
Definition: IntersectionQueryEngine3.h:19
bool IsIntersects(const BoundingBox3D &box, const BoxIntersectionTestFunc3< T > &testFunc) const override
Returns true if given box intersects with any of the stored items.
Definition: ListQueryEngine3-Impl.h:27
std::function< void(const T &)> IntersectionVisitorFunc3
Visitor function which is invoked for each intersecting item.
Definition: IntersectionQueryEngine3.h:43
std::function< bool(const T &, const Ray3D &)> RayIntersectionTestFunc3
Ray-item intersection test function.
Definition: IntersectionQueryEngine3.h:35
NearestNeighborQueryResult3< T > GetNearestNeighbor(const Vector3D &pt, const NearestNeighborDistanceFunc3< T > &distanceFunc) const override
Returns the nearest neighbor for given point and distance measure function.
Definition: ListQueryEngine3-Impl.h:105
Nearest neighbor query result.
Definition: NearestNeighborQueryEngine3.h:18
void Add(const T &item)
Adds an item to the container.
Definition: ListQueryEngine3-Impl.h:15
Class for 3-D ray.
Definition: Ray3.h:23
Abstract base class for 3-D intersection test query engine.
Definition: IntersectionQueryEngine3.h:47
std::function< double(const T &, const Vector3D &)> NearestNeighborDistanceFunc3
Nearest neighbor distance measure function.
Definition: NearestNeighborQueryEngine3.h:26