17 #ifndef QGSCOMPOSERNODESITEM_H 18 #define QGSCOMPOSERNODESITEM_H 58 bool addNode(
const QPointF &pt,
const bool checkArea =
true,
const double radius = 10 );
81 int nodeAtPosition(
QPointF node,
const bool searchInRadius =
true,
const double radius = 10 );
88 bool nodePosition(
const int index,
QPointF &position );
99 bool removeNode(
const int index );
107 bool setSelectedNode(
const int index );
130 virtual bool _addNode(
const int nodeIndex,
const QPointF &newNode,
const double radius ) = 0;
133 virtual bool _removeNode(
const int nodeIndex ) = 0;
136 virtual void _draw(
QPainter *painter ) = 0;
139 virtual void _readXMLStyle(
const QDomElement &elmt ) = 0;
146 void rescaleToFitBoundingBox();
149 double computeDistance(
const QPointF &pt1,
const QPointF &pt2 )
const;
152 void updateSceneRect();
166 void drawNodes(
QPainter *painter )
const;
167 void drawSelectedNode(
QPainter *painter )
const;
170 #endif // QGSCOMPOSERNODESITEM_H int selectedNode()
Returns the currently selected node.
An abstract composer item that provides generic methods for nodes based shapes such as polygon or pol...
QPolygonF mPolygon
Storage meaning for shape's nodes.
A item that forms part of a map composition.
virtual bool writeXML(QDomElement &elem, QDomDocument &doc) const
Stores item state in DOM element.
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
Graphics scene for map printing.
virtual bool readXML(const QDomElement &itemElem, const QDomDocument &doc)
Sets item state from DOM element.
int nodesSize()
Returns the number of nodes in the shape.
void setDisplayNodes(const bool display=true)
Set a tag to indicate if we want to draw or not the shape's nodes.
void unselectNode()
Unselect a node.