Make ModelNode and Light as Control 29/303829/3
authorEunki, Hong <eunkiki.hong@samsung.com>
Fri, 5 Jan 2024 10:14:23 +0000 (19:14 +0900)
committerEunki Hong <eunkiki.hong@samsung.com>
Mon, 22 Jan 2024 08:20:15 +0000 (08:20 +0000)
Since we need to use some control features (like KeyboardFocus) let we make
ModelNode and Light as Control, instead of CustomActor.

TODO : We'd better make some universion Control for Scene3D.
For example, we should not allow to add Visual into ModelNode or Light.

Change-Id: I8acbb57d967c438101fe8a1877950d044ca943f2
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
dali-scene3d/internal/light/light-impl.cpp
dali-scene3d/internal/light/light-impl.h
dali-scene3d/internal/model-components/model-node-impl.cpp
dali-scene3d/internal/model-components/model-node-impl.h
dali-scene3d/public-api/light/light.cpp
dali-scene3d/public-api/light/light.h
dali-scene3d/public-api/model-components/model-node.cpp
dali-scene3d/public-api/model-components/model-node.h

index 0a0a453..cc7c639 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -70,7 +70,7 @@ Dali::Scene3D::Light Light::New()
 }
 
 Light::Light()
-: CustomActorImpl(ActorFlags::DISABLE_SIZE_NEGOTIATION)
+: Control(static_cast<ControlBehaviour>(ControlBehaviour::DISABLE_STYLE_CHANGE_SIGNALS | ActorFlags::DISABLE_SIZE_NEGOTIATION))
 {
 }
 
index c691423..bb46c5f 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_SCENE3D_LIGHT_IMPL_H
 
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -19,7 +19,7 @@
  */
 
 // EXTERNAL INCLUDES
-#include <dali/public-api/actors/custom-actor-impl.h>
+#include <dali-toolkit/public-api/controls/control-impl.h>
 #include <dali/public-api/common/dali-common.h>
 #include <dali/public-api/object/weak-handle.h>
 #include <string_view>
@@ -44,7 +44,7 @@ namespace Internal
  *
  * @SINCE_2_2.32
  */
-class DALI_SCENE3D_API Light : public CustomActorImpl
+class DALI_SCENE3D_API Light : public Toolkit::Internal::Control
 {
 public:
   // Creation & Destruction
@@ -215,7 +215,6 @@ protected:
   void Initialize();
 
 public: // Public Method
-
   /**
    * @copydoc Scene3D::Light::GetMaximumEnabledLightCount()
    */
@@ -258,10 +257,10 @@ private:
   /// @cond internal
 
   // Not copyable or movable
-  DALI_INTERNAL        Light(const Light&)     = delete; ///< Deleted copy constructor.
-  DALI_INTERNAL        Light(Light&&)          = delete; ///< Deleted move constructor.
+  DALI_INTERNAL Light(const Light&) = delete;            ///< Deleted copy constructor.
+  DALI_INTERNAL Light(Light&&)      = delete;            ///< Deleted move constructor.
   DALI_INTERNAL Light& operator=(const Light&) = delete; ///< Deleted copy assignment operator.
-  DALI_INTERNAL Light& operator=(Light&&)      = delete; ///< Deleted move assignment operator.
+  DALI_INTERNAL Light& operator=(Light&&) = delete;      ///< Deleted move assignment operator.
 
 private:
   Dali::CameraActor              mLightSourceActor;
index 8d85cf2..1eb07db 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -65,7 +65,7 @@ Dali::Scene3D::ModelNode ModelNode::New()
 }
 
 ModelNode::ModelNode()
-: CustomActorImpl(ActorFlags::DISABLE_SIZE_NEGOTIATION)
+: Control(static_cast<ControlBehaviour>(ControlBehaviour::DISABLE_STYLE_CHANGE_SIGNALS | ActorFlags::DISABLE_SIZE_NEGOTIATION))
 {
 }
 
index f36e218..0996155 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_SCENE3D_MODEL_COMPONENTS_MODEL_NODE_IMPL_H
 
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -19,8 +19,8 @@
  */
 
 // EXTERNAL INCLUDES
+#include <dali-toolkit/public-api/controls/control-impl.h>
 #include <dali/devel-api/common/map-wrapper.h>
-#include <dali/public-api/actors/custom-actor-impl.h>
 #include <dali/public-api/common/dali-common.h>
 #include <memory> // for std::unique_ptr
 #include <string>
@@ -54,7 +54,7 @@ using ColliderMeshUniquePtr = std::unique_ptr<Dali::Scene3D::Algorithm::Collider
  *
  * @SINCE_2_2.99
  */
-class DALI_SCENE3D_API ModelNode : public CustomActorImpl, public ModelPrimitiveModifyObserver
+class DALI_SCENE3D_API ModelNode : public Toolkit::Internal::Control, public ModelPrimitiveModifyObserver
 {
 public:
   using ModelPrimitiveContainer = std::vector<Scene3D::ModelPrimitive>;
index 095e053..0086c1f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -122,12 +122,12 @@ float Light::GetShadowBias() const
 }
 
 Light::Light(Internal::Light& implementation)
-: CustomActor(implementation)
+: Control(implementation)
 {
 }
 
 Light::Light(Dali::Internal::CustomActor* internal)
-: CustomActor(internal)
+: Control(internal)
 {
   // Can have a NULL pointer so we only need to check if the internal implementation is our class
   // when there is a value.
index ef4892a..3d8d763 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_SCENE3D_LIGHT_H
 
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -60,7 +60,7 @@ class Light;
  * @endcode
  * @SINCE_2_2.32
  */
-class DALI_SCENE3D_API Light : public Dali::CustomActor
+class DALI_SCENE3D_API Light : public Dali::Toolkit::Control
 {
 public:
   /**
index 2832531..a93d71e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -71,12 +71,12 @@ ModelNode ModelNode::DownCast(BaseHandle handle)
 }
 
 ModelNode::ModelNode(Internal::ModelNode& implementation)
-: CustomActor(implementation)
+: Control(implementation)
 {
 }
 
 ModelNode::ModelNode(Dali::Internal::CustomActor* internal)
-: CustomActor(internal)
+: Control(internal)
 {
   // Can have a NULL pointer so we only need to check if the internal implementation is our class
   // when there is a value.
index 5ae5831..993d9dd 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_SCENE3D_MODEL_COMPONENTS_MODEL_NODE_H
 
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -19,7 +19,7 @@
  */
 
 // EXTERNAL INCLUDES
-#include <dali/public-api/actors/custom-actor.h>
+#include <dali-toolkit/public-api/controls/control.h>
 #include <dali/public-api/common/dali-common.h>
 
 // INTERNAL INCLUDES
@@ -60,7 +60,7 @@ class ModelNode;
  * material.SetProperty(PropertyIndex, PropertyValue);
  * @endcode
  */
-class DALI_SCENE3D_API ModelNode : public Dali::CustomActor
+class DALI_SCENE3D_API ModelNode : public Dali::Toolkit::Control
 {
 public:
   /**