X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-scene3d%2Fpublic-api%2Fcontrols%2Fmodel%2Fmodel.h;fp=dali-scene3d%2Fpublic-api%2Fcontrols%2Fmodel-view%2Fmodel-view.h;h=6678d9fe5962a7a6ea8bcd20645fb86826a79d5a;hp=19ea4c33aeb44e186b387a8fb9a1e16b6dc671e5;hb=352af592adca3b68694d0d10552f490044005043;hpb=52b3a0d3057c239c2ca75321864d687d09a9f01f diff --git a/dali-scene3d/public-api/controls/model-view/model-view.h b/dali-scene3d/public-api/controls/model/model.h similarity index 55% rename from dali-scene3d/public-api/controls/model-view/model-view.h rename to dali-scene3d/public-api/controls/model/model.h index 19ea4c3..6678d9f 100644 --- a/dali-scene3d/public-api/controls/model-view/model-view.h +++ b/dali-scene3d/public-api/controls/model/model.h @@ -1,5 +1,5 @@ -#ifndef DALI_SCENE3D_MODEL_VIEW_H -#define DALI_SCENE3D_MODEL_VIEW_H +#ifndef DALI_SCENE3D_MODEL_H +#define DALI_SCENE3D_MODEL_H /* * Copyright (c) 2022 Samsung Electronics Co., Ltd. @@ -32,87 +32,84 @@ namespace Scene3D { namespace Internal DALI_INTERNAL { -class ModelView; +class Model; } /** - * @addtogroup dali_toolkit_controls_model_view + * @addtogroup dali_toolkit_controls_model * @{ */ /** - * @brief ModelView is a control to show 3D model objects. - * ModelView supports to load glTF 2.0 and DLI models for the input format + * @brief Model is a control to show 3D model objects. + * Model supports to load glTF 2.0 and DLI models for the input format * and also supports Physically Based Rendering with Image Based Lighting. * * The Animations defined in the glTF or DLI models are also loaded and can be retrieved by using GetAnimation() method. * The number of animation is also retrieved by GetAnimationCount() method. * - * By default, The loaded model has it's own position and size which are defined in vertex buffer regardless of the Control size. - * The model can be resized and repositioned to fit to the ModelView Control with FitSize() and FitCenter() methods. + * By default, The loaded model has its own position and size which are defined in vertex buffer regardless of the Control size. * * @code * - * ModelView modelView = ModelView::New(modelUrl); - * modelView.SetProperty(Dali::Actor::Property::SIZE, Vector2(width, height)); - * modelView.SetProperty(Dali::Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); - * modelView.SetProperty(Dali::Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); - * modelView.SetImageBasedLightSource(diffuseUrl, specularUrl, scaleFactor); - * modelView.FitSize(true); - * modelView.FitCenter(true); - * window.Add(modelView); - * uint32_t animationCount = modelView.GetAnimationCount(); - * Dali::Animation animation = modelView.GetAnimation(0); + * Model model = Model::New(modelUrl); + * model.SetProperty(Dali::Actor::Property::SIZE, Vector2(width, height)); + * model.SetProperty(Dali::Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); + * model.SetProperty(Dali::Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); + * model.SetImageBasedLightSource(diffuseUrl, specularUrl, scaleFactor); + * window.Add(model); + * uint32_t animationCount = model.GetAnimationCount(); + * Dali::Animation animation = model.GetAnimation(0); * animation.Play(); * * @endcode */ -class DALI_SCENE3D_API ModelView : public Dali::Toolkit::Control +class DALI_SCENE3D_API Model : public Dali::Toolkit::Control { public: /** - * @brief Create an initialized ModelView. - * @param[in] modelPath model file path.(e.g., glTF, and DLI). - * @param[in] resourcePath resource file path that includes binary, image etc. - * @note If resourcePath is empty, the parent directory path of modelPath is used for resource path. + * @brief Create an initialized Model. + * @param[in] modelUrl model file path.(e.g., glTF, and DLI). + * @param[in] resourceDirectoryUrl resource file path that includes binary, image etc. + * @note If resourceDirectoryUrl is empty, the parent directory path of modelUrl is used for resource path. * @return A handle to a newly allocated Dali resource */ - static ModelView New(const std::string& modelPath, const std::string& resourcePath = std::string()); + static Model New(const std::string& modelUrl, const std::string& resourceDirectoryUrl = std::string()); /** - * @brief Creates an uninitialized ModelView. + * @brief Creates an uninitialized Model. * * Only derived versions can be instantiated. Calling member * functions with an uninitialized Dali::Object is not allowed. */ - ModelView(); + Model(); /** * @brief Destructor. * * This is non-virtual since derived Handle types must not contain data or virtual methods. */ - ~ModelView(); + ~Model(); /** * @brief Copy constructor. - * @param[in] modelView Handle to an object + * @param[in] model Handle to an object */ - ModelView(const ModelView& modelView); + Model(const Model& model); /** * @brief Move constructor * * @param[in] rhs A reference to the moved handle */ - ModelView(ModelView&& rhs); + Model(Model&& rhs); /** * @brief Assignment operator. - * @param[in] modelView Handle to an object + * @param[in] model Handle to an object * @return reference to this */ - ModelView& operator=(const ModelView& modelView); + Model& operator=(const Model& model); /** * @brief Move assignment @@ -120,18 +117,18 @@ public: * @param[in] rhs A reference to the moved handle * @return A reference to this */ - ModelView& operator=(ModelView&& rhs); + Model& operator=(Model&& rhs); /** - * @brief Downcasts an Object handle to ModelView. + * @brief Downcasts an Object handle to Model. * - * If handle points to a ModelView, the downcast produces valid handle. + * If handle points to a Model, the downcast produces valid handle. * If not, the returned handle is left uninitialized. * * @param[in] handle Handle to an object - * @return Handle to a ModelView or an uninitialized handle + * @return Handle to a Model or an uninitialized handle */ - static ModelView DownCast(BaseHandle handle); + static Model DownCast(BaseHandle handle); /** * @brief Retrieves model root Actor. @@ -140,40 +137,23 @@ public: const Actor GetModelRoot() const; /** - * @brief Fits the model to the Control size. - * @param[in] fit true to fit model size to control. - * @note This method makes model fit to the Control size by keeping original model ratio. - * It means If model size is (2, 2, 2) and ModelView size is (10, 8), then the model become looks (8, 8, 8). - * If ModelView Size x or y is 0, this method don't work anything. - * If ModelView Size z is 0, this method considers only x and y values of ModelView Size. - */ - void FitSize(bool fit); - - /** - * @brief Moves the model to the center of control. - * @param[in] fit true to fit model to center of control. - * @note This method doesn't changes size of model. - */ - void FitCenter(bool fit); - - /** * @brief Changes Image Based Light as the input textures. - * @param[in] diffuse cube map that can be used as a diffuse IBL source. - * @param[in] specular cube map that can be used as a specular IBL source. + * @param[in] diffuseUrl cube map that can be used as a diffuse IBL source. + * @param[in] specularUrl cube map that can be used as a specular IBL source. * @param[in] scaleFactor scale factor that controls light source intensity in [0.0f, 1.0f]. Default value is 1.0f. */ - void SetImageBasedLightSource(const std::string& diffuse, const std::string& specular, float scaleFactor = 1.0f); + void SetImageBasedLightSource(const std::string& diffuseUrl, const std::string& specularUrl, float scaleFactor = 1.0f); /** * @brief Sets Image Based Light Texture. * - * @param[in] diffuse cube map texture that can be used as a diffuse IBL source. - * @param[in] specular cube map texture that can be used as a specular IBL source. + * @param[in] diffuseTexture cube map texture that can be used as a diffuse IBL source. + * @param[in] specularTexture cube map texture that can be used as a specular IBL source. * @param[in] scaleFactor scale factor that controls light source intensity in [0.0f, 1.0f]. Default value is 1.0f. * - * @note Both of diffuse and specular should be available. If not, nothing applied. + * @note Both of diffuse texture and specular texture should be available. If not, nothing applied. */ - void SetImageBasedLightTexture(Texture diffuse, Texture specular, float scaleFactor = 1.0f); + void SetImageBasedLightTexture(Texture diffuseTexture, Texture specularTexture, float scaleFactor = 1.0f); /** * @brief Sets Scale Factor of Image Based Light Source. @@ -222,14 +202,14 @@ public: // Not intended for application developers * * @param[in] implementation The Control implementation */ - DALI_INTERNAL ModelView(Internal::ModelView& implementation); + DALI_INTERNAL Model(Internal::Model& implementation); /** * @brief Allows the creation of this Control from an Internal::CustomActor pointer. * * @param[in] internal A pointer to the internal CustomActor */ - DALI_INTERNAL ModelView(Dali::Internal::CustomActor* internal); + DALI_INTERNAL Model(Dali::Internal::CustomActor* internal); /// @endcond }; @@ -240,4 +220,4 @@ public: // Not intended for application developers } // namespace Dali -#endif // DALI_SCENE3D_MODEL_VIEW_H +#endif // DALI_SCENE3D_MODEL_H