Merge branch 'devel/master' into tizen
[platform/core/uifw/dali-toolkit.git] / dali-scene3d / internal / event / collider-mesh-processor-impl.h
1 #pragma once
2
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 // EXTERNAL INCLUDES
21 #include <dali/integration-api/processor-interface.h>
22 #include <dali/public-api/common/vector-wrapper.h>
23 #include <dali/public-api/object/base-handle.h>
24 #include <dali/public-api/object/base-object.h>
25 #include <dali/public-api/signals/connection-tracker.h>
26
27 // INTERNAL INCLUDES
28 #include <dali-scene3d/internal/event/collider-mesh-processor.h>
29 #include <dali-scene3d/public-api/controls/model/model.h>
30 #include <dali-scene3d/public-api/controls/scene-view/scene-view.h>
31
32 namespace Dali::Scene3D
33 {
34 namespace Internal
35 {
36 class ColliderMeshProcessor : public BaseObject, public Dali::ConnectionTracker, public Integration::Processor
37 {
38 public:
39   ColliderMeshProcessor();
40
41   ~ColliderMeshProcessor();
42
43   void ColliderMeshChanged(Scene3D::Model model);
44
45 private:
46   void ModelOnScene(Actor actor);
47
48   void Process(bool /*postProcessor*/);
49
50   void AddSceneViewParentToProcessingQueue(Scene3D::Model model);
51
52 private:
53   std::vector<Scene3D::SceneView> mSceneViewsToProcess;
54   std::vector<Scene3D::SceneView> mConnectedSceneViews;
55 };
56
57 } // namespace Internal
58
59 inline Internal::ColliderMeshProcessor& GetImpl(ColliderMeshProcessor& obj)
60 {
61   DALI_ASSERT_ALWAYS(obj);
62
63   Dali::BaseObject& handle = obj.GetBaseObject();
64
65   return static_cast<Internal::ColliderMeshProcessor&>(handle);
66 }
67
68 inline const Internal::ColliderMeshProcessor& GetImpl(const ColliderMeshProcessor& obj)
69 {
70   DALI_ASSERT_ALWAYS(obj);
71
72   const Dali::BaseObject& handle = obj.GetBaseObject();
73
74   return static_cast<const Internal::ColliderMeshProcessor&>(handle);
75 }
76
77 } // namespace Dali::Scene3D