[dali_2.3.21] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / particle-system / particle-modifier-impl.h
1 #ifndef DALI_TOOLKIT_PARTICLE_SYSTEM_INTERNAL_PARTICLE_MODIFIER_H
2 #define DALI_TOOLKIT_PARTICLE_SYSTEM_INTERNAL_PARTICLE_MODIFIER_H
3 /*
4  * Copyright (c) 2023 Samsung Electronics Co., Ltd.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  */
19
20 #include <dali-toolkit/public-api/particle-system/particle-modifier.h>
21 #include <dali/public-api/object/base-object.h>
22
23 namespace Dali::Toolkit::ParticleSystem::Internal
24 {
25 class ParticleList;
26 class ParticleEmitter;
27 class ParticleModifier : public Dali::BaseObject
28 {
29 public:
30   ParticleModifier(std::unique_ptr<ParticleModifierInterface>&& updater);
31
32   void Update(ParticleSystem::ParticleList& list, uint32_t first, uint32_t count);
33
34   ParticleModifierInterface& GetUpdater();
35
36 private:
37   std::unique_ptr<ParticleModifierInterface> mUpdater;
38 };
39
40 } // namespace Dali::Toolkit::ParticleSystem::Internal
41
42 namespace Dali::Toolkit::ParticleSystem
43 {
44 inline Internal::ParticleModifier& GetImplementation(ParticleSystem::ParticleModifier& source)
45 {
46   DALI_ASSERT_ALWAYS(source && "ParticleModifier handle is empty");
47
48   BaseObject& handle = source.GetBaseObject();
49
50   return static_cast<Internal::ParticleModifier&>(handle);
51 }
52
53 inline const Internal::ParticleModifier& GetImplementation(const ParticleSystem::ParticleModifier& source)
54 {
55   DALI_ASSERT_ALWAYS(source && "ParticleModifier handle is empty");
56
57   const BaseObject& handle = source.GetBaseObject();
58
59   return static_cast<const Internal::ParticleModifier&>(handle);
60 }
61
62 } // namespace Dali::Toolkit::ParticleSystem
63
64 #endif // DALI_TOOLKIT_PARTICLE_SYSTEM_INTERNAL_PARTICLE_MODIFIER_H