/////////////////////////////////////////////////////////////////////////////// // 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 "COBieBuildOptions.h" #include #include "OdAnsiString.h" namespace OdCOBie { /** \details This class represents color-related data for COBie. */ class COBIE_EXPORT OdCOBieColor { public: /** \details Defines legend types object. */ enum LegendType { /** Required field */ Required = 0, /** Reference to other sheet or pick list */ Reference, /** External reference */ ExtReference, /** If specified as required */ IfSpecifiedAsRequired, /** Secondary information when preparing product data */ Secondary, /** Regional, owner, or product-specific data */ Regional, /** Not used data */ NotUsed, /** Default data */ Default }; /** \details Creates a new OdCOBieColor object with default parameters. */ OdCOBieColor(); /** \details The function returns the total number of legend elements. \returns Retrieves a total number of legend elements. */ static const int getLegendCount(); /** \details Retrieves the default text color for a given legend in RGB format. \param legendType [in] Legend that requires text color. \returns Default text color for the specified legend in RRGGBB format. \remarks Black in Html is actually 0x000000 but black color is defined as 0x1000000 to avoid confusion with an undefined or Zero color value. It is converted to the correct Html code internally. */ static const OdUInt32 getTextColorDefault(const LegendType legendType); /** \details Retrieves the default background color for a given legend in RGB format. \param legendType [in] Legend that requires background color. \returns Default background color for the specified legend in RRGGBB format. \remarks Black in Html is actually 0x000000 but black color is defined as 0x1000000 to avoid confusion with an undefined or Zero color value. It is converted to the correct Html code internally. */ static const OdUInt32 getBgColorDefault(const LegendType legendType); /** \details Retrieves the text color for a given legend in RGB format. \param legendType [in] Legend that requires text color. \returns Text color for the specified legend in RRGGBB format. \remarks Black in Html is actually 0x000000 but black color is defined as 0x1000000 to avoid confusion with an undefined or Zero color value. It is converted to the correct Html code internally. */ virtual const OdUInt32 getTextColor(const LegendType legendType); /** \details Retrieves the background color for a given legend in RGB format. \param legendType [in] Legend that requires background color. \returns Background color for the specified legend in RRGGBB format. \remarks Black in Html is actually 0x000000 but black color is defined as 0x1000000 to avoid confusion with an undefined or Zero color value. It is converted to the correct Html code internally. */ virtual const OdUInt32 getBgColor(const LegendType legendType); /** \details Retrieves the text color and background color for a given legend in RGB format. \param legendType [in] Legend that requires color. \param textColor [in] Pointer to the text color to return. \param bgColor [in] Pointer to the background color to return. \remarks Black in Html is actually 0x000000 but black color is defined as 0x1000000 to avoid confusion with an undefined or Zero color value. It is converted to the correct Html code internally. */ virtual void getColor(const LegendType legendType, OdUInt32* textColor, OdUInt32* bgColor); }; /** \details Contains attribute setting information for an entity attribute. */ struct AttributeSettings { /** Legend type to define field color */ OdCOBieColor::LegendType legendType; /** Field width */ double width; }; /** \details Attributes setting information. */ typedef std::map AttributeSettingsMap; /** \details Contains information about setting up a table. */ struct TableSettrings { /** Legend type to define table tab color */ OdCOBieColor::LegendType colorId; /** Attributes setting information */ AttributeSettingsMap attributes; }; /** \details Tables setting information. */ typedef std::map TablesSettingsMap; /** \details Retrieves a tables setting information. \returns Tables setting information. */ TablesSettingsMap COBIE_EXPORT getCOBieTablesSettings(); } // namespace OdCOBie