QGIS API Documentation 3.41.0-Master (45a0abf3bec)
Loading...
Searching...
No Matches
qgsannotationlineitem.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsannotationlineitem.h
3 ----------------
4 begin : July 2020
5 copyright : (C) 2020 by Nyall Dawson
6 email : nyall dot dawson at gmail dot com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#ifndef QGSANNOTATIONLINEITEM_H
19#define QGSANNOTATIONLINEITEM_H
20
21#include "qgis_core.h"
22#include "qgis_sip.h"
23#include "qgsannotationitem.h"
24
25class QgsCurve;
26
33class CORE_EXPORT QgsAnnotationLineItem : public QgsAnnotationItem
34{
35 public:
36
42
43 QString type() const override;
44 void render( QgsRenderContext &context, QgsFeedback *feedback ) override;
45 bool writeXml( QDomElement &element, QDomDocument &document, const QgsReadWriteContext &context ) const override;
46 QList< QgsAnnotationItemNode > nodesV2( const QgsAnnotationItemEditContext &context ) const override;
49 Qgis::AnnotationItemFlags flags() const override;
50
54 static QgsAnnotationLineItem *create() SIP_FACTORY;
55
56 bool readXml( const QDomElement &element, const QgsReadWriteContext &context ) override;
57 QgsRectangle boundingBox() const override;
58
59 QgsAnnotationLineItem *clone() const override SIP_FACTORY;
60
68 const QgsCurve *geometry() const { return mCurve.get(); }
69
77 void setGeometry( QgsCurve *geometry SIP_TRANSFER );
78
84 const QgsLineSymbol *symbol() const;
85
93 void setSymbol( QgsLineSymbol *symbol SIP_TRANSFER );
94
95 private:
96
97 std::unique_ptr< QgsCurve > mCurve;
98 std::unique_ptr< QgsLineSymbol > mSymbol;
99
100#ifdef SIP_RUN
102#endif
103
104};
105
106#endif // QGSANNOTATIONLINEITEM_H
AnnotationItemEditOperationResult
Results from an edit operation on an annotation item.
Definition qgis.h:2351
QFlags< AnnotationItemFlag > AnnotationItemFlags
Annotation item flags.
Definition qgis.h:2302
Abstract base class for annotation item edit operations.
Encapsulates the context for an annotation item edit operation.
Encapsulates the transient results of an in-progress annotation edit operation.
Abstract base class for annotation items which are drawn with QgsAnnotationLayers.
virtual bool writeXml(QDomElement &element, QDomDocument &document, const QgsReadWriteContext &context) const =0
Writes the item's state into an XML element.
virtual QList< QgsAnnotationItemNode > nodesV2(const QgsAnnotationItemEditContext &context) const
Returns the nodes for the item, used for editing the item.
virtual QString type() const =0
Returns a unique (untranslated) string identifying the type of item.
virtual void render(QgsRenderContext &context, QgsFeedback *feedback)=0
Renders the item to the specified render context.
virtual QgsAnnotationItemEditOperationTransientResults * transientEditResultsV2(QgsAbstractAnnotationItemEditOperation *operation, const QgsAnnotationItemEditContext &context)
Retrieves the results of a transient (in progress) edit operation on the item.
virtual Qgis::AnnotationItemFlags flags() const
Returns item flags.
virtual Qgis::AnnotationItemEditOperationResult applyEditV2(QgsAbstractAnnotationItemEditOperation *operation, const QgsAnnotationItemEditContext &context)
Applies an edit operation to the item.
An annotation item which renders a line symbol along a line geometry.
~QgsAnnotationLineItem() override
Abstract base class for curved geometry type.
Definition qgscurve.h:35
Base class for feedback objects to be used for cancellation of something running in a worker thread.
Definition qgsfeedback.h:44
A line symbol type, for rendering LineString and MultiLineString geometries.
The class is used as a container of context for various read/write operations on other objects.
A rectangle specified with double values.
Contains information about the context of a rendering operation.
#define SIP_TRANSFER
Definition qgis_sip.h:36
#define SIP_FACTORY
Definition qgis_sip.h:76