diff --git a/cvpcb/display_footprints_frame.cpp b/cvpcb/display_footprints_frame.cpp index d3b76949c9..c7442f63eb 100644 --- a/cvpcb/display_footprints_frame.cpp +++ b/cvpcb/display_footprints_frame.cpp @@ -455,12 +455,3 @@ void DISPLAY_FOOTPRINTS_FRAME::SyncToolbars() } -/* - * Redraw the BOARD items but not cursors, axis or grid. - */ -void BOARD::Print( PCB_BASE_FRAME* aFrame, wxDC* aDC, const wxPoint& aOffset ) -{ - if( !m_modules.empty() ) - GetFirstModule()->Print( aFrame, aDC ); -} - diff --git a/include/class_board_item.h b/include/class_board_item.h index c58c7b25ae..5f857b8ca1 100644 --- a/include/class_board_item.h +++ b/include/class_board_item.h @@ -152,12 +152,6 @@ public: m_Layer = aLayer; } - /** - * Function Print - * BOARD_ITEMs have their own color information. - */ - virtual void Print( PCB_BASE_FRAME* aFrame, wxDC* DC, const wxPoint& offset = ZeroOffset ) = 0; - /** * Function Duplicate * creates a copy of a BOARD_ITEM. diff --git a/include/origin_viewitem.h b/include/origin_viewitem.h index 37ec74687f..87393df676 100644 --- a/include/origin_viewitem.h +++ b/include/origin_viewitem.h @@ -62,11 +62,6 @@ public: void ViewDraw( int aLayer, VIEW* aView ) const override; - void Print( PCB_BASE_FRAME* aFrame, wxDC* DC, const wxPoint& offset = ZeroOffset ) override - { - wxASSERT( 0 ); // ORIGIN_VIEWITEM never added to BOARD - } - void ViewGetLayers( int aLayers[], int& aCount ) const override { aLayers[0] = LAYER_GP_OVERLAY; diff --git a/pcbnew/CMakeLists.txt b/pcbnew/CMakeLists.txt index 69bf802071..2618444ad5 100644 --- a/pcbnew/CMakeLists.txt +++ b/pcbnew/CMakeLists.txt @@ -287,7 +287,6 @@ set( PCBNEW_CLASS_SRCS pcbnew_config.cpp pcbnew_printout.cpp pcbnew_settings.cpp - pcb_legacy_draw_utils.cpp pcbplot.cpp plot_board_layers.cpp plot_brditems_plotter.cpp diff --git a/pcbnew/class_board.cpp b/pcbnew/class_board.cpp index a37a484b7f..268de28855 100644 --- a/pcbnew/class_board.cpp +++ b/pcbnew/class_board.cpp @@ -78,7 +78,6 @@ public: // pure virtuals: const wxPoint GetPosition() const override { return wxPoint(); } void SetPosition( const wxPoint& ) override {} - void Print( PCB_BASE_FRAME* aFrame, wxDC* DC, const wxPoint& aOffset ) override {} #if defined(DEBUG) void Show( int , std::ostream& ) const override {} diff --git a/pcbnew/class_board.h b/pcbnew/class_board.h index caa1835c0d..b24bac242a 100644 --- a/pcbnew/class_board.h +++ b/pcbnew/class_board.h @@ -747,16 +747,6 @@ public: void GetMsgPanelInfo( EDA_UNITS aUnits, std::vector& aList ) override; - /** - * Function Print. - * Print the BOARD items. - * @param aFrame = the current Frame - * @param aDC = the current device context - * @param aDrawMode = GR_COPY, GR_OR ... (not always used) - * @param aOffset = an draw offset value (default = 0,0) - */ - void Print( PCB_BASE_FRAME* aFrame, wxDC* aDC, const wxPoint& aOffset = ZeroOffset ) override; - /** * Function Visit * may be re-implemented for each derived class in order to handle diff --git a/pcbnew/class_dimension.cpp b/pcbnew/class_dimension.cpp index 049e6520fd..213de29acd 100644 --- a/pcbnew/class_dimension.cpp +++ b/pcbnew/class_dimension.cpp @@ -356,43 +356,6 @@ void DIMENSION::AdjustDimensionDetails( int aPrecision ) } -void DIMENSION::Print( PCB_BASE_FRAME* aFrame, wxDC* DC, const wxPoint& offset ) -{ - BOARD* brd = GetBoard(); - - if( brd->IsLayerVisible( m_Layer ) == false ) - return; - - m_Text.Print( aFrame, DC, offset ); - - COLOR4D gcolor = Pgm().GetSettingsManager().GetColorSettings()->GetColor( m_Layer ); - auto displ_opts = aFrame->GetDisplayOptions(); - bool filled = displ_opts.m_DisplayDrawItemsFill; - int width = m_Width; - - if( filled ) - { - GRLine( nullptr, DC, m_crossBarO + offset, m_crossBarF + offset, width, gcolor ); - GRLine( nullptr, DC, m_featureLineGO + offset, m_featureLineGF + offset, width, gcolor ); - GRLine( nullptr, DC, m_featureLineDO + offset, m_featureLineDF + offset, width, gcolor ); - GRLine( nullptr, DC, m_crossBarF + offset, m_arrowD1F + offset, width, gcolor ); - GRLine( nullptr, DC, m_crossBarF + offset, m_arrowD2F + offset, width, gcolor ); - GRLine( nullptr, DC, m_crossBarO + offset, m_arrowG1F + offset, width, gcolor ); - GRLine( nullptr, DC, m_crossBarO + offset, m_arrowG2F + offset, width, gcolor ); - } - else - { - GRCSegm( nullptr, DC, m_crossBarO + offset, m_crossBarF + offset, width, gcolor ); - GRCSegm( nullptr, DC, m_featureLineGO + offset, m_featureLineGF + offset, width, gcolor ); - GRCSegm( nullptr, DC, m_featureLineDO + offset, m_featureLineDF + offset, width, gcolor ); - GRCSegm( nullptr, DC, m_crossBarF + offset, m_arrowD1F + offset, width, gcolor ); - GRCSegm( nullptr, DC, m_crossBarF + offset, m_arrowD2F + offset, width, gcolor ); - GRCSegm( nullptr, DC, m_crossBarO + offset, m_arrowG1F + offset, width, gcolor ); - GRCSegm( nullptr, DC, m_crossBarO + offset, m_arrowG2F + offset, width, gcolor ); - } -} - - // see class_cotation.h void DIMENSION::GetMsgPanelInfo( EDA_UNITS aUnits, std::vector& aList ) { diff --git a/pcbnew/class_dimension.h b/pcbnew/class_dimension.h index 06ddce88bb..4bb10d7f7d 100644 --- a/pcbnew/class_dimension.h +++ b/pcbnew/class_dimension.h @@ -203,8 +203,6 @@ public: TEXTE_PCB& Text() { return m_Text; } TEXTE_PCB& Text() const { return *(const_cast (&m_Text)); } - void Print( PCB_BASE_FRAME* aFrame, wxDC* DC, const wxPoint& offset = ZeroOffset ) override; - /** * Function Move * @param offset : moving vector diff --git a/pcbnew/class_drawsegment.cpp b/pcbnew/class_drawsegment.cpp index 5ab31f8d1d..bd8688e67f 100644 --- a/pcbnew/class_drawsegment.cpp +++ b/pcbnew/class_drawsegment.cpp @@ -342,119 +342,6 @@ MODULE* DRAWSEGMENT::GetParentModule() const } -void DRAWSEGMENT::Print( PCB_BASE_FRAME* aFrame, wxDC* DC, const wxPoint& aOffset ) -{ - int ux0, uy0, dx, dy; - int l_trace; - int radius; - - BOARD* brd = GetBoard( ); - - if( brd->IsLayerVisible( GetLayer() ) == false ) - return; - - COLOR4D color = Pgm().GetSettingsManager().GetColorSettings()->GetColor( GetLayer() ); - auto displ_opts = aFrame->GetDisplayOptions(); - - l_trace = m_Width >> 1; // half trace width - - // Line start point or Circle and Arc center - ux0 = m_Start.x + aOffset.x; - uy0 = m_Start.y + aOffset.y; - - // Line end point or circle and arc start point - dx = m_End.x + aOffset.x; - dy = m_End.y + aOffset.y; - - bool filled = displ_opts.m_DisplayDrawItemsFill; - - if( m_Flags & FORCE_SKETCH ) - filled = SKETCH; - - switch( m_Shape ) - { - case S_CIRCLE: - radius = KiROUND( Distance( ux0, uy0, dx, dy ) ); - - if( filled ) - { - GRCircle( nullptr, DC, ux0, uy0, radius, m_Width, color ); - } - else - { - GRCircle( nullptr, DC, ux0, uy0, radius - l_trace, color ); - GRCircle( nullptr, DC, ux0, uy0, radius + l_trace, color ); - } - - break; - - case S_ARC: - double StAngle, EndAngle; - radius = KiROUND( Distance( ux0, uy0, dx, dy ) ); - StAngle = ArcTangente( dy - uy0, dx - ux0 ); - EndAngle = StAngle + m_Angle; - - if( StAngle > EndAngle ) - std::swap( StAngle, EndAngle ); - - if( filled ) - { - GRArc( nullptr, DC, ux0, uy0, StAngle, EndAngle, radius, m_Width, color ); - } - else - { - GRArc( nullptr, DC, ux0, uy0, StAngle, EndAngle, radius - l_trace, color ); - GRArc( nullptr, DC, ux0, uy0, StAngle, EndAngle, radius + l_trace, color ); - } - - break; - - case S_CURVE: - { - RebuildBezierToSegmentsPointsList( m_Width ); - - wxPoint& startp = m_BezierPoints[0]; - - for( unsigned int i = 1; i < m_BezierPoints.size(); i++ ) - { - wxPoint& endp = m_BezierPoints[i]; - - if( filled ) - GRFilledSegment( nullptr, DC, startp+aOffset, endp+aOffset, m_Width, color ); - else - GRCSegm( nullptr, DC, startp+aOffset, endp+aOffset, m_Width, color ); - - startp = m_BezierPoints[i]; - } - } - break; - - case S_POLYGON: - { - SHAPE_POLY_SET& outline = GetPolyShape(); - // Draw the polygon: only one polygon is expected - // However we provide a multi polygon shape drawing - // ( for the future or to show a non expected shape ) - for( int jj = 0; jj < outline.OutlineCount(); ++jj ) - { - SHAPE_LINE_CHAIN& poly = outline.Outline( jj ); - GRClosedPoly( nullptr, DC, poly.PointCount(), (const wxPoint*) &poly.CPoint( 0 ), - IsPolygonFilled(), GetWidth(), color, color ); - } - } - break; - - default: - if( filled ) - GRFillCSegm( nullptr, DC, ux0, uy0, dx, dy, m_Width, color ); - else - GRCSegm( nullptr, DC, ux0, uy0, dx, dy, m_Width, color ); - - break; - } -} - - void DRAWSEGMENT::GetMsgPanelInfo( EDA_UNITS aUnits, std::vector& aList ) { wxString msg; diff --git a/pcbnew/class_drawsegment.h b/pcbnew/class_drawsegment.h index 60e87fbe93..fce2767549 100644 --- a/pcbnew/class_drawsegment.h +++ b/pcbnew/class_drawsegment.h @@ -215,8 +215,6 @@ public: void SetPolyPoints( const std::vector& aPoints ); - void Print( PCB_BASE_FRAME* aFrame, wxDC* DC, const wxPoint& aOffset = ZeroOffset ) override; - void GetMsgPanelInfo( EDA_UNITS aUnits, std::vector& aList ) override; const EDA_RECT GetBoundingBox() const override; diff --git a/pcbnew/class_edge_mod.cpp b/pcbnew/class_edge_mod.cpp index ac7d609e82..592a8d66c5 100644 --- a/pcbnew/class_edge_mod.cpp +++ b/pcbnew/class_edge_mod.cpp @@ -121,126 +121,6 @@ void EDGE_MODULE::SetDrawCoord() } -void EDGE_MODULE::Print( PCB_BASE_FRAME* aFrame, wxDC* DC, const wxPoint& offset ) -{ - int ux0, uy0, dx, dy, radius, StAngle, EndAngle; - MODULE* module = (MODULE*) m_Parent; - BOARD* brd = GetBoard( ); - - if( !module || !brd->IsLayerVisible( m_Layer ) ) - return; - - COLOR4D color = Pgm().GetSettingsManager().GetColorSettings()->GetColor( m_Layer ); - auto displ_opts = aFrame->GetDisplayOptions(); - - ux0 = m_Start.x - offset.x; - uy0 = m_Start.y - offset.y; - - dx = m_End.x - offset.x; - dy = m_End.y - offset.y; - - bool filled = displ_opts.m_DisplayModEdgeFill; - - if( IsCopperLayer( m_Layer ) ) - filled = displ_opts.m_DisplayPcbTrackFill; - - switch( m_Shape ) - { - case S_SEGMENT: - if( filled ) - GRLine( nullptr, DC, ux0, uy0, dx, dy, m_Width, color ); - else - // SKETCH Mode - GRCSegm( nullptr, DC, ux0, uy0, dx, dy, m_Width, color ); - - break; - - case S_CIRCLE: - radius = KiROUND( Distance( ux0, uy0, dx, dy ) ); - - if( filled ) - { - GRCircle( nullptr, DC, ux0, uy0, radius, m_Width, color ); - } - else // SKETCH Mode - { - GRCircle( nullptr, DC, ux0, uy0, radius + (m_Width / 2), color ); - GRCircle( nullptr, DC, ux0, uy0, radius - (m_Width / 2), color ); - } - - break; - - case S_ARC: - radius = KiROUND( Distance( ux0, uy0, dx, dy ) ); - StAngle = ArcTangente( dy - uy0, dx - ux0 ); - EndAngle = StAngle + m_Angle; - - if( StAngle > EndAngle ) - std::swap( StAngle, EndAngle ); - - if( filled ) - { - GRArc( nullptr, DC, ux0, uy0, StAngle, EndAngle, radius, m_Width, color ); - } - else // SKETCH Mode - { - GRArc( nullptr, DC, ux0, uy0, StAngle, EndAngle, radius + (m_Width / 2), color ); - GRArc( nullptr, DC, ux0, uy0, StAngle, EndAngle, radius - (m_Width / 2), color ); - } - break; - - case S_POLYGON: - if( m_Poly.IsEmpty() ) - break; - - { - // We must compute absolute coordinates from m_PolyPoints - // which are relative to module position, orientation 0 - std::vector points; - - for( auto iter = m_Poly.CIterate(); iter; iter++ ) - { - points.emplace_back( iter->x,iter->y ); - } - - for( unsigned ii = 0; ii < points.size(); ii++ ) - { - wxPoint& pt = points[ii]; - - RotatePoint( &pt.x, &pt.y, module->GetOrientation() ); - pt += module->GetPosition() - offset; - } - - GRPoly( nullptr, DC, points.size(), &points[0], true, m_Width, color, color ); - } - break; - - case S_CURVE: - { - RebuildBezierToSegmentsPointsList( m_Width ); - - wxPoint& startp = m_BezierPoints[0]; - - for( unsigned int i = 1; i < m_BezierPoints.size(); i++ ) - { - wxPoint& endp = m_BezierPoints[i]; - - if( filled ) - GRFilledSegment( nullptr, DC, startp-offset, endp-offset, m_Width, color ); - else - GRCSegm( nullptr, DC, startp-offset, endp-offset, m_Width, color ); - - startp = m_BezierPoints[i]; - } - } - break; - - default: - break; - } -} - - // see class_edge_mod.h void EDGE_MODULE::GetMsgPanelInfo( EDA_UNITS aUnits, std::vector& aList ) { diff --git a/pcbnew/class_edge_mod.h b/pcbnew/class_edge_mod.h index cb7142fe40..d88b50b056 100644 --- a/pcbnew/class_edge_mod.h +++ b/pcbnew/class_edge_mod.h @@ -114,8 +114,6 @@ public: */ void SetDrawCoord(); - void Print( PCB_BASE_FRAME* aFrame, wxDC* DC, const wxPoint& offset = ZeroOffset ) override; - void GetMsgPanelInfo( EDA_UNITS aUnits, std::vector& aList ) override; wxString GetClass() const override diff --git a/pcbnew/class_marker_pcb.cpp b/pcbnew/class_marker_pcb.cpp index 804c0ed0bc..e48c474fd8 100644 --- a/pcbnew/class_marker_pcb.cpp +++ b/pcbnew/class_marker_pcb.cpp @@ -244,11 +244,3 @@ const BOX2I MARKER_PCB::ViewBBox() const } -void MARKER_PCB::Print( PCB_BASE_FRAME* aFrame, wxDC* aDC, const wxPoint& aOffset ) -{ - // JEY TODO: needs RENDER_SETTINGS passed in - RENDER_SETTINGS* renderSettings = aFrame->GetCanvas()->GetView()->GetPainter()->GetSettings(); - renderSettings->SetPrintDC( aDC ); - - PrintMarker( renderSettings, aOffset ); -} diff --git a/pcbnew/class_marker_pcb.h b/pcbnew/class_marker_pcb.h index 9d3a630403..2ba4045c8c 100644 --- a/pcbnew/class_marker_pcb.h +++ b/pcbnew/class_marker_pcb.h @@ -116,8 +116,6 @@ public: void Flip( const wxPoint& aCentre, bool aFlipLeftRight ) override; - void Print( PCB_BASE_FRAME* aFrame, wxDC* aDC, const wxPoint& aOffset = ZeroOffset ) override; - const wxPoint GetPosition() const override { return m_Pos; } void SetPosition( const wxPoint& aPos ) override { m_Pos = aPos; } diff --git a/pcbnew/class_module.cpp b/pcbnew/class_module.cpp index 2654fc0bf4..d64f49af1f 100644 --- a/pcbnew/class_module.cpp +++ b/pcbnew/class_module.cpp @@ -397,39 +397,6 @@ void MODULE::Remove( BOARD_ITEM* aBoardItem ) } -void MODULE::Print( PCB_BASE_FRAME* aFrame, wxDC* aDC, const wxPoint& aOffset ) -{ - for( auto pad : m_pads ) - pad->Print( aFrame, aDC, aOffset ); - - for( auto zone : m_fp_zones ) - zone->Print( aFrame, aDC, aOffset ); - - BOARD* brd = GetBoard(); - - // Draw graphic items - if( brd->IsElementVisible( LAYER_MOD_REFERENCES ) ) - m_Reference->Print( aFrame, aDC, aOffset ); - - if( brd->IsElementVisible( LAYER_MOD_VALUES ) ) - m_Value->Print( aFrame, aDC, aOffset ); - - for( auto item : m_drawings ) - { - switch( item->Type() ) - { - case PCB_MODULE_TEXT_T: - case PCB_MODULE_EDGE_T: - item->Print( aFrame, aDC, aOffset ); - break; - - default: - break; - } - } -} - - void MODULE::CalculateBoundingBox() { m_BoundaryBox = GetFootprintRect(); diff --git a/pcbnew/class_module.h b/pcbnew/class_module.h index 4b98918739..cdc5c7b14b 100644 --- a/pcbnew/class_module.h +++ b/pcbnew/class_module.h @@ -352,15 +352,6 @@ public: /* drawing functions */ - /** - * Function Print - * Prints the footprint to the \a aDC. - * @param aFrame = the current Frame - * @param aDC = Current Device Context - * @param aOffset = draw offset (usually wxPoint(0,0) - */ - void Print( PCB_BASE_FRAME* aFrame, wxDC* aDC, const wxPoint& aOffset = ZeroOffset ) override; - /** * function TransformPadsShapesWithClearanceToPolygon * generate pads shapes on layer aLayer as polygons, diff --git a/pcbnew/class_pad.h b/pcbnew/class_pad.h index 72b5b5a6c9..f6ec6f63ca 100644 --- a/pcbnew/class_pad.h +++ b/pcbnew/class_pad.h @@ -545,8 +545,6 @@ public: void SetThermalGap( int aGap ) { m_ThermalGap = aGap; } int GetThermalGap() const; - void Print( PCB_BASE_FRAME* aFrame, wxDC* aDC, const wxPoint& aOffset = ZeroOffset ) override; - /** * Function PrintShape * basic function to print a pad. diff --git a/pcbnew/class_pcb_target.cpp b/pcbnew/class_pcb_target.cpp index 297d2c367e..ef70750884 100644 --- a/pcbnew/class_pcb_target.cpp +++ b/pcbnew/class_pcb_target.cpp @@ -72,68 +72,6 @@ PCB_TARGET::~PCB_TARGET() } -/* Print PCB_TARGET object: 2 segments + 1 circle - * The circle radius is half the radius of the target - * 2 lines have length the diameter of the target - */ -void PCB_TARGET::Print( PCB_BASE_FRAME* aFrame, wxDC* DC, const wxPoint& offset ) -{ - int radius, ox, oy, width; - int dx1, dx2, dy1, dy2; - - ox = m_Pos.x + offset.x; - oy = m_Pos.y + offset.y; - - BOARD* brd = GetBoard( ); - - if( brd->IsLayerVisible( m_Layer ) == false ) - return; - - COLOR4D gcolor = Pgm().GetSettingsManager().GetColorSettings()->GetColor( m_Layer ); - auto displ_opts = aFrame->GetDisplayOptions(); - bool filled = displ_opts.m_DisplayDrawItemsFill; - width = m_Width; - - radius = m_Size / 3; - - if( GetShape() ) // shape X - radius = m_Size / 2; - - if( filled ) - GRCircle( nullptr, DC, ox, oy, radius, width, gcolor ); - else - { - GRCircle( nullptr, DC, ox, oy, radius + (width / 2), gcolor ); - GRCircle( nullptr, DC, ox, oy, radius - (width / 2), gcolor ); - } - - - radius = m_Size / 2; - dx1 = radius; - dy1 = 0; - dx2 = 0; - dy2 = radius; - - if( GetShape() ) // shape X - { - dx1 = dy1 = radius; - dx2 = dx1; - dy2 = -dy1; - } - - if( filled ) - { - GRLine( nullptr, DC, ox - dx1, oy - dy1, ox + dx1, oy + dy1, width, gcolor ); - GRLine( nullptr, DC, ox - dx2, oy - dy2, ox + dx2, oy + dy2, width, gcolor ); - } - else - { - GRCSegm( nullptr, DC, ox - dx1, oy - dy1, ox + dx1, oy + dy1, width, gcolor ); - GRCSegm( nullptr, DC, ox - dx2, oy - dy2, ox + dx2, oy + dy2, width, gcolor ); - } -} - - bool PCB_TARGET::HitTest( const wxPoint& aPosition, int aAccuracy ) const { int dX = aPosition.x - m_Pos.x; diff --git a/pcbnew/class_pcb_target.h b/pcbnew/class_pcb_target.h index 689232e383..3882317377 100644 --- a/pcbnew/class_pcb_target.h +++ b/pcbnew/class_pcb_target.h @@ -83,8 +83,6 @@ public: void Flip( const wxPoint& aCentre, bool aFlipLeftRight ) override; - void Print( PCB_BASE_FRAME* aFrame, wxDC* DC, const wxPoint& offset = ZeroOffset ) override; - wxString GetClass() const override { return wxT( "PCB_TARGET" ); diff --git a/pcbnew/class_pcb_text.cpp b/pcbnew/class_pcb_text.cpp index ba9ee4dfdd..9b92498ecc 100644 --- a/pcbnew/class_pcb_text.cpp +++ b/pcbnew/class_pcb_text.cpp @@ -111,28 +111,6 @@ void TEXTE_PCB::SetTextAngle( double aAngle ) } -void TEXTE_PCB::Print( PCB_BASE_FRAME* aFrame, wxDC* DC, const wxPoint& offset ) -{ - BOARD* brd = GetBoard(); - - if( brd->IsLayerVisible( m_Layer ) == false ) - return; - - auto color = Pgm().GetSettingsManager().GetColorSettings()->GetColor( m_Layer ); - EDA_DRAW_MODE_T fillmode = FILLED; - auto& displ_opts = aFrame->GetDisplayOptions(); - - if( displ_opts.m_DisplayDrawItemsFill == SKETCH ) - fillmode = SKETCH; - - // JEY TODO: needs RENDER_SETTINGS passed in... - RENDER_SETTINGS* renderSettings = aFrame->GetCanvas()->GetView()->GetPainter()->GetSettings(); - renderSettings->SetPrintDC( DC ); - - EDA_TEXT::Print( renderSettings, offset, color, fillmode ); -} - - void TEXTE_PCB::GetMsgPanelInfo( EDA_UNITS aUnits, std::vector& aList ) { wxString msg; diff --git a/pcbnew/class_pcb_text.h b/pcbnew/class_pcb_text.h index eae004cfc2..44ac48d3a7 100644 --- a/pcbnew/class_pcb_text.h +++ b/pcbnew/class_pcb_text.h @@ -81,8 +81,6 @@ public: void Flip( const wxPoint& aCentre, bool aFlipLeftRight ) override; - void Print( PCB_BASE_FRAME* aFrame, wxDC* DC, const wxPoint& offset = ZeroOffset ) override; - void GetMsgPanelInfo( EDA_UNITS aUnits, std::vector& aList ) override; bool HitTest( const wxPoint& aPosition, int aAccuracy ) const override diff --git a/pcbnew/class_text_mod.cpp b/pcbnew/class_text_mod.cpp index a7bf42b1b4..f77d9710d6 100644 --- a/pcbnew/class_text_mod.cpp +++ b/pcbnew/class_text_mod.cpp @@ -261,57 +261,6 @@ const EDA_RECT TEXTE_MODULE::GetBoundingBox() const } -void TEXTE_MODULE::Print( PCB_BASE_FRAME* aFrame, wxDC* aDC, const wxPoint& aOffset ) -{ - /* parent must *not* be NULL (a footprint text without a footprint parent has no sense) */ - wxASSERT( m_Parent ); - - BOARD* brd = GetBoard( ); - KIGFX::COLOR4D color = Pgm().GetSettingsManager().GetColorSettings()->GetColor( GetLayer() ); - PCB_LAYER_ID text_layer = GetLayer(); - - if( !brd->IsLayerVisible( m_Layer ) - || ( IsFrontLayer( text_layer ) && !brd->IsElementVisible( LAYER_MOD_TEXT_FR ) ) - || ( IsBackLayer( text_layer ) && !brd->IsElementVisible( LAYER_MOD_TEXT_BK ) ) ) - return; - - if( !brd->IsElementVisible( LAYER_MOD_REFERENCES ) && GetText() == wxT( "${REFERENCE}" ) ) - return; - - if( !brd->IsElementVisible( LAYER_MOD_VALUES ) && GetText() == wxT( "${VALUE}" ) ) - return; - - // Invisible texts are still drawn (not plotted) in LAYER_MOD_TEXT_INVISIBLE - // Just because we must have to edit them (at least to make them visible) - if( !IsVisible() ) - { - if( !brd->IsElementVisible( LAYER_MOD_TEXT_INVISIBLE ) ) - return; - - color = Pgm().GetSettingsManager().GetColorSettings()->GetColor( LAYER_MOD_TEXT_INVISIBLE ); - } - - // Draw mode compensation for the width - int width = GetEffectiveTextPenWidth(); - - if( aFrame->GetDisplayOptions().m_DisplayModTextFill == SKETCH ) - width = -width; - - wxPoint pos = GetTextPos() - aOffset; - - // Draw the text proper, with the right attributes - wxSize size = GetTextSize(); - double orient = GetDrawRotation(); - - // If the text is mirrored : negate size.x (mirror / Y axis) - if( IsMirrored() ) - size.x = -size.x; - - GRText( aDC, pos, color, GetShownText(), orient, size, GetHorizJustify(), GetVertJustify(), - width, IsItalic(), IsBold() ); -} - - double TEXTE_MODULE::GetDrawRotation() const { MODULE* module = (MODULE*) m_Parent; diff --git a/pcbnew/class_text_mod.h b/pcbnew/class_text_mod.h index a572d12f6e..4c7312d402 100644 --- a/pcbnew/class_text_mod.h +++ b/pcbnew/class_text_mod.h @@ -179,17 +179,6 @@ public: ///> Set relative coordinates. void SetLocalCoord(); - /* drawing functions */ - - /** - * Function Print - * Print the text according to the footprint pos and orient - * @param aFrame = the current Frame - * @param aDC = Current Device Context - * @param aOffset = draw offset (usually wxPoint(0,0) - */ - void Print( PCB_BASE_FRAME* aFrame, wxDC* aDC, const wxPoint& aOffset = ZeroOffset ) override; - void GetMsgPanelInfo( EDA_UNITS aUnits, std::vector& aList ) override; bool TextHitTest( const wxPoint& aPoint, int aAccuracy = 0 ) const override; diff --git a/pcbnew/class_track.cpp b/pcbnew/class_track.cpp index 161974b100..110b528a80 100644 --- a/pcbnew/class_track.cpp +++ b/pcbnew/class_track.cpp @@ -429,37 +429,6 @@ void VIA::SanitizeLayers() } -void TRACK::Print( PCB_BASE_FRAME* aFrame, wxDC* aDC, const wxPoint& aOffset ) -{ - BOARD* brd = GetBoard(); - auto color = Pgm().GetSettingsManager().GetColorSettings()->GetColor( m_Layer ); - - if( !brd->IsLayerVisible( m_Layer ) || !brd->IsElementVisible( LAYER_TRACKS ) ) - return; - - auto displ_opts = aFrame->GetDisplayOptions(); - - color.a = 0.588; - - // Draw track as line if width <= 1pixel: - if( aDC->LogicalToDeviceXRel( m_Width ) <= 1 ) - { - GRLine( nullptr, aDC, m_Start + aOffset, m_End + aOffset, m_Width, color ); - return; - } - - if( !displ_opts.m_DisplayPcbTrackFill || GetState( FORCE_SKETCH ) ) - { - GRCSegm( nullptr, aDC, m_Start + aOffset, m_End + aOffset, m_Width, color ); - } - else - { - GRFillCSegm( nullptr, aDC, m_Start.x + aOffset.x, m_Start.y + aOffset.y, - m_End.x + aOffset.x, m_End.y + aOffset.y, m_Width, color ); - } -} - - void TRACK::ViewGetLayers( int aLayers[], int& aCount ) const { // Show the track and its netname on different layers @@ -495,176 +464,6 @@ const BOX2I TRACK::ViewBBox() const } -void VIA::Print( PCB_BASE_FRAME* aFrame, wxDC* aDC, const wxPoint& aOffset ) -{ - int radius; - int fillvia = 0; - PCB_SCREEN* screen = aFrame->GetScreen(); - auto& displ_opts = aFrame->GetDisplayOptions(); - BOARD* brd = GetBoard(); - COLOR4D color = Pgm().GetSettingsManager().GetColorSettings()->GetColor( - LAYER_VIAS + static_cast( GetViaType() ) ); - - if( displ_opts.m_DisplayViaFill == FILLED ) - fillvia = 1; - - if( !brd->IsElementVisible( LAYER_VIAS + static_cast( GetViaType() ) ) ) - return; - - // Only draw the via if at least one of the layers it crosses is being displayed - if( !( brd->GetVisibleLayers() & GetLayerSet() ).any() ) - return; - - color.a = 0.588; - - radius = m_Width >> 1; - // for small via size on screen (radius < 4 pixels) draw a simplified shape - - int radius_in_pixels = aDC->LogicalToDeviceXRel( radius ); - bool fast_draw = false; - - // Vias are drawn as a filled circle or a double circle. The hole will be drawn later - int drill_radius = GetDrillValue() / 2; - int inner_radius = radius - aDC->DeviceToLogicalXRel( 2 ); - - if( radius_in_pixels < MIN_VIA_DRAW_SIZE ) - { - fast_draw = true; - fillvia = false; - } - - if( fillvia ) - { - GRFilledCircle( nullptr, aDC, m_Start + aOffset, radius, color ); - } - else - { - GRCircle( nullptr, aDC, m_Start + aOffset, radius, 0, color ); - - if ( fast_draw ) - return; - - GRCircle( nullptr, aDC, m_Start + aOffset, inner_radius, 0, color ); - } - - if( fillvia ) - { - bool blackpenstate = false; - - if( screen->m_IsPrinting ) - { - blackpenstate = GetGRForceBlackPenState(); - GRForceBlackPen( false ); - color = WHITE; - } - else - { - color = BLACK; // or DARKGRAY; - } - - // Draw hole if the radius is > 1pixel. - if( aDC->LogicalToDeviceXRel( drill_radius ) > 1 ) - GRFilledCircle( nullptr, aDC, m_Start.x + aOffset.x, m_Start.y + aOffset.y, - drill_radius, 0, color, color ); - - if( screen->m_IsPrinting ) - GRForceBlackPen( blackpenstate ); - } - else - { - if( drill_radius < inner_radius ) // We can show the via hole - GRCircle( nullptr, aDC, m_Start + aOffset, drill_radius, 0, color ); - } - - if( ShowClearance( displ_opts, this ) ) - { - GRCircle( nullptr, aDC, m_Start + aOffset, radius + GetClearance(), 0, color ); - } - - // for Micro Vias, draw a partial cross : X on component layer, or + on copper layer - // (so we can see 2 superimposed microvias ): - if( GetViaType() == VIATYPE::MICROVIA ) - { - int ax, ay, bx, by; - - if( IsOnLayer( B_Cu ) ) - { - ax = radius; ay = 0; - bx = drill_radius; by = 0; - } - else - { - ax = ay = (radius * 707) / 1000; - bx = by = (drill_radius * 707) / 1000; - } - - // lines '|' or '\' - GRLine( nullptr, aDC, m_Start.x + aOffset.x - ax, m_Start.y + aOffset.y - ay, - m_Start.x + aOffset.x - bx, m_Start.y + aOffset.y - by, 0, color ); - GRLine( nullptr, aDC, m_Start.x + aOffset.x + bx, m_Start.y + aOffset.y + by, - m_Start.x + aOffset.x + ax, m_Start.y + aOffset.y + ay, 0, color ); - - // lines - or '/' - GRLine( nullptr, aDC, m_Start.x + aOffset.x + ay, m_Start.y + aOffset.y - ax, - m_Start.x + aOffset.x + by, m_Start.y + aOffset.y - bx, 0, color ); - GRLine( nullptr, aDC, m_Start.x + aOffset.x - by, m_Start.y + aOffset.y + bx, - m_Start.x + aOffset.x - ay, m_Start.y + aOffset.y + ax, 0, color ); - } - - // for Buried Vias, draw a partial line : orient depending on layer pair - // (so we can see superimposed buried vias ): - if( GetViaType() == VIATYPE::BLIND_BURIED ) - { - int ax = 0, ay = radius, bx = 0, by = drill_radius; - PCB_LAYER_ID layer_top, layer_bottom; - - LayerPair( &layer_top, &layer_bottom ); - - // lines for the top layer - RotatePoint( &ax, &ay, layer_top * 3600.0 / brd->GetCopperLayerCount( ) ); - RotatePoint( &bx, &by, layer_top * 3600.0 / brd->GetCopperLayerCount( ) ); - GRLine( nullptr, aDC, m_Start.x + aOffset.x - ax, m_Start.y + aOffset.y - ay, - m_Start.x + aOffset.x - bx, m_Start.y + aOffset.y - by, 0, color ); - - // lines for the bottom layer - ax = 0; ay = radius; bx = 0; by = drill_radius; - RotatePoint( &ax, &ay, layer_bottom * 3600.0 / brd->GetCopperLayerCount( ) ); - RotatePoint( &bx, &by, layer_bottom * 3600.0 / brd->GetCopperLayerCount( ) ); - GRLine( nullptr, aDC, m_Start.x + aOffset.x - ax, m_Start.y + aOffset.y - ay, - m_Start.x + aOffset.x - bx, m_Start.y + aOffset.y - by, 0, color ); - } - - // Display the short netname: - if( GetNetCode() == NETINFO_LIST::UNCONNECTED ) - return; - - if( displ_opts.m_DisplayNetNamesMode == 0 || displ_opts.m_DisplayNetNamesMode == 1 ) - return; - - NETINFO_ITEM* net = GetNet(); - - if( net == NULL ) - return; - - wxString text = UnescapeString( net->GetShortNetname() ); - int len = text.Len(); - - if( len > 0 ) - { - // calculate a good size for the text - int tsize = m_Width / len; - - if( aDC->LogicalToDeviceXRel( tsize ) >= MIN_TEXT_SIZE ) - { - tsize = (tsize * 7) / 10; // small reduction to give a better look, inside via - - GRHaloText( aDC, m_Start, color, WHITE, BLACK, text, 0, wxSize( tsize, tsize ), - GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, tsize/7, false, false ); - } - } -} - - void VIA::ViewGetLayers( int aLayers[], int& aCount ) const { aLayers[0] = LAYER_VIAS_HOLES; diff --git a/pcbnew/class_track.h b/pcbnew/class_track.h index d608c3113a..62da08bc71 100644 --- a/pcbnew/class_track.h +++ b/pcbnew/class_track.h @@ -143,8 +143,6 @@ public: return GetLineLength( m_Start, m_End ); } - void Print( PCB_BASE_FRAME* aFrame, wxDC* DC, const wxPoint& aOffset = ZeroOffset ) override; - /** * Function TransformShapeWithClearanceToPolygon * Convert the track shape to a closed polygon @@ -349,8 +347,6 @@ public: // Do not create a copy constructor. The one generated by the compiler is adequate. - void Print( PCB_BASE_FRAME* aFrame, wxDC* DC, const wxPoint& aOffset = ZeroOffset ) override; - bool IsOnLayer( PCB_LAYER_ID aLayer ) const override; virtual LSET GetLayerSet() const override; diff --git a/pcbnew/class_zone.cpp b/pcbnew/class_zone.cpp index 18f7584921..36662503ff 100644 --- a/pcbnew/class_zone.cpp +++ b/pcbnew/class_zone.cpp @@ -318,118 +318,6 @@ bool ZONE_CONTAINER::IsOnLayer( PCB_LAYER_ID aLayer ) const } -void ZONE_CONTAINER::Print( PCB_BASE_FRAME* aFrame, wxDC* DC, const wxPoint& offset ) -{ - if( !DC ) - return; - - wxPoint seg_start, seg_end; - PCB_LAYER_ID curr_layer = aFrame->GetActiveLayer(); - BOARD* brd = GetBoard(); - PCB_LAYER_ID draw_layer = UNDEFINED_LAYER; - - LSET layers = GetLayerSet() & brd->GetVisibleLayers(); - - // If there are no visible layers, return - if( layers.count() == 0 ) - return; - - /* Keepout zones can exist on multiple layers - * Thus, determining which color to use to render them is a bit tricky. - * In descending order of priority: - * - * 1. If in GR_HIGHLIGHT mode: - * a. If zone is on selected layer, use layer color! - * b. Else, use grey - * 1. Not in GR_HIGHLIGHT mode - * a. If zone is on selected layer, use layer color - * b. Else, use color of top-most (visible) layer - * - */ - if( GetIsKeepout() ) - { - // At least one layer must be provided! - assert( GetLayerSet().count() > 0 ); - - // Not on any visible layer? - if( layers.count() == 0 ) - return; - - // Is keepout zone present on the selected layer? - if( layers.test( curr_layer ) ) - { - draw_layer = curr_layer; - } - else - { - // Select the first (top) visible layer - if( layers.count() > 0 ) - { - draw_layer = layers.Seq()[0]; - } - else - { - draw_layer = GetLayerSet().Seq()[0]; - } - } - - } - /* Non-keepout zones are easier to deal with - */ - else - { - if( brd->IsLayerVisible( GetLayer() ) == false ) - return; - - draw_layer = GetLayer(); - } - - assert( draw_layer != UNDEFINED_LAYER ); - - COLOR4D color = Pgm().GetSettingsManager().GetColorSettings()->GetColor( draw_layer ); - - auto displ_opts = aFrame->GetDisplayOptions(); - - if( displ_opts.m_ContrastModeDisplay ) - { - if( !IsOnLayer( curr_layer ) ) - color = COLOR4D( DARKDARKGRAY ); - } - - color.a = 0.588; - - // draw the lines - std::vector lines; - lines.reserve( (GetNumCorners() * 2) + 2 ); - - // Iterate through the segments of the outline - for( auto iterator = m_Poly->IterateSegmentsWithHoles(); iterator; iterator++ ) - { - // Create the segment - SEG segment = *iterator; - - lines.push_back( static_cast( segment.A ) + offset ); - lines.push_back( static_cast( segment.B ) + offset ); - } - - GRLineArray( nullptr, DC, lines, 0, color ); - - // draw hatches - lines.clear(); - lines.reserve( (m_HatchLines.size() * 2) + 2 ); - - for( unsigned ic = 0; ic < m_HatchLines.size(); ic++ ) - { - seg_start = static_cast( m_HatchLines[ic].A ) + offset; - seg_end = static_cast( m_HatchLines[ic].B ) + offset; - lines.push_back( seg_start ); - lines.push_back( seg_end ); - } - - GRLineArray( nullptr, DC, lines, 0, color ); -} - - void ZONE_CONTAINER::PrintFilledArea( PCB_BASE_FRAME* aFrame, wxDC* DC, const wxPoint& offset ) { static std::vector CornersBuffer; diff --git a/pcbnew/class_zone.h b/pcbnew/class_zone.h index e4b6c76a18..96fd24af73 100644 --- a/pcbnew/class_zone.h +++ b/pcbnew/class_zone.h @@ -105,16 +105,6 @@ public: virtual LSET GetLayerSet() const override; - /** - * Function Print - * Prints the zone outline. - * @param aFrame = current Frame - * @param DC = current Device Context - * @param aDrawMode = GR_OR, GR_XOR, GR_COPY .. - * @param offset = Draw offset (usually wxPoint(0,0)) - */ - void Print( PCB_BASE_FRAME* aFrame, wxDC* DC, const wxPoint& offset = ZeroOffset ) override; - /** * Function PrintFilledArea * Draws the filled area for this zone (polygon list .m_FilledPolysList) diff --git a/pcbnew/netinfo.h b/pcbnew/netinfo.h index a7460e08b0..3c93d83e48 100644 --- a/pcbnew/netinfo.h +++ b/pcbnew/netinfo.h @@ -210,13 +210,6 @@ public: #endif - /** - * Function Peinr - * @todo we actually could show a NET, simply show all the tracks and - * a pads or net name on pad and vias - */ - void Print( PCB_BASE_FRAME* aFrame, wxDC* DC, const wxPoint& offset ) override; - /** * Function GetNet * @return int - the netcode diff --git a/pcbnew/netinfo_item.cpp b/pcbnew/netinfo_item.cpp index 65baa116fe..e9725b7dac 100644 --- a/pcbnew/netinfo_item.cpp +++ b/pcbnew/netinfo_item.cpp @@ -68,14 +68,6 @@ NETINFO_ITEM::~NETINFO_ITEM() } -/** - * Function Print (TODO) - */ -void NETINFO_ITEM::Print( PCB_BASE_FRAME* frame, wxDC* DC, const wxPoint& aOffset ) -{ -} - - void NETINFO_ITEM::SetClass( const NETCLASSPTR& aNetClass ) { wxCHECK( m_parent, /* void */ ); diff --git a/pcbnew/pad_print_functions.cpp b/pcbnew/pad_print_functions.cpp index 2c5deaf803..78e14ea83e 100644 --- a/pcbnew/pad_print_functions.cpp +++ b/pcbnew/pad_print_functions.cpp @@ -57,143 +57,6 @@ PAD_DRAWINFO::PAD_DRAWINFO() } -void D_PAD::Print( PCB_BASE_FRAME* aFrame, wxDC* aDC, const wxPoint& aOffset ) -{ - wxSize mask_margin; // margin (clearance) used for some non copper layers - - if( m_Flags & DO_NOT_DRAW ) - return; - - PAD_DRAWINFO drawInfo; - - drawInfo.m_Offset = aOffset; - - /* We can show/hide pads from the layer manager. - * options are show/hide pads on front and/or back side of the board - * For through pads, we hide them only if both sides are hidden. - * smd pads on back are hidden for all layers (copper and technical layers) - * on back side of the board - * smd pads on front are hidden for all layers (copper and technical layers) - * on front side of the board - * ECO, edge and Draw layers and not considered - */ - - BOARD* brd = GetBoard(); - - bool frontVisible = brd->IsElementVisible( LAYER_PAD_FR ); - bool backVisible = brd->IsElementVisible( LAYER_PAD_BK ); - - if( !frontVisible && !backVisible ) - return; - - // If pad is only on front side (no layer on back side) - // and if hide front side pads is enabled, do not draw - if( !frontVisible && !( m_layerMask & LSET::BackMask() ).any() ) - return; - - // If pad is only on back side (no layer on front side) - // and if hide back side pads is enabled, do not draw - if( !backVisible && !( m_layerMask & LSET::FrontMask() ).any() ) - return; - - - auto& displ_opts = aFrame->GetDisplayOptions(); - PCB_SCREEN* screen = aFrame->GetScreen(); - - if( displ_opts.m_DisplayPadFill == SKETCH ) - drawInfo.m_ShowPadFilled = false; - else - drawInfo.m_ShowPadFilled = true; - - COLOR4D color = COLOR4D::BLACK; - - if( m_layerMask[F_Cu] ) - { - color = aFrame->ColorSettings()->GetColor( LAYER_PAD_FR ); - } - - if( m_layerMask[B_Cu] ) - { - color = color.LegacyMix( aFrame->ColorSettings()->GetColor( LAYER_PAD_BK ) ); - } - - if( color == BLACK ) // Not on a visible copper layer (i.e. still nothing to show) - { - // If the pad is on only one tech layer, use the layer color else use DARKGRAY - LSET mask_non_copper_layers = m_layerMask & ~LSET::AllCuMask(); - - PCB_LAYER_ID pad_layer = mask_non_copper_layers.ExtractLayer(); - - switch( (int) pad_layer ) - { - case UNDEFINED_LAYER: // More than one layer - color = DARKGRAY; - break; - - case UNSELECTED_LAYER: // Shouldn't really happen... - break; - - default: - color = aFrame->ColorSettings()->GetColor( pad_layer ); - } - } - - if( ( IsOnLayer( B_Paste ) && brd->IsLayerVisible( B_Paste ) ) || - ( IsOnLayer( F_Paste ) && brd->IsLayerVisible( F_Paste ) ) ) - { - mask_margin = GetSolderPasteMargin(); - } - - if( ( IsOnLayer( B_Mask ) && brd->IsLayerVisible( B_Mask ) ) || - ( IsOnLayer( F_Mask ) && brd->IsLayerVisible( F_Mask ) ) ) - { - mask_margin.x = std::max( mask_margin.x, GetSolderMaskMargin() ); - mask_margin.y = std::max( mask_margin.y, GetSolderMaskMargin() ); - } - - bool DisplayIsol = displ_opts.m_DisplayPadIsol; - - if( !( m_layerMask & LSET::AllCuMask() ).any() ) - DisplayIsol = false; - - if( ( GetAttribute() == PAD_ATTRIB_HOLE_NOT_PLATED ) && - brd->IsElementVisible( LAYER_NON_PLATEDHOLES ) ) - { - drawInfo.m_ShowNotPlatedHole = true; - drawInfo.m_NPHoleColor = aFrame->ColorSettings()->GetColor( LAYER_NON_PLATEDHOLES ); - } - // Don't let pads that *should* be NPTHs get lost - else if ( PadShouldBeNPTH() ) - { - drawInfo.m_ShowNotPlatedHole = true; - drawInfo.m_NPHoleColor = aFrame->ColorSettings()->GetColor( LAYER_MOD_TEXT_INVISIBLE ); - } - - drawInfo.m_Color = color; - drawInfo.m_NoNetMarkColor = aFrame->ColorSettings()->GetColor( LAYER_NO_CONNECTS ); - drawInfo.m_Mask_margin = mask_margin; - drawInfo.m_ShowNCMark = brd->IsElementVisible( LAYER_NO_CONNECTS ); - drawInfo.m_IsPrinting = screen->m_IsPrinting; - color.a = 0.666; - - /* Get the pad clearance. This has a meaning only for Pcbnew. - * for CvPcb GetClearance() creates debug errors because - * there is no net classes so a call to GetClearance() is made only when - * needed (never needed in CvPcb) - */ - drawInfo.m_PadClearance = DisplayIsol ? GetClearance() : 0; - - // Draw the pad number - if( !displ_opts.m_DisplayPadNum ) - drawInfo.m_Display_padnum = false; - - if( ( displ_opts.m_DisplayNetNamesMode == 0 ) || ( displ_opts.m_DisplayNetNamesMode == 2 ) ) - drawInfo.m_Display_netname = false; - - PrintShape( aDC, drawInfo ); -} - - void D_PAD::PrintShape( wxDC* aDC, PAD_DRAWINFO& aDrawInfo ) { #define SEGCOUNT 32 // number of segments to approximate a circle diff --git a/pcbnew/pcb_legacy_draw_utils.cpp b/pcbnew/pcb_legacy_draw_utils.cpp deleted file mode 100644 index bf12e380b6..0000000000 --- a/pcbnew/pcb_legacy_draw_utils.cpp +++ /dev/null @@ -1,176 +0,0 @@ -/* - * This program source code file is part of KiCad, a free EDA CAD application. - * - * Copyright (C) 2012 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr - * Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck - * Copyright (C) 2012 Wayne Stambaugh - * Copyright (C) 1992-2019 KiCad Developers, see AUTHORS.txt for contributors. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, you may find one here: - * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html - * or you may search the http://www.gnu.org website for the version 2 license, - * or you may write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -// Local functions: -/* Trace the pads of a module in sketch mode. - * Used to display pads when when the module visibility is set to not visible - * and we want to see pad through. - * The pads must appear on the layers selected in LayerMask - */ -static void Trace_Pads_Only( PCB_BASE_FRAME* aFrame, wxDC* DC, MODULE* Module, - int ox, int oy, LSET LayerMask ); - - -// Redraw the BOARD items but not cursors, axis or grid -void BOARD::Print( PCB_BASE_FRAME* aFrame, wxDC* DC, const wxPoint& offset ) -{ - /* The order of drawing is flexible on some systems and not on others. For - * OSes which use OR to draw, the order is not important except for the - * effect of the highlight and its relationship to markers. See comment - * below. - * This order independence comes from the fact that a binary OR operation is - * commutative in nature. - * However on the OSX, the OR operation is not used, and so this sequence - * below is chosen to give MODULEs the highest visible priority. - */ - - /* Draw all tracks and zones. As long as dark colors are used for the - * tracks, Then the OR draw mode should show tracks underneath other - * tracks. But a white track will cover any other color since it has - * more bits to OR in. - */ - for( auto track : m_tracks ) - { - if( track->IsMoving() ) - continue; - - track->Print( aFrame, DC ); - } - - // Draw areas (i.e. zones) - for( int ii = 0; ii < GetAreaCount(); ii++ ) - { - ZONE_CONTAINER* zone = GetArea( ii ); - - // Areas must be drawn here only if not moved or dragged, - // because these areas are drawn by ManageCursor() in a specific manner - if( ( zone->GetEditFlags() & (IN_EDIT | IS_DRAGGED | IS_MOVED) ) == 0 ) - { - zone->Print( aFrame, DC ); - zone->PrintFilledArea( aFrame, DC ); - } - } - - // Draw the graphic items - for( auto item : m_drawings ) - { - if( item->IsMoving() ) - continue; - - switch( item->Type() ) - { - case PCB_DIMENSION_T: - case PCB_TEXT_T: - case PCB_TARGET_T: - case PCB_LINE_T: - item->Print( aFrame, DC ); - break; - - default: - break; - } - } - - LSET all_cu = LSET::AllCuMask(); - - for( auto module : m_modules ) - { - bool display = true; - LSET layerMask = all_cu; - - if( module->IsMoving() ) - continue; - - if( !IsElementVisible( LAYER_MOD_FR ) ) - { - if( module->GetLayer() == F_Cu ) - display = false; - - layerMask.set( F_Cu, false ); - } - - if( !IsElementVisible( LAYER_MOD_BK ) ) - { - if( module->GetLayer() == B_Cu ) - display = false; - - layerMask.set( B_Cu, false ); - } - - if( display ) - module->Print( aFrame, DC ); - else - Trace_Pads_Only( aFrame, DC, module, 0, 0, layerMask ); - } - - // draw the BOARD's markers last, otherwise the high light will erase any marker on a pad - for( unsigned i = 0; i < m_markers.size(); ++i ) - { - m_markers[i]->Print( aFrame, DC ); - } -} - - -/* Trace the pads of a module in sketch mode. - * Used to display pads when when the module visibility is set to not visible - * and we want to see pad through. - * The pads must appear on the layers selected in LayerMask - */ -static void Trace_Pads_Only( PCB_BASE_FRAME* aFrame, wxDC* DC, MODULE* aModule, - int ox, int oy, LSET aLayerMask ) -{ - PCB_DISPLAY_OPTIONS displ_opts = aFrame->GetDisplayOptions(); - int tmp = displ_opts.m_DisplayPadFill; - - displ_opts.m_DisplayPadFill = false; - aFrame->SetDisplayOptions( displ_opts ); - - // Draw pads. - for( auto pad : aModule->Pads() ) - { - if( (pad->GetLayerSet() & aLayerMask) == 0 ) - continue; - - pad->Print( aFrame, DC, wxPoint( ox, oy ) ); - } - - displ_opts.m_DisplayPadFill = tmp; - aFrame->SetDisplayOptions( displ_opts ); -} diff --git a/qa/qa_utils/mocks.cpp b/qa/qa_utils/mocks.cpp index e2360b2b75..449b265643 100644 --- a/qa/qa_utils/mocks.cpp +++ b/qa/qa_utils/mocks.cpp @@ -141,11 +141,6 @@ KIFACE_I& Kiface() FP_LIB_TABLE GFootprintTable; -void BOARD::Print( PCB_BASE_FRAME* aFrame, wxDC* DC, const wxPoint& offset ) -{ -} - - DIALOG_FIND::DIALOG_FIND( PCB_BASE_FRAME* aParent ) : DIALOG_FIND_BASE( aParent ) { // these members are initialized to avoid warnings about non initialized vars