Skip to content
Permalink
Browse files
dxf export: link vertices to polyline (fixes #15484)
  • Loading branch information
jef-n committed Aug 28, 2016
1 parent 6f7b933 commit 052d3ef
Showing 1 changed file with 14 additions and 8 deletions.
@@ -449,11 +449,12 @@ void QgsDxfExport::writeGroup( const QColor& color, int exactMatchCode, int rgbC
minDist = dist;
}

if ( minDist == 0 && color.alpha() == 255 && minDistAt != 7 )
if ( minDist == 0 && minDistAt != 7 )
{
// exact full opaque match, not black/white
writeGroup( exactMatchCode, minDistAt );
return;
if ( color.alpha() == 255 )
return;
}

int c = ( color.red() & 0xff ) * 0x10000 + ( color.green() & 0xff ) * 0x100 + ( color.blue() & 0xff );
@@ -3435,21 +3436,24 @@ void QgsDxfExport::writePolyline( const QgsPointSequenceV2 &line, const QString&
else
{
writeGroup( 0, "POLYLINE" );
writeHandle();
writeGroup( 8, layer );
int plHandle = writeHandle();
writeGroup( 330, mBlockHandle );
writeGroup( 100, "AcDbEntity" );
writeGroup( 100, "AcDb3dPolyline" );
writeGroup( 8, layer );
writeGroup( 6, lineStyleName );
writeGroup( 0, QgsPointV2( QgsWKBTypes::PointZ ) );
writeGroup( color );
writeGroup( 100, "AcDb3dPolyline" );
writeGroup( 0, QgsPointV2( QgsWKBTypes::PointZ ) );
writeGroup( 70, 8 );

for ( int i = 0; i < n; i++ )
{
writeGroup( 0, "VERTEX" );
writeHandle();
writeGroup( 8, layer );
writeGroup( 330, plHandle );
writeGroup( 100, "AcDbEntity" );
writeGroup( 8, layer );
writeGroup( color );
writeGroup( 100, "AcDbVertex" );
writeGroup( 100, "AcDb3dPolylineVertex" );
writeGroup( 0, line[i] );
@@ -3458,8 +3462,10 @@ void QgsDxfExport::writePolyline( const QgsPointSequenceV2 &line, const QString&

writeGroup( 0, "SEQEND" );
writeHandle();
writeGroup( 8, layer );
writeGroup( 330, plHandle );
writeGroup( 100, "AcDbEntity" );
writeGroup( 8, layer );
writeGroup( color );
}
}

0 comments on commit 052d3ef

Please sign in to comment.