/////////////////////////////////////////////////////////////////////////////// // Copyright (C) 2002-2025, Open Design Alliance (the "Alliance"). // All rights reserved. // // This software and its documentation and related materials are owned by // the Alliance. The software may only be incorporated into application // programs owned by members of the Alliance, subject to a signed // Membership Agreement and Supplemental Software License Agreement with the // Alliance. The structure and organization of this software are the valuable // trade secrets of the Alliance and its suppliers. The software is also // protected by copyright law and international treaty provisions. Application // programs incorporating this software must include the following statement // with their copyright notices: // // This application incorporates Open Design Alliance software pursuant to a license // agreement with Open Design Alliance. // Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance. // All rights reserved. // // By use of this software, its documentation or related materials, you // acknowledge and accept the above terms. /////////////////////////////////////////////////////////////////////////////// #pragma once #include "RxObject.h" #include "MaterialReaderExport.h" #include "OdAProperties.h" #include "AssetAccessor.h" #include "Gi/GiMaterial.h" class OdDbBaseHostAppServices; /** \details A class that represents an asset for storing properties. */ class MATERIALREADER_EXPORT ODRX_ABSTRACT OdAsset : public OdRxObjectImpl { public: ODRX_DECLARE_MEMBERS(OdAsset); /** \details Get the library. \returns OdString. */ virtual OdString getLibrary() const = 0; /** \details Get the scene. \returns OdString. */ virtual OdString getScene() const = 0; /** \details Get the image. \returns OdRxObjectPtr. */ virtual OdRxObjectPtr getImage() const = 0; /** \details Get the AssetType. \returns OdInt32. */ virtual OdInt32 getAssetType() const = 0; /** \details Get the schema name. \returns schema name as OdString. */ virtual OdString getSchemaName() const = 0; /** \details Get properties. \returns properties as OdAPropertiesPtr. */ virtual const OdAPropertiesPtr getProperties() const = 0; }; /** \details The typified smart pointer for the OdAsset object. */ typedef OdSmartPtr OdAssetPtr; /** \details The typified std::map for the OdAsset object with string key. */ typedef std::map OdAssetPtrMap; namespace OdMaterial { /** \details Parses the FBX material data and returns a std::map containing a set of assets from the FBX, where the keys are GUID names of these materials. \param assetMap [out] The returned std::map contains assets and their string keys. \param pAppServ [in] A pointer to the application service, used for searching files. \param pFbx [in] A pointer to the FBX data. \returns eOk if the application to get assets was successful. eInvalidInput if OdDbBaseHostAppServices or OdMaterialFBXAssetXData is NULL, or fbx data matching failed. eSecErrorReadingFile if reading properties failed. */ MATERIALREADER_EXPORT OdResult getAssets(OdAssetPtrMap& assetMap, const OdDbBaseHostAppServices* pAppServ, const OdMaterialFBXAssetXData* pFbx); /** \details Creates an OdAssetAccessor from the asset for manual use in retrieving the COM properties of the material. \param pAsset [in] A smart pointer to OdAsset object. \returns smart pointer to OdAssetAccessor object if operation is successful, other wise return smart pointer referenced to null. */ MATERIALREADER_EXPORT OdAssetAccessorPtr getAssetAccessor(const OdAssetPtr& pAsset); };