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.
19 #include <dali-scene3d/public-api/light/light.h>
22 #include <dali-scene3d/internal/light/light-impl.h>
32 Light::Light(const Light& light) = default;
34 Light::Light(Light&& rhs) noexcept = default;
36 Light& Light::operator=(const Light& light) = default;
38 Light& Light::operator=(Light&& rhs) noexcept = default;
46 return Internal::Light::New();
49 Light Light::DownCast(BaseHandle handle)
53 CustomActor custom = Dali::CustomActor::DownCast(handle);
56 CustomActorImpl& customImpl = custom.GetImplementation();
58 Internal::Light* impl = dynamic_cast<Internal::Light*>(&customImpl);
62 result = Light(customImpl.GetOwner());
69 void Light::Enable(bool enable)
71 Internal::GetImplementation(*this).Enable(enable);
74 bool Light::IsEnabled() const
76 return Internal::GetImplementation(*this).IsEnabled();
79 uint32_t Light::GetMaximumEnabledLightCount()
81 return Internal::Light::GetMaximumEnabledLightCount();
84 Light::Light(Internal::Light& implementation)
85 : CustomActor(implementation)
89 Light::Light(Dali::Internal::CustomActor* internal)
90 : CustomActor(internal)
92 // Can have a NULL pointer so we only need to check if the internal implementation is our class
93 // when there is a value.
96 DALI_ASSERT_DEBUG(dynamic_cast<Internal::Light*>(&CustomActor(internal).GetImplementation()));
100 } // namespace Scene3D