QGIS API Documentation 3.41.0-Master (af5edcb665c)
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
QgsAnnotationLineItem Class Reference

An annotation item which renders a line symbol along a line geometry. More...

#include <qgsannotationlineitem.h>

Inheritance diagram for QgsAnnotationLineItem:
Inheritance graph
[legend]

Public Member Functions

 QgsAnnotationLineItem (QgsCurve *curve)
 Constructor for QgsAnnotationLineItem, with the specified curve.
 
 ~QgsAnnotationLineItem () override
 
Qgis::AnnotationItemEditOperationResult applyEditV2 (QgsAbstractAnnotationItemEditOperation *operation, const QgsAnnotationItemEditContext &context) override
 Applies an edit operation to the item.
 
QgsRectangle boundingBox () const override
 Returns the bounding box of the item's geographic location, in the parent layer's coordinate reference system.
 
QgsAnnotationLineItemclone () const override
 Returns a clone of the item.
 
Qgis::AnnotationItemFlags flags () const override
 Returns item flags.
 
const QgsCurvegeometry () const
 Returns the geometry of the item.
 
QList< QgsAnnotationItemNodenodesV2 (const QgsAnnotationItemEditContext &context) const override
 Returns the nodes for the item, used for editing the item.
 
bool readXml (const QDomElement &element, const QgsReadWriteContext &context) override
 Reads the item's state from the given DOM element.
 
void render (QgsRenderContext &context, QgsFeedback *feedback) override
 Renders the item to the specified render context.
 
void setGeometry (QgsCurve *geometry)
 Sets the geometry of the item.
 
void setSymbol (QgsLineSymbol *symbol)
 Sets the symbol used to render the marker item.
 
const QgsLineSymbolsymbol () const
 Returns the symbol used to render the item.
 
QgsAnnotationItemEditOperationTransientResultstransientEditResultsV2 (QgsAbstractAnnotationItemEditOperation *operation, const QgsAnnotationItemEditContext &context) override
 Retrieves the results of a transient (in progress) edit operation on the item.
 
QString type () const override
 Returns a unique (untranslated) string identifying the type of item.
 
bool writeXml (QDomElement &element, QDomDocument &document, const QgsReadWriteContext &context) const override
 Writes the item's state into an XML element.
 
- Public Member Functions inherited from QgsAnnotationItem
 QgsAnnotationItem ()
 
 QgsAnnotationItem (const QgsAnnotationItem &other)=delete
 
virtual ~QgsAnnotationItem ()
 
virtual Q_DECL_DEPRECATED Qgis::AnnotationItemEditOperationResult applyEdit (QgsAbstractAnnotationItemEditOperation *operation)
 Applies an edit operation to the item.
 
virtual QgsRectangle boundingBox (QgsRenderContext &context) const
 Returns the bounding box of the item's geographic location, in the parent layer's coordinate reference system.
 
QgsCalloutcallout () const
 Returns the item's callout renderer, responsible for drawing item callouts.
 
QgsGeometry calloutAnchor () const
 Returns the callout's anchor geometry.
 
bool enabled () const
 Returns true if the item is enabled and will be rendered in the layer.
 
virtual Q_DECL_DEPRECATED QList< QgsAnnotationItemNodenodes () const
 Returns the nodes for the item, used for editing the item.
 
QSizeF offsetFromCallout () const
 Returns the (optional) offset of the annotation item from the calloutAnchor().
 
Qgis::RenderUnit offsetFromCalloutUnit () const
 Returns the units for the offsetFromCallout().
 
QgsAnnotationItemoperator= (const QgsAnnotationItem &other)=delete
 
void setCallout (QgsCallout *callout)
 Sets the item's callout renderer, responsible for drawing item callouts.
 
void setCalloutAnchor (const QgsGeometry &anchor)
 Sets the callout's anchor geometry.
 
