26 , mPolygonStyleSymbol( nullptr )
54 properties.
insert(
"color",
"white" );
55 properties.
insert(
"style",
"solid" );
56 properties.
insert(
"style_border",
"solid" );
57 properties.
insert(
"color_border",
"black" );
58 properties.
insert(
"width_border",
"0.3" );
59 properties.
insert(
"joinstyle",
"miter" );
68 if ( !
id().isEmpty() )
71 return tr(
"<polygon>" );
90 painter->
scale( 1 / dotsPerMM, 1 / dotsPerMM );
101 painter->
scale( dotsPerMM, dotsPerMM );
135 int newSelectNode =
index;
void setForceVectorOutput(bool force)
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.
QgsComposerPolygon(QgsComposition *c)
Constructor.
QDomNode appendChild(const QDomNode &newChild)
bool _addNode(const int indexPoint, const QPointF &newPoint, const double radius) override
Add the node newPoint at the given position according to some criteres.
void scale(qreal sx, qreal sy)
static QgsFillSymbolV2 * createSimple(const QgsStringMap &properties)
Create a fill symbol with one symbol layer: SimpleFill with specified properties. ...
void setOutputDpi(double dpi)
Set DPI used for conversion between real world units (e.g. mm) and pixels.
void insert(int i, const T &value)
static QDomElement saveSymbol(const QString &symbolName, QgsSymbolV2 *symbol, QDomDocument &doc)
bool _removeNode(const int nodeIndex) override
Method called in removeNode.
QPolygonF toFillPolygon(const QMatrix &matrix) const
virtual QgsExpressionContext * createExpressionContext() const override
Creates an expression context relating to the item's current state.
QString tr(const char *sourceText, const char *disambiguation, int n)
virtual QString displayName() const override
Overridden to return shape name.
void update(const QRectF &rect)
void setPolygonStyleSymbol(QgsFillSymbolV2 *symbol)
Set the QgsSymbolV2 used to draw the shape.
The QgsMapSettings class contains configuration for rendering of the map.
void _writeXMLStyle(QDomDocument &doc, QDomElement &elmt) const override
Write the symbol in an XML document.
void frameChanged()
Emitted if the item's frame style changes.
void createDefaultPolygonStyleSymbol()
Create a default symbol.
void addPolygon(const QPolygonF &polygon)
~QgsComposerPolygon()
Destructor.
QPaintDevice * device() const
void setPainter(QPainter *p)
bool setSelectedNode(const int index)
Select a node.
Graphics scene for map printing.
const QgsMapSettings & mapSettings() const
Return setting of QGIS map canvas.
virtual QgsFillSymbolV2 * clone() const override
QgsComposition * mComposition
Contains information about the context of a rendering operation.
static QgsRenderContext fromMapSettings(const QgsMapSettings &mapSettings)
create initialized QgsRenderContext instance from given QgsMapSettings
void _draw(QPainter *painter) override
Draw nodes for the current shape.
void _readXMLStyle(const QDomElement &elmt) override
Read symbol in XML.
iterator insert(const Key &key, const T &value)
QString id() const
Get item's id (which is not necessarly unique)
void setExpressionContext(const QgsExpressionContext &context)
Sets the expression context.
QScopedPointer< QgsFillSymbolV2 > mPolygonStyleSymbol
QgsSymbolV2 use to draw the shape.