QGIS API Documentation 3.41.0-Master (fda2aa46e9a)
Loading...
Searching...
No Matches
qgsannotationitemeditoperation.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgsannotationitemeditoperation.cpp
3 ----------------
4 copyright : (C) 2021 by Nyall Dawson
5 email : nyall dot dawson at gmail dot com
6 ***************************************************************************/
7
8/***************************************************************************
9 * *
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. *
14 * *
15 ***************************************************************************/
16
18
19//
20// QgsAnnotationItemEditContext
21//
22
24{
25 return mCurrentItemBounds;
26}
27
29{
30 mCurrentItemBounds = bounds;
31}
32
34{
35 return mRenderContext;
36}
37
39{
40 mRenderContext = context;
41}
42
43
44//
45// QgsAbstractAnnotationItemEditOperation
46//
48 : mItemId( itemId )
49{
50
51}
52
54
55
56//
57// QgsAnnotationItemEditOperationMoveNode
58//
60 double translatePixelsX, double translatePixelsY )
62 , mNodeId( nodeId )
63 , mBefore( before )
64 , mAfter( after )
65 , mTranslatePixelsX( translatePixelsX )
66 , mTranslatePixelsY( translatePixelsY )
67{
68
69}
70
75
76
77//
78// QgsAnnotationItemEditOperationDeleteNode
79//
80
83 , mNodeId( nodeId )
84 , mBefore( before )
85{
86
87}
88
93
94//
95// QgsAnnotationItemEditOperationTranslateItem
96//
97
98QgsAnnotationItemEditOperationTranslateItem::QgsAnnotationItemEditOperationTranslateItem( const QString &itemId, double translateX, double translateY, double translatePixelsX, double translatePixelsY )
100 , mTranslateX( translateX )
101 , mTranslateY( translateY )
102 , mTranslatePixelsX( translatePixelsX )
103 , mTranslatePixelsY( translatePixelsY )
104{
105
106}
107
112
113
114//
115// QgsAnnotationItemEditOperationAddNode
116//
117
120 , mPoint( point )
121{
122
123}
124
Abstract base class for annotation item edit operations.
@ TranslateItem
Translate (move) an item.
QgsAbstractAnnotationItemEditOperation(const QString &itemId)
Constructor for QgsAbstractAnnotationItemEditOperation, for the specified item id.
void setCurrentItemBounds(const QgsRectangle &bounds)
Sets the current rendered bounds of the item, in the annotation layer's CRS.
QgsRectangle currentItemBounds() const
Returns the current rendered bounds of the item, in the annotation layer's CRS.
QgsRenderContext renderContext() const
Returns the render context associated with the edit operation.
void setRenderContext(const QgsRenderContext &context)
Sets the render context associated with the edit operation.
QgsAnnotationItemEditOperationAddNode(const QString &itemId, const QgsPoint &point)
Constructor for QgsAnnotationItemEditOperationAddNode at the specified point.
Type type() const override
Returns the operation type.
QgsAnnotationItemEditOperationDeleteNode(const QString &itemId, QgsVertexId nodeId, const QgsPoint &before)
Constructor for QgsAnnotationItemEditOperationDeleteNode, where the node with the specified id and pr...
Type type() const override
Returns the operation type.
Type type() const override
Returns the operation type.
QgsAnnotationItemEditOperationMoveNode(const QString &itemId, QgsVertexId nodeId, const QgsPoint &before, const QgsPoint &after, double translatePixelsX=0, double translatePixelsY=0)
Constructor for QgsAnnotationItemEditOperationMoveNode, where the node with the specified id moves fr...
Type type() const override
Returns the operation type.
QgsAnnotationItemEditOperationTranslateItem(const QString &itemId, double translateX, double translateY, double translatePixelsX=0, double translatePixelsY=0)
Constructor for QgsAnnotationItemEditOperationTranslateItem, where the node with the specified id and...
Point geometry type, with support for z-dimension and m-values.
Definition qgspoint.h:49
A rectangle specified with double values.
Contains information about the context of a rendering operation.
Utility class for identifying a unique vertex within a geometry.
Definition qgsvertexid.h:30