void setEnabled (bool enabled)
 Sets if the item will be rendered or not in the layer.
 
void setOffsetFromCallout (const QSizeF &offset)
 Sets the offset of the annotation item from the calloutAnchor().
 
void setOffsetFromCalloutUnit (Qgis::RenderUnit unit)
 Sets the unit for the offsetFromCallout().
 
void setSymbologyReferenceScale (double scale)
 Sets the annotation's symbology reference scale.
 
void setUseSymbologyReferenceScale (bool enabled)
 Sets whether the annotation item uses a symbology reference scale.
 
void setZIndex (int index)
 Sets the item's z index, which controls the order in which annotation items are rendered in the layer.
 
double symbologyReferenceScale () const
 Returns the annotation's symbology reference scale.
 
virtual Q_DECL_DEPRECATED QgsAnnotationItemEditOperationTransientResultstransientEditResults (QgsAbstractAnnotationItemEditOperation *operation)
 Retrieves the results of a transient (in progress) edit operation on the item.
 
bool useSymbologyReferenceScale () const
 Returns true if the annotation item uses a symbology reference scale.
 
int zIndex () const
 Returns the item's z index, which controls the order in which annotation items are rendered in the layer.
 

Static Public Member Functions

static QgsAnnotationLineItemcreate ()
 Creates a new linestring annotation item.
 

Additional Inherited Members

- Protected Member Functions inherited from QgsAnnotationItem
virtual void copyCommonProperties (const QgsAnnotationItem *other)
 Copies common properties from the base class from an other item.
 
virtual bool readCommonProperties (const QDomElement &element, const QgsReadWriteContext &context)
 Reads common properties from the base class from the given DOM element.
 
void renderCallout (QgsRenderContext &context, const QRectF &rect, double angle, QgsCallout::QgsCalloutContext &calloutContext, QgsFeedback *feedback)
 Renders the item's callout.
 
virtual bool writeCommonProperties (QDomElement &element, QDomDocument &document, const QgsReadWriteContext &context) const
 Writes common properties from the base class into an XML element.
 

Detailed Description

An annotation item which renders a line symbol along a line geometry.

Since
QGIS 3.16

Definition at line 33 of file qgsannotationlineitem.h.

Constructor & Destructor Documentation

◆ QgsAnnotationLineItem()

QgsAnnotationLineItem::QgsAnnotationLineItem ( QgsCurve curve)

Constructor for QgsAnnotationLineItem, with the specified curve.

Definition at line 27 of file qgsannotationlineitem.cpp.

◆ ~QgsAnnotationLineItem()

QgsAnnotationLineItem::~QgsAnnotationLineItem ( )
overridedefault

Member Function Documentation

◆ applyEditV2()

Qgis::AnnotationItemEditOperationResult QgsAnnotationLineItem::applyEditV2 ( QgsAbstractAnnotationItemEditOperation operation,
const QgsAnnotationItemEditContext context 
)
overridevirtual

Applies an edit operation to the item.

Since
QGIS 3.40

Reimplemented from QgsAnnotationItem.

Definition at line 97 of file qgsannotationlineitem.cpp.

◆ boundingBox()

QgsRectangle QgsAnnotationLineItem::boundingBox ( ) const
overridevirtual

Returns the bounding box of the item's geographic location, in the parent layer's coordinate reference system.

Implements QgsAnnotationItem.

Definition at line 198 of file qgsannotationlineitem.cpp.

◆ clone()

QgsAnnotationLineItem * QgsAnnotationLineItem::clone ( ) const
overridevirtual

Returns a clone of the item.

Ownership is transferred to the caller.

Implementations should include a call to copyCommonProperties() to copy the base class properties.

See also
copyCommonProperties()

Implements QgsAnnotationItem.

Definition at line 203 of file qgsannotationlineitem.cpp.

◆ create()

QgsAnnotationLineItem * QgsAnnotationLineItem::create ( )
static

