Skip to content

Commit e432317

Browse files
committed
dxf export: use implicit cast QPointF to QgsPoint
1 parent 859efa5 commit e432317

File tree

2 files changed

+22
-22
lines changed

2 files changed

+22
-22
lines changed

src/core/symbology-ng/qgsellipsesymbollayerv2.cpp

+9-9
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@ bool QgsEllipseSymbolLayerV2::writeDxf( QgsDxfExport& e, double mmMapUnitScaleFa
696696
if ( qgsDoubleNear( halfWidth, halfHeight ) )
697697
{
698698
QPointF pt( t.map( QPointF( 0, 0 ) ) );
699-
e.writeFilledCircle( layerName, oc, QgsPoint( pt.x(), pt.y() ), halfWidth );
699+
e.writeFilledCircle( layerName, oc, pt, halfWidth );
700700
}
701701
else
702702
{
@@ -708,11 +708,11 @@ bool QgsEllipseSymbolLayerV2::writeDxf( QgsDxfExport& e, double mmMapUnitScaleFa
708708
double x = halfWidth * cos( angle );
709709
double y = halfHeight * sin( angle );
710710
QPointF pt( t.map( QPointF( x, y ) ) );
711-
line.push_back( QgsPoint( pt.x(), pt.y() ) );
711+
line.push_back( pt );
712712
}
713713
//close ellipse with first point
714714
line.push_back( line.at( 0 ) );
715-
e.writePolyline( line, layerName, "solid", oc, outlineWidth, true );
715+
e.writePolyline( line, layerName, "SOLID", oc, outlineWidth, true );
716716
}
717717
}
718718
else if ( symbolName == "rectangle" )
@@ -721,22 +721,22 @@ bool QgsEllipseSymbolLayerV2::writeDxf( QgsDxfExport& e, double mmMapUnitScaleFa
721721
QPointF pt2( t.map( QPointF( halfWidth, -halfHeight ) ) );
722722
QPointF pt3( t.map( QPointF( -halfWidth, halfHeight ) ) );
723723
QPointF pt4( t.map( QPointF( halfWidth, halfHeight ) ) );
724-
e.writeSolid( layerName, fc, QgsPoint( pt1.x(), pt1.y() ), QgsPoint( pt2.x(), pt2.y() ), QgsPoint( pt3.x(), pt3.y() ), QgsPoint( pt4.x(), pt4.y() ) );
724+
e.writeSolid( layerName, fc, pt1, pt2, pt3, pt4 );
725725
return true;
726726
}
727727
else if ( symbolName == "cross" )
728728
{
729729
QgsPolyline line1( 2 );
730730
QPointF pt1( t.map( QPointF( -halfWidth, 0 ) ) );
731731
QPointF pt2( t.map( QPointF( halfWidth, 0 ) ) );
732-
line1[0] = QgsPoint( pt1.x(), pt1.y() );
733-
line1[1] = QgsPoint( pt2.x(), pt2.y() );
732+
line1[0] = pt1;
733+
line1[1] = pt2;
734734
e.writePolyline( line1, layerName, "CONTINUOUS", oc, outlineWidth, false );
735735
QgsPolyline line2( 2 );
736736
QPointF pt3( t.map( QPointF( 0, halfHeight ) ) );
737737
QPointF pt4( t.map( QPointF( 0, -halfHeight ) ) );
738-
line2[0] = QgsPoint( pt3.x(), pt3.y() );
739-
line2[1] = QgsPoint( pt4.x(), pt4.y() );
738+
line2[0] = pt3;
739+
line2[1] = pt4;
740740
e.writePolyline( line2, layerName, "CONTINUOUS", oc, outlineWidth, false );
741741
return true;
742742
}
@@ -746,7 +746,7 @@ bool QgsEllipseSymbolLayerV2::writeDxf( QgsDxfExport& e, double mmMapUnitScaleFa
746746
QPointF pt2( t.map( QPointF( halfWidth, -halfHeight ) ) );
747747
QPointF pt3( t.map( QPointF( 0, halfHeight ) ) );
748748
QPointF pt4( t.map( QPointF( 0, halfHeight ) ) );
749-
e.writeSolid( layerName, fc, QgsPoint( pt1.x(), pt1.y() ), QgsPoint( pt2.x(), pt2.y() ), QgsPoint( pt3.x(), pt3.y() ), QgsPoint( pt4.x(), pt4.y() ) );
749+
e.writeSolid( layerName, fc, pt1, pt2, pt3, pt4 );
750750
return true;
751751
}
752752

