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/internal/event/collider-mesh-processor.h>
22 #include <dali/devel-api/common/singleton-service.h>
25 #include <dali-scene3d/internal/event/collider-mesh-processor-impl.h>
27 namespace Dali::Scene3D
29 ColliderMeshProcessor ColliderMeshProcessor::Get()
31 ColliderMeshProcessor processor;
33 // Check whether the processor has already created
34 SingletonService singletonService(SingletonService::Get());
37 Dali::BaseHandle handle = singletonService.GetSingleton(typeid(ColliderMeshProcessor));
40 // If so, downcast the handle of singleton to focus manager
41 processor = ColliderMeshProcessor(dynamic_cast<Internal::ColliderMeshProcessor*>(handle.GetObjectPtr()));
46 // If not, create the focus manager and register it as a singleton
47 processor = ColliderMeshProcessor(new Internal::ColliderMeshProcessor());
48 singletonService.Register(typeid(processor), processor);
55 void ColliderMeshProcessor::ColliderMeshChanged(Scene3D::Model model)
57 GetImpl(*this).ColliderMeshChanged(model);
60 ColliderMeshProcessor::ColliderMeshProcessor(Internal::ColliderMeshProcessor* impl)
65 } // namespace Dali::Scene3D