/////////////////////////////////////////////////////////////////////////////// // 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. /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// // // PdfPublishLineAnnotation.h // /////////////////////////////////////////////////////////////////////////////// #ifndef _PDF_PUBLISH_LINE_ANNOTATION_INCLUDED_ #define _PDF_PUBLISH_LINE_ANNOTATION_INCLUDED_ #include "PdfPublishMarkupAnnotation.h" #include "Ge/GePoint2dArray.h" #include "OdArray.h" #include "PdfPublishAnnotationBorderStyle.h" /** \details Contains declarations for Publish SDK. */ namespace OdPdfPublish { /** \details This class implements a line annotation in a .pdf document created with Publish SDK. Line annotations represent straight line segments with optional styles and captions. */ class PDFPUBLISH_TOOLKIT OdLineAnnotation : public OdMarkupAnnotation { //DOM-IGNORE-BEGIN protected: OdLineAnnotation(); //DOM-IGNORE-END public: //DOM-IGNORE-BEGIN ODRX_DECLARE_MEMBERS(OdLineAnnotation); ODRX_HEAP_OPERATORS(); //DOM-IGNORE-END /** \details Destroys the line annotation. */ virtual ~OdLineAnnotation(); /** \details Sets the start and end points of the line. \param start [in] The starting point of the line. \param end [in] The ending point of the line. \remarks This corresponds to the required `L` entry in the annotation dictionary. */ void setPoints(const OdGePoint2d& start, const OdGePoint2d& end); /** \details Sets the border style for the line annotation. \param style [in] A smart pointer to a border style object. \remarks This corresponds to the optional `BS` entry in the annotation dictionary. */ void setLineStyle(const OdAnnotationBorderStylePtr& style); /** \details Sets the line ending styles for the start and end points. \param start_le [in] Line ending style at the start point. \param end_le [in] Line ending style at the end point. \remarks This corresponds to the optional `LE` entry in the annotation dictionary. */ void setEndings(const LineEnding::Style& start_le, const LineEnding::Style& end_le); /** \details Sets the length of the leader lines extending from each endpoint. \param size [in] Length of the leader lines in default user space. \remarks This corresponds to the `LL` entry. Default is 0 (no leader lines). */ void setLeaderLinesSize(const OdInt32 size); /** \details Sets the length of leader line extensions that extend from the end of the leader lines. \param size [in] Length of the leader line extensions. \remarks This corresponds to the `LLE` entry. Default is 0. */ void setLeaderLinesExtSize(const OdUInt32 size); /** \details Sets the length of the line offset between the annotation and the start of leader lines. \param size [in] Offset size in user space units. \remarks This corresponds to the `LLO` entry. Default is 0. */ void setLeaderLinesOffsetSize(const OdUInt32 size); /** \details Sets the intent of the line annotation. \param size [in] Intent of the line (e.g. LineArrow or LineDimension). \remarks This corresponds to the optional `IT` entry. */ void setLineIntent(const LineOptions::Intent size); /** \details Sets the caption positioning for the line annotation. \param position [in] Caption positioning type (Inline or Top). \remarks This corresponds to the optional `CP` entry. Default is Inline. */ void setCaptionPosition(const LineOptions::CaptionPosition position); /** \details Sets the offset of the caption text from its normal position. \param offset [in] The horizontal and vertical offsets from the midpoint of the line. \remarks This corresponds to the optional `CO` entry. Default is [0, 0]. */ void setCaptionOffset(const OdGePoint2d offset); /** \details Sets the caption text that will be displayed with the line. \param caption [in] The caption string. \remarks This corresponds to the optional `Cap` and `Contents`/`RC` entries. */ void setCaption(const OdString& caption); /** \details Retrieves the start and end points of the line. \param start [out] The starting point. \param end [out] The ending point. */ void getPoints(OdGePoint2d& start, OdGePoint2d& end) const; /** \details Retrieves the border style of the line. \param style [out] A smart pointer to the border style. */ void getLineStyle(OdAnnotationBorderStylePtr& style) const; /** \details Retrieves the line ending styles for the start and end points. \param start_le [out] Line ending style at the start point. \param end_le [out] Line ending style at the end point. */ void getEndings(LineEnding::Style& start_le, LineEnding::Style& end_le) const; /** \details Retrieves the length of the leader lines. \param size [out] Length of leader lines. */ void getLeaderLinesSize(OdInt32& size) const; /** \details Retrieves the length of leader line extensions. \param size [out] Length of the extensions. */ void getLeaderLinesExtSize(OdUInt32& size) const; /** \details Retrieves the line offset before the leader lines begin. \param size [out] Offset size. */ void getLeaderLinesOffsetSize(OdUInt32& size) const; /** \details Retrieves the intent of the line annotation. \param size [out] Intent value. */ void getLineIntent(LineOptions::Intent& size) const; /** \details Retrieves the caption positioning of the line. \param position [out] Positioning type. */ void getCaptionPosition(LineOptions::CaptionPosition& position) const; /** \details Retrieves the caption offset. \param offset [out] The horizontal and vertical offsets. */ void getCaptionOffset(OdGePoint2d& offset) const; /** \details Retrieves the caption string. \param caption [out] The caption text. */ void getCaption(OdString& caption) const; }; /** \details A data type that represents a smart pointer to an object. */ SMARTPTR(OdLineAnnotation); } // namespace OdPdfPublish #endif // _PDF_PUBLISH_LINE_ANNOTATION_INCLUDED_