X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-scene3d%2Finternal%2Fcontrols%2Fmodel%2Fmodel-impl.h;h=23aaf61065e436875dc24069b5b6cbac3572dd45;hb=5feee171a62b20f7d7b8cd1bcfdf5abb79bdd524;hp=fea5d60d89ba1230884e34b986f967ed1914bd54;hpb=1ac29fd1c5cc68034da8338f8ab4d9a4899f6027;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-scene3d/internal/controls/model/model-impl.h b/dali-scene3d/internal/controls/model/model-impl.h index fea5d60..23aaf61 100644 --- a/dali-scene3d/internal/controls/model/model-impl.h +++ b/dali-scene3d/internal/controls/model/model-impl.h @@ -32,6 +32,8 @@ #include #include #include +#include +#include namespace Dali { @@ -51,16 +53,24 @@ public: using CameraData = Loader::CameraParameters; /** - * @brief Creates a new Model. - * - * @return A public handle to the newly allocated Model. + * @copydoc Model::New() */ static Dali::Scene3D::Model New(const std::string& modelUrl, const std::string& resourceDirectoryUrl); /** * @copydoc Model::GetModelRoot() */ - const Actor GetModelRoot() const; + const Scene3D::ModelNode GetModelRoot() const; + + /** + * @copydoc Model::AddModelNode() + */ + void AddModelNode(Scene3D::ModelNode modelNode); + + /** + * @copydoc Model::RemoveModelNode() + */ + void RemoveModelNode(Scene3D::ModelNode modelNode); /** * @copydoc Model::SetChildrenSensitive() @@ -88,11 +98,6 @@ public: void SetImageBasedLightSource(const std::string& diffuseUrl, const std::string& specularUrl, float scaleFactor); /** - * @copydoc Model::SetImageBasedLightTexture() - */ - void SetImageBasedLightTexture(Dali::Texture diffuseTexture, Dali::Texture specularTexture, float scaleFactor); - - /** * @copydoc Model::SetImageBasedLightScaleFactor() */ void SetImageBasedLightScaleFactor(float scaleFactor); @@ -132,9 +137,16 @@ public: */ bool ApplyCamera(uint32_t index, Dali::CameraActor camera) const; + /** + * @copydoc Model::FindChildModelNodeByName() + */ + Scene3D::ModelNode FindChildModelNodeByName(std::string_view nodeName); + protected: /** * @brief Constructs a new Model. + * @param[in] modelUrl model file path.(e.g., glTF, and DLI). + * @param[in] resourceDirectoryUrl resource file path that includes binary, image etc. */ Model(const std::string& modelUrl, const std::string& resourceDirectoryUrl); @@ -186,6 +198,11 @@ private: private: /** + * @brief Create Model Root of this Model class. + */ + void CreateModelRoot(); + + /** * @brief Scales the model to fit the control or to return to original size. */ void ScaleModel(); @@ -198,7 +215,12 @@ private: /** * @brief Changes IBL information of the input node. */ - void CollectRenderableActor(Actor actor); + void UpdateImageBasedLightTextureRecursively(Scene3D::ModelNode node, Dali::Texture diffuseTexture, Dali::Texture specularTexture, float iblScaleFactor, uint32_t specularMipmapLevels); + + /** + * @brief Changes IBL factor of the input node. + */ + void UpdateImageBasedLightScaleFactorRecursively(Scene3D::ModelNode node, float iblScaleFactor); /** * @brief Changes IBL textures of the input node. @@ -223,7 +245,7 @@ public: // Overrides ImageBasedLightObserver Methods. /** * @copydoc Dali::Scene3D::Internal::ImageBasedLightObserver::NotifyImageBasedLightTexture() */ - void NotifyImageBasedLightTexture(Dali::Texture diffuseTexture, Dali::Texture specularTexture, float scaleFactor) override; + void NotifyImageBasedLightTexture(Dali::Texture diffuseTexture, Dali::Texture specularTexture, float scaleFactor, uint32_t specularMipmapLevels) override; /** * @copydoc Dali::Scene3D::Internal::ImageBasedLightObserver::NotifyImageBasedLightScaleFactor() @@ -262,11 +284,6 @@ private: void ResetResourceTask(IntrusivePtr asyncTask); /** - * @brief Request to load a Ibl texture asynchronously - */ - void RequestLoadIblTexture(EnvironmentMapLoadTaskPtr asyncLoadTask, const std::string& url); - - /** * @brief Notify Resource Ready signal. */ void NotifyResourceReady(); @@ -287,13 +304,12 @@ private: void ResetCameraParameters(); private: - std::string mModelUrl; - std::string mResourceDirectoryUrl; - Dali::Actor mModelRoot; - std::vector mAnimations; - std::vector mCameraParameters; - std::vector> mRenderableActors; - WeakHandle mParentSceneView; + std::string mModelUrl; + std::string mResourceDirectoryUrl; + Scene3D::ModelNode mModelRoot; + std::vector mAnimations; + std::vector mCameraParameters; + WeakHandle mParentSceneView; // Asynchronous loading variable ModelLoadTaskPtr mModelLoadTask; @@ -303,7 +319,6 @@ private: std::string mDiffuseIblUrl; std::string mSpecularIblUrl; - // TODO: This default texture can be removed after 3D Resource Cache is added. Dali::Texture mDefaultSpecularTexture; Dali::Texture mDefaultDiffuseTexture; Dali::Texture mSceneSpecularTexture; @@ -314,6 +329,8 @@ private: Vector3 mModelPivot; float mSceneIblScaleFactor; float mIblScaleFactor; + uint32_t mSceneSpecularMipmapLevels; + uint32_t mSpecularMipmapLevels; bool mModelChildrenSensitive; bool mModelChildrenFocusable; bool mModelResourceReady;