QGIS/python/core/auto_generated/layout/qgslayoutitemnodeitem.sip.in

197 lines
5.5 KiB
Plaintext
Raw Normal View History

/************************************************************************
* This file has been generated automatically from *
* *
* src/core/layout/qgslayoutitemnodeitem.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsLayoutNodesItem: QgsLayoutItem
{
%Docstring
2017-12-15 10:36:55 -04:00
An abstract layout item that provides generic methods for node based
shapes such as polygon or polylines.
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgslayoutitemnodeitem.h"
%End
public:
2017-10-17 17:39:55 +10:00
void setNodes( const QPolygonF &nodes );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the ``nodes`` the shape consists of.
.. seealso:: :py:func:`nodes`
2017-10-17 17:39:55 +10:00
%End
QPolygonF nodes() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the nodes the shape consists of.
.. seealso:: :py:func:`setNodes`
2017-10-17 17:39:55 +10:00
%End
bool addNode( QPointF point, bool checkArea = true, double radius = 10 );
%Docstring
2017-12-15 10:36:55 -04:00
Add a node in current shape.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param point: is the location of the new node (in scene coordinates)
:param checkArea: is a flag to indicate if there's a space constraint.
:param radius: is the space contraint and is used only if checkArea is
true. Typically, if this flag is true, the new node has to be nearer
than radius to the shape to be added.
%End
void setDisplayNodes( bool display = true );
%Docstring
2017-12-15 10:36:55 -04:00
Set whether the item's nodes should be displayed.
%End
bool moveNode( int index, QPointF node );
%Docstring
2017-12-15 10:36:55 -04:00
Moves a node to a new position.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param index: the index of the node to move
:param node: is the new position in scene coordinate
%End
int nodeAtPosition( QPointF point, bool searchInRadius = true, double radius = 10 ) const;
%Docstring
2017-12-15 10:36:55 -04:00
Search for the nearest node in the shape within a maximal area. Returns the
index of the nearest node or -1 if no node was found.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param point: is the location to search for nodes from (in scene coordinates)
:param searchInRadius: is a flag to indicate if the area of research is
limited in space.
2017-12-15 10:36:55 -04:00
:param radius: is only used if searchInRadius is true
%End
bool nodePosition( int index, QPointF &position ) const;
%Docstring
2017-12-15 10:36:55 -04:00
Gets the position of a node in scene coordinates.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param index: of the node
:param position: the position of the node
:return: true if the index is valid and the position is set, false otherwise
%End
bool removeNode( int index );
%Docstring
2017-12-15 10:36:55 -04:00
Remove a node with specified ``index`` from the shape.
%End
int nodesSize() const;
%Docstring
Returns the number of nodes in the shape.
%End
bool setSelectedNode( int index );
%Docstring
2017-12-15 10:36:55 -04:00
Selects a node by ``index``.
%End
int selectedNode() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the currently selected node, or -1 if no node is selected.
%End
void deselectNode();
%Docstring
2017-12-15 10:36:55 -04:00
Deselects any selected nodes.
%End
virtual QRectF boundingRect() const;
virtual double estimatedFrameBleed() const;
protected:
QgsLayoutNodesItem( QgsLayout *layout );
%Docstring
2017-12-15 10:36:55 -04:00
Constructor for QgsLayoutNodesItem, attached to the specified ``layout``.
%End
QgsLayoutNodesItem( const QPolygonF &polygon, QgsLayout *layout );
%Docstring
2017-12-15 10:36:55 -04:00
Constructor for a QgsLayoutNodesItem with the given ``polygon`` nodes, attached to the specified ``layout``.
%End
virtual void draw( QgsLayoutItemRenderContext &context );
2017-10-24 21:59:50 +10:00
virtual bool writePropertiesToElement( QDomElement &element, QDomDocument &document, const QgsReadWriteContext &context ) const;
virtual bool readPropertiesFromElement( const QDomElement &element, const QDomDocument &document, const QgsReadWriteContext &context );
virtual bool _addNode( int nodeIndex, QPointF newNode, double radius ) = 0;
%Docstring
Method called in addNode.
%End
virtual bool _removeNode( int nodeIndex ) = 0;
%Docstring
Method called in removeNode.
%End
virtual void _draw( QgsLayoutItemRenderContext &context, const QStyleOptionGraphicsItem *itemStyle = 0 ) = 0;
%Docstring
Method called in paint.
%End
virtual void _readXmlStyle( const QDomElement &elmt, const QgsReadWriteContext &context ) = 0;
%Docstring
Method called in readXml.
%End
virtual void _writeXmlStyle( QDomDocument &doc, QDomElement &elmt, const QgsReadWriteContext &context ) const = 0;
%Docstring
Method called in writeXml.
%End
void rescaleToFitBoundingBox();
%Docstring
2017-12-15 10:36:55 -04:00
Rescale the current shape according to the item's bounding box. Useful when
the shape is resized thanks to the rubber band.
%End
double computeDistance( QPointF pt1, QPointF pt2 ) const;
%Docstring
Compute an euclidian distance between 2 nodes.
%End
void updateSceneRect();
%Docstring
Update the current scene rectangle for this item.
%End
protected slots:
virtual void updateBoundingRect();
%Docstring
2017-12-15 10:36:55 -04:00
Called when the bounding rect of the item should recalculated. Subclasses should update
currentRectangle in their implementations.
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/layout/qgslayoutitemnodeitem.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/