/////////////////////////////////////////////////////////////////////////////// // 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. /////////////////////////////////////////////////////////////////////////////// #ifndef _IFC_PRESENTATIONSTYLE_H #define _IFC_PRESENTATIONSTYLE_H #include "IfcCachedCompound.h" #include "daiBooleanType.h" #include "TD_PackPush.h" namespace OdIfc { /** \details A base class that represents IfcPresentationStyle entity, an abstract generalization of style table for presentation information assigned to geometric representation items according to IFC4X3 specification. IfcPresentationStyle provides the abstract supertype for all presentation style definitions. Each subtype defines style information for specific geometric element types including curves, areas, surfaces, and text. Style information may include color, hatching, rendering, and text fonts. Each subtype of IfcPresentationStyle is assigned to IfcGeometricRepresentationItem through an intermediate IfcStyledItem. The presentation styles can be used for model space or draughting space representations and support both 2D and 3D visualization contexts within IFC models. */ class IFCGEOM_EXPORT OdIfcPresentationStyle : public OdIfcCachedCompound { ODRX_DECLARE_MEMBERS(OdIfcPresentationStyle); public: /** \details Composes the presentation style object by processing its attributes and relationships. */ void compose() override; /** \details Sets the style settings for rendering through the world draw interface. This pure virtual method must be implemented by derived classes to apply specific style properties. \param pWd [in] A raw pointer to the world draw interface for entity-level vectorization. \returns eOk if the style settings were successfully applied; otherwise, returns an appropriate error code. */ virtual OdResult setStyleSettings(OdGiWorldDraw* pWd) const = 0; /** \details Retrieves the name of the presentation style as defined in the Name attribute. \returns An OdString containing the presentation style name, or an empty string if no name is defined. */ OdString name() const; }; SMARTPTR(OdIfcPresentationStyle) /** \details A class that represents IfcCurveStyle entity, which provides the style table for presentation information assigned to geometric curves. IfcCurveStyle defines the visual appearance of curves through three main attributes: curve font (line type pattern), curve width (thickness), and curve color. The style is defined by a color, a font and a width. At least one of the three attributes (CurveFont, CurveWidth, or CurveColour) must be specified to create an identifiable curve style. The IfcCurveStyle defines curve patterns as model patterns, meaning the distance between visible and invisible segments of curve patterns are given in model space dimensions and must be scaled using the target plot scale. The ModelOrDraughting attribute indicates whether the style is intended for model space or draughting space usage. */ class IFCGEOM_EXPORT OdIfcCurveStyle : public OdIfcPresentationStyle { ODRX_DECLARE_MEMBERS(OdIfcCurveStyle); public: /** \details Composes the curve style object by processing curve font, width, and color attributes. */ void compose(); /** \details Sets the curve style settings for rendering through the world draw interface. Applies curve font patterns, line width, and color properties to the graphics context. \param pWd [in] A raw pointer to the world draw interface for entity-level vectorization. \returns eOk if the curve style settings were successfully applied; otherwise, returns an appropriate error code. */ OdResult setStyleSettings(OdGiWorldDraw* pWd) const override; /** \details Sets the values of the curve style's sub-entity traits. \param traits [in] A raw pointer to the drawable traits to be filled and returned to a calling subroutine. \returns The result code of the traits setting operation. */ OdUInt32 subSetAttributes(OdGiDrawableTraits* traits) const override; /** \details Retrieves a predefined font pattern and converts it to dash array format. \param dashes [out] Reference to the linetype dash array to be filled with pattern data. \param length [out] Reference to the double value to receive the total pattern length. \param pEnt [in] A smart pointer to the IFC entity containing the font definition. \returns eOk if the predefined font was successfully retrieved; otherwise, returns an appropriate error code. */ OdResult getPreDefinedFont(OdGiLinetypeDashArray& dashes, double& length, const OdIfcInstancePtr& pEnt) const; /** \details Retrieves a font pattern from the curve font definition and converts it to dash array format. \param dashes [out] Reference to the linetype dash array to be filled with pattern data. \param length [out] Reference to the double value to receive the total pattern length. \param pEnt [in] A smart pointer to the IFC entity containing the font definition. \returns eOk if the font pattern was successfully retrieved; otherwise, returns an appropriate error code. */ OdResult getFontPattern(OdGiLinetypeDashArray& dashes, double& length, const OdIfcInstancePtr& pEnt) const; /** \details Retrieves the CurveFont attribute which defines the line type pattern for the curve. \returns A smart pointer to the IFC instance representing the curve font, or nullptr if not defined. */ OdIfcInstancePtr curveFont() const; /** \details Retrieves the CurveWidth attribute which defines the thickness of the curve line. \returns A smart pointer to the IFC instance representing the curve width, or nullptr if not defined. */ OdIfcInstancePtr curveWidth() const; /** \details Retrieves the CurveColour attribute which defines the color of the curve. \returns A smart pointer to the IFC instance representing the curve color, or nullptr if not defined. */ OdIfcInstancePtr curveColour() const; /** \details Retrieves the ModelOrDraughting attribute indicating the usage context of the curve style. \returns An OdDAI::Boolean value: true for model space usage, false for draughting space usage, or unset if not specified. */ OdDAI::Boolean modelOrDraughting() const; }; SMARTPTR(OdIfcCurveStyle) /** \details A class that represents IfcSurfaceStyle entity according to IFC4X3 specification, which defines an assignment of one or many surface style elements to a surface. IfcSurfaceStyle is applied to surfaces defined by subtypes of IfcSurface, IfcFaceBasedSurfaceModel, IfcShellBasedSurfaceModel, or by subtypes of IfcSolidModel. The surface style defines the visual appearance through a collection of surface style elements including rendering properties, shading, textures, lighting, and refraction characteristics. The Side attribute determines which side of the surface the style applies to (positive, negative, or both sides). The positive direction of the surface normal relates to the positive side. Multiple style elements can be combined, but certain restrictions apply to ensure consistent rendering. \remarks Constraints ensure maximum one instance each of externally defined surface style, lighting, refraction, and shading elements within the styles collection. */ class IFCGEOM_EXPORT OdIfcSurfaceStyle : public OdIfcPresentationStyle { ODRX_DECLARE_MEMBERS(OdIfcSurfaceStyle); public: /** \details Sets the surface style settings for rendering through the world draw interface. Applies surface rendering properties, materials, textures, and lighting to the graphics context. \param pWd [in] A raw pointer to the world draw interface for entity-level vectorization. \returns eOk if the surface style settings were successfully applied; otherwise, returns an appropriate error code. */ OdResult setStyleSettings(OdGiWorldDraw* pWd) const override; /** \details Sets the values of the surface style's sub-entity traits. \param traits [in] A raw pointer to the drawable traits to be filled and returned to a calling subroutine. \returns The result of the traits setting operation. */ OdUInt32 subSetAttributes(OdGiDrawableTraits* traits) const override; /** \details Retrieves the Side attribute which specifies which side of the surface the style applies to. \returns An OdAnsiString representing the surface side value of ENUM type \remarks Possible values are: POSITIVE, NEGATIVE, or BOTH. */ OdAnsiString side() const; /** \details Retrieves the Styles attribute containing the collection of surface style elements. \returns An OdArray of smart pointers to IFC instances representing surface style elements (rendering, shading, textures, lighting, refraction properties). */ OdArray styles() const; }; SMARTPTR(OdIfcSurfaceStyle) /** \details A class that represents IfcFillAreaStyle entity according to IFC4X3 specification, which defines the style for filling areas with colors, hatching patterns, tiling, or externally defined fill styles. IfcFillAreaStyle specifies the visual appearance of filled areas through a collection of fill style elements. The style can include solid colors, hatching patterns, tile patterns, and externally defined fill styles. Multiple fill styles can be applied to create complex area filling effects, with later styles potentially overriding or combining with earlier ones. The fill area style is typically applied to surfaces, face-based surface models, shell-based surface models, or solid models through the styled item mechanism. The ModelOrDraughting attribute indicates whether the style is intended for model space or draughting space representation contexts. \remarks Fill styles are processed in order, allowing for layered fill effects and complex area presentations within IFC models. */ class IFCGEOM_EXPORT OdIfcFillAreaStyle : public OdIfcPresentationStyle { ODRX_DECLARE_MEMBERS(OdIfcFillAreaStyle); public: /** \details Sets the fill area style settings for rendering through the world draw interface. Applies area filling properties including colors, hatching patterns, tiles, and external fill styles. \param pWd [in] A raw pointer to the world draw interface for entity-level vectorization. \returns eOk if the fill area style settings were successfully applied; otherwise, returns an appropriate error code. */ OdResult setStyleSettings(OdGiWorldDraw* pWd) const override; /** \details Sets the values of the fill area style's sub-entity traits. \param traits [in] A raw pointer to the drawable traits to be filled and returned to a calling subroutine. \returns The result of the traits setting operation. */ OdUInt32 subSetAttributes(OdGiDrawableTraits* traits) const override; /** \details Retrieves the FillStyles attribute containing the collection of fill area style elements. \returns An OdArray of smart pointers to IFC instances representing fill style elements (colors, hatching patterns, tile patterns, externally defined fills). */ OdArray fillStyles() const; /** \details Retrieves the ModelOrDraughting attribute indicating the usage context of the fill area style. \returns An OdDAI::Boolean value: true for model space usage, false for draughting space usage, or unset if not specified. */ OdDAI::Boolean modelOrDraughting() const; }; SMARTPTR(OdIfcFillAreaStyle) /** \details A class that represents IfcTextStyle entity according to IFC4X3 specification, which provides the text style for presentation information assigned to IfcTextLiteral annotations in model space. IfcTextStyle defines the visual appearance of text through three main style components: character appearance, text model properties, and font characteristics. The style controls how text annotations are rendered within IFC models, including typography, layout, and formatting properties. The text style is specifically designed for model space annotations and text literals, providing comprehensive control over text presentation including font selection, character formatting, and text box properties. The ModelOrDraughting attribute indicates the intended usage context for the text style. \remarks IfcTextStyle is assigned to IfcTextLiteral elements through the IfcStyledItem entity, enabling rich text presentation within IFC geometric models. */ class IFCGEOM_EXPORT OdIfcTextStyle : public OdIfcPresentationStyle { ODRX_DECLARE_MEMBERS(OdIfcTextStyle); public: /** \details Sets the text style settings for rendering through the world draw interface. Applies text font characteristics, character appearance, and text model properties to the graphics context. \param pWd [in] A raw pointer to the world draw interface for entity-level vectorization. \returns eOk if the text style settings were successfully applied; otherwise, returns an appropriate error code. */ OdResult setStyleSettings(OdGiWorldDraw* pWd) const override; /** \details Sets the values of the text style's sub-entity traits. \param traits [in] A raw pointer to the drawable traits to be filled and returned to a calling subroutine. \returns The result of the traits setting operation. */ OdUInt32 subSetAttributes(OdGiDrawableTraits* traits) const override; /** \details Retrieves the TextCharacterAppearance attribute which defines character-level formatting properties. \returns A smart pointer to the IFC instance representing text character appearance (IfcTextStyleForDefinedFont), or null if not defined. */ OdIfcInstancePtr textCharacterAppearance() const; /** \details Retrieves the TextStyle attribute which defines text model properties and layout characteristics. \returns A smart pointer to the IFC instance representing text style properties (IfcTextStyleTextModel), or null if not defined. */ OdIfcInstancePtr textStyle() const; /** \details Retrieves the TextFontStyle attribute which defines font selection and characteristics. \returns A smart pointer to the IFC instance representing the text font style (IfcTextFontSelect). */ OdIfcInstancePtr textFontStyle() const; /** \details Retrieves the ModelOrDraughting attribute indicating the usage context of the text style. \returns An OdDAI::Boolean value: true for model space usage, false for draughting space usage, or unset if not specified. */ OdDAI::Boolean modelOrDraughting() const; }; SMARTPTR(OdIfcTextStyle) } #include "TD_PackPop.h" #endif // _IFC_PRESENTATIONSTYLE_H