Creates a new linestring annotation item.

Definition at line 177 of file qgsannotationlineitem.cpp.

◆ flags()

Qgis::AnnotationItemFlags QgsAnnotationLineItem::flags ( ) const
overridevirtual

Returns item flags.

Since
QGIS 3.22

Reimplemented from QgsAnnotationItem.

Definition at line 172 of file qgsannotationlineitem.cpp.

◆ geometry()

const QgsCurve * QgsAnnotationLineItem::geometry ( ) const
inline

Returns the geometry of the item.

The coordinate reference system for the line will be the parent layer's QgsAnnotationLayer::crs().

See also
setGeometry()

Definition at line 68 of file qgsannotationlineitem.h.

◆ nodesV2()

QList< QgsAnnotationItemNode > QgsAnnotationLineItem::nodesV2 ( const QgsAnnotationItemEditContext context) const
overridevirtual

Returns the nodes for the item, used for editing the item.

Since
QGIS 3.40

Reimplemented from QgsAnnotationItem.

Definition at line 86 of file qgsannotationlineitem.cpp.

◆ readXml()

bool QgsAnnotationLineItem::readXml ( const QDomElement &  element,
const QgsReadWriteContext context 
)
overridevirtual

Reads the item's state from the given DOM element.

Implementations should include a call to readCommonProperties() to read the base class properties.

See also
writeXml()
readCommonProperties()

Implements QgsAnnotationItem.

Definition at line 182 of file qgsannotationlineitem.cpp.

◆ render()

void QgsAnnotationLineItem::render ( QgsRenderContext context,
QgsFeedback feedback 
)
overridevirtual

Renders the item to the specified render context.

The feedback argument can be used to detect render cancellations during expensive render operations.

Implements QgsAnnotationItem.

Definition at line 42 of file qgsannotationlineitem.cpp.

◆ setGeometry()

void QgsAnnotationLineItem::setGeometry ( QgsCurve geometry)

Sets the geometry of the item.

Ownership of geometry is transferred.

The coordinate reference system for the line will be the parent layer's QgsAnnotationLayer::crs().

See also
geometry()

Definition at line 211 of file qgsannotationlineitem.cpp.

◆ setSymbol()

void QgsAnnotationLineItem::setSymbol ( QgsLineSymbol symbol)

Sets the symbol used to render the marker item.

The item takes ownership of the symbol.

See also
symbol()

Definition at line 218 of file qgsannotationlineitem.cpp.

◆ symbol()

const QgsLineSymbol * QgsAnnotationLineItem::symbol ( ) const

Returns the symbol used to render the item.

See also
setSymbol()

Definition at line 213 of file qgsannotationlineitem.cpp.

◆ transientEditResultsV2()

QgsAnnotationItemEditOperationTransientResults * QgsAnnotationLineItem::transientEditResultsV2 ( QgsAbstractAnnotationItemEditOperation operation,
const QgsAnnotationItemEditContext context 
)
overridevirtual

Retrieves the results of a transient (in progress) edit operation on the item.

Since
QGIS 3.40

Reimplemented from QgsAnnotationItem.

Definition at line 141 of file qgsannotationlineitem.cpp.

◆ type()

QString QgsAnnotationLineItem::type ( ) const
overridevirtual

Returns a unique (untranslated) string identifying the type of item.

Implements QgsAnnotationItem.

Definition at line 37 of file qgsannotationlineitem.cpp.

◆ writeXml()

bool QgsAnnotationLineItem::writeXml ( QDomElement &  element,
QDomDocument &  document,
const QgsReadWriteContext context 
) const
overridevirtual

Writes the item's state into an XML element.

Implementations should include a call to writeCommonProperties() to store the base class properties.

See also
readXml()
writeCommonProperties()

Implements QgsAnnotationItem.

Definition at line 77 of file qgsannotationlineitem.cpp.


The documentation for this class was generated from the following files: