Skip to content

Commit b8c727f

Browse files
committed
dwg import: force polyline and hatch/ring continuity
1 parent e1562a7 commit b8c727f

File tree

1 file changed

+22
-5
lines changed

1 file changed

+22
-5
lines changed

src/app/dwg/qgsdwgimporter.cpp

+22-5
Original file line numberDiff line numberDiff line change
@@ -1759,14 +1759,20 @@ void QgsDwgImporter::addPolyline( const DRW_Polyline &data )
17591759
{
17601760
QgsCircularString *c = new QgsCircularString();
17611761
c->setPoints( s );
1762-
// QgsDebugMsg( QStringLiteral( "add circular string:%1" ).arg( c->asWkt() ) );
1762+
1763+
if ( i > 0 )
1764+
c->moveVertex( QgsVertexId( 0, 0, 0 ), cc.endPoint() );
1765+
17631766
cc.addCurve( c );
17641767
}
17651768
else
17661769
{
17671770
QgsLineString *c = new QgsLineString();
17681771
c->setPoints( s );
1769-
// QgsDebugMsg( QStringLiteral( "add line string:%1" ).arg( c->asWkt() ) );
1772+
1773+
if ( i > 0 )
1774+
c->moveVertex( QgsVertexId( 0, 0, 0 ), cc.endPoint() );
1775+
17701776
cc.addCurve( c );
17711777
}
17721778

@@ -2454,21 +2460,30 @@ void QgsDwgImporter::addHatch( const DRW_Hatch *pdata )
24542460
ls->setPoints( QgsPointSequence()
24552461
<< QgsPoint( QgsWkbTypes::PointZ, l->basePoint.x, l->basePoint.y, l->basePoint.z )
24562462
<< QgsPoint( QgsWkbTypes::PointZ, l->secPoint.x, l->secPoint.y, l->secPoint.z ) );
2457-
QgsDebugMsg( QStringLiteral( "add line string:%1" ).arg( ls->asWkt() ) );
2463+
2464+
if ( j > 0 )
2465+
ls->moveVertex( QgsVertexId( 0, 0, 0 ), cc->endPoint() );
2466+
24582467
cc->addCurve( ls );
24592468
}
24602469
else if ( a )
24612470
{
24622471
QgsCircularString *cs = new QgsCircularString();
24632472
circularStringFromArc( *a, *cs );
2464-
QgsDebugMsg( QStringLiteral( "add line string:%1" ).arg( cs->asWkt() ) );
2473+
2474+
if ( j > 0 )
2475+
cs->moveVertex( QgsVertexId( 0, 0, 0 ), cc->endPoint() );
2476+
24652477
cc->addCurve( cs );
24662478
}
24672479
else if ( sp )
24682480
{
24692481
QgsLineString *ls = new QgsLineString();
24702482
lineFromSpline( *sp, *ls );
2471-
QgsDebugMsg( QStringLiteral( "add line string:%1" ).arg( ls->asWkt() ) );
2483+
2484+
if ( j > 0 )
2485+
ls->moveVertex( QgsVertexId( 0, 0, 0 ), cc->endPoint() );
2486+
24722487
cc->addCurve( ls );
24732488
}
24742489
else
@@ -2486,6 +2501,8 @@ void QgsDwgImporter::addHatch( const DRW_Hatch *pdata )
24862501
#endif
24872502
}
24882503

2504+
cc->moveVertex( QgsVertexId( 0, 0, 0 ), cc->endPoint() );
2505+
24892506
if ( i == 0 )
24902507
{
24912508
// QgsDebugMsg( QStringLiteral( "set exterior ring:%1" ).arg( cc->asWkt() ) );

0 commit comments

Comments
 (0)