Skip to content
Permalink
Browse files

Use new unit conversion function to calculate dxf line width

  • Loading branch information
mhugent committed Jan 17, 2014
1 parent cc195a6 commit 71e09ec38489444f8f418ebf38f92bc74595043b
Showing with 2 additions and 21 deletions.
  1. +2 −20 src/core/dxf/qgsdxfexport.cpp
  2. +0 −1 src/core/dxf/qgsdxfexport.h
@@ -1021,18 +1021,6 @@ void QgsDxfExport::addFeature( const QgsSymbolV2RenderContext& ctx, const QStrin
}
}

double QgsDxfExport::scaleToMapUnits( double value, QgsSymbolV2::OutputUnit symbolUnits, QGis::UnitType mapUnits ) const
{
if ( symbolUnits == QgsSymbolV2::MapUnit )
{
return 1.0;
}

//symbology in mm
value *= ( mSymbologyScaleDenominator * QGis::fromUnitToUnitFactor( mapUnits, QGis::Meters ) ) / 1000;
return value;
}

int QgsDxfExport::colorFromSymbolLayer( const QgsSymbolLayerV2* symbolLayer, const QgsSymbolV2RenderContext& ctx )
{
if ( !symbolLayer )
@@ -1111,14 +1099,8 @@ double QgsDxfExport::mapUnitScaleFactor( double scaleDenominator, QgsSymbolV2::O
{
return 1.0;
}
else if ( symbolUnits == QgsSymbolV2::MM && mapUnits == QGis::Meters )
{
return scaleDenominator / 1000;
}
else
{
return 1.0;
}
//MM symbol unit
return scaleDenominator * QGis::fromUnitToUnitFactor( QGis::Meters, mapUnits ) / 1000.0;
}

QList< QPair< QgsSymbolLayerV2*, QgsSymbolV2* > > QgsDxfExport::symbolLayers()
@@ -143,7 +143,6 @@ class CORE_EXPORT QgsDxfExport
QgsRectangle dxfExtent() const;

void addFeature( const QgsSymbolV2RenderContext& ctx, const QString& layer, const QgsSymbolLayerV2* symbolLayer, const QgsSymbolV2* symbol );
double scaleToMapUnits( double value, QgsSymbolV2::OutputUnit symbolUnits, QGis::UnitType mapUnits ) const;

//returns dxf palette index from symbol layer color
static int colorFromSymbolLayer( const QgsSymbolLayerV2* symbolLayer, const QgsSymbolV2RenderContext& ctx );

0 comments on commit 71e09ec

Please sign in to comment.
You can’t perform that action at this time.