/////////////////////////////////////////////////////////////////////////////// // 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_GEOMETRYTEXT_H__ #define __TNW_GEOMETRYTEXT_H__ #include "NwGeometry.h" #include "NwTextStyleType.h" #include "NwVerticesData.h" #include "NwTriangleIndexes.h" class OdGeVector3d; class OdGeMatrix3d; class OdGePoint3d; /** \details This class represents geometry with the text type. */ class NWDBEXPORT OdNwGeometryText : public OdNwGeometry { ODRX_DECLARE_MEMBERS(OdNwGeometryText); /** \details Default constructor. Creates a new object of the OdNwGeometryText class. */ OdNwGeometryText(); public: /** \details Virtual destructor. Frees allocated resources. */ virtual ~OdNwGeometryText(); public: /** \details Returns the left point of the text geometry data. \returns OdGePoint3d of the object with the left point of the text geometry data. */ OdGePoint3d getLeftPoint() const; /** \details Returns the right point of the text geometry data. \returns OdGePoint3d of the object with the right point of the text geometry data. */ OdGePoint3d getRightPoint() const; /** \details Returns the normal of the text geometry data. \returns OdGeVector3d of the object with the normal of the text geometry data. \remarks The method is deprecated. Use getTextTransform() method instead. */ OdGeVector3d getNormal() const; /** \details Returns the text of the text geometry data. \returns OdString of the object with the text of the text geometry data. */ OdString getText() const; /** \details Returns the rotation of the text geometry data. \returns The current rotation angle of the text geometry data in radians as a float value. \remarks The method is deprecated. Use getTextTransform() method and method OdGeQuaternion::set(const OdGeMatrix3d& matrix) for get rotation of instead. */ float getRotation() const; /** \details Returns the scale of the text geometry data. \returns The current scale of the text geometry data as a float value. \remarks The method is deprecated. Use getTextTransform() method for getting scale of instead. */ float getScale() const; /** \details Returns the objectId of the text style for the text geometry data. \returns OdNwObjectId of the OdNwTextStyle class object with the text style for the text geometry data. */ OdNwObjectId getTextStyleId() const; /** \details Returns the transformation of the text geometry data. \returns The OdGeMatrix3d with transformation of the text geometry data. \remarks The transform may contain: * scaling by x and y coords * rotation around z-axis */ OdGeMatrix3d getTextTransform() const; /** \details Creates text style. \param typeFace [in] Font name \param fontHeight [in] Font height \param pointSize [in] Point size \param fontWeight [in] Font weight \param style [in] Text style \returns OdNwObjectId of the created OdNwTextStyle class object with the text style for the text geometry data. \remarks The style parameter must be a combination of one or more of the following: Name Value Description NwTextStyleDecor::Normal 0 Normal. NwTextStyleDecor::Italic 1 Italic. NwTextStyleDecor::Underline 2 Underline. NwTextStyleDecor::Strikeout 4 Strikeout.
The fontWeight parameter must be a combination of one or more of the following: Name Value Description NwTextStyleWeight::Default 0 Default value. NwTextStyleWeight::Normal 400 Normal. NwTextStyleWeight::Bold 700 Bold.
*/ OdNwObjectId createTextStyle(OdString typeFace, double fontHeight, OdUInt32 pointSize, NwTextStyleWeight::Enum fontWeight, NwTextStyleDecor::Enum style); /** \details Sets text style. \param typeFace [in] OdNwObjectId text style object created earlier. \returns The eOk value if the operation is successful, otherwise an appropriate error code. */ OdResult setTextStyle(OdNwObjectId val); /** \details Gets a triangle data object. \returns The OdNwTriangleData objects with vertices, normals and triangle indices. \remarks The method performs conversion from fonts as NURBS to triangle data. This functionality requires the NwGeom2Shell library to be loaded and the database to be opened with the NwOpenOptions::kOptionCacheGeometry option enabled. */ OdNwTriangleData toShell() const; }; /** \details This template class is a specialization of the OdSmartPtr class for OdNwGeometryText object pointers. */ typedef OdSmartPtr OdNwGeometryTextPtr; #endif //__TNW_GEOMETRYTEXT_H__