2 * Copyright (c) 2023 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #include <dali-toolkit/internal/particle-system/particle-list-impl.h>
19 #include <dali-toolkit/public-api/particle-system/particle-list.h>
21 namespace Dali::Toolkit::ParticleSystem
24 ParticleStream::StreamDataType StreamDataTypeWrapper<Vector3>::GetType()
26 return ParticleStream::StreamDataType::FLOAT3;
30 ParticleStream::StreamDataType StreamDataTypeWrapper<Vector4>::GetType()
32 return ParticleStream::StreamDataType::FLOAT4;
36 ParticleStream::StreamDataType StreamDataTypeWrapper<Vector2>::GetType()
38 return ParticleStream::StreamDataType::FLOAT2;
42 ParticleStream::StreamDataType StreamDataTypeWrapper<float>::GetType()
44 return ParticleStream::StreamDataType::FLOAT;
47 ParticleList ParticleList::New(uint32_t capacity, const ParticleStreamTypeFlags& defaultStreams)
49 return {new ParticleSystem::Internal::ParticleList(capacity, defaultStreams)};
52 ParticleList ParticleList::DownCast(BaseHandle handle)
54 return {dynamic_cast<Internal::ParticleList*>(handle.GetObjectPtr())};
57 uint32_t ParticleList::AddStream(void* defaults, size_t dataTypeSize, ParticleStream::StreamDataType dataType, bool localStream)
59 return GetImplementation(*this).AddStream(dataTypeSize, defaults, dataType, "", localStream);
62 void* ParticleList::GetRawStream(uint32_t streamIndex)
64 return GetImplementation(*this).GetRawStream(streamIndex);
67 void* ParticleList::GetDefaultStream(ParticleStreamTypeFlagBit streamBit)
69 return GetImplementation(*this).GetDefaultStream(streamBit);
72 uint32_t ParticleList::GetActiveParticleCount()
74 return GetImplementation(*this).GetActiveParticleCount();
77 ParticleList::ParticleList(Dali::Toolkit::ParticleSystem::Internal::ParticleList* impl)
78 : Dali::BaseHandle(impl)
82 uint32_t ParticleList::GetCapacity() const
84 return GetImplementation(*this).GetParticleCount();
87 Particle ParticleList::NewParticle(float lifetime)
89 return GetImplementation(*this).NewParticle(lifetime);
92 uint32_t ParticleList::GetParticleDataSize(bool includeLocalStreams)
94 return GetImplementation(*this).GetStreamElementSize(includeLocalStreams);
97 int ParticleList::GetDefaultStreamIndex(ParticleStreamTypeFlagBit defaultStreamBit)
99 return GetImplementation(*this).GetDefaultStreamIndex(defaultStreamBit);
102 std::list<Particle>& ParticleList::GetActiveParticles()
104 return GetImplementation(*this).GetParticles();
107 ParticleList::ParticleList() = default;
109 } // namespace Dali::Toolkit::ParticleSystem