X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-scene3d%2Fpublic-api%2Floader%2Fresource-bundle.h;h=c7011127039ab056ad573ab3aa7ed1aedabdc7af;hb=HEAD;hp=cea48c0bbd6272a3c0fcaa7f3d1deb163d6e90f7;hpb=1bfc1cca1c61f62bc3b368773db63b545abf5502;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-scene3d/public-api/loader/resource-bundle.h b/dali-scene3d/public-api/loader/resource-bundle.h index cea48c0..c701112 100644 --- a/dali-scene3d/public-api/loader/resource-bundle.h +++ b/dali-scene3d/public-api/loader/resource-bundle.h @@ -1,7 +1,7 @@ -#ifndef DALI_SCENE3D_LOADERERERERER_RESOURCE_BUNDLE_H_ -#define DALI_SCENE3D_LOADERERERERER_RESOURCE_BUNDLE_H_ +#ifndef DALI_SCENE3D_LOADERERERER_RESOURCE_BUNDLE_H_ +#define DALI_SCENE3D_LOADERERERER_RESOURCE_BUNDLE_H_ /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -17,28 +17,26 @@ * */ -// INTERNAL -#include "dali-scene3d/public-api/loader/environment-definition.h" -#include "dali-scene3d/public-api/loader/material-definition.h" -#include "dali-scene3d/public-api/loader/mesh-definition.h" -#include "dali-scene3d/public-api/loader/shader-definition.h" -#include "dali-scene3d/public-api/loader/skeleton-definition.h" - -// EXTERNAL +// EXTERNAL INCLUDES +#include +#include +#include #include #include -#include "dali/public-api/common/vector-wrapper.h" -#include "dali/public-api/rendering/shader.h" -#include "dali/public-api/rendering/texture-set.h" -namespace Dali -{ -namespace Scene3D -{ -namespace Loader +// INTERNAL INCLUDES +#include +#include +#include +#include +#include +#include + +namespace Dali::Scene3D::Loader { -/* +/** * @brief The types of resources that .dli may define. + * @SINCE_2_0.7 */ struct DALI_SCENE3D_API ResourceType { @@ -53,17 +51,20 @@ struct DALI_SCENE3D_API ResourceType ResourceType() = delete; }; -/* - * @return The string value corresponding to the given resource @a type. +/** + * @brief The string value corresponding to the given resource @a type. + * @SINCE_2_0.7 + * @return The string value for type. */ DALI_SCENE3D_API const char* GetResourceTypeName(ResourceType::Value type); using ResourceRefCounts = std::vector>; -/* +/** * @brief Stores all resource definitions along with the DALi resources that * could be created from them, directly indexible into with values from a dli * document. + * @SINCE_2_0.7 */ class DALI_SCENE3D_API ResourceBundle { @@ -82,7 +83,7 @@ public: using PathProvider = std::function; - ResourceBundle() = default; + ResourceBundle(); ResourceBundle(const ResourceBundle&) = delete; ResourceBundle& operator=(const ResourceBundle&) = delete; @@ -91,9 +92,11 @@ public: ResourceBundle& operator=(ResourceBundle&&) = default; /** - * @return A ResourceRefCounts object with the correct number of entries for + * @brief A ResourceRefCounts object with the correct number of entries for * all resource types (based on the various resource definition vectors), * with all reference counts set to 0. + * @SINCE_2_0.7 + * @return A ResourceRefCounts object. */ ResourceRefCounts CreateRefCounter() const; @@ -101,64 +104,72 @@ public: * @brief Based on a ResourceRefCounts, and more specifically the reference * count of materials therein, it will calculate the reference count of * environment maps. + * @SINCE_2_0.7 */ - void CountEnvironmentReferences(ResourceRefCounts& refCounts) const; + void CountEnvironmentReferences(); /** - * @brief Performs the loading of all resources based on their respective - * reference count in @a refCounts. Resources that had a non-zero ref count will be - * loaded unless we already have a handle to them (OR the ForceReload option was specified). + * @brief Performs the loading of all resources based on their respective reference count in @a refCounts. + * + * Resources that had a non-zero ref count will be loaded unless we already have a handle to them + * (OR the ForceReload option was specified). * Any handles we have to resources that come in with a zero ref count will be reset, * UNLESS the KeepUnused option was specified. - * @param[in] refCounts Reference Count that denote how many the resource is used. + * + * @SINCE_2_0.7 * @param[in] pathProvider path provider for resource data. * @param[in] options Option to load resource * @note This method creates DALi objects like Dali::Texture, Dali::Geometry, etc. */ - void LoadResources(const ResourceRefCounts& refCounts, - PathProvider pathProvider, - Options::Type options = Options::None); + void LoadResources(PathProvider pathProvider, + Options::Type options = Options::None); /** - * @brief Loads of all resources based on their respective - * reference count in @a refCounts. Resources that had a non-zero ref count will be - * loaded unless we already have a handle to them (OR the ForceReload option was specified). + * @brief Loads of all resources based on their respective reference count in @a refCounts. + * + * Resources that had a non-zero ref count will be loaded unless we already have a handle to them + * (OR the ForceReload option was specified). * Any handles we have to resources that come in with a zero ref count will be reset, * UNLESS the KeepUnused option was specified. + * + * @SINCE_2_2.9 * @note This method don't create any of DALi objects. - * @param[in] refCounts Reference Count that denote how many the resource is used. * @param[in] pathProvider path provider for resource data. * @param[in] options Option to load resource * @note This method only loads raw data from resource file, and * doesn't create any of DALi objects. GenerateResources() method is required to be called * after this method to create DALi objects. */ - void LoadRawResources(const ResourceRefCounts& refCounts, - PathProvider pathProvider, - Options::Type options = Options::None); + void LoadRawResources(PathProvider pathProvider, + Options::Type options = Options::None); /** * @brief Generates DALi objects from already loaded Raw Resources. - * @param[in] refCounts Reference Count that denote how many the resource is used. + * @SINCE_2_2.9 * @param[in] options Option to load resource * @note This method generates DALi objects from raw data that is already * loaded by LoadRawResources method. Therefore, LoadRawResources should be called first * before this method is called. */ - void GenerateResources(const ResourceRefCounts& refCounts, - Options::Type options = Options::None); + void GenerateResources(Options::Type options = Options::None); public: // DATA + ResourceRefCounts mReferenceCounts; EnvironmentDefinition::Vector mEnvironmentMaps; ShaderDefinition::Vector mShaders; MeshDefinition::Vector mMeshes; MaterialDefinition::Vector mMaterials; SkeletonDefinition::Vector mSkeletons; + BufferDefinition::Vector mBuffers; + + bool mRawResourcesLoading; + bool mResourcesGenerating; + + bool mRawResourcesLoaded; + bool mResourcesGenerated; }; -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader -#endif //DALI_SCENE3D_LOADERERERERER_RESOURCE_BUNDLE_H_ +#endif //DALI_SCENE3D_LOADERERERER_RESOURCE_BUNDLE_H_