213 changes: 187 additions & 26 deletions src/core/symbology-ng/qgsfillsymbollayerv2.cpp

Large diffs are not rendered by default.

64 changes: 63 additions & 1 deletion src/core/symbology-ng/qgsfillsymbollayerv2.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,28 @@ class CORE_EXPORT QgsSimpleFillSymbolLayerV2 : public QgsFillSymbolLayerV2
void setOffset( QPointF offset ) { mOffset = offset; }
QPointF offset() { return mOffset; }

void setBorderWidthUnit( QgsSymbolV2::OutputUnit unit ) { mBorderWidthUnit = unit; }
QgsSymbolV2::OutputUnit borderWidthUnit() const { return mBorderWidthUnit; }

void setOffsetUnit( QgsSymbolV2::OutputUnit unit ) { mOffsetUnit = unit; }
QgsSymbolV2::OutputUnit offsetUnit() const { return mOffsetUnit; }

void setOutputUnit( QgsSymbolV2::OutputUnit unit );
QgsSymbolV2::OutputUnit outputUnit() const;

protected:
QBrush mBrush;
QBrush mSelBrush;
Qt::BrushStyle mBrushStyle;
QColor mBorderColor;
Qt::PenStyle mBorderStyle;
double mBorderWidth;
QgsSymbolV2::OutputUnit mBorderWidthUnit;
QPen mPen;
QPen mSelPen;

QPointF mOffset;
QgsSymbolV2::OutputUnit mOffsetUnit;
};

/**Base class for polygon renderers generating texture images*/
Expand All @@ -98,11 +109,16 @@ class CORE_EXPORT QgsImageFillSymbolLayer: public QgsFillSymbolLayerV2
virtual QgsSymbolV2* subSymbol() { return mOutline; }
virtual bool setSubSymbol( QgsSymbolV2* symbol );

void setOutlineWidthUnit( QgsSymbolV2::OutputUnit unit ) { mOutlineWidthUnit = unit; }
QgsSymbolV2::OutputUnit outlineWidthUnit() const { return mOutlineWidthUnit; }

protected:
QBrush mBrush;

/**Outline width*/
double mOutlineWidth;
QgsSymbolV2::OutputUnit mOutlineWidthUnit;

/**Custom outline*/
QgsLineSymbolV2* mOutline;
};
Expand Down Expand Up @@ -145,9 +161,20 @@ class CORE_EXPORT QgsSVGFillSymbolLayer: public QgsImageFillSymbolLayer
void setSvgOutlineWidth( double w ) { mSvgOutlineWidth = w; }
double svgOutlineWidth() const { return mSvgOutlineWidth; }

void setPatternWidthUnit( QgsSymbolV2::OutputUnit unit ) { mPatternWidthUnit = unit; }
QgsSymbolV2::OutputUnit patternWidthUnit() const { return mPatternWidthUnit; }

void setSvgOutlineWidthUnit( QgsSymbolV2::OutputUnit unit ) { mSvgOutlineWidthUnit = unit; }
QgsSymbolV2::OutputUnit svgOutlineWidthUnit() const { return mSvgOutlineWidthUnit; }

void setOutputUnit( QgsSymbolV2::OutputUnit unit );
QgsSymbolV2::OutputUnit outputUnit() const;

protected:
/**Width of the pattern (in QgsSymbolV2 output units)*/
/**Width of the pattern (in output units)*/
double mPatternWidth;
QgsSymbolV2::OutputUnit mPatternWidthUnit;

/**SVG data*/
QByteArray mSvgData;
/**Path to the svg file (or empty if constructed directly from data)*/
Expand All @@ -163,6 +190,7 @@ class CORE_EXPORT QgsSVGFillSymbolLayer: public QgsImageFillSymbolLayer
QColor mSvgFillColor;
QColor mSvgOutlineColor;
double mSvgOutlineWidth;
QgsSymbolV2::OutputUnit mSvgOutlineWidthUnit;

private:
/**Helper function that gets the view box from the byte array*/
Expand Down Expand Up @@ -205,16 +233,31 @@ class CORE_EXPORT QgsLinePatternFillSymbolLayer: public QgsImageFillSymbolLayer
void setOffset( double offset ) { mOffset = offset; }
double offset() const { return mOffset; }

void setDistanceUnit( QgsSymbolV2::OutputUnit unit ) { mDistanceUnit = unit; }
QgsSymbolV2::OutputUnit distanceUnit() const { return mDistanceUnit; }

void setLineWidthUnit( QgsSymbolV2::OutputUnit unit ) { mLineWidthUnit = unit; }
QgsSymbolV2::OutputUnit lineWidthUnit() const { return mLineWidthUnit; }

void setOffsetUnit( QgsSymbolV2::OutputUnit unit ) { mOffsetUnit = unit; }
QgsSymbolV2::OutputUnit offsetUnit() const { return mOffsetUnit; }

void setOutputUnit( QgsSymbolV2::OutputUnit unit );
QgsSymbolV2::OutputUnit outputUnit() const;

protected:
/**Distance (in mm or map units) between lines*/
double mDistance;
QgsSymbolV2::OutputUnit mDistanceUnit;
/**Line width (in mm or map units)*/
double mLineWidth;
QgsSymbolV2::OutputUnit mLineWidthUnit;
QColor mColor;
/**Vector line angle in degrees (0 = horizontal, counterclockwise)*/
double mLineAngle;
/**Offset perpendicular to line direction*/
double mOffset;
QgsSymbolV2::OutputUnit mOffsetUnit;
};

class CORE_EXPORT QgsPointPatternFillSymbolLayer: public QgsImageFillSymbolLayer
Expand Down Expand Up @@ -254,12 +297,31 @@ class CORE_EXPORT QgsPointPatternFillSymbolLayer: public QgsImageFillSymbolLayer
bool setSubSymbol( QgsSymbolV2* symbol );
virtual QgsSymbolV2* subSymbol() { return mMarkerSymbol; }

void setDistanceXUnit( QgsSymbolV2::OutputUnit unit ) { mDistanceXUnit = unit; }
QgsSymbolV2::OutputUnit distanceXUnit() const { return mDistanceXUnit; }

void setDistanceYUnit( QgsSymbolV2::OutputUnit unit ) { mDistanceYUnit = unit; }
QgsSymbolV2::OutputUnit distanceYUnit() const { return mDistanceYUnit; }

void setDisplacementXUnit( QgsSymbolV2::OutputUnit unit ) { mDisplacementXUnit = unit; }
QgsSymbolV2::OutputUnit displacementXUnit() const { return mDisplacementXUnit; }

void setDisplacementYUnit( QgsSymbolV2::OutputUnit unit ) { mDisplacementYUnit = unit; }
QgsSymbolV2::OutputUnit displacementYUnit() const { return mDisplacementYUnit; }

void setOutputUnit( QgsSymbolV2::OutputUnit unit );
QgsSymbolV2::OutputUnit outputUnit() const;

protected:
QgsMarkerSymbolV2* mMarkerSymbol;
double mDistanceX;
QgsSymbolV2::OutputUnit mDistanceXUnit;
double mDistanceY;
QgsSymbolV2::OutputUnit mDistanceYUnit;
double mDisplacementX;
QgsSymbolV2::OutputUnit mDisplacementXUnit;
double mDisplacementY;
QgsSymbolV2::OutputUnit mDisplacementYUnit;
};

class CORE_EXPORT QgsCentroidFillSymbolLayerV2 : public QgsFillSymbolLayerV2
Expand Down
112 changes: 98 additions & 14 deletions src/core/symbology-ng/qgslinesymbollayerv2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,31 @@
#include <cmath>

QgsSimpleLineSymbolLayerV2::QgsSimpleLineSymbolLayerV2( QColor color, double width, Qt::PenStyle penStyle )
: mPenStyle( penStyle ), mPenJoinStyle( DEFAULT_SIMPLELINE_JOINSTYLE ), mPenCapStyle( DEFAULT_SIMPLELINE_CAPSTYLE ), mOffset( 0 ), mUseCustomDashPattern( false )
: mPenStyle( penStyle ), mPenJoinStyle( DEFAULT_SIMPLELINE_JOINSTYLE ), mPenCapStyle( DEFAULT_SIMPLELINE_CAPSTYLE ), mOffset( 0 ), mOffsetUnit( QgsSymbolV2::MM ),
mUseCustomDashPattern( false ), mCustomDashPatternUnit( QgsSymbolV2::MM )
{
mColor = color;
mWidth = width;
mCustomDashVector << 5 << 2;
}

void QgsSimpleLineSymbolLayerV2::setOutputUnit( QgsSymbolV2::OutputUnit unit )
{
mWidthUnit = unit;
mOffsetUnit = unit;
mCustomDashPatternUnit = unit;
}

QgsSymbolV2::OutputUnit QgsSimpleLineSymbolLayerV2::outputUnit() const
{
QgsSymbolV2::OutputUnit unit = mWidthUnit;
if ( mOffsetUnit != unit || mCustomDashPatternUnit != unit )
{
return QgsSymbolV2::Mixed;
}
return unit;
}