src/core/symbology-ng/qgsmarkersymbollayerv2.cpp

+13-13
Original file line numberDiff line numberDiff line change
@@ -889,9 +889,9 @@ bool QgsSimpleMarkerSymbolLayerV2::writeDxf( QgsDxfExport& e, double mmMapUnitSc
889889
if ( mName == "circle" )
890890
{
891891
if ( mBrush.style() != Qt::NoBrush )
892-
e.writeFilledCircle( layerName, bc, QgsPoint( shift.x(), shift.y() ), halfSize );
892+
e.writeFilledCircle( layerName, bc, shift, halfSize );
893893
if ( mPen.style() != Qt::NoPen )
894-
e.writeCircle( layerName, pc, QgsPoint( shift.x(), shift.y() ), halfSize, "CONTINUOUS", outlineWidth );
894+
e.writeCircle( layerName, pc, shift, halfSize, "CONTINUOUS", outlineWidth );
895895
}
896896
else if ( mName == "square" || mName == "rectangle" )
897897
{
@@ -903,7 +903,7 @@ bool QgsSimpleMarkerSymbolLayerV2::writeDxf( QgsDxfExport& e, double mmMapUnitSc
903903
QPointF pt4 = t.map( QPointF( halfSize, halfSize ) );
904904

905905
if ( mBrush.style() != Qt::NoBrush )
906-
e.writeSolid( layerName, bc, QgsPoint( pt1.x(), pt1.y() ), QgsPoint( pt2.x(), pt2.y() ), QgsPoint( pt3.x(), pt3.y() ), QgsPoint( pt4.x(), pt4.y() ) );
906+
e.writeSolid( layerName, bc, pt1, pt2, pt3, pt4 );
907907

908908
if ( mPen.style() != Qt::NoPen )
909909
{
@@ -921,7 +921,7 @@ bool QgsSimpleMarkerSymbolLayerV2::writeDxf( QgsDxfExport& e, double mmMapUnitSc
921921
QPointF pt4 = t.map( QPointF( halfSize, 0 ) );
922922

923923
if ( mBrush.style() != Qt::NoBrush )
924-
e.writeSolid( layerName, bc, QgsPoint( pt1.x(), pt1.y() ), QgsPoint( pt2.x(), pt2.y() ), QgsPoint( pt3.x(), pt3.y() ), QgsPoint( pt4.x(), pt4.y() ) );
924+
e.writeSolid( layerName, bc, pt1, pt2, pt3, pt4 );
925925

926926
if ( mPen.style() != Qt::NoPen )
927927
{
@@ -938,7 +938,7 @@ bool QgsSimpleMarkerSymbolLayerV2::writeDxf( QgsDxfExport& e, double mmMapUnitSc
938938
QPointF pt3 = t.map( QPointF( 0, halfSize ) );
939939

940940
if ( mBrush.style() != Qt::NoBrush )
941-
e.writeSolid( layerName, bc, QgsPoint( pt1.x(), pt1.y() ), QgsPoint( pt2.x(), pt2.y() ), QgsPoint( pt3.x(), pt3.y() ), QgsPoint( pt3.x(), pt3.y() ) );
941+
e.writeSolid( layerName, bc, pt1, pt2, pt3, pt3 );
942942

943943
if ( mPen.style() != Qt::NoPen )
944944
{
@@ -959,7 +959,7 @@ bool QgsSimpleMarkerSymbolLayerV2::writeDxf( QgsDxfExport& e, double mmMapUnitSc
959959
QPointF pt2 = t.map( QPointF( 0, -halfSize ) );
960960

961961
if ( mPen.style() != Qt::NoPen )
962-
e.writeLine( QgsPoint( pt1.x(), pt1.y() ), QgsPoint( pt2.x(), pt2.y() ), layerName, "CONTINUOUS", pc, outlineWidth );
962+
e.writeLine( pt1, pt2, layerName, "CONTINUOUS", pc, outlineWidth );
963963
}
964964
else if ( mName == "cross" )
965965
{
@@ -970,8 +970,8 @@ bool QgsSimpleMarkerSymbolLayerV2::writeDxf( QgsDxfExport& e, double mmMapUnitSc
970970

971971
if ( mPen.style() != Qt::NoPen )
972972
{
973-
e.writeLine( QgsPoint( pt1.x(), pt1.y() ), QgsPoint( pt2.x(), pt2.y() ), layerName, "CONTINUOUS", pc, outlineWidth );
974-
e.writeLine( QgsPoint( pt3.x(), pt3.y() ), QgsPoint( pt4.x(), pt4.y() ), layerName, "CONTINUOUS", pc, outlineWidth );
973+
e.writeLine( pt1, pt2, layerName, "CONTINUOUS", pc, outlineWidth );
974+
e.writeLine( pt3, pt4, layerName, "CONTINUOUS", pc, outlineWidth );
975975
}
976976
}
977977
else if ( mName == "x" || mName == "cross2" )
@@ -983,8 +983,8 @@ bool QgsSimpleMarkerSymbolLayerV2::writeDxf( QgsDxfExport& e, double mmMapUnitSc
983983

984984
if ( mPen.style() != Qt::NoPen )
985985
{
986-
e.writeLine( QgsPoint( pt1.x(), pt1.y() ), QgsPoint( pt2.x(), pt2.y() ), layerName, "CONTINUOUS", pc, outlineWidth );
987-
e.writeLine( QgsPoint( pt3.x(), pt3.y() ), QgsPoint( pt4.x(), pt4.y() ), layerName, "CONTINUOUS", pc, outlineWidth );
986+
e.writeLine( pt1, pt2, layerName, "CONTINUOUS", pc, outlineWidth );
987+
e.writeLine( pt3, pt4, layerName, "CONTINUOUS", pc, outlineWidth );
988988
}
989989
}
990990
else if ( mName == "arrowhead" )
@@ -995,8 +995,8 @@ bool QgsSimpleMarkerSymbolLayerV2::writeDxf( QgsDxfExport& e, double mmMapUnitSc
995995

996996
if ( mPen.style() != Qt::NoPen )
997997
{
998-
e.writeLine( QgsPoint( pt1.x(), pt1.y() ), QgsPoint( pt2.x(), pt2.y() ), layerName, "CONTINUOUS", pc, outlineWidth );
999-
e.writeLine( QgsPoint( pt3.x(), pt3.y() ), QgsPoint( pt2.x(), pt2.y() ), layerName, "CONTINUOUS", pc, outlineWidth );
998+
e.writeLine( pt1, pt2, layerName, "CONTINUOUS", pc, outlineWidth );
999+
e.writeLine( pt3, pt2, layerName, "CONTINUOUS", pc, outlineWidth );
10001000
}
10011001
}
10021002
else if ( mName == "filled_arrowhead" )
@@ -1007,7 +1007,7 @@ bool QgsSimpleMarkerSymbolLayerV2::writeDxf( QgsDxfExport& e, double mmMapUnitSc
10071007

10081008
if ( mBrush.style() != Qt::NoBrush )
10091009
{
1010-
e.writeSolid( layerName, bc, QgsPoint( pt1.x(), pt1.y() ), QgsPoint( pt2.x(), pt2.y() ), QgsPoint( pt3.x(), pt3.y() ), QgsPoint( pt3.x(), pt3.y() ) );
1010+
e.writeSolid( layerName, bc, pt1, pt2, pt3, pt3 );
10111011
}
10121012
}
10131013
else

0 commit comments

Comments
 (0)