PointGenerator2.hpp
Go to the documentation of this file.
1 // This code is based on Jet framework.
2 // Copyright (c) 2018 Doyub Kim
3 // CubbyFlow is voxel-based fluid simulation engine for computer games.
4 // Copyright (c) 2020 CubbyFlow Team
5 // Core Part: Chris Ohk, Junwoo Hwang, Jihong Sin, Seungwoo Yoo
6 // AI Part: Dongheon Cho, Minseo Kim
7 // We are making my contributions/submissions to this project solely in our
8 // personal capacity and are not conveying any rights to any intellectual
9 // property of any third parties.
10 
11 #ifndef CUBBYFLOW_POINT_GENERATOR2_HPP
12 #define CUBBYFLOW_POINT_GENERATOR2_HPP
13 
14 #include <Core/Array/Array.hpp>
16 
17 #include <functional>
18 
19 namespace CubbyFlow
20 {
29 {
30  public:
32  PointGenerator2() = default;
33 
35  PointGenerator2(const PointGenerator2&) = default;
36 
38  PointGenerator2(PointGenerator2&&) noexcept = default;
39 
41  virtual ~PointGenerator2() = default;
42 
44  PointGenerator2& operator=(const PointGenerator2&) = default;
45 
47  PointGenerator2& operator=(PointGenerator2&&) noexcept = default;
48 
51  void Generate(const BoundingBox2D& boundingBox, double spacing,
52  Array1<Vector2D>* points) const;
53 
65  virtual void ForEachPoint(
66  const BoundingBox2D& boundingBox, double spacing,
67  const std::function<bool(const Vector2D&)>& callback) const = 0;
68 };
69 
71 using PointGenerator2Ptr = std::shared_ptr<PointGenerator2>;
72 } // namespace CubbyFlow
73 
74 #endif
virtual ~PointGenerator2()=default
Default virtual destructor.
N-D axis-aligned bounding box class.
Definition: BoundingBox.hpp:46
Definition: Matrix.hpp:27
Abstract base class for 2-D point generator.
Definition: PointGenerator2.hpp:28
Definition: pybind11Utils.hpp:20
Definition: Array-Impl.hpp:19
void Generate(const BoundingBox2D &boundingBox, double spacing, Array1< Vector2D > *points) const
std::shared_ptr< PointGenerator2 > PointGenerator2Ptr
Shared pointer for the PointGenerator2 type.
Definition: PointGenerator2.hpp:71
PointGenerator2()=default
Default constructor.
PointGenerator2 & operator=(const PointGenerator2 &)=default
Default copy assignment operator.
virtual void ForEachPoint(const BoundingBox2D &boundingBox, double spacing, const std::function< bool(const Vector2D &)> &callback) const =0
Iterates every point within the bounding box with specified point pattern and invokes the callback fu...