From 262a105416e68c4c5250e4dc121882fe38adf347 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Mon, 8 Oct 2018 15:50:59 +0200 Subject: [PATCH] Disable zone outlines and hatched lines rendering in printouts --- pcbnew/pcb_painter.cpp | 6 ++++-- pcbnew/pcb_painter.h | 13 ++++++++++++- pcbnew/pcbnew_printout.cpp | 7 +++++++ pcbnew/pcbnew_printout.h | 5 +---- 4 files changed, 24 insertions(+), 7 deletions(-) diff --git a/pcbnew/pcb_painter.cpp b/pcbnew/pcb_painter.cpp index a6886543c4..99418f0b3b 100644 --- a/pcbnew/pcb_painter.cpp +++ b/pcbnew/pcb_painter.cpp @@ -51,6 +51,8 @@ PCB_RENDER_SETTINGS::PCB_RENDER_SETTINGS() m_padNumbers = true; m_netNamesOnPads = true; m_netNamesOnTracks = true; + m_netNamesOnVias = true; + m_zoneOutlines = true; m_displayZone = DZ_SHOW_FILLED; m_clearance = CL_NONE; m_sketchBoardGfx = false; @@ -1108,7 +1110,7 @@ void PCB_PAINTER::draw( const ZONE_CONTAINER* aZone, int aLayer ) // Draw the outline const SHAPE_POLY_SET* outline = aZone->Outline(); - if( outline ) + if( m_pcbSettings.m_zoneOutlines && outline ) { m_gal->SetStrokeColor( color ); m_gal->SetIsFill( false ); @@ -1130,7 +1132,7 @@ void PCB_PAINTER::draw( const ZONE_CONTAINER* aZone, int aLayer ) int holes_count = outline->HoleCount( 0 ); for( int ii = 0; ii < holes_count; ++ii ) - m_gal->DrawPolyline( outline->CHole( 0, ii ) ); + m_gal->DrawPolyline( outline->CHole( 0, ii ) ); // Draw hatch lines for( const SEG& hatchLine : aZone->GetHatchLines() ) diff --git a/pcbnew/pcb_painter.h b/pcbnew/pcb_painter.h index 3f647b873b..879ae6c962 100644 --- a/pcbnew/pcb_painter.h +++ b/pcbnew/pcb_painter.h @@ -136,6 +136,14 @@ public: m_sketchBoardGfx = aEnabled; } + /** + * Turns on/off drawing outline and hatched lines for zones. + */ + void EnableZoneOutlines( bool aEnabled ) + { + m_zoneOutlines = aEnabled; + } + inline bool IsBackgroundDark() const override { auto luma = m_layerColors[ LAYER_PCB_BACKGROUND ].GetBrightness(); @@ -177,7 +185,10 @@ protected: bool m_netNamesOnTracks; ///> Flag determining if net names should be visible for vias - bool m_netNamesOnVias = true; + bool m_netNamesOnVias; + + ///> Flag determining if zones should have outlines drawn + bool m_zoneOutlines; ///> Maximum font size for netnames (and other dynamically shown strings) static const double MAX_FONT_SIZE; diff --git a/pcbnew/pcbnew_printout.cpp b/pcbnew/pcbnew_printout.cpp index 0b20fa4cd1..a21121e1f0 100644 --- a/pcbnew/pcbnew_printout.cpp +++ b/pcbnew/pcbnew_printout.cpp @@ -210,6 +210,13 @@ std::unique_ptr PCBNEW_PRINTOUT::getPainter( KIGFX::GAL* aGal ) } +KIGFX::PCB_PRINT_PAINTER::PCB_PRINT_PAINTER( GAL* aGal ) + : PCB_PAINTER( aGal ), m_drillMarkReal( false ), m_drillMarkSize( 0 ) +{ + m_pcbSettings.EnableZoneOutlines( false ); +} + + int KIGFX::PCB_PRINT_PAINTER::getDrillShape( const D_PAD* aPad ) const { return m_drillMarkReal ? KIGFX::PCB_PAINTER::getDrillShape( aPad ) : PAD_DRILL_SHAPE_CIRCLE; diff --git a/pcbnew/pcbnew_printout.h b/pcbnew/pcbnew_printout.h index 9609e49950..8881735a50 100644 --- a/pcbnew/pcbnew_printout.h +++ b/pcbnew/pcbnew_printout.h @@ -83,10 +83,7 @@ namespace KIGFX { class PCB_PRINT_PAINTER : public PCB_PAINTER { public: - PCB_PRINT_PAINTER( GAL* aGal ) - : PCB_PAINTER( aGal ), m_drillMarkReal( false ), m_drillMarkSize( 0 ) - { - } + PCB_PRINT_PAINTER( GAL* aGal ); /** * Set drill marks visibility and options.