/////////////////////////////////////////////////////////////////////////////// // 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 "MaterialReaderExport.h" #include "CmColorBase.h" #include "OdAProperty.h" /** \details Class for working with properties of various types. */ struct OdAProperties : public OdRxObjectImpl { public: ODRX_DECLARE_MEMBERS(OdAProperties); /** \details Adds a property to the property array. \param OdString [in] The name that will be set to the property. \param OdInt32 [in] The value that will be set for the property. \remarks Adds a property, but does not remove the old one. Therefore, there can be two properties in the list. */ virtual void addAPropertyInteger(const OdString&, OdInt32) = 0; /** \details Replaces the existing property. \param OdString [in] The name that will be set to the property. \param OdInt32 [in] The value that will be set for the property. \remarks If there is no such property with the specified name, then it is added. */ virtual void setAPropertyInteger(const OdString&, OdInt32) = 0; /** \details Get the value of the property. \param OdString [in] The name of the property serves as a key to search for the property. \param OdInt32 [out] Return the value of the property. \returns eOk if successful. eNotThatKindOfClass invalid expected property type. Property of a different type. E.g: property->isA() != OdAPropertyInteger::desc(). eWrongSubentityType invalid expected property subtype. Property of a different subtype. eNullPtr if the property has no value. eInvalidKey invalid property name. */ virtual OdResult getAPropertyInteger(const OdString&, OdInt32&) const = 0; /** \details Adds a property to the property array. \param OdString [in] The name that will be set to the property. \param OdInt32 [in] The value that will be set for the property. \remarks Adds a property, but does not remove the old one. Therefore, there can be two properties in the list. */ virtual void addAPropertyEnum(const OdString&, OdInt32) = 0; /** \details Replaces the existing property. \param OdString [in] The name that will be set to the property. \param OdInt32 [in] The value that will be set for the property. \remarks If there is no such property with the specified name, then it is added. */ virtual void setAPropertyEnum(const OdString&, OdInt32) = 0; /** \details Get the value of the property. \param OdString [in] The name of the property serves as a key to search for the property. \param OdInt32 [out] Return the value of the property. \returns eOk if successful. eNotThatKindOfClass invalid expected property type. Property of a different type. E.g: property->isA() != OdAPropertyEnum::desc(). eWrongSubentityType invalid expected property subtype. Property of a different subtype. eNullPtr if the property has no value. eInvalidKey invalid property name. */ virtual OdResult getAPropertyEnum(const OdString&, OdInt32&) const = 0; /** \details Adds a property to the property array. \param OdString [in] The name that will be set to the property. \param double [in] The value that will be set for the property. \remarks Adds a property, but does not remove the old one. Therefore, there can be two properties in the list. */ virtual void addAPropertyDouble1(const OdString&, double) = 0; /** \details Replaces the existing property. \param OdString [in] The name that will be set to the property. \param double [in] The value that will be set for the property. \remarks If there is no such property with the specified name, then it is added. */ virtual void setAPropertyDouble1(const OdString&, double) = 0; /** \details Get the value of the property. \param OdString [in] The name of the property serves as a key to search for the property. \param double [out] Return the value of the property. \returns eOk if successful. eNotThatKindOfClass invalid expected property type. Property of a different type. E.g: property->isA() != OdAPropertyDouble1::desc(). eWrongSubentityType invalid expected property subtype. Property of a different subtype. eNullPtr if the property has no value. eInvalidKey invalid property name. */ virtual OdResult getAPropertyDouble1(const OdString&, double&) const = 0; /** \details Adds a property to the property array. \param OdString [in] The name that will be set to the property. \param double[2] [in] The value that will be set for the property. \remarks Adds a property, but does not remove the old one. Therefore, there can be two properties in the list. */ virtual void addAPropertyDouble2(const OdString&, const double(&)[2]) = 0; /** \details Replaces the existing property. \param OdString [in] The name that will be set to the property. \param double[2] [in] The value that will be set for the property. \remarks If there is no such property with the specified name, then it is added. */ virtual void setAPropertyDouble2(const OdString&, const double(&)[2]) = 0; /** \details Get the value of the property. \param OdString [in] The name of the property serves as a key to search for the property. \param double[2] [out] Return the value of the property. \returns eOk if successful. eNotThatKindOfClass invalid expected property type. Property of a different type. E.g: property->isA() != OdAPropertyDouble2::desc(). eWrongSubentityType invalid expected property subtype. Property of a different subtype. eNullPtr if the property has no value. eInvalidKey invalid property name. */ virtual OdResult getAPropertyDouble2(const OdString&, double(&)[2]) const = 0; /** \details Adds a property to the property array. \param OdString [in] The name that will be set to the property. \param double[3] [in] The value that will be set for the property. \remarks Adds a property, but does not remove the old one. Therefore, there can be two properties in the list. */ virtual void addAPropertyDouble3(const OdString&, const double(&)[3]) = 0; /** \details Replaces the existing property. \param OdString [in] The name that will be set to the property. \param double[3] [in] The value that will be set for the property. \remarks If there is no such property with the specified name, then it is added. */ virtual void setAPropertyDouble3(const OdString&, const double(&)[3]) = 0; /** \details Get the value of the property. \param OdString [in] The name of the property serves as a key to search for the property. \param double[3] [out] Return the value of the property. \returns eOk if successful. eNotThatKindOfClass invalid expected property type. Property of a different type. E.g: property->isA() != OdAPropertyDouble3::desc(). eWrongSubentityType invalid expected property subtype. Property of a different subtype. eNullPtr if the property has no value. eInvalidKey invalid property name. */ virtual OdResult getAPropertyDouble3(const OdString&, double(&)[3]) const = 0; /** \details Adds a property to the property array. \param OdString [in] The name that will be set to the property. \param double[4] [in] The value that will be set for the property. \remarks Adds a property, but does not remove the old one. Therefore, there can be two properties in the list. */ virtual void addAPropertyDouble4(const OdString&, const double(&)[4]) = 0; /** \details Replaces the existing property. \param OdString [in] The name that will be set to the property. \param double[4] [in] The value that will be set for the property. \remarks If there is no such property with the specified name, then it is added. */ virtual void setAPropertyDouble4(const OdString&, const double(&)[4]) = 0; /** \details Get the value of the property. \param OdString [in] The name of the property serves as a key to search for the property. \param double[4] [out] Return the value of the property. \returns eOk if successful. eNotThatKindOfClass invalid expected property type. Property of a different type. E.g: property->isA() != OdAPropertyDouble4::desc(). eWrongSubentityType invalid expected property subtype. Property of a different subtype. eNullPtr if the property has no value. eInvalidKey invalid property name. */ virtual OdResult getAPropertyDouble4(const OdString&, double(&)[4]) const = 0; /** \details Adds a property to the property array. \param OdString [in] The name that will be set to the property. \param bool [in] The value that will be set for the property. \remarks Adds a property, but does not remove the old one. Therefore, there can be two properties in the list. */ virtual void addAPropertyBoolean(const OdString&, const bool) = 0; /** \details Replaces the existing property. \param OdString [in] The name that will be set to the property. \param bool [in] The value that will be set for the property. \remarks If there is no such property with the specified name, then it is added. */ virtual void setAPropertyBoolean(const OdString&, const bool) = 0; /** \details Get the value of the property. \param OdString [in] The name of the property serves as a key to search for the property. \param bool [out] Return the value of the property. \returns eOk if successful. eNotThatKindOfClass invalid expected property type. Property of a different type. E.g: property->isA() != OdAPropertyBoolean::desc(). eWrongSubentityType invalid expected property subtype. Property of a different subtype. eNullPtr if the property has no value. eInvalidKey invalid property name. */ virtual OdResult getAPropertyBoolean(const OdString&, bool&) const = 0; /** \details Adds a property to the property array. \param OdString [in] The name that will be set to the property. \param OdString [in] The value that will be set for the property. \remarks Adds a property, but does not remove the old one. Therefore, there can be two properties in the list. */ virtual void addAPropertyString(const OdString&, const OdString&) = 0; /** \details Replaces the existing property. \param OdString [in] The name that will be set to the property. \param OdString [in] The value that will be set for the property. \remarks If there is no such property with the specified name, then it is added. */ virtual void setAPropertyString(const OdString&, const OdString&) = 0; /** \details Get the value of the property. \param OdString [in] The name of the property serves as a key to search for the property. \param OdString [out] Return the value of the property. \returns eOk if successful. eNotThatKindOfClass invalid expected property type. Property of a different type. E.g: property->isA() != OdAPropertyString::desc(). eWrongSubentityType invalid expected property subtype. Property of a different subtype. eNullPtr if the property has no value. eInvalidKey invalid property name. */ virtual OdResult getAPropertyString(const OdString&, OdString&) const = 0; /** \details Adds a property to the property array. \param OdString [in] The name that will be set to the property. \param double [in] The value that will be set for the property. \param distancesUnit [in] distancesUnit which will be set to the property. \remarks Adds a property, but does not remove the old one. Therefore, there can be two properties in the list. */ virtual void addAPropertyDistance(const OdString&, double, const OdInt32 distancesUnit) = 0; /** \details Replaces the existing property. \param OdString [in] The name that will be set to the property. \param double [in] The value that will be set for the property. \param distancesUnit [in] distancesUnit which will be set to the property. \remarks If there is no such property with the specified name, then it is added. */ virtual void setAPropertyDistance(const OdString&, double, const OdInt32 distancesUnit) = 0; /** \details Get the value and distance of the property. \param OdString [in] The name of the property serves as a key to search for the property. \param double [out] Return the value of the property. \param distancesUnit [out] Return distancesUnit of the property. \returns eOk if successful. eNotThatKindOfClass invalid expected property type. Property of a different type. E.g: property->isA() != OdAPropertyDistance::desc(). eWrongSubentityType invalid expected property subtype. Property of a different subtype. eNullPtr if the property has no value. eInvalidKey invalid property name. */ virtual OdResult getAPropertyDistance(const OdString&, double&, OdInt32& distancesUnit) const = 0; /** \details Adds a property to the property array. \param OdString [in] The name that will be set to the property. \param OdCmEntityColor [in] The color that will be set for the property. \remarks Adds a property, but does not remove the old one. Therefore, there can be two properties in the list. */ virtual void addAPropertyColor(const OdString&, const OdCmEntityColor&) = 0; /** \details Adds a property to the property array. \param OdString [in] The name that will be set to the property. \param red [in] The red channel will be converted to a color, which will then be set for the property. \param green [in] The green channel will be converted to a color, which will then be set for the property. \param blue [in] The blue channel will be converted to a color, which will then be set for the property. \remarks Adds a property, but does not remove the old one. Therefore, there can be two properties in the list. */ virtual void addAPropertyColor(const OdString&, const OdUInt8 red, const OdUInt8 green, const OdUInt8 blue) = 0; /** \details Replaces the existing property. \param OdString [in] The name that will be set to the property. \param OdCmEntityColor [in] The color that will be set for the property. \remarks If there is no such property with the specified name, then it is added. */ virtual void setAPropertyColor(const OdString&, const OdCmEntityColor&) = 0; /** \details Replaces the existing property. \param OdString [in] The name that will be set to the property. \param red [in] The red channel will be converted to a color, which will then be set for the property. \param green [in] The green channel will be converted to a color, which will then be set for the property. \param blue [in] The blue channel will be converted to a color, which will then be set for the property. \remarks If there is no such property with the specified name, then it is added. */ virtual void setAPropertyColor(const OdString&, const OdUInt8 red, const OdUInt8 green, const OdUInt8 blue) = 0; /** \details Get the value of the property. \param OdString [in] The name of the property serves as a key to search for the property. \param OdCmEntityColor [out] Return the color of the property. \returns eOk if successful. eNotThatKindOfClass invalid expected property type. Property of a different type. E.g: property->isA() != OdAPropertyDouble4::desc(). eWrongSubentityType invalid expected property subtype. Property of a different subtype. eNullPtr if the property has no value. eInvalidKey invalid property name. */ virtual OdResult getAPropertyColor(const OdString&, OdCmEntityColor&) const = 0; /** \details Get the value of the property. \param OdString [in] The name of the property serves as a key to search for the property. \param red [out] Red color channel. \param green [out] Green color channel. \param blue [out] Blue color channel \returns eOk if successful. eNotThatKindOfClass invalid expected property type. Property of a different type. E.g: property->isA() != OdAPropertyDouble4::desc(). eWrongSubentityType invalid expected property subtype. Property of a different subtype. eNullPtr if the property has no value. eInvalidKey invalid property name. */ virtual OdResult getAPropertyColor(const OdString&, OdUInt8& red, OdUInt8& green, OdUInt8& blue) const = 0; /** \details Add a property to the property array. \param pProp [in] The property that will be added to the property array. \returns eOk if successful. eInvalidInput if the property is null. */ virtual OdResult addAProperty(const OdAPropertyPtr& pProp) = 0; /** \details Getting properties by key. The key is the name of the property. \param OdString [in] The name of the property. \param OdAPropertyPtr [out] Returns the found property. \returns true if the property was found. false if the property was not found. */ virtual bool getAProperty(const OdString&, OdAPropertyPtr&) const = 0; /** \details Getting an array of properties. \returns constant reference to the property array. */ virtual const OdAPropertyPtrArray& getAProperties() const = 0; /** \details Setting an array of properties. \param OdAPropertyPtrArray [in] Array of properties. */ virtual void setAProperties(const OdAPropertyPtrArray&) = 0; /** \details Getting an array of properties. \returns reference to the property array. */ virtual OdAPropertyPtrArray& getAProperties() = 0; /** \details Clears the properties list. */ virtual void clearAProperties() = 0; }; typedef OdSmartPtr OdAPropertiesPtr;