/////////////////////////////////////////////////////////////////////////////// // 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 "../OdAsset.h" #include "../Enums.h" #include "../MaterialReaderExport.h" #include "CmColorBase.h" #include "AssetPropDefine.h" #include "Ge/GePoint3d.h" #include "OdRound.h" /** \details * A helper basic class to work with appearance schema. */ class MATERIALREADER_EXPORT OdAppearanceSchemaBaseHelper { public: /** \details Default constructor. \param pAsset [in] Input Smart pointer to asset object of Appearance asset which contains appearance schema data. */ OdAppearanceSchemaBaseHelper(const OdAssetPtr& pAsset); /** \details Retrieves asset schema type. \returns A Od::PredefinedAppearanceAsset enum that contains schema type. */ OdMaterial::PredefinedAppearanceAsset getSchemaType() const; /** \details Retrieves schema name. \returns A string that contains the schema name. */ OdString getSchemaName() const; /** \details Retrieves schema description. \param value [out] Output string that contains the schema description. \returns An OdResult value: eOk if description can be retrieved, eNotApplicable if not. */ OdResult getSchemaDescription(OdString& value) const; /** \details Sets the schema description. \param value [in] Input string that contains the schema description. */ void setSchemaDescription(const OdString& value); /** \details Retrieves schema UI name. \param value [out] Output string that contains the schema UI name. \returns An OdResult value: eOk if UI name can be retrieved, eNotApplicable if not. */ OdResult getSchemaUIName(OdString& value) const; /** \details Sets the schema UI name. \param value [in] Input string that contains the schema UI name. */ void setSchemaUIName(const OdString& value); /** \details Retrieves schema keywords. \param value [out] Output string that contains the schema keywords. \returns An OdResult value: eOk if keywords can be retrieved, eNotApplicable if not. */ OdResult getSchemaKeywords(OdString& value) const; /** \details Sets the schema keywords. \param value [in] Input string that contains the schema keywords. */ void setSchemaKeywords(const OdString& value); /** \details Returns the asset. \returns the asset. */ OdAssetPtr getAsset() { return m_pAsset; } /** \details Returns the asset. \returns the asset. */ OdAssetPtr getAsset() const { return m_pAsset; } // Tint properties /** \details Retrieves a common tint color of the material appearance. \param value [out] Output common tint color. \returns An OdResult value: eOk if schema contains a common tint color, eNotApplicable if not. */ OdResult getCommonTintColor(OdCmEntityColor& value); /** \details Sets the material appearance common tint color. \param value [in] Input common tint color. */ void setCommonTintColor(const OdCmEntityColor& value); /** \details Retrieves a value indicating whether the common tint color is enabled for the appearance of the material. \param value [out] Output common tint color. \returns An OdResult value: eOk if schema contains a common tint color, eNotApplicable if not. */ OdResult getCommonTintEnabled(bool& value); /** \details Enable or disable common tint color. \param value [in] Input True or False value. */ void setCommonTintEnabled(bool value); /** \details Retrieves a schema-dependent tint color of the material appearance. \param value [out] Output material tint color. \returns An OdResult value: eOk if schema contains a dependent tint color, eNotApplicable if not. */ virtual OdResult getSchemaTintColor(OdCmEntityColor& value); /** \details Sets the material appearance schema-dependent tint color. \param value [in] Input tint color. */ virtual void setSchemaTintColor(const OdCmEntityColor& value); /** \details Retrieves a value indicating whether the schema-dependent tint color is enabled for the appearance of the material. \param value [out] Output True or False value indicating that tint is enabled. \returns An OdResult value: eOk if schema contains a tint color, eNotApplicable if not. */ virtual OdResult getSchemaTintEnabled(bool& value); /** \details Enable or disable schema-dependent tint color. \param value [in] Input True or False value. */ virtual void setSchemaTintEnabled(bool value); // End of Tint properties private: OdAssetPtr m_pAsset; OdMaterial::PredefinedAppearanceAsset m_schemaType; };