QgsSymbolLayerV2* QgsSimpleLineSymbolLayerV2::create( const QgsStringMap& props )
{
Expand All @@ -49,8 +67,12 @@ QgsSymbolLayerV2* QgsSimpleLineSymbolLayerV2::create( const QgsStringMap& props


QgsSimpleLineSymbolLayerV2* l = new QgsSimpleLineSymbolLayerV2( color, width, penStyle );
if ( props.contains( "width_unit" ) )
l->setWidthUnit( QgsSymbolLayerV2Utils::decodeOutputUnit( props["width_unit"] ) );
if ( props.contains( "offset" ) )
l->setOffset( props["offset"].toDouble() );
if ( props.contains( "offset_unit" ) )
l->setOffsetUnit( QgsSymbolLayerV2Utils::decodeOutputUnit( props["offset_unit"] ) );
if ( props.contains( "joinstyle" ) )
l->setPenJoinStyle( QgsSymbolLayerV2Utils::decodePenJoinStyle( props["joinstyle"] ) );
if ( props.contains( "capstyle" ) )
Expand All @@ -64,6 +86,10 @@ QgsSymbolLayerV2* QgsSimpleLineSymbolLayerV2::create( const QgsStringMap& props
{
l->setCustomDashVector( QgsSymbolLayerV2Utils::decodeRealVector( props["customdash"] ) );
}
if ( props.contains( "customdash_unit" ) )
{
l->setCustomDashPatternUnit( QgsSymbolLayerV2Utils::decodeOutputUnit( props["customdash_unit"] ) );
}
return l;
}

Expand All @@ -78,7 +104,7 @@ void QgsSimpleLineSymbolLayerV2::startRender( QgsSymbolV2RenderContext& context
QColor penColor = mColor;
penColor.setAlphaF( mColor.alphaF() * context.alpha() );
mPen.setColor( penColor );
double scaledWidth = context.outputLineWidth( mWidth );
double scaledWidth = mWidth * QgsSymbolLayerV2Utils::lineWidthScaleFactor( context.renderContext(), mWidthUnit );
mPen.setWidthF( scaledWidth );
if ( mUseCustomDashPattern && scaledWidth != 0 )
{
Expand All @@ -90,7 +116,7 @@ void QgsSimpleLineSymbolLayerV2::startRender( QgsSymbolV2RenderContext& context
for ( ; it != mCustomDashVector.constEnd(); ++it )
{
//the dash is specified in terms of pen widths, therefore the division
scaledVector << context.outputLineWidth(( *it ) / scaledWidth );
scaledVector << ( *it ) * QgsSymbolLayerV2Utils::lineWidthScaleFactor( context.renderContext(), mCustomDashPatternUnit ) / scaledWidth;
}
mPen.setDashPattern( scaledVector );
}
Expand Down Expand Up @@ -123,7 +149,7 @@ void QgsSimpleLineSymbolLayerV2::renderPolyline( const QPolygonF& points, QgsSym

if ( context.renderHints() & QgsSymbolV2::DataDefinedSizeScale )
{
double scaledWidth = context.outputLineWidth( mWidth );
double scaledWidth = mWidth * QgsSymbolLayerV2Utils::lineWidthScaleFactor( context.renderContext(), mWidthUnit );
mPen.setWidthF( scaledWidth );
mSelPen.setWidthF( scaledWidth );
}
Expand All @@ -135,7 +161,7 @@ void QgsSimpleLineSymbolLayerV2::renderPolyline( const QPolygonF& points, QgsSym
}
else
{
double scaledOffset = context.outputLineWidth( mOffset );
double scaledOffset = mOffset * QgsSymbolLayerV2Utils::lineWidthScaleFactor( context.renderContext(), mOffsetUnit );
p->drawPolyline( ::offsetLine( points, scaledOffset ) );
}
}
Expand All @@ -145,18 +171,24 @@ QgsStringMap QgsSimpleLineSymbolLayerV2::properties() const
QgsStringMap map;
map["color"] = QgsSymbolLayerV2Utils::encodeColor( mColor );
map["width"] = QString::number( mWidth );
map["width_unit"] = QgsSymbolLayerV2Utils::encodeOutputUnit( mWidthUnit );
map["penstyle"] = QgsSymbolLayerV2Utils::encodePenStyle( mPenStyle );
map["joinstyle"] = QgsSymbolLayerV2Utils::encodePenJoinStyle( mPenJoinStyle );
map["capstyle"] = QgsSymbolLayerV2Utils::encodePenCapStyle( mPenCapStyle );
map["offset"] = QString::number( mOffset );
map["offset_unit"] = QgsSymbolLayerV2Utils::encodeOutputUnit( mOffsetUnit );
map["use_custom_dash"] = ( mUseCustomDashPattern ? "1" : "0" );
map["customdash"] = QgsSymbolLayerV2Utils::encodeRealVector( mCustomDashVector );
map["customdash_unit"] = QgsSymbolLayerV2Utils::encodeOutputUnit( mCustomDashPatternUnit );
return map;
}

QgsSymbolLayerV2* QgsSimpleLineSymbolLayerV2::clone() const
{
QgsSimpleLineSymbolLayerV2* l = new QgsSimpleLineSymbolLayerV2( mColor, mWidth, mPenStyle );
l->setWidthUnit( mWidthUnit );
l->setOffsetUnit( mOffsetUnit );
l->setCustomDashPatternUnit( mCustomDashPatternUnit );
l->setOffset( mOffset );
l->setPenJoinStyle( mPenJoinStyle );
l->setPenCapStyle( mPenCapStyle );
Expand Down Expand Up @@ -319,8 +351,10 @@ QgsMarkerLineSymbolLayerV2::QgsMarkerLineSymbolLayerV2( bool rotateMarker, doubl
{
mRotateMarker = rotateMarker;
mInterval = interval;
mIntervalUnit = QgsSymbolV2::MM;
mMarker = NULL;
mOffset = 0;
mOffsetUnit = QgsSymbolV2::MM;
mPlacement = Interval;

setSubSymbol( new QgsMarkerSymbolV2() );
Expand All @@ -346,6 +380,14 @@ QgsSymbolLayerV2* QgsMarkerLineSymbolLayerV2::create( const QgsStringMap& props
{
x->setOffset( props["offset"].toDouble() );
}
if ( props.contains( "offset_unit" ) )
{
x->setOffsetUnit( QgsSymbolLayerV2Utils::decodeOutputUnit( props["offset_unit"] ) );
}
if ( props.contains( "interval_unit" ) )
{
x->setIntervalUnit( QgsSymbolLayerV2Utils::decodeOutputUnit( props["interval_unit"] ) );
}

if ( props.contains( "placement" ) )
{
Expand Down Expand Up @@ -377,7 +419,6 @@ void QgsMarkerLineSymbolLayerV2::setColor( const QColor& color )
void QgsMarkerLineSymbolLayerV2::startRender( QgsSymbolV2RenderContext& context )
{
mMarker->setAlpha( context.alpha() );
mMarker->setOutputUnit( context.outputUnit() );

// if being rotated, it gets initialized with every line segment
int hints = 0;
Expand Down Expand Up @@ -408,7 +449,7 @@ void QgsMarkerLineSymbolLayerV2::renderPolyline( const QPolygonF& points, QgsSym
}
else
{
QPolygonF points2 = ::offsetLine( points, context.outputLineWidth( mOffset ) );
QPolygonF points2 = ::offsetLine( points, mOffset * QgsSymbolLayerV2Utils::lineWidthScaleFactor( context.renderContext(), mOffsetUnit ) );
if ( mPlacement == Interval )
renderPolylineInterval( points2, context );
else if ( mPlacement == CentralPoint )
Expand All @@ -428,9 +469,9 @@ void QgsMarkerLineSymbolLayerV2::renderPolylineInterval( const QPolygonF& points
bool first = true;
double origAngle = mMarker->angle();

double painterUnitInterval = context.outputLineWidth( mInterval > 0 ? mInterval : 0.1 );

QgsRenderContext& rc = context.renderContext();
double interval = mInterval > 0 ? mInterval : 0.1;
double painterUnitInterval = interval * QgsSymbolLayerV2Utils::lineWidthScaleFactor( rc, mIntervalUnit );

for ( int i = 1; i < points.count(); ++i )
{
Expand Down Expand Up @@ -636,6 +677,8 @@ QgsStringMap QgsMarkerLineSymbolLayerV2::properties() const
map["rotate"] = ( mRotateMarker ? "1" : "0" );
map["interval"] = QString::number( mInterval );
map["offset"] = QString::number( mOffset );
map["offset_unit"] = QgsSymbolLayerV2Utils::encodeOutputUnit( mOffsetUnit );
map["interval_unit"] = QgsSymbolLayerV2Utils::encodeOutputUnit( mIntervalUnit );
if ( mPlacement == Vertex )
map["placement"] = "vertex";
else if ( mPlacement == LastVertex )
Expand All @@ -646,6 +689,7 @@ QgsStringMap QgsMarkerLineSymbolLayerV2::properties() const
map["placement"] = "centralpoint";
else
map["placement"] = "interval";

return map;
}

Expand Down Expand Up @@ -674,6 +718,8 @@ QgsSymbolLayerV2* QgsMarkerLineSymbolLayerV2::clone() const
x->setSubSymbol( mMarker->clone() );
x->setOffset( mOffset );
x->setPlacement( mPlacement );
x->setOffsetUnit( mOffsetUnit );
x->setIntervalUnit( mIntervalUnit );
return x;
}

Expand Down Expand Up @@ -835,6 +881,22 @@ double QgsMarkerLineSymbolLayerV2::width() const
return mMarker->size();
}

void QgsMarkerLineSymbolLayerV2::setOutputUnit( QgsSymbolV2::OutputUnit unit )
{
mIntervalUnit = unit;
mOffsetUnit = unit;
}

QgsSymbolV2::OutputUnit QgsMarkerLineSymbolLayerV2::outputUnit() const
{
QgsSymbolV2::OutputUnit unit = mIntervalUnit;
if ( mOffsetUnit != unit )
{
return QgsSymbolV2::Mixed;
}
return unit;
}

/////////////

QgsLineDecorationSymbolLayerV2::QgsLineDecorationSymbolLayerV2( QColor color, double width )
Expand All @@ -857,7 +919,14 @@ QgsSymbolLayerV2* QgsLineDecorationSymbolLayerV2::create( const QgsStringMap& pr
if ( props.contains( "width" ) )
width = props["width"].toDouble();

return new QgsLineDecorationSymbolLayerV2( color, width );

QgsLineDecorationSymbolLayerV2* layer = new QgsLineDecorationSymbolLayerV2( color, width );
if ( props.contains( "width_unit" ) )
{
layer->setWidthUnit( QgsSymbolLayerV2Utils::decodeOutputUnit( props["width_unit"] ) );
}
return layer;

}

QString QgsLineDecorationSymbolLayerV2::layerType() const
Expand All @@ -869,12 +938,14 @@ void QgsLineDecorationSymbolLayerV2::startRender( QgsSymbolV2RenderContext& cont
{
QColor penColor = mColor;
penColor.setAlphaF( context.alpha() );
mPen.setWidth( context.outputLineWidth( mWidth ) );

double width = mWidth * QgsSymbolLayerV2Utils::lineWidthScaleFactor( context.renderContext(), mWidthUnit );
mPen.setWidth( context.outputLineWidth( width ) );
mPen.setColor( penColor );
QColor selColor = context.selectionColor();
if ( ! selectionIsOpaque )
selColor.setAlphaF( context.alpha() );
mSelPen.setWidth( context.outputLineWidth( mWidth ) );
mSelPen.setWidth( context.outputLineWidth( width ) );
mSelPen.setColor( selColor );
}

Expand Down Expand Up @@ -910,7 +981,7 @@ void QgsLineDecorationSymbolLayerV2::renderPolyline( const QPolygonF& points, Qg
}

double angle = atan2( p2.y() - p1.y(), p2.x() - p1.x() );
double size = context.outputLineWidth( mWidth * 8 );
double size = ( mWidth * 8 ) * QgsSymbolLayerV2Utils::lineWidthScaleFactor( context.renderContext(), mWidthUnit );
double angle1 = angle + M_PI / 6;
double angle2 = angle - M_PI / 6;

Expand All @@ -927,12 +998,15 @@ QgsStringMap QgsLineDecorationSymbolLayerV2::properties() const
QgsStringMap map;
map["color"] = QgsSymbolLayerV2Utils::encodeColor( mColor );
map["width"] = QString::number( mWidth );
map["width_unit"] = QgsSymbolLayerV2Utils::encodeOutputUnit( mWidthUnit );
return map;
}

QgsSymbolLayerV2* QgsLineDecorationSymbolLayerV2::clone() const
{
return new QgsLineDecorationSymbolLayerV2( mColor, mWidth );
QgsLineDecorationSymbolLayerV2* layer = new QgsLineDecorationSymbolLayerV2( mColor, mWidth );
layer->setWidthUnit( mWidthUnit );
return layer;
}

void QgsLineDecorationSymbolLayerV2::toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props ) const
Expand Down Expand Up @@ -965,3 +1039,13 @@ void QgsLineDecorationSymbolLayerV2::toSld( QDomDocument &doc, QDomElement &elem
// use <VendorOption> to draw the decoration at end of the line
symbolizerElem.appendChild( QgsSymbolLayerV2Utils::createVendorOptionElement( doc, "placement", "lastPoint" ) );
}

void QgsLineDecorationSymbolLayerV2::setOutputUnit( QgsSymbolV2::OutputUnit unit )
{
mWidthUnit = unit;
}

QgsSymbolV2::OutputUnit QgsLineDecorationSymbolLayerV2::outputUnit() const
{
return mWidthUnit;
}
27 changes: 27 additions & 0 deletions src/core/symbology-ng/qgslinesymbollayerv2.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ class CORE_EXPORT QgsSimpleLineSymbolLayerV2 : public QgsLineSymbolLayerV2

QString ogrFeatureStyle( double mmScaleFactor, double mapUnitScaleFactor ) const;

void setOutputUnit( QgsSymbolV2::OutputUnit unit );
QgsSymbolV2::OutputUnit outputUnit() const;

// new stuff

Qt::PenStyle penStyle() const { return mPenStyle; }
Expand All @@ -72,9 +75,15 @@ class CORE_EXPORT QgsSimpleLineSymbolLayerV2 : public QgsLineSymbolLayerV2
double offset() const { return mOffset; }
void setOffset( double offset ) { mOffset = offset; }

QgsSymbolV2::OutputUnit offsetUnit() const { return mOffsetUnit; }
void setOffsetUnit( QgsSymbolV2::OutputUnit unit ) { mOffsetUnit = unit; }

bool useCustomDashPattern() const { return mUseCustomDashPattern; }
void setUseCustomDashPattern( bool b ) { mUseCustomDashPattern = b; }

QgsSymbolV2::OutputUnit customDashPatternUnit() const { return mCustomDashPatternUnit; }
void setCustomDashPatternUnit( QgsSymbolV2::OutputUnit unit ) { mCustomDashPatternUnit = unit; }

QVector<qreal> customDashVector() const { return mCustomDashVector; }
void setCustomDashVector( const QVector<qreal>& vector ) { mCustomDashVector = vector; }

Expand All @@ -85,8 +94,12 @@ class CORE_EXPORT QgsSimpleLineSymbolLayerV2 : public QgsLineSymbolLayerV2
QPen mPen;
QPen mSelPen;
double mOffset;
QgsSymbolV2::OutputUnit mOffsetUnit;

//use a custom dash dot pattern instead of the predefined ones
bool mUseCustomDashPattern;
QgsSymbolV2::OutputUnit mCustomDashPatternUnit;

/**Vector with an even number of entries for the */
QVector<qreal> mCustomDashVector;
};
Expand Down Expand Up @@ -156,6 +169,15 @@ class CORE_EXPORT QgsMarkerLineSymbolLayerV2 : public QgsLineSymbolLayerV2
Placement placement() const { return mPlacement; }
void setPlacement( Placement p ) { mPlacement = p; }

QgsSymbolV2::OutputUnit intervalUnit() const { return mIntervalUnit; }
void setIntervalUnit( QgsSymbolV2::OutputUnit unit ) { mIntervalUnit = unit; }

QgsSymbolV2::OutputUnit offsetUnit() const { return mOffsetUnit; }
void setOffsetUnit( QgsSymbolV2::OutputUnit unit ) { mOffsetUnit = unit; }

void setOutputUnit( QgsSymbolV2::OutputUnit unit );
QgsSymbolV2::OutputUnit outputUnit() const;

protected:

void renderPolylineInterval( const QPolygonF& points, QgsSymbolV2RenderContext& context );
Expand All @@ -164,8 +186,10 @@ class CORE_EXPORT QgsMarkerLineSymbolLayerV2 : public QgsLineSymbolLayerV2

bool mRotateMarker;
double mInterval;
QgsSymbolV2::OutputUnit mIntervalUnit;
QgsMarkerSymbolV2* mMarker;
double mOffset;
QgsSymbolV2::OutputUnit mOffsetUnit;
Placement mPlacement;
};

Expand Down Expand Up @@ -202,6 +226,9 @@ class CORE_EXPORT QgsLineDecorationSymbolLayerV2 : public QgsLineSymbolLayerV2

void toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props ) const;

void setOutputUnit( QgsSymbolV2::OutputUnit unit );
QgsSymbolV2::OutputUnit outputUnit() const;

protected:
QPen mPen;
QPen mSelPen;
Expand Down
75 changes: 66 additions & 9 deletions src/core/symbology-ng/qgsmarkersymbollayerv2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ QgsSimpleMarkerSymbolLayerV2::QgsSimpleMarkerSymbolLayerV2( QString name, QColor
mAngle = angle;
mOffset = QPointF( 0, 0 );
mScaleMethod = scaleMethod;
mSizeUnit = QgsSymbolV2::MM;
mOffsetUnit = QgsSymbolV2::MM;
}

QgsSymbolLayerV2* QgsSimpleMarkerSymbolLayerV2::create( const QgsStringMap& props )
Expand Down Expand Up @@ -82,6 +84,10 @@ QgsSymbolLayerV2* QgsSimpleMarkerSymbolLayerV2::create( const QgsStringMap& prop
QgsSimpleMarkerSymbolLayerV2* m = new QgsSimpleMarkerSymbolLayerV2( name, color, borderColor, size, angle, scaleMethod );
if ( props.contains( "offset" ) )
m->setOffset( QgsSymbolLayerV2Utils::decodePoint( props["offset"] ) );
if ( props.contains( "offset_unit" ) )
m->setOffsetUnit( QgsSymbolLayerV2Utils::decodeOutputUnit( props["offset_unit"] ) );
if ( props.contains( "size_unit" ) )
m->setSizeUnit( QgsSymbolLayerV2Utils::decodeOutputUnit( props["size_unit"] ) );
return m;
}

Expand Down Expand Up @@ -146,7 +152,7 @@ void QgsSimpleMarkerSymbolLayerV2::startRender( QgsSymbolV2RenderContext& contex
// scale the shape (if the size is not going to be modified)
if ( !hasDataDefinedSize )
{
double scaledSize = context.outputLineWidth( mSize );
double scaledSize = mSize * QgsSymbolLayerV2Utils::lineWidthScaleFactor( context.renderContext(), mSizeUnit );
if ( mUsingCache )
scaledSize *= context.renderContext().rasterScaleFactor();
double half = scaledSize / 2.0;
Expand Down Expand Up @@ -178,7 +184,7 @@ void QgsSimpleMarkerSymbolLayerV2::startRender( QgsSymbolV2RenderContext& contex

void QgsSimpleMarkerSymbolLayerV2::prepareCache( QgsSymbolV2RenderContext& context )
{
double scaledSize = context.outputPixelSize( mSize );
double scaledSize = mSize * QgsSymbolLayerV2Utils::lineWidthScaleFactor( context.renderContext(), mSizeUnit );

// calculate necessary image size for the cache
double pw = (( mPen.widthF() == 0 ? 1 : mPen.widthF() ) + 1 ) / 2 * 2; // make even (round up); handle cosmetic pen
Expand Down Expand Up @@ -375,7 +381,9 @@ void QgsSimpleMarkerSymbolLayerV2::renderPoint( const QPointF& point, QgsSymbolV
return;
}

QPointF off( context.outputLineWidth( mOffset.x() ), context.outputLineWidth( mOffset.y() ) );
double offsetX = mOffset.x() * QgsSymbolLayerV2Utils::lineWidthScaleFactor( context.renderContext(), mOffsetUnit );
double offsetY = mOffset.y() * QgsSymbolLayerV2Utils::lineWidthScaleFactor( context.renderContext(), mOffsetUnit );
QPointF off( offsetX, offsetY );
if ( mAngle )
off = _rotatedOffset( off, mAngle );

Expand All @@ -401,7 +409,7 @@ void QgsSimpleMarkerSymbolLayerV2::renderPoint( const QPointF& point, QgsSymbolV
// resize if necessary
if ( hasDataDefinedSize )
{
double scaledSize = context.outputLineWidth( mSize );
double scaledSize = mSize * QgsSymbolLayerV2Utils::lineWidthScaleFactor( context.renderContext(), mSizeUnit );

switch ( mScaleMethod )
{
Expand Down Expand Up @@ -440,8 +448,10 @@ QgsStringMap QgsSimpleMarkerSymbolLayerV2::properties() const
map["color"] = QgsSymbolLayerV2Utils::encodeColor( mColor );
map["color_border"] = QgsSymbolLayerV2Utils::encodeColor( mBorderColor );
map["size"] = QString::number( mSize );
map["size_unit"] = QgsSymbolLayerV2Utils::encodeOutputUnit( mSizeUnit );
map["angle"] = QString::number( mAngle );
map["offset"] = QgsSymbolLayerV2Utils::encodePoint( mOffset );
map["offset_unit"] = QgsSymbolLayerV2Utils::encodeOutputUnit( mOffsetUnit );
map["scale_method"] = QgsSymbolLayerV2Utils::encodeScaleMethod( mScaleMethod );
return map;
}
Expand All @@ -450,6 +460,8 @@ QgsSymbolLayerV2* QgsSimpleMarkerSymbolLayerV2::clone() const
{
QgsSimpleMarkerSymbolLayerV2* m = new QgsSimpleMarkerSymbolLayerV2( mName, mColor, mBorderColor, mSize, mAngle, mScaleMethod );
m->setOffset( mOffset );
m->setSizeUnit( mSizeUnit );
m->setOffsetUnit( mOffsetUnit );
return m;
}

Expand Down Expand Up @@ -600,6 +612,7 @@ QgsSvgMarkerSymbolLayerV2::QgsSvgMarkerSymbolLayerV2( QString name, double size,
mAngle = angle;
mOffset = QPointF( 0, 0 );
mOutlineWidth = 1.0;
mOutlineWidthUnit = QgsSymbolV2::MM;
mFillColor = QColor( Qt::black );
mOutlineColor = QColor( Qt::black );
}
Expand Down Expand Up @@ -641,14 +654,20 @@ QgsSymbolLayerV2* QgsSvgMarkerSymbolLayerV2::create( const QgsStringMap& props )
}
}

if ( props.contains( "size_unit" ) )
m->setSizeUnit( QgsSymbolLayerV2Utils::decodeOutputUnit( "size_unit" ) );
if ( props.contains( "offset" ) )
m->setOffset( QgsSymbolLayerV2Utils::decodePoint( props["offset"] ) );
if ( props.contains( "offset_unit" ) )
m->setOffsetUnit( QgsSymbolLayerV2Utils::decodeOutputUnit( props["offset_unit"] ) );
if ( props.contains( "fill" ) )
m->setFillColor( QColor( props["fill"] ) );
if ( props.contains( "outline" ) )
m->setOutlineColor( QColor( props["outline"] ) );
if ( props.contains( "outline-width" ) )
m->setOutlineWidth( props["outline-width"].toDouble() );
if ( props.contains( "outline_width_unit" ) )
m->setOutlineWidthUnit( QgsSymbolLayerV2Utils::decodeOutputUnit( props["outline_width_unit"] ) );
return m;
}

Expand Down Expand Up @@ -698,15 +717,18 @@ void QgsSvgMarkerSymbolLayerV2::renderPoint( const QPointF& point, QgsSymbolV2Re
return;
}

double size = context.outputLineWidth( mSize );
double size = mSize * QgsSymbolLayerV2Utils::lineWidthScaleFactor( context.renderContext(), mSizeUnit );
//don't render symbols with size below one or above 10,000 pixels
if (( int )size < 1 || 10000.0 < size )
{
return;
}

p->save();
QPointF outputOffset = QPointF( context.outputLineWidth( mOffset.x() ), context.outputLineWidth( mOffset.y() ) );
double offsetX = mOffset.x() * QgsSymbolLayerV2Utils::lineWidthScaleFactor( context.renderContext(), mOffsetUnit );
double offsetY = mOffset.y() * QgsSymbolLayerV2Utils::lineWidthScaleFactor( context.renderContext(), mOffsetUnit );
QPointF outputOffset( offsetX, offsetY );

if ( mAngle )
outputOffset = _rotatedOffset( outputOffset, mAngle );
p->translate( point + outputOffset );
Expand Down Expand Up @@ -758,7 +780,7 @@ void QgsSvgMarkerSymbolLayerV2::renderPoint( const QPointF& point, QgsSymbolV2Re
if ( context.selected() )
{
QPen pen( context.selectionColor() );
double penWidth = context.outputLineWidth( 1.0 );
double penWidth = QgsSymbolLayerV2Utils::lineWidthScaleFactor( context.renderContext(), QgsSymbolV2::MM );
if ( penWidth > size / 20 )
{
// keep the pen width from covering symbol
Expand All @@ -782,11 +804,14 @@ QgsStringMap QgsSvgMarkerSymbolLayerV2::properties() const
QgsStringMap map;
map["name"] = QgsSymbolLayerV2Utils::symbolPathToName( mPath );
map["size"] = QString::number( mSize );
map["size_unit"] = QgsSymbolLayerV2Utils::encodeOutputUnit( mSizeUnit );
map["angle"] = QString::number( mAngle );
map["offset"] = QgsSymbolLayerV2Utils::encodePoint( mOffset );
map["offset_unit"] = QgsSymbolLayerV2Utils::encodeOutputUnit( mOffsetUnit );
map["fill"] = mFillColor.name();
map["outline"] = mOutlineColor.name();
map["outline-width"] = QString::number( mOutlineWidth );
map["outline_width_unit"] = QgsSymbolLayerV2Utils::encodeOutputUnit( mOutlineWidthUnit );
return map;
}

Expand All @@ -796,10 +821,30 @@ QgsSymbolLayerV2* QgsSvgMarkerSymbolLayerV2::clone() const
m->setFillColor( mFillColor );
m->setOutlineColor( mOutlineColor );
m->setOutlineWidth( mOutlineWidth );
m->setOutlineWidthUnit( mOutlineWidthUnit );
m->setOffset( mOffset );
m->setOffsetUnit( mOffsetUnit );
m->setSizeUnit( mSizeUnit );
return m;
}

void QgsSvgMarkerSymbolLayerV2::setOutputUnit( QgsSymbolV2::OutputUnit unit )
{
mSizeUnit = unit;
mOffsetUnit = unit;
mOutlineWidthUnit = unit;
}

QgsSymbolV2::OutputUnit QgsSvgMarkerSymbolLayerV2::outputUnit() const
{
QgsSymbolV2::OutputUnit unit = mSizeUnit;
if ( unit != mOffsetUnit || unit != mOutlineWidthUnit )
{
return QgsSymbolV2::Mixed;
}
return unit;
}

void QgsSvgMarkerSymbolLayerV2::writeSldMarker( QDomDocument &doc, QDomElement &element, QgsStringMap props ) const
{
// <Graphic>
Expand Down Expand Up @@ -876,7 +921,9 @@ QgsFontMarkerSymbolLayerV2::QgsFontMarkerSymbolLayerV2( QString fontFamily, QCha
mColor = color;
mAngle = angle;
mSize = pointSize;
mSizeUnit = QgsSymbolV2::MM;
mOffset = QPointF( 0, 0 );
mOffsetUnit = QgsSymbolV2::MM;
}

QgsSymbolLayerV2* QgsFontMarkerSymbolLayerV2::create( const QgsStringMap& props )
Expand All @@ -901,6 +948,10 @@ QgsSymbolLayerV2* QgsFontMarkerSymbolLayerV2::create( const QgsStringMap& props
QgsFontMarkerSymbolLayerV2* m = new QgsFontMarkerSymbolLayerV2( fontFamily, chr, pointSize, color, angle );
if ( props.contains( "offset" ) )
m->setOffset( QgsSymbolLayerV2Utils::decodePoint( props["offset"] ) );
if ( props.contains( "offset_unit" ) )
m->setOffsetUnit( QgsSymbolLayerV2Utils::decodeOutputUnit( props["offset_unit" ] ) );
if ( props.contains( "size_unit" ) )
m->setSizeUnit( QgsSymbolLayerV2Utils::decodeOutputUnit( props["size_unit"] ) );
return m;
}

Expand All @@ -912,7 +963,7 @@ QString QgsFontMarkerSymbolLayerV2::layerType() const
void QgsFontMarkerSymbolLayerV2::startRender( QgsSymbolV2RenderContext& context )
{
mFont = QFont( mFontFamily );
mFont.setPixelSize( context.outputLineWidth( mSize ) );
mFont.setPixelSize( mSize * QgsSymbolLayerV2Utils::lineWidthScaleFactor( context.renderContext(), mSizeUnit ) );
QFontMetrics fm( mFont );
mChrOffset = QPointF( fm.width( mChr ) / 2, -fm.ascent() / 2 );

Expand All @@ -934,7 +985,9 @@ void QgsFontMarkerSymbolLayerV2::renderPoint( const QPointF& point, QgsSymbolV2R


p->save();
QPointF outputOffset = QPointF( context.outputLineWidth( mOffset.x() ), context.outputLineWidth( mOffset.y() ) );
double offsetX = mOffset.x() * QgsSymbolLayerV2Utils::lineWidthScaleFactor( context.renderContext(), mOffsetUnit );
double offsetY = mOffset.y() * QgsSymbolLayerV2Utils::lineWidthScaleFactor( context.renderContext(), mOffsetUnit );
QPointF outputOffset( offsetX, offsetY );
if ( mAngle )
outputOffset = _rotatedOffset( outputOffset, mAngle );
p->translate( point + outputOffset );
Expand All @@ -958,16 +1011,20 @@ QgsStringMap QgsFontMarkerSymbolLayerV2::properties() const
props["font"] = mFontFamily;
props["chr"] = mChr;
props["size"] = QString::number( mSize );
props["size_unit"] = QgsSymbolLayerV2Utils::encodeOutputUnit( mSizeUnit );
props["color"] = QgsSymbolLayerV2Utils::encodeColor( mColor );
props["angle"] = QString::number( mAngle );
props["offset"] = QgsSymbolLayerV2Utils::encodePoint( mOffset );
props["offset_unit"] = QgsSymbolLayerV2Utils::encodeOutputUnit( mOffsetUnit );
return props;
}

QgsSymbolLayerV2* QgsFontMarkerSymbolLayerV2::clone() const
{
QgsFontMarkerSymbolLayerV2* m = new QgsFontMarkerSymbolLayerV2( mFontFamily, mChr, mSize, mColor, mAngle );
m->setOffset( mOffset );
m->setOffsetUnit( mOffsetUnit );
m->setSizeUnit( mSizeUnit );
return m;
}

Expand Down
7 changes: 7 additions & 0 deletions src/core/symbology-ng/qgsmarkersymbollayerv2.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,12 @@ class CORE_EXPORT QgsSvgMarkerSymbolLayerV2 : public QgsMarkerSymbolLayerV2
double outlineWidth() const { return mOutlineWidth; }
void setOutlineWidth( double w ) { mOutlineWidth = w; }

void setOutlineWidthUnit( QgsSymbolV2::OutputUnit unit ) { mOutlineWidthUnit = unit; }
QgsSymbolV2::OutputUnit outlineWidthUnit() const { return mOutlineWidthUnit; }

void setOutputUnit( QgsSymbolV2::OutputUnit unit );
QgsSymbolV2::OutputUnit outputUnit() const;

protected:
QString mPath;

Expand All @@ -146,6 +152,7 @@ class CORE_EXPORT QgsSvgMarkerSymbolLayerV2 : public QgsMarkerSymbolLayerV2
QColor mFillColor;
QColor mOutlineColor;
double mOutlineWidth;
QgsSymbolV2::OutputUnit mOutlineWidthUnit;
double mOrigSize;
};

Expand Down
20 changes: 18 additions & 2 deletions src/core/symbology-ng/qgssymbollayerv2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@


QgsMarkerSymbolLayerV2::QgsMarkerSymbolLayerV2( bool locked )
: QgsSymbolLayerV2( QgsSymbolV2::Marker, locked )
: QgsSymbolLayerV2( QgsSymbolV2::Marker, locked ), mSizeUnit( QgsSymbolV2::MM ), mOffsetUnit( QgsSymbolV2::MM )
{
}

QgsLineSymbolLayerV2::QgsLineSymbolLayerV2( bool locked )
: QgsSymbolLayerV2( QgsSymbolV2::Line, locked )
: QgsSymbolLayerV2( QgsSymbolV2::Line, locked ), mWidthUnit( QgsSymbolV2::MM )
{
}

Expand All @@ -47,6 +47,22 @@ void QgsMarkerSymbolLayerV2::drawPreviewIcon( QgsSymbolV2RenderContext& context,
stopRender( context );
}

void QgsMarkerSymbolLayerV2::setOutputUnit( QgsSymbolV2::OutputUnit unit )
{
mSizeUnit = unit;
mOffsetUnit = unit;
}

QgsSymbolV2::OutputUnit QgsMarkerSymbolLayerV2::outputUnit() const
{
QgsSymbolV2::OutputUnit unit = mSizeUnit;
if ( mOffsetUnit != unit )
{
return QgsSymbolV2::Mixed;
}
return unit;
}

void QgsLineSymbolLayerV2::drawPreviewIcon( QgsSymbolV2RenderContext& context, QSize size )
{
QPolygonF points;
Expand Down
18 changes: 18 additions & 0 deletions src/core/symbology-ng/qgssymbollayerv2.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ class CORE_EXPORT QgsSymbolLayerV2
void setLocked( bool locked ) { mLocked = locked; }
bool isLocked() const { return mLocked; }

virtual void setOutputUnit( QgsSymbolV2::OutputUnit unit ) { Q_UNUSED( unit ); } //= 0;
virtual QgsSymbolV2::OutputUnit outputUnit() const { return QgsSymbolV2::Mixed; } //= 0;

// used only with rending with symbol levels is turned on (0 = first pass, 1 = second, ...)
void setRenderingPass( int renderingPass ) { mRenderingPass = renderingPass; }
int renderingPass() const { return mRenderingPass; }
Expand Down Expand Up @@ -118,12 +121,23 @@ class CORE_EXPORT QgsMarkerSymbolLayerV2 : public QgsSymbolLayerV2
virtual void writeSldMarker( QDomDocument &doc, QDomElement &element, QgsStringMap props ) const
{ Q_UNUSED( props ); element.appendChild( doc.createComment( QString( "QgsMarkerSymbolLayerV2 %1 not implemented yet" ).arg( layerType() ) ) ); }

void setOffsetUnit( QgsSymbolV2::OutputUnit unit ) { mOffsetUnit = unit; }
QgsSymbolV2::OutputUnit offsetUnit() const { return mOffsetUnit; }

void setSizeUnit( QgsSymbolV2::OutputUnit unit ) { mSizeUnit = unit; }
QgsSymbolV2::OutputUnit sizeUnit() const { return mSizeUnit; }

virtual void setOutputUnit( QgsSymbolV2::OutputUnit unit );
virtual QgsSymbolV2::OutputUnit outputUnit() const;

protected:
QgsMarkerSymbolLayerV2( bool locked = false );

double mAngle;
double mSize;
QgsSymbolV2::OutputUnit mSizeUnit;
QPointF mOffset;
QgsSymbolV2::OutputUnit mOffsetUnit;
QgsSymbolV2::ScaleMethod mScaleMethod;
};

Expand All @@ -138,12 +152,16 @@ class CORE_EXPORT QgsLineSymbolLayerV2 : public QgsSymbolLayerV2
virtual void setWidth( double width ) { mWidth = width; }
virtual double width() const { return mWidth; }

void setWidthUnit( QgsSymbolV2::OutputUnit unit ) { mWidthUnit = unit; }
QgsSymbolV2::OutputUnit widthUnit() const { return mWidthUnit; }

void drawPreviewIcon( QgsSymbolV2RenderContext& context, QSize size );

protected:
QgsLineSymbolLayerV2( bool locked = false );

double mWidth;
QgsSymbolV2::OutputUnit mWidthUnit;
};

class CORE_EXPORT QgsFillSymbolLayerV2 : public QgsSymbolLayerV2
Expand Down
1 change: 0 additions & 1 deletion src/core/symbology-ng/qgssymbollayerv2utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,6 @@ QgsSymbolV2* QgsSymbolLayerV2Utils::loadSymbol( QDomElement& element )
return NULL;
}

symbol->setOutputUnit( decodeOutputUnit( element.attribute( "outputUnit" ) ) );
symbol->setAlpha( element.attribute( "alpha", "1.0" ).toDouble() );

return symbol;
Expand Down
49 changes: 39 additions & 10 deletions src/core/symbology-ng/qgssymbolv2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include <cmath>

QgsSymbolV2::QgsSymbolV2( SymbolType type, QgsSymbolLayerV2List layers )
: mType( type ), mLayers( layers ), mOutputUnit( MM ), mAlpha( 1.0 ), mRenderHints( 0 )
: mType( type ), mLayers( layers ), mAlpha( 1.0 ), mRenderHints( 0 )
{

// check they're all correct symbol layers
Expand All @@ -61,6 +61,38 @@ QgsSymbolV2::~QgsSymbolV2()
delete *it;
}

QgsSymbolV2::OutputUnit QgsSymbolV2::outputUnit() const
{
QgsSymbolV2::OutputUnit unit;

QgsSymbolLayerV2List::const_iterator it = mLayers.constBegin();
for ( ; it != mLayers.constEnd(); ++it )
{
if ( it == mLayers.constBegin() )
{
unit = ( *it )->outputUnit();
}
else
{
if (( *it )->outputUnit() != unit )
{
return QgsSymbolV2::Mixed;
}
}
}

return unit;
}

void QgsSymbolV2::setOutputUnit( QgsSymbolV2::OutputUnit u )
{
QgsSymbolLayerV2List::iterator it = mLayers.begin();
for ( ; it != mLayers.end(); ++it )
{
( *it )->setOutputUnit( u );
}
}

QgsSymbolV2* QgsSymbolV2::defaultSymbol( QGis::GeometryType geomType )
{
QgsSymbolV2* s = 0;
Expand Down Expand Up @@ -184,15 +216,15 @@ bool QgsSymbolV2::changeSymbolLayer( int index, QgsSymbolLayerV2* layer )

void QgsSymbolV2::startRender( QgsRenderContext& context, const QgsVectorLayer* layer )
{
QgsSymbolV2RenderContext symbolContext( context, mOutputUnit, mAlpha, false, mRenderHints );
QgsSymbolV2RenderContext symbolContext( context, outputUnit(), mAlpha, false, mRenderHints );
symbolContext.setLayer( layer );
for ( QgsSymbolLayerV2List::iterator it = mLayers.begin(); it != mLayers.end(); ++it )
( *it )->startRender( symbolContext );
}

void QgsSymbolV2::stopRender( QgsRenderContext& context )
{
QgsSymbolV2RenderContext symbolContext( context, mOutputUnit, mAlpha, false, mRenderHints );
QgsSymbolV2RenderContext symbolContext( context, outputUnit(), mAlpha, false, mRenderHints );
for ( QgsSymbolLayerV2List::iterator it = mLayers.begin(); it != mLayers.end(); ++it )
( *it )->stopRender( symbolContext );
}
Expand Down Expand Up @@ -220,7 +252,7 @@ QColor QgsSymbolV2::color()
void QgsSymbolV2::drawPreviewIcon( QPainter* painter, QSize size )
{
QgsRenderContext context = QgsSymbolLayerV2Utils::createRenderContext( painter );
QgsSymbolV2RenderContext symbolContext( context, mOutputUnit, mAlpha, false, mRenderHints );
QgsSymbolV2RenderContext symbolContext( context, outputUnit(), mAlpha, false, mRenderHints );
for ( QgsSymbolLayerV2List::iterator it = mLayers.begin(); it != mLayers.end(); ++it )
{
if ( mType == Fill && ( *it )->type() == Line )
Expand Down Expand Up @@ -504,7 +536,7 @@ QgsSymbolV2::ScaleMethod QgsMarkerSymbolV2::scaleMethod()

void QgsMarkerSymbolV2::renderPoint( const QPointF& point, const QgsFeature* f, QgsRenderContext& context, int layer, bool selected )
{
QgsSymbolV2RenderContext symbolContext( context, mOutputUnit, mAlpha, selected, mRenderHints, f );
QgsSymbolV2RenderContext symbolContext( context, outputUnit(), mAlpha, selected, mRenderHints, f );
if ( layer != -1 )
{
if ( layer >= 0 && layer < mLayers.count() )
Expand All @@ -522,7 +554,6 @@ void QgsMarkerSymbolV2::renderPoint( const QPointF& point, const QgsFeature* f,
QgsSymbolV2* QgsMarkerSymbolV2::clone() const
{
QgsSymbolV2* cloneSymbol = new QgsMarkerSymbolV2( cloneLayers() );
cloneSymbol->setOutputUnit( mOutputUnit );
cloneSymbol->setAlpha( mAlpha );
return cloneSymbol;
}
Expand Down Expand Up @@ -573,7 +604,7 @@ double QgsLineSymbolV2::width()

void QgsLineSymbolV2::renderPolyline( const QPolygonF& points, const QgsFeature* f, QgsRenderContext& context, int layer, bool selected )
{
QgsSymbolV2RenderContext symbolContext( context, mOutputUnit, mAlpha, selected, mRenderHints, f );
QgsSymbolV2RenderContext symbolContext( context, outputUnit(), mAlpha, selected, mRenderHints, f );
if ( layer != -1 )
{
if ( layer >= 0 && layer < mLayers.count() )
Expand All @@ -592,7 +623,6 @@ void QgsLineSymbolV2::renderPolyline( const QPolygonF& points, const QgsFeature*
QgsSymbolV2* QgsLineSymbolV2::clone() const
{
QgsSymbolV2* cloneSymbol = new QgsLineSymbolV2( cloneLayers() );
cloneSymbol->setOutputUnit( mOutputUnit );
cloneSymbol->setAlpha( mAlpha );
return cloneSymbol;
}
Expand All @@ -609,7 +639,7 @@ QgsFillSymbolV2::QgsFillSymbolV2( QgsSymbolLayerV2List layers )

void QgsFillSymbolV2::renderPolygon( const QPolygonF& points, QList<QPolygonF>* rings, const QgsFeature* f, QgsRenderContext& context, int layer, bool selected )
{
QgsSymbolV2RenderContext symbolContext( context, mOutputUnit, mAlpha, selected, mRenderHints, f );
QgsSymbolV2RenderContext symbolContext( context, outputUnit(), mAlpha, selected, mRenderHints, f );
if ( layer != -1 )
{
if ( layer >= 0 && layer < mLayers.count() )
Expand Down Expand Up @@ -643,7 +673,6 @@ void QgsFillSymbolV2::renderPolygon( const QPolygonF& points, QList<QPolygonF>*
QgsSymbolV2* QgsFillSymbolV2::clone() const
{
QgsSymbolV2* cloneSymbol = new QgsFillSymbolV2( cloneLayers() );
cloneSymbol->setOutputUnit( mOutputUnit );
cloneSymbol->setAlpha( mAlpha );
return cloneSymbol;
}
Expand Down
11 changes: 5 additions & 6 deletions src/core/symbology-ng/qgssymbolv2.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ class CORE_EXPORT QgsSymbolV2

enum OutputUnit
{
MM,
MapUnit
MM = 0,
MapUnit,
Mixed //mixed units in symbol layers
};

enum SymbolType
Expand Down Expand Up @@ -112,8 +113,8 @@ class CORE_EXPORT QgsSymbolV2

void toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props ) const;

OutputUnit outputUnit() const { return mOutputUnit; }
void setOutputUnit( OutputUnit u ) { mOutputUnit = u; }
QgsSymbolV2::OutputUnit outputUnit() const;
void setOutputUnit( QgsSymbolV2::OutputUnit u );

//! Get alpha transparency 1 for opaque, 0 for invisible
qreal alpha() const { return mAlpha; }
Expand All @@ -140,8 +141,6 @@ class CORE_EXPORT QgsSymbolV2
SymbolType mType;
QgsSymbolLayerV2List mLayers;

OutputUnit mOutputUnit;

/**Symbol opacity (in the range 0 - 1)*/
qreal mAlpha;

Expand Down
29 changes: 23 additions & 6 deletions src/core/symbology-ng/qgsvectorfieldsymbollayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "qgsvectorfieldsymbollayer.h"
#include "qgsvectorlayer.h"

QgsVectorFieldSymbolLayer::QgsVectorFieldSymbolLayer(): mXAttribute( "" ), mYAttribute( "" ), mScale( 1.0 ),
QgsVectorFieldSymbolLayer::QgsVectorFieldSymbolLayer(): mXAttribute( "" ), mYAttribute( "" ), mDistanceUnit( QgsSymbolV2::MM ), mScale( 1.0 ),
mVectorFieldType( Cartesian ), mAngleOrientation( ClockwiseFromNorth ), mAngleUnits( Degrees ), mXIndex( -1 ), mYIndex( -1 )
{
setSubSymbol( new QgsLineSymbolV2() );
Expand All @@ -28,6 +28,16 @@ QgsVectorFieldSymbolLayer::~QgsVectorFieldSymbolLayer()
{
}

void QgsVectorFieldSymbolLayer::setOutputUnit( QgsSymbolV2::OutputUnit unit )
{
mDistanceUnit = unit; //other units are not used
}

QgsSymbolV2::OutputUnit QgsVectorFieldSymbolLayer::outputUnit() const
{
return mDistanceUnit;
}

QgsSymbolLayerV2* QgsVectorFieldSymbolLayer::create( const QgsStringMap& properties )
{
QgsVectorFieldSymbolLayer* symbolLayer = new QgsVectorFieldSymbolLayer();
Expand All @@ -39,6 +49,10 @@ QgsSymbolLayerV2* QgsVectorFieldSymbolLayer::create( const QgsStringMap& propert
{
symbolLayer->setYAttribute( properties["y_attribute"] );
}
if ( properties.contains( "distance_unit" ) )
{
symbolLayer->setDistanceUnit( QgsSymbolLayerV2Utils::decodeOutputUnit( properties["distance_unit"] ) );
}
if ( properties.contains( "scale" ) )
{
symbolLayer->setScale( properties["scale"].toDouble() );
Expand Down Expand Up @@ -75,6 +89,8 @@ void QgsVectorFieldSymbolLayer::renderPoint( const QPointF& point, QgsSymbolV2Re
return;
}

const QgsRenderContext& ctx = context.renderContext();

const QgsFeature* f = context.feature();
if ( !f )
{
Expand Down Expand Up @@ -102,17 +118,17 @@ void QgsVectorFieldSymbolLayer::renderPoint( const QPointF& point, QgsSymbolV2Re
switch ( mVectorFieldType )
{
case Cartesian:
xComponent = context.outputLineWidth( xVal );
yComponent = context.outputLineWidth( yVal );
xComponent = xVal * QgsSymbolLayerV2Utils::lineWidthScaleFactor( ctx, mDistanceUnit );
yComponent = yVal * QgsSymbolLayerV2Utils::lineWidthScaleFactor( ctx, mDistanceUnit );
break;
case Polar:
convertPolarToCartesian( xVal, yVal, xComponent, yComponent );
xComponent = context.outputLineWidth( xComponent );
yComponent = context.outputLineWidth( yComponent );
xComponent = xComponent * QgsSymbolLayerV2Utils::lineWidthScaleFactor( ctx, mDistanceUnit );
yComponent = yComponent * QgsSymbolLayerV2Utils::lineWidthScaleFactor( ctx, mDistanceUnit );
break;
case Height:
xComponent = 0;
yComponent = context.outputLineWidth( yVal );
yComponent = yVal * QgsSymbolLayerV2Utils::lineWidthScaleFactor( ctx, mDistanceUnit );
break;
default:
break;
Expand Down Expand Up @@ -170,6 +186,7 @@ QgsStringMap QgsVectorFieldSymbolLayer::properties() const
QgsStringMap properties;
properties["x_attribute"] = mXAttribute;
properties["y_attribute"] = mYAttribute;
properties["distance_unit"] = QgsSymbolLayerV2Utils::encodeOutputUnit( mDistanceUnit );
properties["scale"] = QString::number( mScale );
properties["vector_field_type"] = QString::number( mVectorFieldType );
properties["angle_orientation"] = QString::number( mAngleOrientation );
Expand Down
7 changes: 7 additions & 0 deletions src/core/symbology-ng/qgsvectorfieldsymbollayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,16 @@ class CORE_EXPORT QgsVectorFieldSymbolLayer: public QgsMarkerSymbolLayerV2
void setAngleUnits( AngleUnits units ) { mAngleUnits = units; }
AngleUnits angleUnits() const { return mAngleUnits; }

void setOutputUnit( QgsSymbolV2::OutputUnit unit );
QgsSymbolV2::OutputUnit outputUnit() const;

void setDistanceUnit( QgsSymbolV2::OutputUnit unit ) { mDistanceUnit = unit; }
QgsSymbolV2::OutputUnit distanceUnit() const { return mDistanceUnit; }

private:
QString mXAttribute;
QString mYAttribute;
QgsSymbolV2::OutputUnit mDistanceUnit;
double mScale;
VectorFieldType mVectorFieldType;
AngleOrientation mAngleOrientation;
Expand Down
30 changes: 30 additions & 0 deletions src/gui/symbology-ng/qgsellipsesymbollayerv2widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ void QgsEllipseSymbolLayerV2Widget::setSymbolLayer( QgsSymbolLayerV2* layer )
blockComboSignals( true );
if ( mLayer )
{
mSymbolWidthUnitComboBox->setCurrentIndex( mLayer->symbolWidthUnit() );
mOutlineWidthUnitComboBox->setCurrentIndex( mLayer->outlineWidthUnit() );
mSymbolHeightUnitComboBox->setCurrentIndex( mLayer->symbolHeightUnit() );

if ( mLayer->widthField().isEmpty() )
{
Expand Down Expand Up @@ -312,6 +315,30 @@ void QgsEllipseSymbolLayerV2Widget::on_mDDShapeComboBox_currentIndexChanged( int
}
}

void QgsEllipseSymbolLayerV2Widget::on_mSymbolWidthUnitComboBox_currentIndexChanged( int index )
{
if ( mLayer )
{
mLayer->setSymbolWidthUnit(( QgsSymbolV2::OutputUnit ) index );
}
}

void QgsEllipseSymbolLayerV2Widget::on_mOutlineWidthUnitComboBox_currentIndexChanged( int index )
{
if ( mLayer )
{
mLayer->setOutlineWidthUnit(( QgsSymbolV2::OutputUnit ) index );
}
}

void QgsEllipseSymbolLayerV2Widget::on_mSymbolHeightUnitComboBox_currentIndexChanged( int index )
{
if ( mLayer )
{
mLayer->setSymbolHeightUnit(( QgsSymbolV2::OutputUnit ) index );
}
}

void QgsEllipseSymbolLayerV2Widget::blockComboSignals( bool block )
{
mDDSymbolWidthComboBox->blockSignals( block );
Expand All @@ -321,4 +348,7 @@ void QgsEllipseSymbolLayerV2Widget::blockComboSignals( bool block )
mDDFillColorComboBox->blockSignals( block );
mDDOutlineColorComboBox->blockSignals( block );
mDDShapeComboBox->blockSignals( block );
mSymbolWidthUnitComboBox->blockSignals( block );
mOutlineWidthUnitComboBox->blockSignals( block );
mSymbolHeightUnitComboBox->blockSignals( block );
}
4 changes: 4 additions & 0 deletions src/gui/symbology-ng/qgsellipsesymbollayerv2widget.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ class GUI_EXPORT QgsEllipseSymbolLayerV2Widget: public QgsSymbolLayerV2Widget, p
void on_mDDFillColorComboBox_currentIndexChanged( int idx );
void on_mDDOutlineColorComboBox_currentIndexChanged( int idx );
void on_mDDShapeComboBox_currentIndexChanged( int idx );

void on_mSymbolWidthUnitComboBox_currentIndexChanged( int index );
void on_mOutlineWidthUnitComboBox_currentIndexChanged( int index );
void on_mSymbolHeightUnitComboBox_currentIndexChanged( int index );
};

#endif // QGSELLIPSESYMBOLLAYERV2WIDGET_H
301 changes: 300 additions & 1 deletion src/gui/symbology-ng/qgssymbollayerv2widget.cpp

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions src/gui/symbology-ng/qgssymbollayerv2widget.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ class GUI_EXPORT QgsSimpleLineSymbolLayerV2Widget : public QgsSymbolLayerV2Widge
void offsetChanged();
void on_mCustomCheckBox_stateChanged( int state );
void on_mChangePatternButton_clicked();
void on_mPenWidthUnitComboBox_currentIndexChanged( int index );
void on_mOffsetUnitComboBox_currentIndexChanged( int index );
void on_mDashPatternUnitComboBox_currentIndexChanged( int index );


protected:
Expand Down Expand Up @@ -102,6 +105,8 @@ class GUI_EXPORT QgsSimpleMarkerSymbolLayerV2Widget : public QgsSymbolLayerV2Wid
void setSize();
void setAngle();
void setOffset();
void on_mSizeUnitComboBox_currentIndexChanged( int index );
void on_mOffsetUnitComboBox_currentIndexChanged( int index );

protected:
QgsSimpleMarkerSymbolLayerV2* mLayer;
Expand Down Expand Up @@ -133,6 +138,8 @@ class GUI_EXPORT QgsSimpleFillSymbolLayerV2Widget : public QgsSymbolLayerV2Widge
void borderWidthChanged();
void borderStyleChanged();
void offsetChanged();
void on_mBorderWidthUnitComboBox_currentIndexChanged( int index );
void on_mOffsetUnitComboBox_currentIndexChanged( int index );

protected:
QgsSimpleFillSymbolLayerV2* mLayer;
Expand Down Expand Up @@ -164,6 +171,8 @@ class GUI_EXPORT QgsMarkerLineSymbolLayerV2Widget : public QgsSymbolLayerV2Widge
void setRotate();
void setOffset();
void setPlacement();
void on_mIntervalUnitComboBox_currentIndexChanged( int index );
void on_mOffsetUnitComboBox_currentIndexChanged( int index );

protected:

Expand Down Expand Up @@ -202,6 +211,9 @@ class GUI_EXPORT QgsSvgMarkerSymbolLayerV2Widget : public QgsSymbolLayerV2Widget
void on_mChangeColorButton_clicked();
void on_mChangeBorderColorButton_clicked();
void on_mBorderWidthSpinBox_valueChanged( double d );
void on_mSizeUnitComboBox_currentIndexChanged( int index );
void on_mBorderWidthUnitComboBox_currentIndexChanged( int index );
void on_mOffsetUnitComboBox_currentIndexChanged( int index );

protected:

Expand Down Expand Up @@ -235,6 +247,7 @@ class GUI_EXPORT QgsLineDecorationSymbolLayerV2Widget : public QgsSymbolLayerV2W
public slots:
void colorChanged();
void penWidthChanged();
void on_mWidthUnitComboBox_currentIndexChanged( int index );

protected:
QgsLineDecorationSymbolLayerV2* mLayer;
Expand Down Expand Up @@ -275,6 +288,8 @@ class GUI_EXPORT QgsSVGFillSymbolLayerWidget : public QgsSymbolLayerV2Widget, pr
void on_mChangeColorButton_clicked();
void on_mChangeBorderColorButton_clicked();
void on_mBorderWidthSpinBox_valueChanged( double d );
void on_mTextureWidthUnitComboBox_currentIndexChanged( int index );
void on_mSvgOutlineWidthUnitComboBox_currentIndexChanged( int index );
};

//////////
Expand Down Expand Up @@ -304,6 +319,9 @@ class GUI_EXPORT QgsLinePatternFillSymbolLayerWidget : public QgsSymbolLayerV2Wi
void on_mLineWidthSpinBox_valueChanged( double d );
void on_mOffsetSpinBox_valueChanged( double d );
void on_mColorPushButton_clicked();
void on_mDistanceUnitComboBox_currentIndexChanged( int index );
void on_mLineWidthUnitComboBox_currentIndexChanged( int index );
void on_mOffsetUnitComboBox_currentIndexChanged( int index );
};

//////////
Expand Down Expand Up @@ -331,6 +349,10 @@ class GUI_EXPORT QgsPointPatternFillSymbolLayerWidget: public QgsSymbolLayerV2Wi
void on_mVerticalDistanceSpinBox_valueChanged( double d );
void on_mHorizontalDisplacementSpinBox_valueChanged( double d );
void on_mVerticalDisplacementSpinBox_valueChanged( double d );
void on_mHorizontalDistanceUnitComboBox_currentIndexChanged( int index );
void on_mVerticalDistanceUnitComboBox_currentIndexChanged( int index );
void on_mHorizontalDisplacementUnitComboBox_currentIndexChanged( int index );
void on_mVerticalDisplacementUnitComboBox_currentIndexChanged( int index );
};

/////////
Expand Down Expand Up @@ -360,6 +382,8 @@ class GUI_EXPORT QgsFontMarkerSymbolLayerV2Widget : public QgsSymbolLayerV2Widge
void setAngle( double angle );
void setCharacter( const QChar& chr );
void setOffset();
void on_mSizeUnitComboBox_currentIndexChanged( int index );
void on_mOffsetUnitComboBox_currentIndexChanged( int index );

protected:
QgsFontMarkerSymbolLayerV2* mLayer;
Expand Down
14 changes: 14 additions & 0 deletions src/gui/symbology-ng/qgsvectorfieldsymbollayerwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ void QgsVectorFieldSymbolLayerWidget::setSymbolLayer( QgsSymbolLayerV2* layer )
{
mRadiansRadioButton->setChecked( true );
}

mDistanceUnitComboBox->blockSignals( true );
mDistanceUnitComboBox->setCurrentIndex( mLayer->distanceUnit() );
mDistanceUnitComboBox->blockSignals( false );

emit changed();
}

Expand Down Expand Up @@ -194,3 +199,12 @@ void QgsVectorFieldSymbolLayerWidget::on_mCounterclockwiseFromEastRadioButton_to
emit changed();
}
}

void QgsVectorFieldSymbolLayerWidget::on_mDistanceUnitComboBox_currentIndexChanged( int index )
{
if ( mLayer )
{
mLayer->setDistanceUnit(( QgsSymbolV2::OutputUnit ) index );
emit changed();
}
}
1 change: 1 addition & 0 deletions src/gui/symbology-ng/qgsvectorfieldsymbollayerwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class GUI_EXPORT QgsVectorFieldSymbolLayerWidget: public QgsSymbolLayerV2Widget,
void on_mRadiansRadioButton_toggled( bool checked );
void on_mClockwiseFromNorthRadioButton_toggled( bool checked );
void on_mCounterclockwiseFromEastRadioButton_toggled( bool checked );
void on_mDistanceUnitComboBox_currentIndexChanged( int index );
};

#endif // QGSVECTORFIELDSYMBOLLAYERWIDGET_H
133 changes: 98 additions & 35 deletions src/ui/symbollayer/widget_ellipse.ui
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>336</width>
<height>336</height>
<height>357</height>
</rect>
</property>
<property name="windowTitle">
Expand All @@ -34,52 +34,49 @@
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QgsColorButtonV2" name="btnChangeColorBorder">
<item row="1" column="1">
<widget class="QgsColorButtonV2" name="btnChangeColorFill">
<property name="text">
<string>Change</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Fill color</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QgsColorButtonV2" name="btnChangeColorFill">
<item row="0" column="1">
<widget class="QgsColorButtonV2" name="btnChangeColorBorder">
<property name="text">
<string>Change</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="mSymbolWidthLabel">
<item row="3" column="0">
<widget class="QLabel" name="mSymbolWidthUnitLabel">
<property name="text">
<string>Symbol width</string>
<string>Symbol width unit</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QDoubleSpinBox" name="mWidthSpinBox">
<property name="decimals">
<number>6</number>
</property>
<property name="maximum">
<double>999999999.000000000000000</double>
</property>
<item row="5" column="1">
<widget class="QComboBox" name="mOutlineWidthUnitComboBox">
<item>
<property name="text">
<string>Millimeter</string>
</property>
</item>
<item>
<property name="text">
<string>Map unit</string>
</property>
</item>
</widget>
</item>
<item row="3" column="0">
<item row="4" column="0">
<widget class="QLabel" name="mOutlineWidthLabel">
<property name="text">
<string>Outline width</string>
</property>
</widget>
</item>
<item row="3" column="1">
<item row="4" column="1">
<widget class="QDoubleSpinBox" name="mOutlineWidthSpinBox">
<property name="decimals">
<number>6</number>
Expand All @@ -89,14 +86,31 @@
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="mSymbolHeightLabel">
<item row="6" column="1">
<widget class="QDoubleSpinBox" name="mRotationSpinBox"/>
</item>
<item row="6" column="0">
<widget class="QLabel" name="mRotationLabel">
<property name="text">
<string>Symbol height</string>
<string>Rotation</string>
</property>
</widget>
</item>
<item row="5" column="1">
<item row="3" column="1">
<widget class="QComboBox" name="mSymbolWidthUnitComboBox">
<item>
<property name="text">
<string>Millimeter</string>
</property>
</item>
<item>
<property name="text">
<string>Map unit</string>
</property>
</item>
</widget>
</item>
<item row="7" column="1">
<widget class="QDoubleSpinBox" name="mHeightSpinBox">
<property name="decimals">
<number>6</number>
Expand All @@ -106,7 +120,14 @@
</property>
</widget>
</item>
<item row="6" column="0" colspan="2">
<item row="5" column="0">
<widget class="QLabel" name="mOutlineWidthUnitLabel">
<property name="text">
<string>Outline width unit</string>
</property>
</widget>
</item>
<item row="9" column="0" colspan="2">
<widget class="QListWidget" name="mShapeListWidget">
<property name="dragDropMode">
<enum>QAbstractItemView::NoDragDrop</enum>
Expand Down Expand Up @@ -146,13 +167,55 @@
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QDoubleSpinBox" name="mRotationSpinBox"/>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Fill color</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="mRotationLabel">
<item row="2" column="0">
<widget class="QLabel" name="mSymbolWidthLabel">
<property name="text">
<string>Rotation</string>
<string>Symbol width</string>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="mSymbolHeightLabel">
<property name="text">
<string>Symbol height</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QDoubleSpinBox" name="mWidthSpinBox">
<property name="decimals">
<number>6</number>
</property>
<property name="maximum">
<double>999999999.000000000000000</double>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QComboBox" name="mSymbolHeightUnitComboBox">
<item>
<property name="text">
<string>Millimeter</string>
</property>
</item>
<item>
<property name="text">
<string>Map unit</string>
</property>
</item>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="mSymbolHeightUnitLabel">
<property name="text">
<string>Symbol height unit</string>
</property>
</widget>
</item>
Expand Down
109 changes: 77 additions & 32 deletions src/ui/symbollayer/widget_fontmarker.ui
Original file line number Diff line number Diff line change
Expand Up @@ -22,50 +22,64 @@
<property name="sizeConstraint">
<enum>QLayout::SetDefaultConstraint</enum>
</property>
<property name="horizontalSpacing">
<number>6</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="horizontalSpacing">
<number>6</number>
</property>
<item row="2" column="0">
<widget class="QLabel" name="label_2">
<item row="5" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Size</string>
<string>Offset X,Y</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QgsColorButtonV2" name="btnColor">
<item row="4" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Change</string>
<string>Rotation</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label">
<item row="3" column="0">
<widget class="QLabel" name="mSizeUnitLabel">
<property name="text">
<string>Font family</string>
<string>Size unit</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QDoubleSpinBox" name="spinAngle">
<property name="suffix">
<string>°</string>
</property>
<widget class="QComboBox" name="mSizeUnitComboBox">
<item>
<property name="text">
<string>Millimeter</string>
</property>
</item>
<item>
<property name="text">
<string>Map unit</string>
</property>
</item>
</widget>
</item>
<item row="2" column="1">
<widget class="QDoubleSpinBox" name="spinSize">
<property name="decimals">
<number>1</number>
<number>5</number>
</property>
<property name="maximum">
<double>360.000000000000000</double>
<double>99999999.000000000000000</double>
</property>
<property name="value">
<double>12.000000000000000</double>
</property>
</widget>
</item>
<item row="4" column="1">
<item row="5" column="1">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QDoubleSpinBox" name="spinOffsetX">
Expand Down Expand Up @@ -95,10 +109,10 @@
</item>
</layout>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_5">
<item row="2" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Offset X,Y</string>
<string>Size</string>
</property>
</widget>
</item>
Expand All @@ -109,26 +123,57 @@
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QDoubleSpinBox" name="spinSize">
<property name="decimals">
<number>5</number>
</property>
<property name="value">
<double>12.000000000000000</double>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Font family</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_4">
<item row="1" column="1">
<widget class="QgsColorButtonV2" name="btnColor">
<property name="text">
<string>Rotation</string>
<string>Change</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QFontComboBox" name="cboFont"/>
</item>
<item row="4" column="1">
<widget class="QDoubleSpinBox" name="spinAngle">
<property name="suffix">
<string>°</string>
</property>
<property name="decimals">
<number>1</number>
</property>
<property name="maximum">
<double>360.000000000000000</double>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QComboBox" name="mOffsetUnitComboBox">
<item>
<property name="text">
<string>Millimeter</string>
</property>
</item>
<item>
<property name="text">
<string>Map unit</string>
</property>
</item>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="mOffsetUnitLabel">
<property name="text">
<string>Offset unit</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
Expand Down
37 changes: 29 additions & 8 deletions src/ui/symbollayer/widget_linedecoration.ui
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@
</property>
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Color</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QgsColorButtonV2" name="btnChangeColor">
<property name="sizePolicy">
Expand All @@ -32,6 +39,13 @@
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Pen width</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QDoubleSpinBox" name="spinWidth">
<property name="alignment">
Expand All @@ -48,17 +62,24 @@
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Pen width</string>
</property>
<item row="2" column="1">
<widget class="QComboBox" name="mWidthUnitComboBox">
<item>
<property name="text">
<string>Millimeter</string>
</property>
</item>
<item>
<property name="text">
<string>Map unit</string>
</property>
</item>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label">
<item row="2" column="0">
<widget class="QLabel" name="mWidthUnitLabel">
<property name="text">
<string>Color</string>
<string>Width unit</string>
</property>
</widget>
</item>
Expand Down
130 changes: 98 additions & 32 deletions src/ui/symbollayer/widget_linepatternfill.ui
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,20 @@
<property name="margin">
<number>1</number>
</property>
<item row="1" column="1">
<widget class="QDoubleSpinBox" name="mDistanceSpinBox">
<property name="maximum">
<double>999999999.000000000000000</double>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QDoubleSpinBox" name="mAngleSpinBox">
<property name="maximum">
<double>360.000000000000000</double>
</property>
</widget>
</item>
<item row="3" column="1">
<item row="5" column="1">
<widget class="QDoubleSpinBox" name="mOffsetSpinBox">
<property name="decimals">
<number>5</number>
</property>
<property name="minimum">
<double>-99.000000000000000</double>
</property>
<property name="maximum">
<double>999999999.000000000000000</double>
</property>
</widget>
</item>
<item row="2" column="1">
<item row="3" column="1">
<widget class="QDoubleSpinBox" name="mLineWidthSpinBox">
<property name="decimals">
<number>5</number>
Expand All @@ -51,28 +40,98 @@
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QgsColorButtonV2" name="mColorPushButton">
<property name="text">
<string>Change</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="mAngleLabel">
<property name="text">
<string>Angle</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QDoubleSpinBox" name="mAngleSpinBox">
<property name="maximum">
<double>360.000000000000000</double>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QComboBox" name="mLineWidthUnitComboBox">
<item>
<property name="text">
<string>Millimeter</string>
</property>
</item>
<item>
<property name="text">
<string>Map unit</string>
</property>
</item>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="mDistanceLabel">
<property name="text">
<string>Distance</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="mDistanceUnitLabel">
<property name="text">
<string>Distance unit</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="mLineWidthLabel">
<property name="text">
<string>Line width</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="mLineWidthUnitLabel">
<property name="text">
<string>Line width unit</string>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="mColorLabel">
<property name="text">
<string>Color</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="mAngleLabel">
<item row="2" column="1">
<widget class="QComboBox" name="mDistanceUnitComboBox">
<item>
<property name="text">
<string>Millimeter</string>
</property>
</item>
<item>
<property name="text">
<string>Map unit</string>
</property>
</item>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="mOffsetLabel">
<property name="text">
<string>Angle</string>
<string>Offset</string>
</property>
</widget>
</item>
<item row="5" column="0" colspan="2">
<item row="8" column="0" colspan="2">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
Expand All @@ -85,24 +144,31 @@
</property>
</spacer>
</item>
<item row="4" column="1">
<widget class="QgsColorButtonV2" name="mColorPushButton">
<property name="text">
<string>Change</string>
<item row="1" column="1">
<widget class="QDoubleSpinBox" name="mDistanceSpinBox">
<property name="maximum">
<double>999999999.000000000000000</double>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="mDistanceLabel">
<property name="text">
<string>Distance</string>
</property>
<item row="6" column="1">
<widget class="QComboBox" name="mOffsetUnitComboBox">
<item>
<property name="text">
<string>Millimeter</string>
</property>
</item>
<item>
<property name="text">
<string>Map unit</string>
</property>
</item>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="mOffsetLabel">
<item row="6" column="0">
<widget class="QLabel" name="mOffsetUnitLabel">
<property name="text">
<string>Offset</string>
<string>Offset unit</string>
</property>
</widget>
</item>
Expand Down
28 changes: 28 additions & 0 deletions src/ui/symbollayer/widget_markerline.ui
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,34 @@
</property>
</widget>
</item>
<item row="8" column="2">
<widget class="QComboBox" name="mOffsetUnitComboBox">
<item>
<property name="text">
<string>Millimeter</string>
</property>
</item>
<item>
<property name="text">
<string>Map unit</string>
</property>
</item>
</widget>
</item>
<item row="1" column="2">
<widget class="QComboBox" name="mIntervalUnitComboBox">
<item>
<property name="text">
<string>Millimeter</string>
</property>
</item>
<item>
<property name="text">
<string>Map unit</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
<tabstops>
Expand Down
156 changes: 120 additions & 36 deletions src/ui/symbollayer/widget_pointpatternfill.ui
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>283</width>
<height>152</height>
<height>244</height>
</rect>
</property>
<property name="windowTitle">
Expand All @@ -17,21 +17,7 @@
<property name="margin">
<number>1</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="mHorizontalDistanceLabel">
<property name="text">
<string>Horizontal distance</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="mVerticalDistanceLabel">
<property name="text">
<string>Vertical distance</string>
</property>
</widget>
</item>
<item row="1" column="1">
<item row="2" column="1">
<widget class="QDoubleSpinBox" name="mVerticalDistanceSpinBox">
<property name="decimals">
<number>5</number>
Expand All @@ -42,13 +28,26 @@
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="mHorizontalDisplacementLabel">
<widget class="QLabel" name="mVerticalDistanceLabel">
<property name="text">
<string>Horizontal displacement</string>
<string>Vertical distance</string>
</property>
</widget>
</item>
<item row="3" column="1">
<item row="8" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="6" column="1">
<widget class="QDoubleSpinBox" name="mVerticalDisplacementSpinBox">
<property name="decimals">
<number>5</number>
Expand All @@ -58,20 +57,52 @@
</property>
</widget>
</item>
<item row="3" column="0">
<item row="3" column="1">
<widget class="QComboBox" name="mVerticalDistanceUnitComboBox">
<item>
<property name="text">
<string>Millimeter</string>
</property>
</item>
<item>
<property name="text">
<string>Map unit</string>
</property>
</item>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="mHorizontalDistanceUnitComboBox">
<item>
<property name="text">
<string>Millimeter</string>
</property>
</item>
<item>
<property name="text">
<string>Map unit</string>
</property>
</item>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="mVerticalDisplacementLabel">
<property name="text">
<string>Vertical displacement</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QDoubleSpinBox" name="mHorizontalDisplacementSpinBox">
<property name="decimals">
<number>5</number>
<item row="4" column="0">
<widget class="QLabel" name="mHorizontalDisplacementLabel">
<property name="text">
<string>Horizontal displacement</string>
</property>
<property name="maximum">
<double>9999999.990000000223517</double>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="mHorizontalDistanceLabel">
<property name="text">
<string>Horizontal distance</string>
</property>
</widget>
</item>
Expand All @@ -85,18 +116,71 @@
</property>
</widget>
</item>
<item row="4" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
<item row="4" column="1">
<widget class="QDoubleSpinBox" name="mHorizontalDisplacementSpinBox">
<property name="decimals">
<number>5</number>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
<property name="maximum">
<double>9999999.990000000223517</double>
</property>
</spacer>
</widget>
</item>
<item row="5" column="1">
<widget class="QComboBox" name="mHorizontalDisplacementUnitComboBox">
<item>
<property name="text">
<string>Millimeter</string>
</property>
</item>
<item>
<property name="text">
<string>Map unit</string>
</property>
</item>
</widget>
</item>
<item row="7" column="1">
<widget class="QComboBox" name="mVerticalDisplacementUnitComboBox">
<item>
<property name="text">
<string>Millimeter</string>
</property>
</item>
<item>
<property name="text">
<string>Map unit</string>
</property>
</item>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="mHorizontalDistanceUnitLabel">
<property name="text">
<string>Horizontal distance unit</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="mVerticalDistanceUnitLabel">
<property name="text">
<string>Vertical distance unit</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="mHorizontalDisplacementUnitLabel">
<property name="text">
<string>Horizontal displacement unit</string>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="mVerticalDisplacementUnitLabel">
<property name="text">
<string>Vertical displacement unit</string>
</property>
</widget>
</item>
</layout>
</widget>
Expand Down
120 changes: 81 additions & 39 deletions src/ui/symbollayer/widget_simplefill.ui
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>335</width>
<height>212</height>
<height>220</height>
</rect>
</property>
<property name="windowTitle">
Expand All @@ -19,51 +19,35 @@
</property>
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="3" column="1">
<widget class="QgsPenStyleComboBox" name="cboBorderStyle"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_3">
<item row="0" column="1">
<widget class="QgsColorButtonV2" name="btnChangeColor">
<property name="text">
<string>Border color</string>
<string>Change</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<item row="6" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Fill style</string>
<string>Offset X,Y</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QgsBrushStyleComboBox" name="cboFillStyle"/>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label">
<item row="2" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Color</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QDoubleSpinBox" name="spinBorderWidth">
<property name="decimals">
<number>5</number>
</property>
<property name="maximum">
<double>100000.000000000000000</double>
<string>Border color</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_6">
<item row="2" column="1">
<widget class="QgsColorButtonV2" name="btnChangeBorderColor">
<property name="text">
<string>Offset X,Y</string>
<string>Change</string>
</property>
</widget>
</item>
<item row="5" column="1">
<item row="6" column="1">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QDoubleSpinBox" name="spinOffsetX">
Expand Down Expand Up @@ -93,17 +77,40 @@
</item>
</layout>
</item>
<item row="2" column="1">
<widget class="QgsColorButtonV2" name="btnChangeBorderColor">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Change</string>
<string>Color</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QgsColorButtonV2" name="btnChangeColor">
<item row="1" column="1">
<widget class="QgsBrushStyleComboBox" name="cboFillStyle"/>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Change</string>
<string>Border width</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QgsPenStyleComboBox" name="cboBorderStyle"/>
</item>
<item row="4" column="1">
<widget class="QDoubleSpinBox" name="spinBorderWidth">
<property name="decimals">
<number>5</number>
</property>
<property name="maximum">
<double>100000.000000000000000</double>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Fill style</string>
</property>
</widget>
</item>
Expand All @@ -114,10 +121,45 @@
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_5">
<item row="5" column="1">
<widget class="QComboBox" name="mBorderWidthUnitComboBox">
<item>
<property name="text">
<string>Millimeter</string>
</property>
</item>
<item>
<property name="text">
<string>Map unit</string>
</property>
</item>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="mBorderWidthUnitLabel">
<property name="text">
<string>Border width</string>
<string>Border width unit</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QComboBox" name="mOffsetUnitComboBox">
<item>
<property name="text">
<string>Millimeter</string>
</property>
</item>
<item>
<property name="text">
<string>Map unit</string>
</property>
</item>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="mOffsetUnitLabel">
<property name="text">
<string>Offset unit</string>
</property>
</widget>
</item>
Expand Down
291 changes: 159 additions & 132 deletions src/ui/symbollayer/widget_simpleline.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,102 +6,161 @@
<rect>
<x>0</x>
<y>0</y>
<width>368</width>
<height>296</height>
<width>331</width>
<height>235</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Color</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QgsColorButtonV2" name="btnChangeColor">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Change</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Pen width</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QDoubleSpinBox" name="spinWidth">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="decimals">
<number>5</number>
</property>
<property name="maximum">
<double>100000.000000000000000</double>
</property>
<property name="value">
<double>1.000000000000000</double>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Offset</string>
</property>
</widget>
<widget class="QLabel" name="label">
<property name="text">
<string>Color</string>
</property>
</widget>
</item>
<item row="0" column="1" colspan="2">
<widget class="QgsColorButtonV2" name="btnChangeColor">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Change</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Pen width</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QDoubleSpinBox" name="spinWidth">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="decimals">
<number>5</number>
</property>
<property name="maximum">
<double>100000.000000000000000</double>
</property>
<property name="value">
<double>1.000000000000000</double>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QComboBox" name="mPenWidthUnitComboBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<property name="text">
<string>Millimeter</string>
</property>
</item>
<item row="2" column="1">
<widget class="QDoubleSpinBox" name="spinOffset">
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="decimals">
<number>5</number>
</property>
<property name="minimum">
<double>-100000.000000000000000</double>
</property>
<property name="maximum">
<double>100000.000000000000000</double>
</property>
</widget>
<item>
<property name="text">
<string>Map unit</string>
</property>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Pen style</string>
</property>
</widget>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Offset</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QDoubleSpinBox" name="spinOffset">
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="decimals">
<number>5</number>
</property>
<property name="minimum">
<double>-100000.000000000000000</double>
</property>
<property name="maximum">
<double>100000.000000000000000</double>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QComboBox" name="mOffsetUnitComboBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<property name="text">
<string>Millimeter</string>
</property>
</item>
<item row="3" column="1">
<widget class="QgsPenStyleComboBox" name="cboPenStyle"/>
<item>
<property name="text">
<string>Map unit</string>
</property>
</item>
</layout>
</widget>
</item>
<item row="1" column="0">
<item row="3" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Pen style</string>
</property>
</widget>
</item>
<item row="3" column="1" colspan="2">
<widget class="QgsPenStyleComboBox" name="cboPenStyle"/>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Join style</string>
</property>
</widget>
</item>
<item row="4" column="1" colspan="2">
<widget class="QgsPenJoinStyleComboBox" name="cboJoinStyle"/>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Cap style</string>
</property>
</widget>
</item>
<item row="5" column="1" colspan="2">
<widget class="QgsPenCapStyleComboBox" name="cboCapStyle"/>
</item>
<item row="6" column="0" colspan="3">
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="sizeConstraint">
<enum>QLayout::SetFixedSize</enum>
</property>
<item>
<widget class="QCheckBox" name="mCustomCheckBox">
<property name="text">
Expand All @@ -118,58 +177,26 @@
</item>
</layout>
</item>
<item row="2" column="0">
<spacer>
<property name="orientation">
<enum>Qt::Vertical</enum>
<item row="7" column="0">
<widget class="QLabel" name="mDashPatternUnitLabel">
<property name="text">
<string>Dash pattern unit</string>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>350</width>
<height>81</height>
</size>
</property>
</spacer>
</widget>
</item>
<item row="3" column="0">
<layout class="QGridLayout" name="gridLayout_1">
<item row="0" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Join style</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QgsPenJoinStyleComboBox" name="cboJoinStyle"/>
</item>
<item row="0" column="2" rowspan="2">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>38</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Cap style</string>
</property>
</widget>
<item row="7" column="1" colspan="2">
<widget class="QComboBox" name="mDashPatternUnitComboBox">
<item>
<property name="text">
<string>Millimeter</string>
</property>
</item>
<item row="1" column="1">
<widget class="QgsPenCapStyleComboBox" name="cboCapStyle"/>
<item>
<property name="text">
<string>Map unit</string>
</property>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
Expand Down
136 changes: 89 additions & 47 deletions src/ui/symbollayer/widget_simplemarker.ui
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>378</width>
<height>275</height>
<height>290</height>
</rect>
</property>
<property name="windowTitle">
Expand All @@ -19,37 +19,16 @@
</property>
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="3" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Angle</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QDoubleSpinBox" name="spinAngle">
<widget class="QDoubleSpinBox" name="spinSize">
<property name="decimals">
<number>2</number>
<number>5</number>
</property>
<property name="maximum">
<double>360.000000000000000</double>
</property>
<property name="singleStep">
<double>5.000000000000000</double>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QgsColorButtonV2" name="btnChangeColorBorder">
<property name="text">
<string>Change</string>
<double>100000.000000000000000</double>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QgsColorButtonV2" name="btnChangeColorFill">
<property name="text">
<string>Change</string>
<property name="value">
<double>1.000000000000000</double>
</property>
</widget>
</item>
Expand All @@ -60,34 +39,21 @@
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_3">
<item row="0" column="1">
<widget class="QgsColorButtonV2" name="btnChangeColorBorder">
<property name="text">
<string>Size</string>
<string>Change</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<item row="3" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Fill color</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QDoubleSpinBox" name="spinSize">
<property name="decimals">
<number>5</number>
</property>
<property name="maximum">
<double>100000.000000000000000</double>
</property>
<property name="value">
<double>1.000000000000000</double>
<string>Size</string>
</property>
</widget>
</item>
<item row="4" column="1">
<item row="6" column="1">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QDoubleSpinBox" name="spinOffsetX">
Expand All @@ -112,12 +78,88 @@
</layout>
</item>
<item row="4" column="0">
<widget class="QLabel" name="mSizeUnitLabel">
<property name="text">
<string>Size unit</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QDoubleSpinBox" name="spinAngle">
<property name="decimals">
<number>2</number>
</property>
<property name="maximum">
<double>360.000000000000000</double>
</property>
<property name="singleStep">
<double>5.000000000000000</double>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QComboBox" name="mSizeUnitComboBox">
<item>
<property name="text">
<string>Millimeter</string>
</property>
</item>
<item>
<property name="text">
<string>Map unit</string>
</property>
</item>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Fill color</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Angle</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QgsColorButtonV2" name="btnChangeColorFill">
<property name="text">
<string>Change</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Offset X,Y</string>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="mOffsetUnitLabel">
<property name="text">
<string>Offset unit</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QComboBox" name="mOffsetUnitComboBox">
<item>
<property name="text">
<string>Millimeter</string>
</property>
</item>
<item>
<property name="text">
<string>Map unit</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item>
Expand Down
Loading