Skip to content
Permalink
Browse files
Ogr style string for line pattern fill
  • Loading branch information
mhugent committed Dec 25, 2012
1 parent 78f26ba commit c74509ef43060c0ed94316985391fb739651201f
Showing with 17 additions and 0 deletions.
  1. +15 −0 src/core/symbology-ng/qgsfillsymbollayerv2.cpp
  2. +2 −0 src/core/symbology-ng/qgsfillsymbollayerv2.h
@@ -885,6 +885,21 @@ void QgsLinePatternFillSymbolLayer::toSld( QDomDocument &doc, QDomElement &eleme
}
}

QString QgsLinePatternFillSymbolLayer::ogrFeatureStyle( double widthScaleFactor ) const
{
QString featureStyle;
featureStyle.append( "Brush(" );
featureStyle.append( QString( "fc:%1" ).arg( mColor.name() ) );
featureStyle.append( QString( ",bc:%1" ).arg( "#00000000" ) ); //transparent background
featureStyle.append( ",id:\"ogr-brush-2\"" );
featureStyle.append( QString( ",a:%1" ).arg( mLineAngle ) );
featureStyle.append( QString( ",s:%1" ).arg( mLineWidth * widthScaleFactor ) );
featureStyle.append( ",dx:0mm" );
featureStyle.append( QString( ",dy:%1mm" ).arg( mDistance * widthScaleFactor ) );
featureStyle.append( ")" );
return featureStyle;
}

QgsSymbolLayerV2* QgsLinePatternFillSymbolLayer::createFromSld( QDomElement &element )
{
QgsDebugMsg( "Entered." );
@@ -188,6 +188,8 @@ class CORE_EXPORT QgsLinePatternFillSymbolLayer: public QgsImageFillSymbolLayer

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

QString ogrFeatureStyle( double widthScaleFactor ) const;

//getters and setters
void setLineAngle( double a ) { mLineAngle = a; }
double lineAngle() const { return mLineAngle; }

0 comments on commit c74509e

Please sign in to comment.