26 , mPolylineStyleSymbol( nullptr )
51 if ( distEnd < radius )
53 else if ( distStart < radius )
73 int newSelectNode =
index;
85 properties.
insert(
"color",
"0,0,0,255" );
86 properties.
insert(
"width",
"0.3" );
87 properties.
insert(
"capstyle",
"square" );
96 if ( !
id().isEmpty() )
99 return tr(
"<polyline>" );
117 painter->
scale( 1 / dotsPerMM, 1 / dotsPerMM );
123 painter->
scale( dotsPerMM, dotsPerMM );
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.
void _readXMLStyle(const QDomElement &elmt) override
Read symbol in XML.
virtual QgsLineSymbolV2 * clone() const override
QDomNode appendChild(const QDomNode &newChild)
void append(const T &value)
virtual QString displayName() const override
Overridden to return shape name.
void setPolylineStyleSymbol(QgsLineSymbolV2 *symbol)
Set the QgsSymbolV2 used to draw the shape.
void scale(qreal sx, qreal sy)
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)
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)
void update(const QRectF &rect)
double computeDistance(const QPointF &pt1, const QPointF &pt2) const
Compute an euclidian distance between 2 nodes.
The QgsMapSettings class contains configuration for rendering of the map.
void frameChanged()
Emitted if the item's frame style changes.
static QgsLineSymbolV2 * createSimple(const QgsStringMap &properties)
Create a line symbol with one symbol layer: SimpleLine with specified properties. ...
~QgsComposerPolyline()
Destructor.
QPaintDevice * device() const
void _writeXMLStyle(QDomDocument &doc, QDomElement &elmt) const override
Write the symbol in an XML document.
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.
QScopedPointer< QgsLineSymbolV2 > mPolylineStyleSymbol
QgsSymbolV2 use to draw the shape.
void createDefaultPolylineStyleSymbol()
Create a default symbol.
QgsComposition * mComposition
Contains information about the context of a rendering operation.
void _draw(QPainter *painter) override
Draw nodes for the current shape.
static QgsRenderContext fromMapSettings(const QgsMapSettings &mapSettings)
create initialized QgsRenderContext instance from given QgsMapSettings
QgsComposerPolyline(QgsComposition *c)
Constructor.
iterator insert(const Key &key, const T &value)
bool _addNode(const int indexPoint, const QPointF &newPoint, const double radius) override
Add the node newPoint at the given position according to some criteres.
QString id() const
Get item's id (which is not necessarly unique)
bool _removeNode(const int nodeIndex) override
Method called in removeNode.
void setExpressionContext(const QgsExpressionContext &context)
Sets the expression context.