QGIS API Documentation 3.28.0-Firenze (ed3ad0430f)
|
An annotation item which renders a line symbol along a line geometry. More...
#include <qgsannotationlineitem.h>
Public Member Functions | |
QgsAnnotationLineItem (QgsCurve *curve) | |
Constructor for QgsAnnotationLineItem, with the specified linestring. More... | |
~QgsAnnotationLineItem () override | |
Qgis::AnnotationItemEditOperationResult | applyEdit (QgsAbstractAnnotationItemEditOperation *operation) override |
Applies an edit operation to the item. More... | |
QgsRectangle | boundingBox () const override |
Returns the bounding box of the item's geographic location, in the parent layer's coordinate reference system. More... | |
QgsAnnotationLineItem * | clone () override |
Returns a clone of the item. More... | |
const QgsCurve * | geometry () const |
Returns the geometry of the item. More... | |
QList< QgsAnnotationItemNode > | nodes () const override |
Returns the nodes for the item, used for editing the item. More... | |
bool | readXml (const QDomElement &element, const QgsReadWriteContext &context) override |
Reads the item's state from the given DOM element. More... | |
void | render (QgsRenderContext &context, QgsFeedback *feedback) override |
Renders the item to the specified render context. More... | |
void | setGeometry (QgsCurve *geometry) |
Sets the geometry of the item. More... | |
void | setSymbol (QgsLineSymbol *symbol) |
Sets the symbol used to render the marker item. More... | |
const QgsLineSymbol * | symbol () const |
Returns the symbol used to render the item. More... | |
QgsAnnotationItemEditOperationTransientResults * | transientEditResults (QgsAbstractAnnotationItemEditOperation *operation) override |
Retrieves the results of a transient (in progress) edit operation on the item. More... | |
QString | type () const override |
Returns a unique (untranslated) string identifying the type of item. More... | |
bool | writeXml (QDomElement &element, QDomDocument &document, const QgsReadWriteContext &context) const override |
Writes the item's state into an XML element. More... | |
Public Member Functions inherited from QgsAnnotationItem | |
QgsAnnotationItem ()=default | |
Constructor for an annotation item. More... | |
QgsAnnotationItem (const QgsAnnotationItem &other)=delete | |
QgsAnnotationItem cannot be copied. More... | |
virtual | ~QgsAnnotationItem ()=default |
virtual Qgis::AnnotationItemEditOperationResult | applyEdit (QgsAbstractAnnotationItemEditOperation *operation) |
Applies an edit operation to the item. More... | |
virtual QgsRectangle | boundingBox () const =0 |
Returns the bounding box of the item's geographic location, in the parent layer's coordinate reference system. More... | |
virtual QgsRectangle | boundingBox (QgsRenderContext &context) const |
Returns the bounding box of the item's geographic location, in the parent layer's coordinate reference system. More... | |
virtual QgsAnnotationItem * | clone ()=0 |
Returns a clone of the item. More... | |
virtual Qgis::AnnotationItemFlags | flags () const |
Returns item flags. More... | |
virtual QList< QgsAnnotationItemNode > | nodes () const |
Returns the nodes for the item, used for editing the item. More... | |
QgsAnnotationItem & | operator= (const QgsAnnotationItem &other)=delete |
QgsAnnotationItem cannot be copied. More... | |
virtual bool | readXml (const QDomElement &element, const QgsReadWriteContext &context)=0 |
Reads the item's state from the given DOM element. More... | |
virtual void | render (QgsRenderContext &context, QgsFeedback *feedback)=0 |
Renders the item to the specified render context. More... | |
void | setSymbologyReferenceScale (double scale) |
Sets the annotation's symbology reference scale. More... | |
void | setUseSymbologyReferenceScale (bool enabled) |
Sets whether the annotation item uses a symbology reference scale. More... | |
void | setZIndex (int index) |
Sets the item's z index, which controls the order in which annotation items are rendered in the layer. More... | |
double | symbologyReferenceScale () const |
Returns the annotation's symbology reference scale. More... | |
virtual QgsAnnotationItemEditOperationTransientResults * | transientEditResults (QgsAbstractAnnotationItemEditOperation *operation) |
Retrieves the results of a transient (in progress) edit operation on the item. More... | |
virtual QString | type () const =0 |
Returns a unique (untranslated) string identifying the type of item. More... | |
bool | useSymbologyReferenceScale () const |
Returns true if the annotation item uses a symbology reference scale. More... | |
virtual bool | writeXml (QDomElement &element, QDomDocument &document, const QgsReadWriteContext &context) const =0 |
Writes the item's state into an XML element. More... | |
int | zIndex () const |
Returns the item's z index, which controls the order in which annotation items are rendered in the layer. More... | |
Static Public Member Functions | |
static QgsAnnotationLineItem * | create () |
Creates a new linestring annotation item. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from QgsAnnotationItem | |
void | copyCommonProperties (const QgsAnnotationItem *other) |
Copies common properties from the base class from an other item. More... | |
bool | readCommonProperties (const QDomElement &element, const QgsReadWriteContext &context) |
Reads common properties from the base class from the given DOM element. More... | |
bool | writeCommonProperties (QDomElement &element, QDomDocument &document, const QgsReadWriteContext &context) const |
Writes common properties from the base class into an XML element. More... | |
An annotation item which renders a line symbol along a line geometry.
Definition at line 33 of file qgsannotationlineitem.h.
QgsAnnotationLineItem::QgsAnnotationLineItem | ( | QgsCurve * | curve | ) |
Constructor for QgsAnnotationLineItem, with the specified linestring.
Definition at line 25 of file qgsannotationlineitem.cpp.
|
overridedefault |
|
overridevirtual |
Applies an edit operation to the item.
Reimplemented from QgsAnnotationItem.
Definition at line 95 of file qgsannotationlineitem.cpp.
|
overridevirtual |
Returns the bounding box of the item's geographic location, in the parent layer's coordinate reference system.
Implements QgsAnnotationItem.
Definition at line 191 of file qgsannotationlineitem.cpp.
|
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.
Implements QgsAnnotationItem.
Definition at line 196 of file qgsannotationlineitem.cpp.
|
static |
Creates a new linestring annotation item.
Definition at line 170 of file qgsannotationlineitem.cpp.
|
inline |
Returns the geometry of the item.
The coordinate reference system for the line will be the parent layer's QgsAnnotationLayer::crs().
Definition at line 67 of file qgsannotationlineitem.h.
|
overridevirtual |
Returns the nodes for the item, used for editing the item.
Reimplemented from QgsAnnotationItem.
Definition at line 84 of file qgsannotationlineitem.cpp.
|
overridevirtual |
Reads the item's state from the given DOM element.
Implementations should include a call to readCommonProperties() to read the base class properties.
Implements QgsAnnotationItem.
Definition at line 175 of file qgsannotationlineitem.cpp.
|
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 40 of file qgsannotationlineitem.cpp.
|
inline |
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().
Definition at line 76 of file qgsannotationlineitem.h.
void QgsAnnotationLineItem::setSymbol | ( | QgsLineSymbol * | symbol | ) |
Sets the symbol used to render the marker item.
The item takes ownership of the symbol.
Definition at line 209 of file qgsannotationlineitem.cpp.
const QgsLineSymbol * QgsAnnotationLineItem::symbol | ( | ) | const |
Returns the symbol used to render the item.
Definition at line 204 of file qgsannotationlineitem.cpp.
|
overridevirtual |
Retrieves the results of a transient (in progress) edit operation on the item.
Reimplemented from QgsAnnotationItem.
Definition at line 139 of file qgsannotationlineitem.cpp.
|
overridevirtual |
Returns a unique (untranslated) string identifying the type of item.
Implements QgsAnnotationItem.
Definition at line 35 of file qgsannotationlineitem.cpp.
|
overridevirtual |
Writes the item's state into an XML element.
Implementations should include a call to writeCommonProperties() to store the base class properties.
Implements QgsAnnotationItem.
Definition at line 75 of file qgsannotationlineitem.cpp.