QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
qgscomposerpolygon.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgscomposerpolygon.h
3  begin : March 2016
4  copyright : (C) 2016 Paul Blottiere, Oslandia
5  email : paul dot blottiere at oslandia 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 
17 #ifndef QGSCOMPOSERPOLYGON_H
18 #define QGSCOMPOSERPOLYGON_H
19 
20 #include "qgscomposernodesitem.h"
21 #include <QBrush>
22 #include <QPen>
23 
24 class QgsFillSymbolV2;
25 
31 class CORE_EXPORT QgsComposerPolygon: public QgsComposerNodesItem
32 {
33  Q_OBJECT
34 
35  public:
36 
41 
47 
50 
52  virtual QString displayName() const override;
53 
55  QgsFillSymbolV2* polygonStyleSymbol() { return mPolygonStyleSymbol.data(); }
56 
58  void setPolygonStyleSymbol( QgsFillSymbolV2* symbol );
59 
61  virtual int type() const override { return ComposerPolygon; }
62 
63  protected:
64 
67 
70  bool _addNode( const int indexPoint, const QPointF &newPoint, const double radius ) override;
71 
72  bool _removeNode( const int nodeIndex ) override;
73 
75  void _draw( QPainter *painter ) override;
76 
78  void _readXMLStyle( const QDomElement &elmt ) override;
79 
81  void _writeXMLStyle( QDomDocument &doc, QDomElement &elmt ) const override;
82 
84  void createDefaultPolygonStyleSymbol();
85 };
86 
87 #endif // QGSCOMPOSERPOLYGON_H
An abstract composer item that provides generic methods for nodes based shapes such as polygon or pol...
virtual QString displayName() const
Get item display name.
virtual void _readXMLStyle(const QDomElement &elmt)=0
Method called in readXML.
virtual void _writeXMLStyle(QDomDocument &doc, QDomElement &elmt) const =0
Method called in writeXML.
virtual bool _removeNode(const int nodeIndex)=0
Method called in removeNode.
virtual int type() const override
Return correct graphics item type.
virtual bool _addNode(const int nodeIndex, const QPointF &newNode, const double radius)=0
Method called in addNode.
virtual void _draw(QPainter *painter)=0
Method called in paint.
Graphics scene for map printing.
QgsFillSymbolV2 * polygonStyleSymbol()
Returns the QgsSymbolV2 used to draw the shape.
Composer item for polygons.
QScopedPointer< QgsFillSymbolV2 > mPolygonStyleSymbol
QgsSymbolV2 use to draw the shape.