1 #ifndef DALI_TOOLKIT_PARTICLE_SYSTEM_INTERNAL_PARTICLE_SOURCE_H
2 #define DALI_TOOLKIT_PARTICLE_SYSTEM_INTERNAL_PARTICLE_SOURCE_H
4 * Copyright (c) 2023 Samsung Electronics Co., Ltd.
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
10 * http://www.apache.org/licenses/LICENSE-2.0
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.
20 #include <dali-toolkit/public-api/particle-system/particle-source.h>
21 #include <dali/public-api/object/base-object.h>
24 namespace Dali::Toolkit::ParticleSystem::Internal
27 class ParticleEmitter;
28 class ParticleSource : public Dali::BaseObject
31 ~ParticleSource() override = default;
33 explicit ParticleSource(std::unique_ptr<ParticleSourceInterface>&& sourceUpdater);
35 void Update(ParticleSystem::ParticleList& list, uint32_t count);
37 [[nodiscard]] ParticleSourceInterface& GetUpdater() const;
40 std::unique_ptr<ParticleSourceInterface> mUpdater;
43 } // namespace Dali::Toolkit::ParticleSystem::Internal
45 namespace Dali::Toolkit::ParticleSystem
47 inline Internal::ParticleSource& GetImplementation(ParticleSystem::ParticleSource& source)
49 DALI_ASSERT_ALWAYS(source && "ParticleSource handle is empty");
51 BaseObject& handle = source.GetBaseObject();
53 return static_cast<Internal::ParticleSource&>(handle);
56 inline const Internal::ParticleSource& GetImplementation(const ParticleSystem::ParticleSource& source)
58 DALI_ASSERT_ALWAYS(source && "ParticleSource handle is empty");
60 const BaseObject& handle = source.GetBaseObject();
62 return static_cast<const Internal::ParticleSource&>(handle);
65 } // namespace Dali::Toolkit::ParticleSystem
67 #endif // DALI_TOOLKIT_PARTICLE_SYSTEM_INTERNAL_PARTICLE_SOURCE_H