QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
Public Member Functions | Static Public Member Functions | List of all members
QgsAnnotationPolygonItem Class Reference

An annotation item which renders a fill symbol for a polygon geometry. More...

#include <qgsannotationpolygonitem.h>

Inheritance diagram for QgsAnnotationPolygonItem:
Inheritance graph
[legend]

Public Member Functions

 QgsAnnotationPolygonItem (QgsCurvePolygon *polygon)
 Constructor for QgsAnnotationPolygonItem, with the specified polygon geometry. More...
 
 ~QgsAnnotationPolygonItem () 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...
 
QgsAnnotationPolygonItemclone () override
 Returns a clone of the item. More...
 
const QgsCurvePolygongeometry () const
 Returns the geometry of the item. More...
 
QList< QgsAnnotationItemNodenodes () 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 (QgsCurvePolygon *geometry)
 Sets the geometry of the item. More...
 
void setSymbol (QgsFillSymbol *symbol)
 Sets the symbol used to render the polygon item. More...
 
const QgsFillSymbolsymbol () const
 Returns the symbol used to render the item. More...
 
QgsAnnotationItemEditOperationTransientResultstransientEditResults (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 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 Qgis::AnnotationItemFlags flags () const
 Returns item flags. More...
 
QgsAnnotationItemoperator= (const QgsAnnotationItem &other)=delete
 QgsAnnotationItem cannot be copied. 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...
 
bool useSymbologyReferenceScale () const
 Returns true if the annotation item uses a symbology reference scale. 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 QgsAnnotationPolygonItemcreate ()
 Creates a new polygon 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...
 

Detailed Description

An annotation item which renders a fill symbol for a polygon geometry.

Since
QGIS 3.16

Definition at line 32 of file qgsannotationpolygonitem.h.

Constructor & Destructor Documentation

◆ QgsAnnotationPolygonItem()

QgsAnnotationPolygonItem::QgsAnnotationPolygonItem ( QgsCurvePolygon polygon)

Constructor for QgsAnnotationPolygonItem, with the specified polygon geometry.

Definition at line 26 of file qgsannotationpolygonitem.cpp.

◆ ~QgsAnnotationPolygonItem()

QgsAnnotationPolygonItem::~QgsAnnotationPolygonItem ( )
overridedefault

Member Function Documentation

◆ applyEdit()

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

Applies an edit operation to the item.

Since
QGIS 3.22

Reimplemented from QgsAnnotationItem.

Definition at line 125 of file qgsannotationpolygonitem.cpp.

◆ boundingBox()

QgsRectangle QgsAnnotationPolygonItem::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 228 of file qgsannotationpolygonitem.cpp.

◆ clone()

QgsAnnotationPolygonItem * QgsAnnotationPolygonItem::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 220 of file qgsannotationpolygonitem.cpp.

◆ create()

QgsAnnotationPolygonItem * QgsAnnotationPolygonItem::create ( )
static

Creates a new polygon annotation item.

Definition at line 200 of file qgsannotationpolygonitem.cpp.

◆ geometry()

const QgsCurvePolygon* QgsAnnotationPolygonItem::geometry ( ) const
inline

Returns the geometry of the item.

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

See also
setGeometry()

Definition at line 78 of file qgsannotationpolygonitem.h.

◆ nodes()

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

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

Since
QGIS 3.22

Reimplemented from QgsAnnotationItem.

Definition at line 98 of file qgsannotationpolygonitem.cpp.

◆ readXml()

bool QgsAnnotationPolygonItem::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 205 of file qgsannotationpolygonitem.cpp.

◆ render()

void QgsAnnotationPolygonItem::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 41 of file qgsannotationpolygonitem.cpp.

◆ setGeometry()

void QgsAnnotationPolygonItem::setGeometry ( QgsCurvePolygon geometry)
inline

Sets the geometry of the item.

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

See also
geometry()

Definition at line 87 of file qgsannotationpolygonitem.h.

◆ setSymbol()

void QgsAnnotationPolygonItem::setSymbol ( QgsFillSymbol symbol)

Sets the symbol used to render the polygon item.

The item takes ownership of the symbol.

See also
symbol()

Definition at line 238 of file qgsannotationpolygonitem.cpp.

◆ symbol()

const QgsFillSymbol * QgsAnnotationPolygonItem::symbol ( ) const

Returns the symbol used to render the item.

See also
setSymbol()

Definition at line 233 of file qgsannotationpolygonitem.cpp.

◆ transientEditResults()

QgsAnnotationItemEditOperationTransientResults * QgsAnnotationPolygonItem::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 169 of file qgsannotationpolygonitem.cpp.

◆ type()

QString QgsAnnotationPolygonItem::type ( ) const
overridevirtual

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

Implements QgsAnnotationItem.

Definition at line 36 of file qgsannotationpolygonitem.cpp.

◆ writeXml()

bool QgsAnnotationPolygonItem::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 89 of file qgsannotationpolygonitem.cpp.


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