Skip to content

Commit

Permalink
Ogr style string for line pattern fill
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed Dec 25, 2012
1 parent 78f26ba commit c74509e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/core/symbology-ng/qgsfillsymbollayerv2.cpp
Expand Up @@ -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." );
Expand Down
2 changes: 2 additions & 0 deletions src/core/symbology-ng/qgsfillsymbollayerv2.h
Expand Up @@ -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; }
Expand Down

0 comments on commit c74509e

Please sign in to comment.