ParticleEmitterSet2.h
Go to the documentation of this file.
1 /*************************************************************************
2 > File Name: ParticleEmitterSet2.h
3 > Project Name: CubbyFlow
4 > Author: Chan-Ho Chris Ohk
5 > Purpose: 2-D particle-based emitter set.
6 > Created Time: 2017/05/10
7 > Copyright (c) 2018, Chan-Ho Chris Ohk
8 *************************************************************************/
9 #ifndef CUBBYFLOW_PARTICLE_EMITTER_SET2_H
10 #define CUBBYFLOW_PARTICLE_EMITTER_SET2_H
11 
13 
14 namespace CubbyFlow
15 {
20  {
21  public:
22  class Builder;
23 
26 
28  explicit ParticleEmitterSet2(const std::vector<ParticleEmitter2Ptr>& emitters);
29 
31  virtual ~ParticleEmitterSet2();
32 
34  void AddEmitter(const ParticleEmitter2Ptr& emitter);
35 
37  static Builder GetBuilder();
38 
39  private:
40  std::vector<ParticleEmitter2Ptr> m_emitters;
41 
42  void OnSetTarget(const ParticleSystemData2Ptr& particles) override;
43 
44  void OnUpdate(double currentTimeInSeconds, double timeIntervalInSecond) override;
45  };
46 
48  using ParticleEmitterSet2Ptr = std::shared_ptr<ParticleEmitterSet2>;
49 
54  {
55  public:
57  Builder& WithEmitters(const std::vector<ParticleEmitter2Ptr>& emitters);
58 
60  ParticleEmitterSet2 Build() const;
61 
64 
65  private:
66  std::vector<ParticleEmitter2Ptr> m_emitters;
67  };
68 }
69 
70 #endif
std::shared_ptr< ParticleEmitter2 > ParticleEmitter2Ptr
Shared pointer for the ParticleEmitter2 type.
Definition: ParticleEmitter2.h:71
virtual ~ParticleEmitterSet2()
Destructor.
Front-end to create ParticleEmitterSet2 objects step by step.
Definition: ParticleEmitterSet2.h:53
ParticleEmitterSet2Ptr MakeShared() const
Builds shared pointer of ParticleEmitterSet2 instance.
ParticleEmitterSet2 Build() const
Builds ParticleEmitterSet2.
std::shared_ptr< ParticleSystemData2 > ParticleSystemData2Ptr
Shared pointer type of ParticleSystemData2.
Definition: ParticleSystemData2.h:250
Definition: pybind11Utils.h:24
ParticleEmitterSet2()
Constructs an emitter.
static Builder GetBuilder()
Returns builder fox ParticleEmitterSet2.
std::shared_ptr< ParticleEmitterSet2 > ParticleEmitterSet2Ptr
Shared pointer type for the ParticleEmitterSet2.
Definition: ParticleEmitterSet2.h:48
Abstract base class for 2-D particle emitter.
Definition: ParticleEmitter2.h:19
void AddEmitter(const ParticleEmitter2Ptr &emitter)
Adds sub-emitter.
2-D particle-based emitter set.
Definition: ParticleEmitterSet2.h:19
Builder & WithEmitters(const std::vector< ParticleEmitter2Ptr > &emitters)
Returns builder with list of sub-emitters.