/////////////////////////////////////////////////////////////////////////////// // 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 __TNW_TEST_STYLE_H__ #define __TNW_TEST_STYLE_H__ #include "NwObject.h" #include "RxSystemServices.h" /** \details This class represents a text style. */ class NWDBEXPORT OdNwTextStyle : public OdNwObject { //DOM-IGNORE-BEGIN ODRX_DECLARE_MEMBERS(OdNwTextStyle); //DOM-IGNORE-END /** \details The coefficient for correct text display during visualization. Navisworks adjusts the text scale in its own way when rendering. */ static constexpr double nwFontScalingCoef = 0.7272; public: /** \details Default constructor. Creates a new OdNwTextStyle object. */ OdNwTextStyle(); /** \details Constructor for objects of the OdNwTextStyle class. Creates a new OdNwTextStyle object for the specified item. \param pImpl [in] Item to create an OdNwTextStyle object for. */ explicit OdNwTextStyle(OdNwObjectImpl* pImpl); public: /** \details Virtual destructor. Frees allocated resources. */ virtual ~OdNwTextStyle(); public: /** \details Returns the type face for this text style. \returns Returns an OdString value of type face. */ OdString getTypeFace() const; /** \details Returns the font height for this text style. \returns Returns a double precision floating-point value of font height. \remarks This value might not reflect the actual text size because Navisworks renders text in its own way. To render the text correctly, use the nwFontScalingCoef constant. I.e. the size of the rendered text would be nwFontScalingCoef * OdNwTextStyle::getFontHeight() */ double getFontHeight() const; /** \details Returns the point size for this text style. \returns Returns an integer value of point size. */ OdUInt32 getPointSize() const; /** \details Returns the font weight for this text style. \returns Returns an integer value of font weight. \remarks Font weight can be one of the values from NwTextStyleWeight::Enum Name Value Description NwTextStyleWeight::Default 0 Default value. NwTextStyleWeight::Normal 400 Normal. NwTextStyleWeight::Bold 700 Bold.
*/ OdUInt32 getFontWeight() const; /** \details Returns the text style for this text style. \returns Returns an integer value of the style. \remarks Text style is a combination of NwTextStyleDecor::Enum flags Name Value Description NwTextStyleDecor::Normal 0 Normal. NwTextStyleDecor::Italic 1 Italic. NwTextStyleDecor::Underline 2 Underline. NwTextStyleDecor::Strikeout 4 Strikeout.
*/ OdUInt32 getStyle() const; /** \details Returns the render style for this text style. \returns Returns an integer value of the render style. */ OdUInt32 getRenderStyle() const; }; /** \details This template class is a specialization of the OdSmartPtr class for OdNwTextStyle object pointers. */ typedef OdSmartPtr OdNwTextStylePtr; #endif //__TNW_TEST_STYLE_H__