QGIS API Documentation 3.34.0-Prizren (ffbdd678812)
|
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. | |
~QgsAnnotationPolygonItem () 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. | |
QgsAnnotationPolygonItem * | clone () override |
Returns a clone of the item. | |
const QgsCurvePolygon * | geometry () const |
Returns the geometry of the item. | |
QList< QgsAnnotationItemNode > | nodes () 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 (QgsCurvePolygon *geometry) |
Sets the geometry of the item. | |
void | setSymbol (QgsFillSymbol *symbol) |
Sets the symbol used to render the polygon item. | |
const QgsFillSymbol * | symbol () const |
Returns the symbol used to render the item. | |
QgsAnnotationItemEditOperationTransientResults * | transientEditResults (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 |
virtual QgsRectangle | boundingBox (QgsRenderContext &context) const |
Returns the bounding box of the item's geographic location, in the parent layer's coordinate reference system. | |
virtual Qgis::AnnotationItemFlags | flags () const |
Returns item flags. | |
QgsAnnotationItem & | operator= (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 QgsAnnotationPolygonItem * | create () |
Creates a new polygon 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. | |
An annotation item which renders a fill symbol for a polygon geometry.
Definition at line 33 of file qgsannotationpolygonitem.h.
QgsAnnotationPolygonItem::QgsAnnotationPolygonItem | ( | QgsCurvePolygon * | polygon | ) |
Constructor for QgsAnnotationPolygonItem, with the specified polygon geometry.
Definition at line 28 of file qgsannotationpolygonitem.cpp.
|
overridedefault |
|
overridevirtual |
Applies an edit operation to the item.
Reimplemented from QgsAnnotationItem.
Definition at line 127 of file qgsannotationpolygonitem.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 230 of file qgsannotationpolygonitem.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 222 of file qgsannotationpolygonitem.cpp.
|
static |
Creates a new polygon annotation item.
Definition at line 202 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 66 of file qgsannotationpolygonitem.h.
|
overridevirtual |
Returns the nodes for the item, used for editing the item.
Reimplemented from QgsAnnotationItem.
Definition at line 100 of file qgsannotationpolygonitem.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 207 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 43 of file qgsannotationpolygonitem.cpp.
void QgsAnnotationPolygonItem::setGeometry | ( | QgsCurvePolygon * | geometry | ) |
Sets the geometry of the item.
The coordinate reference system for the polygon will be the parent layer's QgsAnnotationLayer::crs().
Definition at line 235 of file qgsannotationpolygonitem.cpp.
void QgsAnnotationPolygonItem::setSymbol | ( | QgsFillSymbol * | symbol | ) |
Sets the symbol used to render the polygon item.
The item takes ownership of the symbol.
Definition at line 245 of file qgsannotationpolygonitem.cpp.
const QgsFillSymbol * QgsAnnotationPolygonItem::symbol | ( | ) | const |
Returns the symbol used to render the item.
Definition at line 240 of file qgsannotationpolygonitem.cpp.
|
overridevirtual |
Retrieves the results of a transient (in progress) edit operation on the item.
Reimplemented from QgsAnnotationItem.
Definition at line 171 of file qgsannotationpolygonitem.cpp.
|
overridevirtual |
Returns a unique (untranslated) string identifying the type of item.
Implements QgsAnnotationItem.
Definition at line 38 of file qgsannotationpolygonitem.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 91 of file qgsannotationpolygonitem.cpp.