From 94e5b362794ec1bf6a75d54d352688a79ba346e6 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Mon, 20 May 2019 19:31:40 -0700 Subject: [PATCH] pcbnew: Allow adding SHAPE_LINE_CHAIN to zones (cherry picked from commit bf0a466642728441aebde5ead3dd11d0ae68941b) --- pcbnew/class_zone.cpp | 12 ++++++++++++ pcbnew/class_zone.h | 2 ++ 2 files changed, 14 insertions(+) diff --git a/pcbnew/class_zone.cpp b/pcbnew/class_zone.cpp index 1c459c1119..4a1181c5b8 100644 --- a/pcbnew/class_zone.cpp +++ b/pcbnew/class_zone.cpp @@ -993,6 +993,18 @@ ZoneConnection ZONE_CONTAINER::GetPadConnection( D_PAD* aPad ) const } +void ZONE_CONTAINER::AddPolygon( const SHAPE_LINE_CHAIN& aPolygon ) +{ + wxASSERT( aPolygon.IsClosed() ); + + // Add the outline as a new polygon in the polygon set + if( m_Poly->OutlineCount() == 0 ) + m_Poly->AddOutline( aPolygon ); + else + m_Poly->AddHole( aPolygon ); +} + + void ZONE_CONTAINER::AddPolygon( std::vector< wxPoint >& aPolygon ) { if( aPolygon.empty() ) diff --git a/pcbnew/class_zone.h b/pcbnew/class_zone.h index 2e8c40a174..45c50de510 100644 --- a/pcbnew/class_zone.h +++ b/pcbnew/class_zone.h @@ -599,6 +599,8 @@ public: */ void AddPolygon( std::vector< wxPoint >& aPolygon ); + void AddPolygon( const SHAPE_LINE_CHAIN& aPolygon ); + void SetFillSegments( const ZONE_SEGMENT_FILL& aSegments ) { m_FillSegmList = aSegments;