17 #ifndef QGSLAYOUTITEMNODEITEM_H
18 #define QGSLAYOUTITEMNODEITEM_H
20 #include "qgis_core.h"
39 void setNodes(
const QPolygonF &nodes );
45 QPolygonF nodes()
const {
return mPolygon; }
55 bool addNode( QPointF point,
bool checkArea =
true,
double radius = 10 );
60 void setDisplayNodes(
bool display =
true ) { mDrawNodes = display; }
67 bool moveNode(
int index, QPointF node );
77 int nodeAtPosition( QPointF point,
bool searchInRadius =
true,
double radius = 10 )
const;
85 bool nodePosition(
int index, QPointF &position )
const;
90 bool removeNode(
int index );
93 int nodesSize()
const {
return mPolygon.size(); }
98 bool setSelectedNode(
int index );
103 int selectedNode()
const {
return mSelectedNode; }
108 void deselectNode() { mSelectedNode = -1; }
111 QRectF boundingRect()
const override;
138 double mMaxSymbolBleed = 0.0;
141 virtual bool _addNode(
int nodeIndex, QPointF newNode,
double radius ) = 0;
144 virtual bool _removeNode(
int nodeIndex ) = 0;
153 virtual void _writeXmlStyle( QDomDocument &doc, QDomElement &elmt,
const QgsReadWriteContext &context )
const = 0;
159 void rescaleToFitBoundingBox();
162 double computeDistance( QPointF pt1, QPointF pt2 )
const;
165 void updateSceneRect();
168 QRectF mCurrentRectangle;
176 virtual void updateBoundingRect();
183 int mSelectedNode = -1;
188 bool mDrawNodes =
false;
196 #endif // QGSLAYOUTITEMNODEITEM_H