Implement simple marker rect / square

This commit is contained in:
Marco Hugentobler 2013-11-21 15:45:38 +01:00
parent de6f83e08f
commit 222946b36a

View File

@ -709,18 +709,37 @@ void QgsSimpleMarkerSymbolLayerV2::writeDxf( QgsDxfExport& e, double mmMapUnitSc
size *= mmMapUnitScaleFactor;
}
double halfSize = size / 2.0;
int colorIndex = QgsDxfExport::closestColorMatch( mBrush.color().rgb() );
if ( mName == "circle" )
{
e.writeGroup( 0, "CIRCLE" );
e.writeGroup( 8, 0 );
int colorIndex = QgsDxfExport::closestColorMatch( mBrush.color().rgb() );
e.writeGroup( 8, "0" );
e.writeGroup( 62, colorIndex );
e.writeGroup( 10, halfSize );
e.writeGroup( 20, halfSize );
e.writeGroup( 30, 0.0 );
e.writeGroup( 40, halfSize );
}
else if ( mName == "square" || mName == "rectangle" )
{
e.writeGroup( 0, "SOLID" );
e.writeGroup( 8, "0" );
e.writeGroup( 62, colorIndex );
e.writeGroup( 10, 0.0 );
e.writeGroup( 20, 0.0 );
e.writeGroup( 30, 0.0 );
e.writeGroup( 11, size );
e.writeGroup( 21, 0.0 );
e.writeGroup( 31, 0.0 );
e.writeGroup( 12, 0 );
e.writeGroup( 22, size );
e.writeGroup( 32, 0.0 );
e.writeGroup( 13, size );
e.writeGroup( 23, size );
e.writeGroup( 33, 0.0 );
}
}
//////////