QGIS API Documentation
3.18.1-Zürich (202f1bf7e5)
|
An annotation item which renders a fill symbol for a polygon geometry. More...
#include <qgsannotationpolygonitem.h>
Public Member Functions | |
QgsAnnotationPolygonItem (QgsCurvePolygon *polygon) | |
Constructor for QgsAnnotationPolygonItem, with the specified polygon geometry. More... | |
~QgsAnnotationPolygonItem () override | |
QgsRectangle | boundingBox () const override |
Returns the bounding box of the item's geographic location, in the parent layer's coordinate reference system. More... | |
QgsAnnotationPolygonItem * | clone () override |
Returns a clone of the item. More... | |
const QgsCurvePolygon * | geometry () const |
Returns the geometry of 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 QgsFillSymbol * | symbol () const |
Returns the symbol used to render 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 |
QgsAnnotationItem & | operator= (const QgsAnnotationItem &other)=delete |
QgsAnnotationItem cannot be copied. 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... | |
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 QgsAnnotationPolygonItem * | create () |
Creates a new polygon annotation item. More... | |
An annotation item which renders a fill symbol for a polygon geometry.
Definition at line 32 of file qgsannotationpolygonitem.h.
QgsAnnotationPolygonItem::QgsAnnotationPolygonItem | ( | QgsCurvePolygon * | polygon | ) |
Constructor for QgsAnnotationPolygonItem, with the specified polygon geometry.
Definition at line 23 of file qgsannotationpolygonitem.cpp.
|
overridedefault |
|
overridevirtual |
Returns the bounding box of the item's geographic location, in the parent layer's coordinate reference system.
Implements QgsAnnotationItem.
Definition at line 125 of file qgsannotationpolygonitem.cpp.
|
overridevirtual |
Returns a clone of the item.
Ownership is transferred to the caller.
Implements QgsAnnotationItem.
Definition at line 117 of file qgsannotationpolygonitem.cpp.
|
static |
Creates a new polygon annotation item.
Definition at line 96 of file qgsannotationpolygonitem.cpp.
|
inline |
Returns the geometry of the item.
The coordinate reference system for the polygon will be the parent layer's QgsAnnotationLayer::crs().
Definition at line 62 of file qgsannotationpolygonitem.h.
|
overridevirtual |
Reads the item's state from the given DOM element.
Implements QgsAnnotationItem.
Definition at line 101 of file qgsannotationpolygonitem.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 38 of file qgsannotationpolygonitem.cpp.
|
inline |
Sets the geometry of the item.
The coordinate reference system for the polygon will be the parent layer's QgsAnnotationLayer::crs().
Definition at line 71 of file qgsannotationpolygonitem.h.
void QgsAnnotationPolygonItem::setSymbol | ( | QgsFillSymbol * | symbol | ) |
Sets the symbol used to render the polygon item.
The item takes ownership of the symbol.
Definition at line 135 of file qgsannotationpolygonitem.cpp.
const QgsFillSymbol * QgsAnnotationPolygonItem::symbol | ( | ) | const |
Returns the symbol used to render the item.
Definition at line 130 of file qgsannotationpolygonitem.cpp.
|
overridevirtual |
Returns a unique (untranslated) string identifying the type of item.
Implements QgsAnnotationItem.
Definition at line 33 of file qgsannotationpolygonitem.cpp.
|
overridevirtual |
Writes the item's state into an XML element.
Implements QgsAnnotationItem.
Definition at line 86 of file qgsannotationpolygonitem.cpp.