GridEmitterSet3.h
Go to the documentation of this file.
1 /*************************************************************************
2 > File Name: GridEmitterSet3.h
3 > Project Name: CubbyFlow
4 > Author: Chan-Ho Chris Ohk
5 > Purpose: 3-D grid-based emitter set.
6 > Created Time: 2017/08/06
7 > Copyright (c) 2018, Chan-Ho Chris Ohk
8 *************************************************************************/
9 #ifndef CUBBYFLOW_GRID_EMITTER_SET3_H
10 #define CUBBYFLOW_GRID_EMITTER_SET3_H
11 
13 
14 #include <vector>
15 
16 namespace CubbyFlow
17 {
21  class GridEmitterSet3 final : public GridEmitter3
22  {
23  public:
24  class Builder;
25 
28 
30  explicit GridEmitterSet3(const std::vector<GridEmitter3Ptr>& emitters);
31 
33  virtual ~GridEmitterSet3();
34 
36  void AddEmitter(const GridEmitter3Ptr& emitter);
37 
39  static Builder GetBuilder();
40 
41  private:
42  std::vector<GridEmitter3Ptr> m_emitters;
43 
44  void OnUpdate(double currentTimeInSeconds, double timeIntervalInSeconds) override;
45  };
46 
48  using GridEmitterSet3Ptr = std::shared_ptr<GridEmitterSet3>;
49 
54  {
55  public:
57  Builder& WithEmitters(const std::vector<GridEmitter3Ptr>& emitters);
58 
60  GridEmitterSet3 Build() const;
61 
64 
65  private:
66  std::vector<GridEmitter3Ptr> m_emitters;
67  };
68 }
69 
70 #endif
std::shared_ptr< GridEmitterSet3 > GridEmitterSet3Ptr
Shared pointer type for the GridEmitterSet3.
Definition: GridEmitterSet3.h:48
3-D grid-based emitter set.
Definition: GridEmitterSet3.h:21
GridEmitterSet3Ptr MakeShared() const
Builds shared pointer of GridEmitterSet3 instance.
GridEmitterSet3()
Constructs an emitter.
std::shared_ptr< GridEmitter3 > GridEmitter3Ptr
Shared pointer type for the GridEmitter3.
Definition: GridEmitter3.h:63
Front-end to create GridEmitterSet3 objects step by step.
Definition: GridEmitterSet3.h:53
void AddEmitter(const GridEmitter3Ptr &emitter)
Adds sub-emitter.
Definition: pybind11Utils.h:24
GridEmitterSet3 Build() const
Builds GridEmitterSet3.
Builder & WithEmitters(const std::vector< GridEmitter3Ptr > &emitters)
Returns builder with list of sub-emitters.
virtual ~GridEmitterSet3()
Destructor.
Abstract base class for 3-D grid-based emitters.
Definition: GridEmitter3.h:20
static Builder GetBuilder()
Returns builder fox GridEmitterSet3.