Skip to content

Commit

Permalink
dxf export: more ellipse marker fixes (essentially like in simple mar…
Browse files Browse the repository at this point in the history
…ker)
  • Loading branch information
jef-n committed May 20, 2015
1 parent c6f9b07 commit e8587c3
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 4 deletions.
6 changes: 6 additions & 0 deletions src/core/dxf/qgsdxfexport.cpp
Expand Up @@ -3340,6 +3340,12 @@ void QgsDxfExport::writePoint( const QgsPoint& pt, const QString& layer, QColor

void QgsDxfExport::writePolyline( const QgsPolyline& line, const QString& layer, const QString& lineStyleName, QColor color, double width )
{
if ( line.size() == 0 )
{
QgsDebugMsg( QString( "writePolyline: empty line layer=%1 lineStyleName=%2" ).arg( layer ).arg( lineStyleName ) );
return;
}

writeGroup( 0, "LWPOLYLINE" );
writeHandle();
writeGroup( 8, layer );
Expand Down
30 changes: 26 additions & 4 deletions src/core/symbology-ng/qgsellipsesymbollayerv2.cpp
Expand Up @@ -679,7 +679,10 @@ bool QgsEllipseSymbolLayerV2::writeDxf( QgsDxfExport& e, double mmMapUnitScaleFa
}
//close ellipse with first point
line.push_back( line.at( 0 ) );
e.writePolyline( line, layerName, "CONTINUOUS", oc, outlineWidth );
if ( mBrush.style() != Qt::NoBrush )
e.writePolygon( QgsPolygon() << line, layerName, "SOLID", fc );
if ( mPen.style() != Qt::NoPen )
e.writePolyline( line, layerName, "CONTINUOUS", oc, outlineWidth );
}
}
else if ( symbolName == "rectangle" )
Expand All @@ -688,10 +691,19 @@ bool QgsEllipseSymbolLayerV2::writeDxf( QgsDxfExport& e, double mmMapUnitScaleFa
QPointF pt2( t.map( QPointF( halfWidth, -halfHeight ) ) );
QPointF pt3( t.map( QPointF( -halfWidth, halfHeight ) ) );
QPointF pt4( t.map( QPointF( halfWidth, halfHeight ) ) );
e.writeSolid( layerName, fc, pt1, pt2, pt3, pt4 );
if ( mBrush.style() != Qt::NoBrush )
e.writeSolid( layerName, fc, pt1, pt2, pt3, pt4 );
QgsPolyline line( 5 );
line[0] = pt1;
line[1] = pt2;
line[2] = pt3;
line[3] = pt4;
line[4] = pt1;
if ( mPen.style() != Qt::NoPen )
e.writePolyline( line, layerName, "CONTINUOUS", oc, outlineWidth );
return true;
}
else if ( symbolName == "cross" )
else if ( symbolName == "cross" && mPen.style() != Qt::NoPen )
{
QgsPolyline line1( 2 );
QPointF pt1( t.map( QPointF( -halfWidth, 0 ) ) );
Expand All @@ -713,7 +725,17 @@ bool QgsEllipseSymbolLayerV2::writeDxf( QgsDxfExport& e, double mmMapUnitScaleFa
QPointF pt2( t.map( QPointF( halfWidth, -halfHeight ) ) );
QPointF pt3( t.map( QPointF( 0, halfHeight ) ) );
QPointF pt4( t.map( QPointF( 0, halfHeight ) ) );
e.writeSolid( layerName, fc, pt1, pt2, pt3, pt4 );
if ( mBrush.style() != Qt::NoBrush )
e.writeSolid( layerName, fc, pt1, pt2, pt3, pt4 );
if ( mPen.style() != Qt::NoPen )
{
QgsPolyline line( 4 );
line[0] = pt1;
line[1] = pt2;
line[2] = pt3;
line[3] = pt4;
e.writePolyline( line, layerName, "CONTINUOUS", oc, outlineWidth );
}
return true;
}

Expand Down

0 comments on commit e8587c3

Please sign in to comment.