QGIS API Documentation 3.34.0-Prizren (ffbdd678812)
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
QgsAnnotationMarkerItem Class Reference

An annotation item which renders a marker symbol at a point location. More...

#include <qgsannotationmarkeritem.h>

Inheritance diagram for QgsAnnotationMarkerItem:
Inheritance graph
[legend]

Public Member Functions

 QgsAnnotationMarkerItem (const QgsPoint &point)
 Constructor for QgsAnnotationMarkerItem, at the specified point.
 
 ~QgsAnnotationMarkerItem () override
 
Qgis::AnnotationItemEditOperationResult applyEdit (QgsAbstractAnnotationItemEditOperation *operation) 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.
 
QgsRectangle boundingBox (QgsRenderContext &context) const override
 Returns the bounding box of the item's geographic location, in the parent layer's coordinate reference system.
 
QgsAnnotationMarkerItemclone () override
 Returns a clone of the item.
 
Qgis::AnnotationItemFlags flags () const override
 Returns item flags.
 
QgsPointXY geometry () const
 Returns the point geometry of the marker.
 
QList< QgsAnnotationItemNodenodes () 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 (const QgsPoint &geometry)
 Sets the point geometry location of the marker.
 
void setSymbol (QgsMarkerSymbol *symbol)
 Sets the symbol used to render the marker item.
 
const QgsMarkerSymbolsymbol () const
 Returns the symbol used to render the marker item.
 
QgsAnnotationItemEditOperationTransientResultstransientEditResults (QgsAbstractAnnotationItemEditOperation *operation) 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 ()=default
 Constructor for an annotation item.
 
 QgsAnnotationItem (const QgsAnnotationItem &other)=delete
 QgsAnnotationItem cannot be copied.
 
virtual ~QgsAnnotationItem ()=default
 
QgsAnnotationItemoperator= (const QgsAnnotationItem &other)=delete
 QgsAnnotationItem cannot be copied.
 
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.
 
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 QgsAnnotationMarkerItemcreate ()
 Creates a new marker annotation item.
 

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.
 
bool readCommonProperties (const QDomElement &element, const QgsReadWriteContext &context)
 Reads common properties from the base class from the given DOM element.
 
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 marker symbol at a point location.

Since
QGIS 3.16

Definition at line 32 of file qgsannotationmarkeritem.h.

Constructor & Destructor Documentation

◆ QgsAnnotationMarkerItem()

QgsAnnotationMarkerItem::QgsAnnotationMarkerItem ( const QgsPoint point)

Constructor for QgsAnnotationMarkerItem, at the specified point.

Definition at line 25 of file qgsannotationmarkeritem.cpp.

◆ ~QgsAnnotationMarkerItem()

QgsAnnotationMarkerItem::~QgsAnnotationMarkerItem ( )
overridedefault

Member Function Documentation

◆ applyEdit()

Qgis::AnnotationItemEditOperationResult QgsAnnotationMarkerItem::applyEdit ( QgsAbstractAnnotationItemEditOperation operation)
overridevirtual

Applies an edit operation to the item.

Since
QGIS 3.22

Reimplemented from QgsAnnotationItem.

Definition at line 83 of file qgsannotationmarkeritem.cpp.

◆ boundingBox() [1/2]

QgsRectangle QgsAnnotationMarkerItem::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 164 of file qgsannotationmarkeritem.cpp.

◆ boundingBox() [2/2]

QgsRectangle QgsAnnotationMarkerItem::boundingBox ( QgsRenderContext context) const
overridevirtual

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

Reimplemented from QgsAnnotationItem.

Definition at line 169 of file qgsannotationmarkeritem.cpp.

◆ clone()

QgsAnnotationMarkerItem * QgsAnnotationMarkerItem::clone ( )
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 156 of file qgsannotationmarkeritem.cpp.

◆ create()

QgsAnnotationMarkerItem * QgsAnnotationMarkerItem::create ( )
static

Creates a new marker annotation item.

Definition at line 137 of file qgsannotationmarkeritem.cpp.

◆ flags()

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

Returns item flags.

Since
QGIS 3.22

Reimplemented from QgsAnnotationItem.

Definition at line 72 of file qgsannotationmarkeritem.cpp.

◆ geometry()

QgsPointXY QgsAnnotationMarkerItem::geometry ( ) const
inline

Returns the point geometry of the marker.

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

See also
setGeometry()

Definition at line 67 of file qgsannotationmarkeritem.h.

◆ nodes()

QList< QgsAnnotationItemNode > QgsAnnotationMarkerItem::nodes ( ) const
overridevirtual

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

Since
QGIS 3.22

Reimplemented from QgsAnnotationItem.

Definition at line 78 of file qgsannotationmarkeritem.cpp.

◆ readXml()

bool QgsAnnotationMarkerItem::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 142 of file qgsannotationmarkeritem.cpp.

◆ render()

void QgsAnnotationMarkerItem::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 40 of file qgsannotationmarkeritem.cpp.

◆ setGeometry()

void QgsAnnotationMarkerItem::setGeometry ( const QgsPoint geometry)
inline

Sets the point geometry location of the marker.

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

See also
geometry()

Definition at line 76 of file qgsannotationmarkeritem.h.

◆ setSymbol()

void QgsAnnotationMarkerItem::setSymbol ( QgsMarkerSymbol symbol)

Sets the symbol used to render the marker item.

The item takes ownership of the symbol.

See also
symbol()

Definition at line 203 of file qgsannotationmarkeritem.cpp.

◆ symbol()

const QgsMarkerSymbol * QgsAnnotationMarkerItem::symbol ( ) const

Returns the symbol used to render the marker item.

See also
setSymbol()

Definition at line 198 of file qgsannotationmarkeritem.cpp.

◆ transientEditResults()

QgsAnnotationItemEditOperationTransientResults * QgsAnnotationMarkerItem::transientEditResults ( QgsAbstractAnnotationItemEditOperation operation)
overridevirtual

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

Since
QGIS 3.22

Reimplemented from QgsAnnotationItem.

Definition at line 114 of file qgsannotationmarkeritem.cpp.

◆ type()

QString QgsAnnotationMarkerItem::type ( ) const
overridevirtual

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

Implements QgsAnnotationItem.

Definition at line 35 of file qgsannotationmarkeritem.cpp.

◆ writeXml()

bool QgsAnnotationMarkerItem::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 61 of file qgsannotationmarkeritem.cpp.


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