From 1538d737e782cd4bcd905d20d3c1a300675b895c Mon Sep 17 00:00:00 2001 From: Marek Roszko Date: Wed, 14 Oct 2020 21:45:20 -0400 Subject: [PATCH] Split out FILL_T to its own header to avoid spreading eda_item everywhere --- Documentation/changelogs/CHANGELOG-2008.txt | 2 +- common/page_layout/ws_draw_item.cpp | 3 +- common/plotters/DXF_plotter.cpp | 24 ++++---- common/plotters/GERBER_plotter.cpp | 56 +++++++++---------- common/plotters/HPGL_plotter.cpp | 25 ++++----- common/plotters/PDF_plotter.cpp | 23 ++++---- common/plotters/PS_plotter.cpp | 22 ++++---- common/plotters/SVG_plotter.cpp | 48 ++++++++-------- common/plotters/common_plot_functions.cpp | 4 +- common/plotters/plotter.cpp | 45 +++++++-------- common/plotters/plotter_dxf.h | 10 ++-- common/plotters/plotter_gerber.h | 10 ++-- common/plotters/plotter_hpgl.h | 10 ++-- common/plotters/plotters_pslike.h | 30 +++++----- eeschema/class_libentry.cpp | 8 +-- .../dialogs/dialog_lib_edit_draw_item.cpp | 2 +- .../dialogs/panel_eeschema_color_settings.cpp | 2 +- eeschema/lib_arc.cpp | 19 ++++--- eeschema/lib_bezier.cpp | 18 +++--- eeschema/lib_circle.cpp | 19 ++++--- eeschema/lib_item.cpp | 6 +- eeschema/lib_item.h | 13 +++-- eeschema/lib_pin.cpp | 2 +- eeschema/lib_polyline.cpp | 22 ++++---- eeschema/lib_rectangle.cpp | 18 +++--- eeschema/plotters/plot_schematic_PDF.cpp | 2 +- eeschema/plotters/plot_schematic_PS.cpp | 2 +- eeschema/plotters/plot_schematic_SVG.cpp | 2 +- eeschema/sch_junction.cpp | 2 +- eeschema/sch_painter.cpp | 8 +-- .../sch_plugins/altium/sch_altium_plugin.cpp | 6 +- .../sch_plugins/eagle/sch_eagle_plugin.cpp | 6 +- .../sch_plugins/kicad/sch_sexpr_parser.cpp | 14 +++-- eeschema/sch_plugins/kicad/sch_sexpr_parser.h | 2 +- .../sch_plugins/kicad/sch_sexpr_plugin.cpp | 12 ++-- .../sch_plugins/legacy/sch_legacy_plugin.cpp | 22 ++++---- eeschema/sch_sheet.cpp | 2 +- eeschema/sch_text.cpp | 2 +- eeschema/tools/lib_drawing_tools.cpp | 2 +- eeschema/tools/lib_drawing_tools.h | 2 +- eeschema/tools/lib_edit_tool.cpp | 2 +- include/eda_item.h | 11 ---- include/fill_type.h | 38 +++++++++++++ include/plotter.h | 13 +++-- pcbnew/exporters/gerber_placefile_writer.cpp | 4 +- pcbnew/plot_board_layers.cpp | 10 ++-- pcbnew/plot_brditems_plotter.cpp | 12 ++-- .../cadstar/cadstar_pcb_archive_loader.cpp | 2 +- .../cadstar/cadstar_pcb_archive_parser.cpp | 4 +- .../cadstar/cadstar_pcb_archive_parser.h | 26 ++++----- 50 files changed, 341 insertions(+), 308 deletions(-) create mode 100644 include/fill_type.h diff --git a/Documentation/changelogs/CHANGELOG-2008.txt b/Documentation/changelogs/CHANGELOG-2008.txt index c19727d426..17bffde446 100644 --- a/Documentation/changelogs/CHANGELOG-2008.txt +++ b/Documentation/changelogs/CHANGELOG-2008.txt @@ -446,7 +446,7 @@ kbool: ================================================================================ +eeschema Fixed a bug plotting pins with circles in them from eeschema. - Added type FILL_T. + Added type FILL_TYPE. 2008-Aug-26 UPDATE Jean-Pierre Charras diff --git a/common/page_layout/ws_draw_item.cpp b/common/page_layout/ws_draw_item.cpp index 0f9ea86a04..57320bc80d 100644 --- a/common/page_layout/ws_draw_item.cpp +++ b/common/page_layout/ws_draw_item.cpp @@ -50,6 +50,7 @@ #include #include +#include #include #include #include @@ -215,7 +216,7 @@ void WS_DRAW_ITEM_POLYPOLYGONS::PrintWsItem( RENDER_SETTINGS* aSettings, const w outline.CPoint( ii ).y + aOffset.y ); } - GRPoly( nullptr, DC, points_moved.size(), &points_moved[0], FILLED_SHAPE, penWidth, + GRPoly( nullptr, DC, points_moved.size(), &points_moved[0], true, penWidth, color, color ); } } diff --git a/common/plotters/DXF_plotter.cpp b/common/plotters/DXF_plotter.cpp index c1622b4738..e5cc94d534 100644 --- a/common/plotters/DXF_plotter.cpp +++ b/common/plotters/DXF_plotter.cpp @@ -25,10 +25,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ - -#include #include -#include +#include #include #include #include @@ -424,7 +422,7 @@ void DXF_PLOTTER::SetColor( COLOR4D color ) /** * DXF rectangle: fill not supported */ -void DXF_PLOTTER::Rect( const wxPoint& p1, const wxPoint& p2, FILL_T fill, int width ) +void DXF_PLOTTER::Rect( const wxPoint& p1, const wxPoint& p2, FILL_TYPE fill, int width ) { wxASSERT( outputFile ); MoveTo( p1 ); @@ -441,7 +439,7 @@ void DXF_PLOTTER::Rect( const wxPoint& p1, const wxPoint& p2, FILL_T fill, int w * * I could use this trick to do other filled primitives */ -void DXF_PLOTTER::Circle( const wxPoint& centre, int diameter, FILL_T fill, int width ) +void DXF_PLOTTER::Circle( const wxPoint& centre, int diameter, FILL_TYPE fill, int width ) { wxASSERT( outputFile ); double radius = userToDeviceSize( diameter / 2 ); @@ -450,14 +448,14 @@ void DXF_PLOTTER::Circle( const wxPoint& centre, int diameter, FILL_T fill, int { wxString cname = getDXFColorName( m_currentColor ); - if( !fill ) + if( fill == FILL_TYPE::NO_FILL ) { fprintf( outputFile, "0\nCIRCLE\n8\n%s\n10\n%g\n20\n%g\n40\n%g\n", TO_UTF8( cname ), centre_dev.x, centre_dev.y, radius ); } - if( fill == FILLED_SHAPE ) + if( fill == FILL_TYPE::FILLED_SHAPE ) { double r = radius*0.5; fprintf( outputFile, "0\nPOLYLINE\n"); @@ -482,7 +480,7 @@ void DXF_PLOTTER::Circle( const wxPoint& centre, int diameter, FILL_T fill, int * are converted to inflated polygon by aWidth/2 */ void DXF_PLOTTER::PlotPoly( const std::vector& aCornerList, - FILL_T aFill, int aWidth, void * aData ) + FILL_TYPE aFill, int aWidth, void * aData ) { if( aCornerList.size() <= 1 ) return; @@ -498,7 +496,7 @@ void DXF_PLOTTER::PlotPoly( const std::vector& aCornerList, LineTo( aCornerList[ii] ); // Close polygon if 'fill' requested - if( aFill ) + if( aFill != FILL_TYPE::NO_FILL ) { if( aCornerList[last] != aCornerList[0] ) LineTo( aCornerList[0] ); @@ -512,7 +510,7 @@ void DXF_PLOTTER::PlotPoly( const std::vector& aCornerList, // if the polygon outline has thickness, and is not filled // (i.e. is a polyline) plot outlines with thick segments - if( aWidth > 0 && !aFill ) + if( aWidth > 0 && aFill == FILL_TYPE::NO_FILL ) { MoveTo( aCornerList[0] ); @@ -634,7 +632,7 @@ void DXF_PLOTTER::ThickSegment( const wxPoint& aStart, const wxPoint& aEnd, int if( cornerList[0] != cornerList[cornerList.size() - 1] ) cornerList.push_back( cornerList[0] ); - PlotPoly( cornerList, NO_FILL ); + PlotPoly( cornerList, FILL_TYPE::NO_FILL ); } else { @@ -647,7 +645,7 @@ void DXF_PLOTTER::ThickSegment( const wxPoint& aStart, const wxPoint& aEnd, int * Filling is not supported */ void DXF_PLOTTER::Arc( const wxPoint& centre, double StAngle, double EndAngle, int radius, - FILL_T fill, int width ) + FILL_TYPE fill, int width ) { wxASSERT( outputFile ); @@ -703,7 +701,7 @@ void DXF_PLOTTER::FlashPadCircle( const wxPoint& pos, int diametre, EDA_DRAW_MODE_T trace_mode, void* aData ) { wxASSERT( outputFile ); - Circle( pos, diametre, NO_FILL ); + Circle( pos, diametre, FILL_TYPE::NO_FILL ); } diff --git a/common/plotters/GERBER_plotter.cpp b/common/plotters/GERBER_plotter.cpp index 080cb5d518..93bb327e34 100644 --- a/common/plotters/GERBER_plotter.cpp +++ b/common/plotters/GERBER_plotter.cpp @@ -23,9 +23,8 @@ * @brief specialized plotter for GERBER files format */ -#include #include -#include +#include #include #include #include // for KiROUND @@ -754,7 +753,7 @@ void GERBER_PLOTTER::PenTo( const wxPoint& aPos, char plume ) } -void GERBER_PLOTTER::Rect( const wxPoint& p1, const wxPoint& p2, FILL_T fill, int width ) +void GERBER_PLOTTER::Rect( const wxPoint& p1, const wxPoint& p2, FILL_TYPE fill, int width ) { std::vector< wxPoint > cornerList; @@ -772,14 +771,14 @@ void GERBER_PLOTTER::Rect( const wxPoint& p1, const wxPoint& p2, FILL_T fill, in } -void GERBER_PLOTTER::Circle( const wxPoint& aCenter, int aDiameter, FILL_T aFill, int aWidth ) +void GERBER_PLOTTER::Circle( const wxPoint& aCenter, int aDiameter, FILL_TYPE aFill, int aWidth ) { Arc( aCenter, 0, 3600, aDiameter / 2, aFill, aWidth ); } void GERBER_PLOTTER::Arc( const wxPoint& aCenter, double aStAngle, double aEndAngle, - int aRadius, FILL_T aFill, int aWidth ) + int aRadius, FILL_TYPE aFill, int aWidth ) { SetCurrentLineWidth( aWidth ); @@ -841,7 +840,7 @@ void GERBER_PLOTTER::PlotGerberRegion( const std::vector< wxPoint >& aCornerList } } - PlotPoly( aCornerList, FILLED_SHAPE, 0 , gbr_metadata ); + PlotPoly( aCornerList, FILL_TYPE::FILLED_SHAPE, 0, gbr_metadata ); // Clear the TA attribute, to avoid the next item to inherit it: if( clearTA_AperFunction ) @@ -858,7 +857,7 @@ void GERBER_PLOTTER::PlotGerberRegion( const std::vector< wxPoint >& aCornerList } void GERBER_PLOTTER::PlotPoly( const std::vector< wxPoint >& aCornerList, - FILL_T aFill, int aWidth, void * aData ) + FILL_TYPE aFill, int aWidth, void * aData ) { if( aCornerList.size() <= 1 ) return; @@ -871,7 +870,7 @@ void GERBER_PLOTTER::PlotPoly( const std::vector< wxPoint >& aCornerList, if( gbr_metadata ) formatNetAttribute( &gbr_metadata->m_NetlistMetadata ); - if( aFill ) + if( aFill != FILL_TYPE::NO_FILL ) { fputs( "G36*\n", outputFile ); @@ -899,7 +898,7 @@ void GERBER_PLOTTER::PlotPoly( const std::vector< wxPoint >& aCornerList, // Ensure the thick outline is closed for filled polygons // (if not filled, could be only a polyline) - if( aFill && ( aCornerList[aCornerList.size()-1] != aCornerList[0] ) ) + if( aFill != FILL_TYPE::NO_FILL &&( aCornerList[aCornerList.size() - 1] != aCornerList[0] ) ) LineTo( aCornerList[0] ); PenFinish(); @@ -938,15 +937,14 @@ void GERBER_PLOTTER::ThickArc( const wxPoint& centre, double StAngle, double End formatNetAttribute( &gbr_metadata->m_NetlistMetadata ); if( tracemode == FILLED ) - Arc( centre, StAngle, EndAngle, radius, NO_FILL, DO_NOT_SET_LINE_WIDTH ); + Arc( centre, StAngle, EndAngle, radius, FILL_TYPE::NO_FILL, DO_NOT_SET_LINE_WIDTH ); else { SetCurrentLineWidth( USE_DEFAULT_LINE_WIDTH ); Arc( centre, StAngle, EndAngle, - radius - ( width - currentPenWidth ) / 2, - NO_FILL, DO_NOT_SET_LINE_WIDTH ); - Arc( centre, StAngle, EndAngle, - radius + ( width - currentPenWidth ) / 2, NO_FILL, + radius - ( width - currentPenWidth ) / 2, FILL_TYPE::NO_FILL, + DO_NOT_SET_LINE_WIDTH ); + Arc( centre, StAngle, EndAngle, radius + ( width - currentPenWidth ) / 2, FILL_TYPE::NO_FILL, DO_NOT_SET_LINE_WIDTH ); } } @@ -962,7 +960,7 @@ void GERBER_PLOTTER::ThickRect( const wxPoint& p1, const wxPoint& p2, int width, formatNetAttribute( &gbr_metadata->m_NetlistMetadata ); if( tracemode == FILLED ) - Rect( p1, p2, NO_FILL, DO_NOT_SET_LINE_WIDTH ); + Rect( p1, p2, FILL_TYPE::NO_FILL, DO_NOT_SET_LINE_WIDTH ); else { SetCurrentLineWidth( USE_DEFAULT_LINE_WIDTH ); @@ -970,12 +968,12 @@ void GERBER_PLOTTER::ThickRect( const wxPoint& p1, const wxPoint& p2, int width, p1.y - (width - currentPenWidth) / 2 ); wxPoint offsetp2( p2.x + (width - currentPenWidth) / 2, p2.y + (width - currentPenWidth) / 2 ); - Rect( offsetp1, offsetp2, NO_FILL, -1 ); + Rect( offsetp1, offsetp2, FILL_TYPE::NO_FILL, -1 ); offsetp1.x += (width - currentPenWidth); offsetp1.y += (width - currentPenWidth); offsetp2.x -= (width - currentPenWidth); offsetp2.y -= (width - currentPenWidth); - Rect( offsetp1, offsetp2, NO_FILL, DO_NOT_SET_LINE_WIDTH ); + Rect( offsetp1, offsetp2, FILL_TYPE::NO_FILL, DO_NOT_SET_LINE_WIDTH ); } } @@ -990,14 +988,14 @@ void GERBER_PLOTTER::ThickCircle( const wxPoint& pos, int diametre, int width, formatNetAttribute( &gbr_metadata->m_NetlistMetadata ); if( tracemode == FILLED ) - Circle( pos, diametre, NO_FILL, DO_NOT_SET_LINE_WIDTH ); + Circle( pos, diametre, FILL_TYPE::NO_FILL, DO_NOT_SET_LINE_WIDTH ); else { SetCurrentLineWidth( USE_DEFAULT_LINE_WIDTH, gbr_metadata ); Circle( pos, diametre - (width - currentPenWidth), - NO_FILL, DO_NOT_SET_LINE_WIDTH ); + FILL_TYPE::NO_FILL, DO_NOT_SET_LINE_WIDTH ); Circle( pos, diametre + (width - currentPenWidth), - NO_FILL, DO_NOT_SET_LINE_WIDTH ); + FILL_TYPE::NO_FILL, DO_NOT_SET_LINE_WIDTH ); } } @@ -1017,12 +1015,12 @@ void GERBER_PLOTTER::FilledCircle( const wxPoint& pos, int diametre, // Draw a circle of diameter = diametre/2 with a line thickness = radius, // To create a filled circle SetCurrentLineWidth( diametre/2, gbr_metadata ); - Circle( pos, diametre/2, NO_FILL, DO_NOT_SET_LINE_WIDTH ); + Circle( pos, diametre/2, FILL_TYPE::NO_FILL, DO_NOT_SET_LINE_WIDTH ); } else { SetCurrentLineWidth( USE_DEFAULT_LINE_WIDTH, gbr_metadata ); - Circle( pos, diametre, NO_FILL, DO_NOT_SET_LINE_WIDTH ); + Circle( pos, diametre, FILL_TYPE::NO_FILL, DO_NOT_SET_LINE_WIDTH ); } } @@ -1039,7 +1037,7 @@ void GERBER_PLOTTER::FlashPadCircle( const wxPoint& pos, int diametre, EDA_DRAW_ SetCurrentLineWidth( USE_DEFAULT_LINE_WIDTH ); - Circle( pos, diametre - currentPenWidth, NO_FILL, DO_NOT_SET_LINE_WIDTH ); + Circle( pos, diametre - currentPenWidth, FILL_TYPE::NO_FILL, DO_NOT_SET_LINE_WIDTH ); } else { @@ -1163,7 +1161,7 @@ void GERBER_PLOTTER::FlashPadRect( const wxPoint& pos, const wxSize& aSize, pos.y - (size.y - GetCurrentLineWidth()) / 2 ), wxPoint( pos.x + (size.x - GetCurrentLineWidth()) / 2, pos.y + (size.y - GetCurrentLineWidth()) / 2 ), - NO_FILL, GetCurrentLineWidth() ); + FILL_TYPE::NO_FILL, GetCurrentLineWidth() ); } else { @@ -1246,7 +1244,7 @@ void GERBER_PLOTTER::FlashPadRoundRect( const wxPoint& aPadPos, const wxSize& aS cornerList.push_back( cornerList[0] ); // plot outlines - PlotPoly( cornerList, NO_FILL, GetCurrentLineWidth(), gbr_metadata ); + PlotPoly( cornerList, FILL_TYPE::NO_FILL, GetCurrentLineWidth(), gbr_metadata ); } else { @@ -1460,7 +1458,7 @@ void GERBER_PLOTTER::FlashPadCustom( const wxPoint& aPadPos, const wxSize& aSize cornerList.push_back( cornerList[0] ); if( aTraceMode == SKETCH ) - PlotPoly( cornerList, NO_FILL, GetCurrentLineWidth(), &gbr_metadata ); + PlotPoly( cornerList, FILL_TYPE::NO_FILL, GetCurrentLineWidth(), &gbr_metadata ); else PlotGerberRegion( cornerList, &gbr_metadata ); } @@ -1505,7 +1503,7 @@ void GERBER_PLOTTER::FlashPadChamferRoundRect( const wxPoint& aShapePos, const w cornerList.push_back( cornerList[0] ); if( aPlotMode == SKETCH ) - PlotPoly( cornerList, NO_FILL, GetCurrentLineWidth(), &gbr_metadata ); + PlotPoly( cornerList, FILL_TYPE::NO_FILL, GetCurrentLineWidth(), &gbr_metadata ); else { #ifdef GBR_USE_MACROS_FOR_CHAMFERED_ROUND_RECT @@ -1616,7 +1614,7 @@ void GERBER_PLOTTER::FlashPadTrapez( const wxPoint& aPadPos, const wxPoint* aCo if( aTrace_Mode == SKETCH ) { - PlotPoly( cornerList, NO_FILL, GetCurrentLineWidth(), &metadata ); + PlotPoly( cornerList, FILL_TYPE::NO_FILL, GetCurrentLineWidth(), &metadata ); return; } @@ -1673,7 +1671,7 @@ void GERBER_PLOTTER::FlashRegularPolygon( const wxPoint& aShapePos, cornerList.push_back( cornerList[0] ); // Close the shape - PlotPoly( cornerList, NO_FILL, GetCurrentLineWidth(), &gbr_metadata ); + PlotPoly( cornerList, FILL_TYPE::NO_FILL, GetCurrentLineWidth(), &gbr_metadata ); } else { diff --git a/common/plotters/HPGL_plotter.cpp b/common/plotters/HPGL_plotter.cpp index df18936030..2d98ad7e79 100644 --- a/common/plotters/HPGL_plotter.cpp +++ b/common/plotters/HPGL_plotter.cpp @@ -194,9 +194,8 @@ */ -#include #include -#include +#include #include #include #include // for KiROUND @@ -274,7 +273,7 @@ void HPGL_PLOTTER::SetPenDiameter( double diameter ) /** * HPGL rectangle: fill not supported */ -void HPGL_PLOTTER::Rect( const wxPoint& p1, const wxPoint& p2, FILL_T fill, int width ) +void HPGL_PLOTTER::Rect( const wxPoint& p1, const wxPoint& p2, FILL_TYPE fill, int width ) { wxASSERT( outputFile ); DPOINT p2dev = userToDeviceCoordinates( p2 ); @@ -285,14 +284,14 @@ void HPGL_PLOTTER::Rect( const wxPoint& p1, const wxPoint& p2, FILL_T fill, int // HPGL circle -void HPGL_PLOTTER::Circle( const wxPoint& centre, int diameter, FILL_T fill, +void HPGL_PLOTTER::Circle( const wxPoint& centre, int diameter, FILL_TYPE fill, int width ) { wxASSERT( outputFile ); double radius = userToDeviceSize( diameter / 2 ); SetCurrentLineWidth( width ); - if( fill == FILLED_SHAPE ) + if( fill == FILL_TYPE::FILLED_SHAPE ) { // Draw the filled area MoveTo( centre ); @@ -315,7 +314,7 @@ void HPGL_PLOTTER::Circle( const wxPoint& centre, int diameter, FILL_T fill, */ void HPGL_PLOTTER::PlotPoly( const std::vector& aCornerList, - FILL_T aFill, int aWidth, void * aData ) + FILL_TYPE aFill, int aWidth, void * aData ) { if( aCornerList.size() <= 1 ) return; @@ -323,7 +322,7 @@ void HPGL_PLOTTER::PlotPoly( const std::vector& aCornerList, SetCurrentLineWidth( aWidth ); MoveTo( aCornerList[0] ); - if( aFill == FILLED_SHAPE ) + if( aFill == FILL_TYPE::FILLED_SHAPE ) { // Draw the filled area SetCurrentLineWidth( USE_DEFAULT_LINE_WIDTH ); @@ -346,7 +345,7 @@ void HPGL_PLOTTER::PlotPoly( const std::vector& aCornerList, LineTo( aCornerList[ii] ); // Always close polygon if filled. - if( aFill ) + if( aFill != FILL_TYPE::NO_FILL ) { int ii = aCornerList.size() - 1; @@ -469,7 +468,7 @@ void HPGL_PLOTTER::ThickSegment( const wxPoint& start, const wxPoint& end, * Or PU PY x, y; PD start_arc_X AA, start_arc_Y, angle, PU; */ void HPGL_PLOTTER::Arc( const wxPoint& centre, double StAngle, double EndAngle, int radius, - FILL_T fill, int width ) + FILL_TYPE fill, int width ) { wxASSERT( outputFile ); double angle; @@ -616,7 +615,7 @@ void HPGL_PLOTTER::FlashPadRect( const wxPoint& pos, const wxSize& padsize, corners[ii] += pos; } - PlotPoly( corners, trace_mode == FILLED ? FILLED_SHAPE : NO_FILL ); + PlotPoly( corners, trace_mode == FILLED ? FILL_TYPE::FILLED_SHAPE : FILL_TYPE::NO_FILL ); } @@ -655,7 +654,7 @@ void HPGL_PLOTTER::FlashPadRoundRect( const wxPoint& aPadPos, const wxSize& aSiz if( cornerList.back() != cornerList.front() ) cornerList.push_back( cornerList.front() ); - PlotPoly( cornerList, aTraceMode == FILLED ? FILLED_SHAPE : NO_FILL ); + PlotPoly( cornerList, aTraceMode == FILLED ? FILL_TYPE::FILLED_SHAPE : FILL_TYPE::NO_FILL ); } void HPGL_PLOTTER::FlashPadCustom( const wxPoint& aPadPos, const wxSize& aSize, @@ -677,7 +676,7 @@ void HPGL_PLOTTER::FlashPadCustom( const wxPoint& aPadPos, const wxSize& aSize, if( cornerList.back() != cornerList.front() ) cornerList.push_back( cornerList.front() ); - PlotPoly( cornerList, aTraceMode == FILLED ? FILLED_SHAPE : NO_FILL ); + PlotPoly( cornerList, aTraceMode == FILLED ? FILL_TYPE::FILLED_SHAPE : FILL_TYPE::NO_FILL ); } } @@ -699,7 +698,7 @@ void HPGL_PLOTTER::FlashPadTrapez( const wxPoint& aPadPos, const wxPoint* aCorne // Close polygon cornerList.push_back( cornerList.front() ); - PlotPoly( cornerList, aTraceMode == FILLED ? FILLED_SHAPE : NO_FILL ); + PlotPoly( cornerList, aTraceMode == FILLED ? FILL_TYPE::FILLED_SHAPE : FILL_TYPE::NO_FILL ); } diff --git a/common/plotters/PDF_plotter.cpp b/common/plotters/PDF_plotter.cpp index e2ca3e9c2a..ad069b2c84 100644 --- a/common/plotters/PDF_plotter.cpp +++ b/common/plotters/PDF_plotter.cpp @@ -219,7 +219,7 @@ void PDF_PLOTTER::SetDash( PLOT_DASH_TYPE dashed ) /** * Rectangles in PDF. Supported by the native operator */ -void PDF_PLOTTER::Rect( const wxPoint& p1, const wxPoint& p2, FILL_T fill, int width ) +void PDF_PLOTTER::Rect( const wxPoint& p1, const wxPoint& p2, FILL_TYPE fill, int width ) { wxASSERT( workFile ); DPOINT p1_dev = userToDeviceCoordinates( p1 ); @@ -227,15 +227,14 @@ void PDF_PLOTTER::Rect( const wxPoint& p1, const wxPoint& p2, FILL_T fill, int w SetCurrentLineWidth( width ); fprintf( workFile, "%g %g %g %g re %c\n", p1_dev.x, p1_dev.y, - p2_dev.x - p1_dev.x, p2_dev.y - p1_dev.y, - fill == NO_FILL ? 'S' : 'B' ); + p2_dev.x - p1_dev.x, p2_dev.y - p1_dev.y, fill == FILL_TYPE::NO_FILL ? 'S' : 'B' ); } /** * Circle drawing for PDF. They're approximated by curves, but fill is supported */ -void PDF_PLOTTER::Circle( const wxPoint& pos, int diametre, FILL_T aFill, int width ) +void PDF_PLOTTER::Circle( const wxPoint& pos, int diametre, FILL_TYPE aFill, int width ) { wxASSERT( workFile ); DPOINT pos_dev = userToDeviceCoordinates( pos ); @@ -250,9 +249,9 @@ void PDF_PLOTTER::Circle( const wxPoint& pos, int diametre, FILL_T aFill, int wi SetCurrentLineWidth( width ); // If diameter is less than width, switch to filled mode - if( aFill == NO_FILL && diametre < width ) + if( aFill == FILL_TYPE::NO_FILL && diametre < width ) { - aFill = FILLED_SHAPE; + aFill = FILL_TYPE::FILLED_SHAPE; SetCurrentLineWidth( 0 ); radius = userToDeviceSize( ( diametre / 2.0 ) + ( width / 2.0 ) ); @@ -284,7 +283,7 @@ void PDF_PLOTTER::Circle( const wxPoint& pos, int diametre, FILL_T aFill, int wi pos_dev.x - radius, pos_dev.y - magic, pos_dev.x - radius, pos_dev.y, - aFill == NO_FILL ? 's' : 'b' ); + aFill == FILL_TYPE::NO_FILL ? 's' : 'b' ); } @@ -293,12 +292,12 @@ void PDF_PLOTTER::Circle( const wxPoint& pos, int diametre, FILL_T aFill, int wi * So no filled arcs (not a great loss... ) */ void PDF_PLOTTER::Arc( const wxPoint& centre, double StAngle, double EndAngle, int radius, - FILL_T fill, int width ) + FILL_TYPE fill, int width ) { wxASSERT( workFile ); if( radius <= 0 ) { - Circle( centre, width, FILLED_SHAPE, 0 ); + Circle( centre, width, FILL_TYPE::FILLED_SHAPE, 0 ); return; } @@ -332,7 +331,7 @@ void PDF_PLOTTER::Arc( const wxPoint& centre, double StAngle, double EndAngle, i // The arc is drawn... if not filled we stroke it, otherwise we finish // closing the pie at the center - if( fill == NO_FILL ) + if( fill == FILL_TYPE::NO_FILL ) { fputs( "S\n", workFile ); } @@ -348,7 +347,7 @@ void PDF_PLOTTER::Arc( const wxPoint& centre, double StAngle, double EndAngle, i * Polygon plotting for PDF. Everything is supported */ void PDF_PLOTTER::PlotPoly( const std::vector< wxPoint >& aCornerList, - FILL_T aFill, int aWidth, void * aData ) + FILL_TYPE aFill, int aWidth, void * aData ) { wxASSERT( workFile ); if( aCornerList.size() <= 1 ) @@ -366,7 +365,7 @@ void PDF_PLOTTER::PlotPoly( const std::vector< wxPoint >& aCornerList, } // Close path and stroke(/fill) - fprintf( workFile, "%c\n", aFill == NO_FILL ? 'S' : 'b' ); + fprintf( workFile, "%c\n", aFill == FILL_TYPE::NO_FILL ? 'S' : 'b' ); } diff --git a/common/plotters/PS_plotter.cpp b/common/plotters/PS_plotter.cpp index c853b50875..be67791374 100644 --- a/common/plotters/PS_plotter.cpp +++ b/common/plotters/PS_plotter.cpp @@ -27,9 +27,7 @@ * @brief Kicad: specialized plotter for PS files format */ -#include #include -#include #include #include // for KiROUND #include @@ -110,7 +108,7 @@ void PSLIKE_PLOTTER::FlashPadCircle( const wxPoint& aPadPos, int aDiameter, EDA_DRAW_MODE_T aTraceMode, void* aData ) { if( aTraceMode == FILLED ) - Circle( aPadPos, aDiameter, FILLED_SHAPE, 0 ); + Circle( aPadPos, aDiameter, FILL_TYPE::FILLED_SHAPE, 0 ); else // Plot a ring: { SetCurrentLineWidth( USE_DEFAULT_LINE_WIDTH ); @@ -120,7 +118,7 @@ void PSLIKE_PLOTTER::FlashPadCircle( const wxPoint& aPadPos, int aDiameter, if( linewidth > aDiameter-2 ) linewidth = aDiameter-2; - Circle( aPadPos, aDiameter - linewidth, NO_FILL, linewidth ); + Circle( aPadPos, aDiameter - linewidth, FILL_TYPE::NO_FILL, linewidth ); } SetCurrentLineWidth( USE_DEFAULT_LINE_WIDTH ); @@ -172,7 +170,7 @@ void PSLIKE_PLOTTER::FlashPadRect( const wxPoint& aPadPos, const wxSize& aSize, cornerList.push_back( cornerList[0] ); - PlotPoly( cornerList, ( aTraceMode == FILLED ) ? FILLED_SHAPE : NO_FILL, + PlotPoly( cornerList, ( aTraceMode == FILLED ) ? FILL_TYPE::FILLED_SHAPE : FILL_TYPE::NO_FILL, GetCurrentLineWidth() ); } @@ -208,7 +206,7 @@ void PSLIKE_PLOTTER::FlashPadRoundRect( const wxPoint& aPadPos, const wxSize& aS // Close polygon cornerList.push_back( cornerList[0] ); - PlotPoly( cornerList, ( aTraceMode == FILLED ) ? FILLED_SHAPE : NO_FILL, + PlotPoly( cornerList, ( aTraceMode == FILLED ) ? FILL_TYPE::FILLED_SHAPE : FILL_TYPE::NO_FILL, GetCurrentLineWidth() ); } @@ -241,7 +239,7 @@ void PSLIKE_PLOTTER::FlashPadCustom( const wxPoint& aPadPos, const wxSize& aSize // Close polygon cornerList.push_back( cornerList[0] ); - PlotPoly( cornerList, ( aTraceMode == FILLED ) ? FILLED_SHAPE : NO_FILL, + PlotPoly( cornerList, ( aTraceMode == FILLED ) ? FILL_TYPE::FILLED_SHAPE : FILL_TYPE::NO_FILL, GetCurrentLineWidth() ); } } @@ -287,7 +285,7 @@ void PSLIKE_PLOTTER::FlashPadTrapez( const wxPoint& aPadPos, const wxPoint *aCor } cornerList.push_back( cornerList[0] ); - PlotPoly( cornerList, ( aTraceMode == FILLED ) ? FILLED_SHAPE : NO_FILL, + PlotPoly( cornerList, ( aTraceMode == FILLED ) ? FILL_TYPE::FILLED_SHAPE : FILL_TYPE::NO_FILL, GetCurrentLineWidth() ); } @@ -575,7 +573,7 @@ void PS_PLOTTER::SetDash( PLOT_DASH_TYPE dashed ) } -void PS_PLOTTER::Rect( const wxPoint& p1, const wxPoint& p2, FILL_T fill, int width ) +void PS_PLOTTER::Rect( const wxPoint& p1, const wxPoint& p2, FILL_TYPE fill, int width ) { DPOINT p1_dev = userToDeviceCoordinates( p1 ); DPOINT p2_dev = userToDeviceCoordinates( p2 ); @@ -586,7 +584,7 @@ void PS_PLOTTER::Rect( const wxPoint& p1, const wxPoint& p2, FILL_T fill, int wi } -void PS_PLOTTER::Circle( const wxPoint& pos, int diametre, FILL_T fill, int width ) +void PS_PLOTTER::Circle( const wxPoint& pos, int diametre, FILL_TYPE fill, int width ) { wxASSERT( outputFile ); DPOINT pos_dev = userToDeviceCoordinates( pos ); @@ -598,7 +596,7 @@ void PS_PLOTTER::Circle( const wxPoint& pos, int diametre, FILL_T fill, int widt void PS_PLOTTER::Arc( const wxPoint& centre, double StAngle, double EndAngle, - int radius, FILL_T fill, int width ) + int radius, FILL_TYPE fill, int width ) { wxASSERT( outputFile ); if( radius <= 0 ) @@ -634,7 +632,7 @@ void PS_PLOTTER::Arc( const wxPoint& centre, double StAngle, double EndAngle, void PS_PLOTTER::PlotPoly( const std::vector< wxPoint >& aCornerList, - FILL_T aFill, int aWidth, void * aData ) + FILL_TYPE aFill, int aWidth, void * aData ) { if( aCornerList.size() <= 1 ) return; diff --git a/common/plotters/SVG_plotter.cpp b/common/plotters/SVG_plotter.cpp index 7bd46a28cc..a0c0233630 100644 --- a/common/plotters/SVG_plotter.cpp +++ b/common/plotters/SVG_plotter.cpp @@ -91,11 +91,9 @@ * The center of ellipse is automatically calculated. */ -#include #include #include #include -#include #include #include #include @@ -168,7 +166,7 @@ SVG_PLOTTER::SVG_PLOTTER() { m_graphics_changed = true; SetTextMode( PLOT_TEXT_MODE::STROKE ); - m_fillMode = NO_FILL; // or FILLED_SHAPE or FILLED_WITH_BG_BODYCOLOR + m_fillMode = FILL_TYPE::NO_FILL; // or FILLED_SHAPE or FILLED_WITH_BG_BODYCOLOR m_pen_rgb_color = 0; // current color value (black) m_brush_rgb_color = 0; // current color value (black) m_dashed = PLOT_DASH_TYPE::SOLID; @@ -219,7 +217,7 @@ void SVG_PLOTTER::SetColor( COLOR4D color ) } -void SVG_PLOTTER::setFillMode( FILL_T fill ) +void SVG_PLOTTER::setFillMode( FILL_TYPE fill ) { if( m_fillMode != fill ) { @@ -239,19 +237,19 @@ void SVG_PLOTTER::setSVGPlotStyle( bool aIsGroup, const std::string& aExtraStyle switch( m_fillMode ) { - case NO_FILL: + case FILL_TYPE::NO_FILL: fputs( "fill-opacity:0.0; ", outputFile ); break; - case FILLED_SHAPE: + case FILL_TYPE::FILLED_SHAPE: fputs( "fill-opacity:1.0; ", outputFile ); break; - case FILLED_WITH_BG_BODYCOLOR: + case FILL_TYPE::FILLED_WITH_BG_BODYCOLOR: fputs( "fill-opacity:0.6; ", outputFile ); break; - case FILLED_WITH_COLOR: + case FILL_TYPE::FILLED_WITH_COLOR: wxFAIL_MSG( "FILLED_WITH_COLOR not implemented" ); break; } @@ -383,7 +381,7 @@ void SVG_PLOTTER::SetDash( PLOT_DASH_TYPE dashed ) } -void SVG_PLOTTER::Rect( const wxPoint& p1, const wxPoint& p2, FILL_T fill, int width ) +void SVG_PLOTTER::Rect( const wxPoint& p1, const wxPoint& p2, FILL_TYPE fill, int width ) { EDA_RECT rect( p1, wxSize( p2.x -p1.x, p2.y -p1.y ) ); rect.Normalize(); @@ -418,7 +416,7 @@ void SVG_PLOTTER::Rect( const wxPoint& p1, const wxPoint& p2, FILL_T fill, int w } -void SVG_PLOTTER::Circle( const wxPoint& pos, int diametre, FILL_T fill, int width ) +void SVG_PLOTTER::Circle( const wxPoint& pos, int diametre, FILL_TYPE fill, int width ) { DPOINT pos_dev = userToDeviceCoordinates( pos ); double radius = userToDeviceSize( diametre / 2.0 ); @@ -427,9 +425,9 @@ void SVG_PLOTTER::Circle( const wxPoint& pos, int diametre, FILL_T fill, int wid SetCurrentLineWidth( width ); // If diameter is less than width, switch to filled mode - if( fill == NO_FILL && diametre < width ) + if( fill == FILL_TYPE::NO_FILL && diametre < width ) { - setFillMode( FILLED_SHAPE ); + setFillMode( FILL_TYPE::FILLED_SHAPE ); SetCurrentLineWidth( 0 ); radius = userToDeviceSize( ( diametre / 2.0 ) + ( width / 2.0 ) ); @@ -442,7 +440,7 @@ void SVG_PLOTTER::Circle( const wxPoint& pos, int diametre, FILL_T fill, int wid void SVG_PLOTTER::Arc( const wxPoint& centre, double StAngle, double EndAngle, int radius, - FILL_T fill, int width ) + FILL_TYPE fill, int width ) { /* Draws an arc of a circle, centred on (xc,yc), with starting point * (x1, y1) and ending at (x2, y2). The current pen is used for the outline @@ -454,7 +452,7 @@ void SVG_PLOTTER::Arc( const wxPoint& centre, double StAngle, double EndAngle, i if( radius <= 0 ) { - Circle( centre, width, FILLED_SHAPE, 0 ); + Circle( centre, width, FILL_TYPE::FILLED_SHAPE, 0 ); return; } @@ -521,7 +519,7 @@ void SVG_PLOTTER::Arc( const wxPoint& centre, double StAngle, double EndAngle, i // flag arc size (0 = small arc > 180 deg, 1 = large arc > 180 deg), // sweep arc ( 0 = CCW, 1 = CW), // end point - if( fill != NO_FILL ) + if( fill != FILL_TYPE::NO_FILL ) { // Filled arcs (in eeschema) consist of the pie wedge and a stroke only on the arc // This needs to be drawn in two steps. @@ -534,7 +532,7 @@ void SVG_PLOTTER::Arc( const wxPoint& centre, double StAngle, double EndAngle, i end.x, end.y, centre_dev.x, centre_dev.y ); } - setFillMode( NO_FILL ); + setFillMode( FILL_TYPE::NO_FILL ); SetCurrentLineWidth( width ); fprintf( outputFile, "\n", start.x, start.y, radius_dev, radius_dev, @@ -548,7 +546,7 @@ void SVG_PLOTTER::BezierCurve( const wxPoint& aStart, const wxPoint& aControl1, int aTolerance, int aLineThickness ) { #if 1 - setFillMode( NO_FILL ); + setFillMode( FILL_TYPE::NO_FILL ); SetCurrentLineWidth( aLineThickness ); DPOINT start = userToDeviceCoordinates( aStart ); @@ -567,7 +565,7 @@ void SVG_PLOTTER::BezierCurve( const wxPoint& aStart, const wxPoint& aControl1, void SVG_PLOTTER::PlotPoly( const std::vector& aCornerList, - FILL_T aFill, int aWidth, void * aData ) + FILL_TYPE aFill, int aWidth, void * aData ) { if( aCornerList.size() <= 1 ) return; @@ -578,16 +576,16 @@ void SVG_PLOTTER::PlotPoly( const std::vector& aCornerList, switch( aFill ) { - case NO_FILL: + case FILL_TYPE::NO_FILL: setSVGPlotStyle( false, "fill:none" ); break; - case FILLED_WITH_BG_BODYCOLOR: - case FILLED_SHAPE: + case FILL_TYPE::FILLED_WITH_BG_BODYCOLOR: + case FILL_TYPE::FILLED_SHAPE: setSVGPlotStyle( false, "fill-rule:evenodd;" ); break; - case FILLED_WITH_COLOR: + case FILL_TYPE::FILLED_WITH_COLOR: wxFAIL_MSG( "FILLED_WITH_COLOR not implemented" ); break; } @@ -686,9 +684,9 @@ void SVG_PLOTTER::PenTo( const wxPoint& pos, char plume ) // Ensure we do not use a fill mode when moving tne pen, // in SVG mode (i;e. we are plotting only basic lines, not a filled area - if( m_fillMode != NO_FILL ) + if( m_fillMode != FILL_TYPE::NO_FILL ) { - setFillMode( NO_FILL ); + setFillMode( FILL_TYPE::NO_FILL ); setSVGPlotStyle(); } @@ -791,7 +789,7 @@ void SVG_PLOTTER::Text( const wxPoint& aPos, bool aMultilineAllowed, void* aData ) { - setFillMode( NO_FILL ); + setFillMode( FILL_TYPE::NO_FILL ); SetColor( aColor ); SetCurrentLineWidth( aWidth ); diff --git a/common/plotters/common_plot_functions.cpp b/common/plotters/common_plot_functions.cpp index 8f28299584..79fb52c73e 100644 --- a/common/plotters/common_plot_functions.cpp +++ b/common/plotters/common_plot_functions.cpp @@ -104,7 +104,7 @@ void PlotWorkSheet( PLOTTER* plotter, const PROJECT* aProject, const TITLE_BLOCK { WS_DRAW_ITEM_RECT* rect = (WS_DRAW_ITEM_RECT*) item; int penWidth = std::max( rect->GetPenWidth(), defaultPenWidth ); - plotter->Rect( rect->GetStart(), rect->GetEnd(), NO_FILL, penWidth ); + plotter->Rect( rect->GetStart(), rect->GetEnd(), FILL_TYPE::NO_FILL, penWidth ); } break; @@ -133,7 +133,7 @@ void PlotWorkSheet( PLOTTER* plotter, const PROJECT* aProject, const TITLE_BLOCK for( int ii = 0; ii < outline.PointCount(); ii++ ) points.emplace_back( outline.CPoint( ii ).x, outline.CPoint( ii ).y ); - plotter->PlotPoly( points, FILLED_SHAPE, penWidth ); + plotter->PlotPoly( points, FILL_TYPE::FILLED_SHAPE, penWidth ); } } break; diff --git a/common/plotters/plotter.cpp b/common/plotters/plotter.cpp index 0424eefd5c..a8558e59c6 100644 --- a/common/plotters/plotter.cpp +++ b/common/plotters/plotter.cpp @@ -37,6 +37,7 @@ * is not handled here. */ +#include #include #include #include @@ -154,7 +155,7 @@ double PLOTTER::GetDashGapLenIU() const void PLOTTER::Arc( const wxPoint& centre, double StAngle, double EndAngle, int radius, - FILL_T fill, int width ) + FILL_TYPE fill, int width ) { wxPoint start, end; const int delta = 50; // increment (in 0.1 degrees) to draw circles @@ -167,7 +168,7 @@ void PLOTTER::Arc( const wxPoint& centre, double StAngle, double EndAngle, int r start.x = centre.x + KiROUND( cosdecideg( radius, -StAngle ) ); start.y = centre.y + KiROUND( sindecideg( radius, -StAngle ) ); - if( fill != NO_FILL ) + if( fill != FILL_TYPE::NO_FILL ) { MoveTo( centre ); LineTo( start ); @@ -187,7 +188,7 @@ void PLOTTER::Arc( const wxPoint& centre, double StAngle, double EndAngle, int r end.x = centre.x + KiROUND( cosdecideg( radius, -EndAngle ) ); end.y = centre.y + KiROUND( sindecideg( radius, -EndAngle ) ); - if( fill != NO_FILL ) + if( fill != FILL_TYPE::NO_FILL ) { LineTo( end ); FinishTo( centre ); @@ -240,7 +241,7 @@ void PLOTTER::PlotImage(const wxImage & aImage, const wxPoint& aPos, double aSca end.x += size.x; end.y += size.y; - Rect( start, end, NO_FILL ); + Rect( start, end, FILL_TYPE::NO_FILL ); } @@ -265,13 +266,13 @@ void PLOTTER::markerSquare( const wxPoint& position, int radius ) corner.y = position.y + r; corner_list.push_back( corner ); - PlotPoly( corner_list, NO_FILL, GetCurrentLineWidth() ); + PlotPoly( corner_list, FILL_TYPE::NO_FILL, GetCurrentLineWidth() ); } void PLOTTER::markerCircle( const wxPoint& position, int radius ) { - Circle( position, radius * 2, NO_FILL, GetCurrentLineWidth() ); + Circle( position, radius * 2, FILL_TYPE::NO_FILL, GetCurrentLineWidth() ); } @@ -295,7 +296,7 @@ void PLOTTER::markerLozenge( const wxPoint& position, int radius ) corner.y = position.y + radius; corner_list.push_back( corner ); - PlotPoly( corner_list, NO_FILL, GetCurrentLineWidth() ); + PlotPoly( corner_list, FILL_TYPE::NO_FILL, GetCurrentLineWidth() ); } @@ -492,13 +493,13 @@ void PLOTTER::sketchOval( const wxPoint& pos, const wxSize& aSize, double orient RotatePoint( &cx, &cy, orient ); Arc( wxPoint( cx + pos.x, cy + pos.y ), orient + 1800, orient + 3600, - radius, NO_FILL ); + radius, FILL_TYPE::NO_FILL ); cx = 0; cy = -deltaxy / 2; RotatePoint( &cx, &cy, orient ); Arc( wxPoint( cx + pos.x, cy + pos.y ), orient, orient + 1800, - radius, NO_FILL ); + radius, FILL_TYPE::NO_FILL ); } @@ -509,7 +510,7 @@ void PLOTTER::ThickSegment( const wxPoint& start, const wxPoint& end, int width, { if( start == end ) { - Circle( start, width, FILLED_SHAPE, 0 ); + Circle( start, width, FILL_TYPE::FILLED_SHAPE, 0 ); } else { @@ -530,14 +531,14 @@ void PLOTTER::ThickArc( const wxPoint& centre, double StAngle, double EndAngle, int radius, int width, EDA_DRAW_MODE_T tracemode, void* aData ) { if( tracemode == FILLED ) - Arc( centre, StAngle, EndAngle, radius, NO_FILL, width ); + Arc( centre, StAngle, EndAngle, radius, FILL_TYPE::NO_FILL, width ); else { SetCurrentLineWidth( -1 ); Arc( centre, StAngle, EndAngle, - radius - ( width - currentPenWidth ) / 2, NO_FILL, -1 ); + radius - ( width - currentPenWidth ) / 2, FILL_TYPE::NO_FILL, -1 ); Arc( centre, StAngle, EndAngle, - radius + ( width - currentPenWidth ) / 2, NO_FILL, -1 ); + radius + ( width - currentPenWidth ) / 2, FILL_TYPE::NO_FILL, -1 ); } } @@ -546,7 +547,7 @@ void PLOTTER::ThickRect( const wxPoint& p1, const wxPoint& p2, int width, EDA_DRAW_MODE_T tracemode, void* aData ) { if( tracemode == FILLED ) - Rect( p1, p2, NO_FILL, width ); + Rect( p1, p2, FILL_TYPE::NO_FILL, width ); else { SetCurrentLineWidth( -1 ); @@ -554,12 +555,12 @@ void PLOTTER::ThickRect( const wxPoint& p1, const wxPoint& p2, int width, p1.y - (width - currentPenWidth) / 2 ); wxPoint offsetp2( p2.x + (width - currentPenWidth) / 2, p2.y + (width - currentPenWidth) / 2 ); - Rect( offsetp1, offsetp2, NO_FILL, -1 ); + Rect( offsetp1, offsetp2, FILL_TYPE::NO_FILL, -1 ); offsetp1.x += (width - currentPenWidth); offsetp1.y += (width - currentPenWidth); offsetp2.x -= (width - currentPenWidth); offsetp2.y -= (width - currentPenWidth); - Rect( offsetp1, offsetp2, NO_FILL, -1 ); + Rect( offsetp1, offsetp2, FILL_TYPE::NO_FILL, -1 ); } } @@ -568,12 +569,12 @@ void PLOTTER::ThickCircle( const wxPoint& pos, int diametre, int width, EDA_DRAW_MODE_T tracemode, void* aData ) { if( tracemode == FILLED ) - Circle( pos, diametre, NO_FILL, width ); + Circle( pos, diametre, FILL_TYPE::NO_FILL, width ); else { SetCurrentLineWidth( -1 ); - Circle( pos, diametre - width + currentPenWidth, NO_FILL, -1 ); - Circle( pos, diametre + width - currentPenWidth, NO_FILL, -1 ); + Circle( pos, diametre - width + currentPenWidth, FILL_TYPE::NO_FILL, -1 ); + Circle( pos, diametre + width - currentPenWidth, FILL_TYPE::NO_FILL, -1 ); } } @@ -582,16 +583,16 @@ void PLOTTER::FilledCircle( const wxPoint& pos, int diametre, EDA_DRAW_MODE_T tracemode, void* aData ) { if( tracemode == FILLED ) - Circle( pos, diametre, FILLED_SHAPE, 0 ); + Circle( pos, diametre, FILL_TYPE::FILLED_SHAPE, 0 ); else { SetCurrentLineWidth( -1 ); - Circle( pos, diametre, NO_FILL, -1 ); + Circle( pos, diametre, FILL_TYPE::NO_FILL, -1 ); } } -void PLOTTER::PlotPoly( const SHAPE_LINE_CHAIN& aCornerList, FILL_T aFill, +void PLOTTER::PlotPoly( const SHAPE_LINE_CHAIN& aCornerList, FILL_TYPE aFill, int aWidth, void * aData ) { std::vector cornerList; diff --git a/common/plotters/plotter_dxf.h b/common/plotters/plotter_dxf.h index 4454e35e06..ab5ca3ac01 100644 --- a/common/plotters/plotter_dxf.h +++ b/common/plotters/plotter_dxf.h @@ -27,7 +27,7 @@ #include #include -#include // FILL_T +#include // FILL_TYPE #include @@ -76,16 +76,16 @@ public: virtual void SetViewport( const wxPoint& aOffset, double aIusPerDecimil, double aScale, bool aMirror ) override; - virtual void Rect( const wxPoint& p1, const wxPoint& p2, FILL_T fill, + virtual void Rect( const wxPoint& p1, const wxPoint& p2, FILL_TYPE fill, int width = USE_DEFAULT_LINE_WIDTH ) override; - virtual void Circle( const wxPoint& pos, int diametre, FILL_T fill, + virtual void Circle( const wxPoint& pos, int diametre, FILL_TYPE fill, int width = USE_DEFAULT_LINE_WIDTH ) override; virtual void PlotPoly( const std::vector< wxPoint >& aCornerList, - FILL_T aFill, int aWidth = USE_DEFAULT_LINE_WIDTH, void * aData = NULL ) override; + FILL_TYPE aFill, int aWidth = USE_DEFAULT_LINE_WIDTH, void * aData = NULL ) override; virtual void ThickSegment( const wxPoint& start, const wxPoint& end, int width, EDA_DRAW_MODE_T tracemode, void* aData ) override; virtual void Arc( const wxPoint& centre, double StAngle, double EndAngle, - int rayon, FILL_T fill, int width = USE_DEFAULT_LINE_WIDTH ) override; + int rayon, FILL_TYPE fill, int width = USE_DEFAULT_LINE_WIDTH ) override; virtual void PenTo( const wxPoint& pos, char plume ) override; virtual void FlashPadCircle( const wxPoint& pos, int diametre, diff --git a/common/plotters/plotter_gerber.h b/common/plotters/plotter_gerber.h index a2083979da..9585925c86 100644 --- a/common/plotters/plotter_gerber.h +++ b/common/plotters/plotter_gerber.h @@ -28,7 +28,7 @@ #include #include -#include // FILL_T +#include // FILL_TYPE #include #include "gbr_plotter_apertures.h" @@ -69,12 +69,12 @@ public: double aScale, bool aMirror ) override; // Basic plot primitives - virtual void Rect( const wxPoint& p1, const wxPoint& p2, FILL_T fill, + virtual void Rect( const wxPoint& p1, const wxPoint& p2, FILL_TYPE fill, int width = USE_DEFAULT_LINE_WIDTH ) override; - virtual void Circle( const wxPoint& pos, int diametre, FILL_T fill, + virtual void Circle( const wxPoint& pos, int diametre, FILL_TYPE fill, int width = USE_DEFAULT_LINE_WIDTH ) override; virtual void Arc( const wxPoint& aCenter, double aStAngle, double aEndAngle, - int aRadius, FILL_T aFill, int aWidth = USE_DEFAULT_LINE_WIDTH ) override; + int aRadius, FILL_TYPE aFill, int aWidth = USE_DEFAULT_LINE_WIDTH ) override; // These functions plot an item and manage X2 gerber attributes virtual void ThickSegment( const wxPoint& start, const wxPoint& end, int width, @@ -94,7 +94,7 @@ public: * appropriate G36/G37 sequence */ virtual void PlotPoly( const std::vector< wxPoint >& aCornerList, - FILL_T aFill, int aWidth = USE_DEFAULT_LINE_WIDTH, + FILL_TYPE aFill, int aWidth = USE_DEFAULT_LINE_WIDTH, void* aData = nullptr ) override; virtual void PenTo( const wxPoint& pos, char plume ) override; diff --git a/common/plotters/plotter_hpgl.h b/common/plotters/plotter_hpgl.h index 980238ba0c..cd178614c8 100644 --- a/common/plotters/plotter_hpgl.h +++ b/common/plotters/plotter_hpgl.h @@ -27,7 +27,7 @@ #include #include -#include // FILL_T +#include // FILL_TYPE #include @@ -74,18 +74,18 @@ public: virtual void SetViewport( const wxPoint& aOffset, double aIusPerDecimil, double aScale, bool aMirror ) override; - virtual void Rect( const wxPoint& p1, const wxPoint& p2, FILL_T fill, + virtual void Rect( const wxPoint& p1, const wxPoint& p2, FILL_TYPE fill, int width = USE_DEFAULT_LINE_WIDTH ) override; - virtual void Circle( const wxPoint& pos, int diametre, FILL_T fill, + virtual void Circle( const wxPoint& pos, int diametre, FILL_TYPE fill, int width = USE_DEFAULT_LINE_WIDTH ) override; virtual void PlotPoly( const std::vector< wxPoint >& aCornerList, - FILL_T aFill, int aWidth = USE_DEFAULT_LINE_WIDTH, + FILL_TYPE aFill, int aWidth = USE_DEFAULT_LINE_WIDTH, void * aData = NULL) override; virtual void ThickSegment( const wxPoint& start, const wxPoint& end, int width, EDA_DRAW_MODE_T tracemode, void* aData ) override; virtual void Arc( const wxPoint& centre, double StAngle, double EndAngle, - int rayon, FILL_T fill, int width = USE_DEFAULT_LINE_WIDTH ) override; + int rayon, FILL_TYPE fill, int width = USE_DEFAULT_LINE_WIDTH ) override; virtual void PenTo( const wxPoint& pos, char plume ) override; virtual void FlashPadCircle( const wxPoint& aPadPos, int aDiameter, EDA_DRAW_MODE_T aTraceMode, void* aData ) override; diff --git a/common/plotters/plotters_pslike.h b/common/plotters/plotters_pslike.h index 90e292e2d3..9b0c91a60d 100644 --- a/common/plotters/plotters_pslike.h +++ b/common/plotters/plotters_pslike.h @@ -27,7 +27,7 @@ #include #include -#include // FILL_T +#include // FILL_TYPE #include @@ -160,15 +160,15 @@ public: virtual void SetViewport( const wxPoint& aOffset, double aIusPerDecimil, double aScale, bool aMirror ) override; - virtual void Rect( const wxPoint& p1, const wxPoint& p2, FILL_T fill, + virtual void Rect( const wxPoint& p1, const wxPoint& p2, FILL_TYPE fill, int width = USE_DEFAULT_LINE_WIDTH ) override; - virtual void Circle( const wxPoint& pos, int diametre, FILL_T fill, + virtual void Circle( const wxPoint& pos, int diametre, FILL_TYPE fill, int width = USE_DEFAULT_LINE_WIDTH ) override; virtual void Arc( const wxPoint& centre, double StAngle, double EndAngle, - int rayon, FILL_T fill, int width = USE_DEFAULT_LINE_WIDTH ) override; + int rayon, FILL_TYPE fill, int width = USE_DEFAULT_LINE_WIDTH ) override; virtual void PlotPoly( const std::vector< wxPoint >& aCornerList, - FILL_T aFill, int aWidth = USE_DEFAULT_LINE_WIDTH, + FILL_TYPE aFill, int aWidth = USE_DEFAULT_LINE_WIDTH, void * aData = NULL ) override; virtual void PlotImage( const wxImage& aImage, const wxPoint& aPos, @@ -234,15 +234,15 @@ public: * with the outputFile open (but not inside a page stream!) */ virtual void SetViewport( const wxPoint& aOffset, double aIusPerDecimil, double aScale, bool aMirror ) override; - virtual void Rect( const wxPoint& p1, const wxPoint& p2, FILL_T fill, + virtual void Rect( const wxPoint& p1, const wxPoint& p2, FILL_TYPE fill, int width = USE_DEFAULT_LINE_WIDTH ) override; - virtual void Circle( const wxPoint& pos, int diametre, FILL_T fill, + virtual void Circle( const wxPoint& pos, int diametre, FILL_TYPE fill, int width = USE_DEFAULT_LINE_WIDTH ) override; virtual void Arc( const wxPoint& centre, double StAngle, double EndAngle, - int rayon, FILL_T fill, int width = USE_DEFAULT_LINE_WIDTH ) override; + int rayon, FILL_TYPE fill, int width = USE_DEFAULT_LINE_WIDTH ) override; virtual void PlotPoly( const std::vector< wxPoint >& aCornerList, - FILL_T aFill, int aWidth = USE_DEFAULT_LINE_WIDTH, + FILL_TYPE aFill, int aWidth = USE_DEFAULT_LINE_WIDTH, void * aData = NULL ) override; virtual void PenTo( const wxPoint& pos, char plume ) override; @@ -308,12 +308,12 @@ public: virtual void SetViewport( const wxPoint& aOffset, double aIusPerDecimil, double aScale, bool aMirror ) override; - virtual void Rect( const wxPoint& p1, const wxPoint& p2, FILL_T fill, + virtual void Rect( const wxPoint& p1, const wxPoint& p2, FILL_TYPE fill, int width = USE_DEFAULT_LINE_WIDTH ) override; - virtual void Circle( const wxPoint& pos, int diametre, FILL_T fill, + virtual void Circle( const wxPoint& pos, int diametre, FILL_TYPE fill, int width = USE_DEFAULT_LINE_WIDTH ) override; virtual void Arc( const wxPoint& centre, double StAngle, double EndAngle, - int rayon, FILL_T fill, int width = USE_DEFAULT_LINE_WIDTH ) override; + int rayon, FILL_TYPE fill, int width = USE_DEFAULT_LINE_WIDTH ) override; virtual void BezierCurve( const wxPoint& aStart, const wxPoint& aControl1, const wxPoint& aControl2, const wxPoint& aEnd, @@ -321,7 +321,7 @@ public: int aLineThickness = USE_DEFAULT_LINE_WIDTH ) override; virtual void PlotPoly( const std::vector< wxPoint >& aCornerList, - FILL_T aFill, int aWidth = USE_DEFAULT_LINE_WIDTH, + FILL_TYPE aFill, int aWidth = USE_DEFAULT_LINE_WIDTH, void * aData = NULL ) override; virtual void PlotImage( const wxImage& aImage, const wxPoint& aPos, @@ -370,7 +370,7 @@ public: void* aData = NULL ) override; protected: - FILL_T m_fillMode; // true if the current contour + FILL_TYPE m_fillMode; // true if the current contour // rect, arc, circle, polygon must be filled long m_pen_rgb_color; // current rgb color value: each color has // a value 0 ... 255, and the 3 colors are @@ -410,5 +410,5 @@ protected: * function setFillMode() * prepare parameters for setSVGPlotStyle() */ - void setFillMode( FILL_T fill ); + void setFillMode( FILL_TYPE fill ); }; diff --git a/eeschema/class_libentry.cpp b/eeschema/class_libentry.cpp index e8e5cdb711..3a87c4ebfd 100644 --- a/eeschema/class_libentry.cpp +++ b/eeschema/class_libentry.cpp @@ -446,7 +446,7 @@ void LIB_PART::Print( RENDER_SETTINGS* aSettings, const wxPoint& aOffset, int aM { for( LIB_ITEM& drawItem : m_drawings ) { - if( drawItem.m_Fill != FILLED_WITH_BG_BODYCOLOR ) + if( drawItem.m_Fill != FILL_TYPE::FILLED_WITH_BG_BODYCOLOR ) continue; // Do not draw items not attached to the current part @@ -495,7 +495,7 @@ void LIB_PART::Print( RENDER_SETTINGS* aSettings, const wxPoint& aOffset, int aM } else { - bool forceNoFill = drawItem.m_Fill == FILLED_WITH_BG_BODYCOLOR; + bool forceNoFill = drawItem.m_Fill == FILL_TYPE::FILLED_WITH_BG_BODYCOLOR; drawItem.Print( aSettings, aOffset, (void*) forceNoFill, aOpts.transform ); } } @@ -525,7 +525,7 @@ void LIB_PART::Plot( PLOTTER* aPlotter, int aUnit, int aConvert, if( aConvert && item.m_Convert && ( item.m_Convert != aConvert ) ) continue; - if( item.m_Fill == FILLED_WITH_BG_BODYCOLOR ) + if( item.m_Fill == FILL_TYPE::FILLED_WITH_BG_BODYCOLOR ) item.Plot( aPlotter, aOffset, fill, aTransform ); } @@ -542,7 +542,7 @@ void LIB_PART::Plot( PLOTTER* aPlotter, int aUnit, int aConvert, if( aConvert && item.m_Convert && ( item.m_Convert != aConvert ) ) continue; - item.Plot( aPlotter, aOffset, fill && ( item.m_Fill != FILLED_WITH_BG_BODYCOLOR ), + item.Plot( aPlotter, aOffset, fill && ( item.m_Fill != FILL_TYPE::FILLED_WITH_BG_BODYCOLOR ), aTransform ); } } diff --git a/eeschema/dialogs/dialog_lib_edit_draw_item.cpp b/eeschema/dialogs/dialog_lib_edit_draw_item.cpp index 764be8423b..1f2dc7ade5 100644 --- a/eeschema/dialogs/dialog_lib_edit_draw_item.cpp +++ b/eeschema/dialogs/dialog_lib_edit_draw_item.cpp @@ -69,7 +69,7 @@ bool DIALOG_LIB_EDIT_DRAW_ITEM::TransferDataToWindow() m_checkApplyToAllConversions->Enable( enblConvOptStyle ); - m_fillCtrl->SetSelection( m_item->GetFillMode() ); + m_fillCtrl->SetSelection( static_cast( m_item->GetFillMode() ) ); m_fillCtrl->Enable( m_item->IsFillable() ); return true; diff --git a/eeschema/dialogs/panel_eeschema_color_settings.cpp b/eeschema/dialogs/panel_eeschema_color_settings.cpp index 31e1ef41d8..8defc20c10 100644 --- a/eeschema/dialogs/panel_eeschema_color_settings.cpp +++ b/eeschema/dialogs/panel_eeschema_color_settings.cpp @@ -341,7 +341,7 @@ void PANEL_EESCHEMA_COLOR_SETTINGS::createPreviewItems() comp_body->SetUnit( 0 ); comp_body->SetConvert( 0 ); comp_body->SetWidth( Mils2iu( 10 ) ); - comp_body->SetFillMode( FILLED_WITH_BG_BODYCOLOR ); + comp_body->SetFillMode( FILL_TYPE::FILLED_WITH_BG_BODYCOLOR ); comp_body->AddPoint( wxPoint( Mils2iu( p.x - 200 ), Mils2iu( p.y + 200 ) ) ); comp_body->AddPoint( wxPoint( Mils2iu( p.x + 200 ), Mils2iu( p.y ) ) ); comp_body->AddPoint( wxPoint( Mils2iu( p.x - 200 ), Mils2iu( p.y - 200 ) ) ); diff --git a/eeschema/lib_arc.cpp b/eeschema/lib_arc.cpp index 31c9672338..3a2c7eabfa 100644 --- a/eeschema/lib_arc.cpp +++ b/eeschema/lib_arc.cpp @@ -50,7 +50,7 @@ LIB_ARC::LIB_ARC( LIB_PART* aParent ) : LIB_ITEM( LIB_ARC_T, aParent ) m_t1 = 0; m_t2 = 0; m_Width = 0; - m_Fill = NO_FILL; + m_Fill = FILL_TYPE::NO_FILL; m_isFillable = true; m_editState = 0; } @@ -261,13 +261,13 @@ void LIB_ARC::Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill, aTransform.MapAngles( &t1, &t2 ); - if( aFill && m_Fill == FILLED_WITH_BG_BODYCOLOR ) + if( aFill && m_Fill == FILL_TYPE::FILLED_WITH_BG_BODYCOLOR ) { aPlotter->SetColor( aPlotter->RenderSettings()->GetLayerColor( LAYER_DEVICE_BACKGROUND ) ); - aPlotter->Arc( pos, -t2, -t1, m_Radius, FILLED_WITH_BG_BODYCOLOR, 0 ); + aPlotter->Arc( pos, -t2, -t1, m_Radius, FILL_TYPE::FILLED_WITH_BG_BODYCOLOR, 0 ); } - bool already_filled = m_Fill == FILLED_WITH_BG_BODYCOLOR; + bool already_filled = m_Fill == FILL_TYPE::FILLED_WITH_BG_BODYCOLOR; int pen_size = GetPenWidth(); if( !already_filled || pen_size > 0 ) @@ -275,7 +275,8 @@ void LIB_ARC::Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill, pen_size = std::max( pen_size, aPlotter->RenderSettings()->GetMinPenWidth() ); aPlotter->SetColor( aPlotter->RenderSettings()->GetLayerColor( LAYER_DEVICE ) ); - aPlotter->Arc( pos, -t2, -t1, m_Radius, already_filled ? NO_FILL : m_Fill, pen_size ); + aPlotter->Arc( + pos, -t2, -t1, m_Radius, already_filled ? FILL_TYPE::NO_FILL : m_Fill, pen_size ); } } @@ -283,7 +284,7 @@ void LIB_ARC::Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill, int LIB_ARC::GetPenWidth() const { // Historically 0 meant "default width" and negative numbers meant "don't stroke". - if( m_Width < 0 && GetFillMode() != NO_FILL ) + if( m_Width < 0 && GetFillMode() != FILL_TYPE::NO_FILL ) return 0; else return std::max( m_Width, 1 ); @@ -296,7 +297,7 @@ void LIB_ARC::print( RENDER_SETTINGS* aSettings, const wxPoint& aOffset, void* a bool forceNoFill = static_cast( aData ); int penWidth = GetPenWidth(); - if( forceNoFill && m_Fill != NO_FILL && penWidth == 0 ) + if( forceNoFill && m_Fill != FILL_TYPE::NO_FILL && penWidth == 0 ) return; wxDC* DC = aSettings->GetPrintDC(); @@ -316,7 +317,7 @@ void LIB_ARC::print( RENDER_SETTINGS* aSettings, const wxPoint& aOffset, void* a std::swap( pos1.y, pos2.y ); } - if( forceNoFill || m_Fill == NO_FILL ) + if( forceNoFill || m_Fill == FILL_TYPE::NO_FILL ) { penWidth = std::max( penWidth, aSettings->GetDefaultPenWidth() ); @@ -324,7 +325,7 @@ void LIB_ARC::print( RENDER_SETTINGS* aSettings, const wxPoint& aOffset, void* a } else { - if( m_Fill == FILLED_WITH_BG_BODYCOLOR ) + if( m_Fill == FILL_TYPE::FILLED_WITH_BG_BODYCOLOR ) color = aSettings->GetLayerColor( LAYER_DEVICE_BACKGROUND ); GRFilledArc( nullptr, DC, posc.x, posc.y, pt1, pt2, m_Radius, penWidth, color, color ); diff --git a/eeschema/lib_bezier.cpp b/eeschema/lib_bezier.cpp index 7590840a80..565415326b 100644 --- a/eeschema/lib_bezier.cpp +++ b/eeschema/lib_bezier.cpp @@ -38,7 +38,7 @@ LIB_BEZIER::LIB_BEZIER( LIB_PART* aParent ) : LIB_ITEM( LIB_BEZIER_T, aParent ) { - m_Fill = NO_FILL; + m_Fill = FILL_TYPE::NO_FILL; m_Width = 0; m_isFillable = true; } @@ -173,13 +173,13 @@ void LIB_BEZIER::Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill, cornerList.push_back( pos ); } - if( aFill && m_Fill == FILLED_WITH_BG_BODYCOLOR ) + if( aFill && m_Fill == FILL_TYPE::FILLED_WITH_BG_BODYCOLOR ) { aPlotter->SetColor( aPlotter->RenderSettings()->GetLayerColor( LAYER_DEVICE_BACKGROUND ) ); - aPlotter->PlotPoly( cornerList, FILLED_WITH_BG_BODYCOLOR, 0 ); + aPlotter->PlotPoly( cornerList, FILL_TYPE::FILLED_WITH_BG_BODYCOLOR, 0 ); } - bool already_filled = m_Fill == FILLED_WITH_BG_BODYCOLOR; + bool already_filled = m_Fill == FILL_TYPE::FILLED_WITH_BG_BODYCOLOR; int pen_size = GetPenWidth(); if( !already_filled || pen_size > 0 ) @@ -187,7 +187,7 @@ void LIB_BEZIER::Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill, pen_size = std::max( pen_size, aPlotter->RenderSettings()->GetMinPenWidth() ); aPlotter->SetColor( aPlotter->RenderSettings()->GetLayerColor( LAYER_DEVICE ) ); - aPlotter->PlotPoly( cornerList, already_filled ? NO_FILL : m_Fill, pen_size ); + aPlotter->PlotPoly( cornerList, already_filled ? FILL_TYPE::NO_FILL : m_Fill, pen_size ); } } @@ -195,7 +195,7 @@ void LIB_BEZIER::Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill, int LIB_BEZIER::GetPenWidth() const { // Historically 0 meant "default width" and negative numbers meant "don't stroke". - if( m_Width < 0 && GetFillMode() != NO_FILL ) + if( m_Width < 0 && GetFillMode() != FILL_TYPE::NO_FILL ) return 0; else return std::max( m_Width, 1 ); @@ -208,7 +208,7 @@ void LIB_BEZIER::print( RENDER_SETTINGS* aSettings, const wxPoint& aOffset, void bool forceNoFill = static_cast( aData ); int penWidth = GetPenWidth(); - if( forceNoFill && m_Fill != NO_FILL && penWidth == 0 ) + if( forceNoFill && m_Fill != FILL_TYPE::NO_FILL && penWidth == 0 ) return; std::vector PolyPointsTraslated; @@ -223,7 +223,7 @@ void LIB_BEZIER::print( RENDER_SETTINGS* aSettings, const wxPoint& aOffset, void for( wxPoint& point : m_PolyPoints ) PolyPointsTraslated.push_back( aTransform.TransformCoordinate( point ) + aOffset ); - if( forceNoFill || m_Fill == NO_FILL ) + if( forceNoFill || m_Fill == FILL_TYPE::NO_FILL ) { penWidth = std::max( penWidth, aSettings->GetDefaultPenWidth() ); @@ -232,7 +232,7 @@ void LIB_BEZIER::print( RENDER_SETTINGS* aSettings, const wxPoint& aOffset, void } else { - if( m_Fill == FILLED_WITH_BG_BODYCOLOR ) + if( m_Fill == FILL_TYPE::FILLED_WITH_BG_BODYCOLOR ) color = aSettings->GetLayerColor( LAYER_DEVICE_BACKGROUND ); GRPoly( nullptr, DC, m_PolyPoints.size(), &PolyPointsTraslated[0], true, penWidth, diff --git a/eeschema/lib_circle.cpp b/eeschema/lib_circle.cpp index 94150168bf..d3a769b623 100644 --- a/eeschema/lib_circle.cpp +++ b/eeschema/lib_circle.cpp @@ -40,7 +40,7 @@ LIB_CIRCLE::LIB_CIRCLE( LIB_PART* aParent ) : LIB_ITEM( LIB_CIRCLE_T, aParent ) { m_Width = 0; - m_Fill = NO_FILL; + m_Fill = FILL_TYPE::NO_FILL; m_isFillable = true; } @@ -164,13 +164,13 @@ void LIB_CIRCLE::Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill, { wxPoint pos = aTransform.TransformCoordinate( m_Pos ) + aOffset; - if( aFill && m_Fill == FILLED_WITH_BG_BODYCOLOR ) + if( aFill && m_Fill == FILL_TYPE::FILLED_WITH_BG_BODYCOLOR ) { aPlotter->SetColor( aPlotter->RenderSettings()->GetLayerColor( LAYER_DEVICE_BACKGROUND ) ); - aPlotter->Circle( pos, GetRadius() * 2, FILLED_WITH_BG_BODYCOLOR, 0 ); + aPlotter->Circle( pos, GetRadius() * 2, FILL_TYPE::FILLED_WITH_BG_BODYCOLOR, 0 ); } - bool already_filled = m_Fill == FILLED_WITH_BG_BODYCOLOR; + bool already_filled = m_Fill == FILL_TYPE::FILLED_WITH_BG_BODYCOLOR; int pen_size = GetPenWidth(); if( !already_filled || pen_size > 0 ) @@ -178,7 +178,8 @@ void LIB_CIRCLE::Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill, pen_size = std::max( pen_size, aPlotter->RenderSettings()->GetMinPenWidth() ); aPlotter->SetColor( aPlotter->RenderSettings()->GetLayerColor( LAYER_DEVICE ) ); - aPlotter->Circle( pos, GetRadius() * 2, already_filled ? NO_FILL : m_Fill, pen_size ); + aPlotter->Circle( + pos, GetRadius() * 2, already_filled ? FILL_TYPE::NO_FILL : m_Fill, pen_size ); } } @@ -186,7 +187,7 @@ void LIB_CIRCLE::Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill, int LIB_CIRCLE::GetPenWidth() const { // Historically 0 meant "default width" and negative numbers meant "don't stroke". - if( m_Width < 0 && GetFillMode() != NO_FILL ) + if( m_Width < 0 && GetFillMode() != FILL_TYPE::NO_FILL ) return 0; else return std::max( m_Width, 1 ); @@ -199,14 +200,14 @@ void LIB_CIRCLE::print( RENDER_SETTINGS* aSettings, const wxPoint& aOffset, void bool forceNoFill = static_cast( aData ); int penWidth = GetPenWidth(); - if( forceNoFill && m_Fill != NO_FILL && penWidth == 0 ) + if( forceNoFill && m_Fill != FILL_TYPE::NO_FILL && penWidth == 0 ) return; wxDC* DC = aSettings->GetPrintDC(); wxPoint pos1 = aTransform.TransformCoordinate( m_Pos ) + aOffset; COLOR4D color = aSettings->GetLayerColor( LAYER_DEVICE ); - if( forceNoFill || m_Fill == NO_FILL ) + if( forceNoFill || m_Fill == FILL_TYPE::NO_FILL ) { penWidth = std::max( penWidth, aSettings->GetDefaultPenWidth() ); @@ -214,7 +215,7 @@ void LIB_CIRCLE::print( RENDER_SETTINGS* aSettings, const wxPoint& aOffset, void } else { - if( m_Fill == FILLED_WITH_BG_BODYCOLOR ) + if( m_Fill == FILL_TYPE::FILLED_WITH_BG_BODYCOLOR ) color = aSettings->GetLayerColor( LAYER_DEVICE_BACKGROUND ); GRFilledCircle( nullptr, DC, pos1.x, pos1.y, GetRadius(), 0, color, color ); diff --git a/eeschema/lib_item.cpp b/eeschema/lib_item.cpp index 14f15346ff..7671012970 100644 --- a/eeschema/lib_item.cpp +++ b/eeschema/lib_item.cpp @@ -29,14 +29,14 @@ #include #include -const int fill_tab[3] = { 'N', 'F', 'f' }; +const int FILL_TYPEab[3] = { 'N', 'F', 'f' }; LIB_ITEM::LIB_ITEM( KICAD_T aType, LIB_PART* aComponent, int aUnit, int aConvert, - FILL_T aFillType ) : + FILL_TYPE aFillType ) : EDA_ITEM( aType ) { m_Unit = aUnit; @@ -84,7 +84,7 @@ int LIB_ITEM::compare( const LIB_ITEM& aOther, LIB_ITEM::COMPARE_FLAGS aCompareF return m_Convert - m_Convert; if( m_Fill != aOther.m_Fill ) - return m_Fill - aOther.m_Fill; + return static_cast( m_Fill ) - static_cast( aOther.m_Fill ); return 0; } diff --git a/eeschema/lib_item.h b/eeschema/lib_item.h index 2cf716a378..8331b22cb2 100644 --- a/eeschema/lib_item.h +++ b/eeschema/lib_item.h @@ -28,6 +28,7 @@ #include #include +#include #include #include #include @@ -41,7 +42,7 @@ class MSG_PANEL_ITEM; using KIGFX::RENDER_SETTINGS; -extern const int fill_tab[]; +extern const int FILL_TYPEab[]; #define MINIMUM_SELECTION_DISTANCE 2 // Minimum selection distance in internal units @@ -88,15 +89,15 @@ protected: /** * The body fill type. This has meaning only for some items. For a list of fill types - * see #FILL_T. + * see #FILL_TYPE. */ - FILL_T m_Fill; + FILL_TYPE m_Fill; bool m_isFillable; public: LIB_ITEM( KICAD_T aType, LIB_PART* aComponent = NULL, int aUnit = 0, int aConvert = 0, - FILL_T aFillType = NO_FILL ); + FILL_TYPE aFillType = FILL_TYPE::NO_FILL ); // Do not create a copy constructor. The one generated by the compiler is adequate. @@ -297,8 +298,8 @@ public: void SetConvert( int aConvert ) { m_Convert = aConvert; } int GetConvert() const { return m_Convert; } - void SetFillMode( FILL_T aFillMode ) { m_Fill = aFillMode; } - FILL_T GetFillMode() const { return m_Fill; } + void SetFillMode( FILL_TYPE aFillMode ) { m_Fill = aFillMode; } + FILL_TYPE GetFillMode() const { return m_Fill; } #if defined(DEBUG) void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); } diff --git a/eeschema/lib_pin.cpp b/eeschema/lib_pin.cpp index d2b9c8779d..291529052a 100644 --- a/eeschema/lib_pin.cpp +++ b/eeschema/lib_pin.cpp @@ -526,7 +526,7 @@ void LIB_PIN::PlotSymbol( PLOTTER* aPlotter, const wxPoint& aPosition, int aOrie { const int radius = externalPinDecoSize( aPlotter->RenderSettings(), *this ); aPlotter->Circle( wxPoint( MapX1 * radius + x1, MapY1 * radius + y1 ), radius * 2, - NO_FILL, penWidth ); + FILL_TYPE::NO_FILL, penWidth ); aPlotter->MoveTo( wxPoint( MapX1 * radius * 2 + x1, MapY1 * radius * 2 + y1 ) ); aPlotter->FinishTo( aPosition ); diff --git a/eeschema/lib_polyline.cpp b/eeschema/lib_polyline.cpp index 2dcbf75af6..b9f847a518 100644 --- a/eeschema/lib_polyline.cpp +++ b/eeschema/lib_polyline.cpp @@ -39,7 +39,7 @@ LIB_POLYLINE::LIB_POLYLINE( LIB_PART* aParent ) : LIB_ITEM( LIB_POLYLINE_T, aParent ) { - m_Fill = NO_FILL; + m_Fill = FILL_TYPE::NO_FILL; m_Width = 0; m_isFillable = true; } @@ -132,13 +132,13 @@ void LIB_POLYLINE::Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill, cornerList.push_back( pos ); } - if( aFill && m_Fill == FILLED_WITH_BG_BODYCOLOR ) + if( aFill && m_Fill == FILL_TYPE::FILLED_WITH_BG_BODYCOLOR ) { aPlotter->SetColor( aPlotter->RenderSettings()->GetLayerColor( LAYER_DEVICE_BACKGROUND ) ); - aPlotter->PlotPoly( cornerList, FILLED_WITH_BG_BODYCOLOR, 0 ); + aPlotter->PlotPoly( cornerList, FILL_TYPE::FILLED_WITH_BG_BODYCOLOR, 0 ); } - bool already_filled = m_Fill == FILLED_WITH_BG_BODYCOLOR; + bool already_filled = m_Fill == FILL_TYPE::FILLED_WITH_BG_BODYCOLOR; int pen_size = GetPenWidth(); if( !already_filled || pen_size > 0 ) @@ -146,7 +146,7 @@ void LIB_POLYLINE::Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill, pen_size = std::max( pen_size, aPlotter->RenderSettings()->GetDefaultPenWidth() ); aPlotter->SetColor( aPlotter->RenderSettings()->GetLayerColor( LAYER_DEVICE ) ); - aPlotter->PlotPoly( cornerList, already_filled ? NO_FILL : m_Fill, pen_size ); + aPlotter->PlotPoly( cornerList, already_filled ? FILL_TYPE::NO_FILL : m_Fill, pen_size ); } } @@ -186,7 +186,7 @@ void LIB_POLYLINE::RemoveCorner( int aIdx ) int LIB_POLYLINE::GetPenWidth() const { // Historically 0 meant "default width" and negative numbers meant "don't stroke". - if( m_Width < 0 && GetFillMode() != NO_FILL ) + if( m_Width < 0 && GetFillMode() != FILL_TYPE::NO_FILL ) return 0; else return std::max( m_Width, 1 ); @@ -199,7 +199,7 @@ void LIB_POLYLINE::print( RENDER_SETTINGS* aSettings, const wxPoint& aOffset, vo bool forceNoFill = static_cast( aData ); int penWidth = GetPenWidth(); - if( forceNoFill && m_Fill != NO_FILL && penWidth == 0 ) + if( forceNoFill && m_Fill != FILL_TYPE::NO_FILL && penWidth == 0 ) return; wxDC* DC = aSettings->GetPrintDC(); @@ -209,7 +209,7 @@ void LIB_POLYLINE::print( RENDER_SETTINGS* aSettings, const wxPoint& aOffset, vo for( unsigned ii = 0; ii < m_PolyPoints.size(); ii++ ) buffer[ii] = aTransform.TransformCoordinate( m_PolyPoints[ii] ) + aOffset; - if( forceNoFill || m_Fill == NO_FILL ) + if( forceNoFill || m_Fill == FILL_TYPE::NO_FILL ) { penWidth = std::max( penWidth, aSettings->GetDefaultPenWidth() ); @@ -217,7 +217,7 @@ void LIB_POLYLINE::print( RENDER_SETTINGS* aSettings, const wxPoint& aOffset, vo } else { - if( m_Fill == FILLED_WITH_BG_BODYCOLOR ) + if( m_Fill == FILL_TYPE::FILLED_WITH_BG_BODYCOLOR ) color = aSettings->GetLayerColor( LAYER_DEVICE_BACKGROUND ); GRPoly( nullptr, DC, m_PolyPoints.size(), buffer, true, penWidth, color, color ); @@ -235,7 +235,7 @@ bool LIB_POLYLINE::HitTest( const wxPoint& aPosition, int aAccuracy ) const for( wxPoint pt : m_PolyPoints ) shape.Append( DefaultTransform.TransformCoordinate( pt ) ); - if( m_Fill != NO_FILL && m_PolyPoints.size() > 2 ) + if( m_Fill != FILL_TYPE::NO_FILL && m_PolyPoints.size() > 2 ) { shape.SetClosed( true ); return shape.PointInside( aPosition, delta ); @@ -266,7 +266,7 @@ bool LIB_POLYLINE::HitTest( const EDA_RECT& aRect, bool aContained, int aAccurac sel.Inflate( ( GetPenWidth() / 2 ) + 1 ); // Only test closing segment if the polyline is filled - int count = m_Fill == NO_FILL ? m_PolyPoints.size() - 1 : m_PolyPoints.size(); + int count = m_Fill == FILL_TYPE::NO_FILL ? m_PolyPoints.size() - 1 : m_PolyPoints.size(); for( int ii = 0; ii < count; ii++ ) { diff --git a/eeschema/lib_rectangle.cpp b/eeschema/lib_rectangle.cpp index aca48f39db..5661905d0a 100644 --- a/eeschema/lib_rectangle.cpp +++ b/eeschema/lib_rectangle.cpp @@ -39,7 +39,7 @@ LIB_RECTANGLE::LIB_RECTANGLE( LIB_PART* aParent ) : LIB_ITEM( LIB_RECTANGLE_T, aParent ) { m_Width = 0; - m_Fill = NO_FILL; + m_Fill = FILL_TYPE::NO_FILL; m_isFillable = true; } @@ -130,13 +130,13 @@ void LIB_RECTANGLE::Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill, wxPoint pos = aTransform.TransformCoordinate( m_Pos ) + aOffset; wxPoint end = aTransform.TransformCoordinate( m_End ) + aOffset; - if( aFill && m_Fill == FILLED_WITH_BG_BODYCOLOR ) + if( aFill && m_Fill == FILL_TYPE::FILLED_WITH_BG_BODYCOLOR ) { aPlotter->SetColor( aPlotter->RenderSettings()->GetLayerColor( LAYER_DEVICE_BACKGROUND ) ); - aPlotter->Rect( pos, end, FILLED_WITH_BG_BODYCOLOR, 0 ); + aPlotter->Rect( pos, end, FILL_TYPE::FILLED_WITH_BG_BODYCOLOR, 0 ); } - bool already_filled = m_Fill == FILLED_WITH_BG_BODYCOLOR; + bool already_filled = m_Fill == FILL_TYPE::FILLED_WITH_BG_BODYCOLOR; int pen_size = GetPenWidth(); if( !already_filled || pen_size > 0 ) @@ -144,7 +144,7 @@ void LIB_RECTANGLE::Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill, pen_size = std::max( pen_size, aPlotter->RenderSettings()->GetMinPenWidth() ); aPlotter->SetColor( aPlotter->RenderSettings()->GetLayerColor( LAYER_DEVICE ) ); - aPlotter->Rect( pos, end, already_filled ? NO_FILL : m_Fill, pen_size ); + aPlotter->Rect( pos, end, already_filled ? FILL_TYPE::NO_FILL : m_Fill, pen_size ); } } @@ -152,7 +152,7 @@ void LIB_RECTANGLE::Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill, int LIB_RECTANGLE::GetPenWidth() const { // Historically 0 meant "default width" and negative numbers meant "don't stroke". - if( m_Width < 0 && GetFillMode() != NO_FILL ) + if( m_Width < 0 && GetFillMode() != FILL_TYPE::NO_FILL ) return 0; else return std::max( m_Width, 1 ); @@ -165,7 +165,7 @@ void LIB_RECTANGLE::print( RENDER_SETTINGS* aSettings, const wxPoint& aOffset, v bool forceNoFill = static_cast( aData ); int penWidth = GetPenWidth(); - if( forceNoFill && m_Fill != NO_FILL && penWidth == 0 ) + if( forceNoFill && m_Fill != FILL_TYPE::NO_FILL && penWidth == 0 ) return; wxDC* DC = aSettings->GetPrintDC(); @@ -173,14 +173,14 @@ void LIB_RECTANGLE::print( RENDER_SETTINGS* aSettings, const wxPoint& aOffset, v wxPoint pt1 = aTransform.TransformCoordinate( m_Pos ) + aOffset; wxPoint pt2 = aTransform.TransformCoordinate( m_End ) + aOffset; - if( forceNoFill || m_Fill == NO_FILL ) + if( forceNoFill || m_Fill == FILL_TYPE::NO_FILL ) { penWidth = std::max( penWidth, aSettings->GetDefaultPenWidth() ); GRRect( nullptr, DC, pt1.x, pt1.y, pt2.x, pt2.y, penWidth, color ); } else { - if( m_Fill == FILLED_WITH_BG_BODYCOLOR ) + if( m_Fill == FILL_TYPE::FILLED_WITH_BG_BODYCOLOR ) color = aSettings->GetLayerColor( LAYER_DEVICE_BACKGROUND ); GRFilledRect( nullptr, DC, pt1.x, pt1.y, pt2.x, pt2.y, penWidth, color, color ); diff --git a/eeschema/plotters/plot_schematic_PDF.cpp b/eeschema/plotters/plot_schematic_PDF.cpp index 559340a723..3338135e3f 100644 --- a/eeschema/plotters/plot_schematic_PDF.cpp +++ b/eeschema/plotters/plot_schematic_PDF.cpp @@ -153,7 +153,7 @@ void DIALOG_PLOT_SCHEMATIC::plotOneSheetPDF( PLOTTER* aPlotter, aPlotter->SetColor( aPlotter->RenderSettings()->GetBackgroundColor() ); wxPoint end( aPlotter->PageSettings().GetWidthIU(), aPlotter->PageSettings().GetHeightIU() ); - aPlotter->Rect( wxPoint( 0, 0 ), end, FILLED_SHAPE, 1.0 ); + aPlotter->Rect( wxPoint( 0, 0 ), end, FILL_TYPE::FILLED_SHAPE, 1.0 ); } if( aPlotFrameRef ) diff --git a/eeschema/plotters/plot_schematic_PS.cpp b/eeschema/plotters/plot_schematic_PS.cpp index 07fcecf4c2..e0d3a13b73 100644 --- a/eeschema/plotters/plot_schematic_PS.cpp +++ b/eeschema/plotters/plot_schematic_PS.cpp @@ -159,7 +159,7 @@ bool DIALOG_PLOT_SCHEMATIC::plotOneSheetPS( const wxString& aFileName, plotter->SetColor( plotter->RenderSettings()->GetLayerColor( LAYER_SCHEMATIC_BACKGROUND ) ); wxPoint end( plotter->PageSettings().GetWidthIU(), plotter->PageSettings().GetHeightIU() ); - plotter->Rect( wxPoint( 0, 0 ), end, FILLED_SHAPE, 1.0 ); + plotter->Rect( wxPoint( 0, 0 ), end, FILL_TYPE::FILLED_SHAPE, 1.0 ); } if( aPlotFrameRef ) diff --git a/eeschema/plotters/plot_schematic_SVG.cpp b/eeschema/plotters/plot_schematic_SVG.cpp index c84bd12a0d..2dac626033 100644 --- a/eeschema/plotters/plot_schematic_SVG.cpp +++ b/eeschema/plotters/plot_schematic_SVG.cpp @@ -134,7 +134,7 @@ bool DIALOG_PLOT_SCHEMATIC::plotOneSheetSVG( const wxString& aFileName, plotter->SetColor( plotter->RenderSettings()->GetLayerColor( LAYER_SCHEMATIC_BACKGROUND ) ); wxPoint end( plotter->PageSettings().GetWidthIU(), plotter->PageSettings().GetHeightIU() ); - plotter->Rect( wxPoint( 0, 0 ), end, FILLED_SHAPE, 1.0 ); + plotter->Rect( wxPoint( 0, 0 ), end, FILL_TYPE::FILLED_SHAPE, 1.0 ); } if( aPlotFrameRef ) diff --git a/eeschema/sch_junction.cpp b/eeschema/sch_junction.cpp index 8b4381fa02..01b8bd4738 100644 --- a/eeschema/sch_junction.cpp +++ b/eeschema/sch_junction.cpp @@ -237,7 +237,7 @@ void SCH_JUNCTION::Plot( PLOTTER* aPlotter ) if( m_diameter != 0 ) diameter = m_diameter; - aPlotter->Circle( m_pos, diameter, FILLED_SHAPE ); + aPlotter->Circle( m_pos, diameter, FILL_TYPE::FILLED_SHAPE ); } diff --git a/eeschema/sch_painter.cpp b/eeschema/sch_painter.cpp index e29cb92deb..73bec80027 100644 --- a/eeschema/sch_painter.cpp +++ b/eeschema/sch_painter.cpp @@ -460,7 +460,7 @@ bool SCH_PAINTER::setDeviceColors( const LIB_ITEM* aItem, int aLayer ) return false; case LAYER_DEVICE_BACKGROUND: - if( aItem->GetFillMode() == FILLED_WITH_BG_BODYCOLOR ) + if( aItem->GetFillMode() == FILL_TYPE::FILLED_WITH_BG_BODYCOLOR ) { COLOR4D fillColor = getRenderColor( aItem, LAYER_DEVICE_BACKGROUND, false ); @@ -468,7 +468,7 @@ bool SCH_PAINTER::setDeviceColors( const LIB_ITEM* aItem, int aLayer ) if( aItem->IsMoving() || aItem->IsDragging() || aItem->IsResized() ) fillColor = fillColor.WithAlpha( 0.75 ); - m_gal->SetIsFill( aItem->GetFillMode() == FILLED_WITH_BG_BODYCOLOR ); + m_gal->SetIsFill( aItem->GetFillMode() == FILL_TYPE::FILLED_WITH_BG_BODYCOLOR ); m_gal->SetFillColor( fillColor ); m_gal->SetIsStroke( false ); return true; @@ -477,10 +477,10 @@ bool SCH_PAINTER::setDeviceColors( const LIB_ITEM* aItem, int aLayer ) return false; case LAYER_DEVICE: - m_gal->SetIsFill( aItem->GetFillMode() == FILLED_SHAPE ); + m_gal->SetIsFill( aItem->GetFillMode() == FILL_TYPE::FILLED_SHAPE ); m_gal->SetFillColor( getRenderColor( aItem, LAYER_DEVICE, false ) ); - if( aItem->GetPenWidth() > 0 || aItem->GetFillMode() == NO_FILL ) + if( aItem->GetPenWidth() > 0 || aItem->GetFillMode() == FILL_TYPE::NO_FILL ) { m_gal->SetIsStroke( true ); m_gal->SetLineWidth( getLineWidth( aItem, false ) ); diff --git a/eeschema/sch_plugins/altium/sch_altium_plugin.cpp b/eeschema/sch_plugins/altium/sch_altium_plugin.cpp index 149d2c3c80..c8c6e88b8b 100644 --- a/eeschema/sch_plugins/altium/sch_altium_plugin.cpp +++ b/eeschema/sch_plugins/altium/sch_altium_plugin.cpp @@ -505,15 +505,15 @@ void SCH_ALTIUM_PLUGIN::ParseRectangle( const std::map& aPro rect->SetWidth( elem.lineWidth ); if( elem.isTransparent ) { - rect->SetFillMode( NO_FILL ); + rect->SetFillMode( FILL_TYPE::NO_FILL ); } else if( elem.isSolid ) { - rect->SetFillMode( FILLED_SHAPE ); + rect->SetFillMode( FILL_TYPE::FILLED_SHAPE ); } else { - rect->SetFillMode( FILLED_WITH_BG_BODYCOLOR ); + rect->SetFillMode( FILL_TYPE::FILLED_WITH_BG_BODYCOLOR ); } } diff --git a/eeschema/sch_plugins/eagle/sch_eagle_plugin.cpp b/eeschema/sch_plugins/eagle/sch_eagle_plugin.cpp index 46047b163b..c2b527e700 100644 --- a/eeschema/sch_plugins/eagle/sch_eagle_plugin.cpp +++ b/eeschema/sch_plugins/eagle/sch_eagle_plugin.cpp @@ -1571,7 +1571,7 @@ LIB_RECTANGLE* SCH_EAGLE_PLUGIN::loadSymbolRectangle( rectangle->SetUnit( aGateNumber ); // Eagle rectangles are filled by definition. - rectangle->SetFillMode( FILLED_SHAPE ); + rectangle->SetFillMode( FILL_TYPE::FILLED_SHAPE ); return rectangle.release(); } @@ -1622,7 +1622,7 @@ LIB_ITEM* SCH_EAGLE_PLUGIN::loadSymbolWire( * 2; arc->SetWidth( 1 ); - arc->SetFillMode( FILLED_SHAPE ); + arc->SetFillMode( FILL_TYPE::FILLED_SHAPE ); } else { @@ -1685,7 +1685,7 @@ LIB_POLYLINE* SCH_EAGLE_PLUGIN::loadSymbolPolyLine( vertex = vertex->GetNext(); } - polyLine->SetFillMode( FILLED_SHAPE ); + polyLine->SetFillMode( FILL_TYPE::FILLED_SHAPE ); polyLine->SetUnit( aGateNumber ); return polyLine.release(); diff --git a/eeschema/sch_plugins/kicad/sch_sexpr_parser.cpp b/eeschema/sch_plugins/kicad/sch_sexpr_parser.cpp index 45fa8e6835..5d030d5112 100644 --- a/eeschema/sch_plugins/kicad/sch_sexpr_parser.cpp +++ b/eeschema/sch_plugins/kicad/sch_sexpr_parser.cpp @@ -493,7 +493,7 @@ void SCH_SEXPR_PARSER::parseFill( FILL_PARAMS& aFill ) wxCHECK_RET( CurTok() == T_fill, wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as fill." ) ); - aFill.m_FillType = NO_FILL; + aFill.m_FillType = FILL_TYPE::NO_FILL; aFill.m_Color = COLOR4D::UNSPECIFIED; T token; @@ -513,9 +513,15 @@ void SCH_SEXPR_PARSER::parseFill( FILL_PARAMS& aFill ) switch( token ) { - case T_none: aFill.m_FillType = NO_FILL; break; - case T_outline: aFill.m_FillType = FILLED_SHAPE; break; - case T_background: aFill.m_FillType = FILLED_WITH_BG_BODYCOLOR; break; + case T_none: + aFill.m_FillType = FILL_TYPE::NO_FILL; + break; + case T_outline: + aFill.m_FillType = FILL_TYPE::FILLED_SHAPE; + break; + case T_background: + aFill.m_FillType = FILL_TYPE::FILLED_WITH_BG_BODYCOLOR; + break; default: Expecting( "none, outline, or background" ); } diff --git a/eeschema/sch_plugins/kicad/sch_sexpr_parser.h b/eeschema/sch_plugins/kicad/sch_sexpr_parser.h index db51afd6a9..d8cf7f7a60 100644 --- a/eeschema/sch_plugins/kicad/sch_sexpr_parser.h +++ b/eeschema/sch_plugins/kicad/sch_sexpr_parser.h @@ -68,7 +68,7 @@ class TITLE_BLOCK; class FILL_PARAMS { public: - FILL_T m_FillType; + FILL_TYPE m_FillType; COLOR4D m_Color; }; diff --git a/eeschema/sch_plugins/kicad/sch_sexpr_plugin.cpp b/eeschema/sch_plugins/kicad/sch_sexpr_plugin.cpp index a235736bb1..9f0f066984 100644 --- a/eeschema/sch_plugins/kicad/sch_sexpr_plugin.cpp +++ b/eeschema/sch_plugins/kicad/sch_sexpr_plugin.cpp @@ -82,9 +82,13 @@ static void formatFill( const LIB_ITEM* aItem, OUTPUTFORMATTER& aFormatter, int switch( aItem->GetFillMode() ) { - case FILLED_SHAPE: fillType = "outline"; break; - case FILLED_WITH_BG_BODYCOLOR: fillType = "background"; break; - case NO_FILL: + case FILL_TYPE::FILLED_SHAPE: + fillType = "outline"; + break; + case FILL_TYPE::FILLED_WITH_BG_BODYCOLOR: + fillType = "background"; + break; + case FILL_TYPE::NO_FILL: KI_FALLTHROUGH; default: fillType = "none"; @@ -299,7 +303,7 @@ class SCH_SEXPR_PLUGIN_CACHE int m_versionMinor; SCH_LIB_TYPE m_libType; // Is this cache a component or symbol library. - static FILL_T parseFillMode( LINE_READER& aReader, const char* aLine, + static FILL_TYPE parseFillMode( LINE_READER& aReader, const char* aLine, const char** aOutput ); LIB_PART* removeSymbol( LIB_PART* aAlias ); diff --git a/eeschema/sch_plugins/legacy/sch_legacy_plugin.cpp b/eeschema/sch_plugins/legacy/sch_legacy_plugin.cpp index 96a1a0295a..e098d65cb7 100644 --- a/eeschema/sch_plugins/legacy/sch_legacy_plugin.cpp +++ b/eeschema/sch_plugins/legacy/sch_legacy_plugin.cpp @@ -505,7 +505,7 @@ class SCH_LEGACY_PLUGIN_CACHE static LIB_POLYLINE* loadPolyLine( std::unique_ptr& aPart, LINE_READER& aReader ); static LIB_BEZIER* loadBezier( std::unique_ptr& aPart, LINE_READER& aReader ); - static FILL_T parseFillMode( LINE_READER& aReader, const char* aLine, + static FILL_TYPE parseFillMode( LINE_READER& aReader, const char* aLine, const char** aOutput ); LIB_PART* removeSymbol( LIB_PART* aAlias ); @@ -3202,23 +3202,23 @@ void SCH_LEGACY_PLUGIN_CACHE::loadDrawEntries( std::unique_ptr& aPart, } -FILL_T SCH_LEGACY_PLUGIN_CACHE::parseFillMode( LINE_READER& aReader, const char* aLine, +FILL_TYPE SCH_LEGACY_PLUGIN_CACHE::parseFillMode( LINE_READER& aReader, const char* aLine, const char** aOutput ) { switch ( parseChar( aReader, aLine, aOutput ) ) { case 'F': - return FILLED_SHAPE; + return FILL_TYPE::FILLED_SHAPE; case 'f': - return FILLED_WITH_BG_BODYCOLOR; + return FILL_TYPE::FILLED_WITH_BG_BODYCOLOR; case 'N': - return NO_FILL; + return FILL_TYPE::NO_FILL; default: SCH_PARSE_ERROR( "invalid fill type, expected f, F, or N", aReader, aLine ); } // This will never be reached but quiets the compiler warnings - return NO_FILL; + return FILL_TYPE::NO_FILL; } @@ -3944,7 +3944,7 @@ void SCH_LEGACY_PLUGIN_CACHE::saveArc( LIB_ARC* aArc, aFormatter.Print( 0, "A %d %d %d %d %d %d %d %d %c %d %d %d %d\n", Iu2Mils( aArc->GetPosition().x ), Iu2Mils( aArc->GetPosition().y ), Iu2Mils( aArc->GetRadius() ), x1, x2, aArc->GetUnit(), aArc->GetConvert(), - Iu2Mils( aArc->GetWidth() ), fill_tab[aArc->GetFillMode()], + Iu2Mils( aArc->GetWidth() ), FILL_TYPEab[ static_cast( aArc->GetFillMode() ) ], Iu2Mils( aArc->GetStart().x ), Iu2Mils( aArc->GetStart().y ), Iu2Mils( aArc->GetEnd().x ), Iu2Mils( aArc->GetEnd().y ) ); } @@ -3961,7 +3961,7 @@ void SCH_LEGACY_PLUGIN_CACHE::saveBezier( LIB_BEZIER* aBezier, for( const auto& pt : aBezier->GetPoints() ) aFormatter.Print( 0, " %d %d", Iu2Mils( pt.x ), Iu2Mils( pt.y ) ); - aFormatter.Print( 0, " %c\n", fill_tab[aBezier->GetFillMode()] ); + aFormatter.Print( 0, " %c\n", FILL_TYPEab[static_cast( aBezier->GetFillMode() )] ); } @@ -3973,7 +3973,7 @@ void SCH_LEGACY_PLUGIN_CACHE::saveCircle( LIB_CIRCLE* aCircle, aFormatter.Print( 0, "C %d %d %d %d %d %d %c\n", Iu2Mils( aCircle->GetPosition().x ), Iu2Mils( aCircle->GetPosition().y ), Iu2Mils( aCircle->GetRadius() ), aCircle->GetUnit(), aCircle->GetConvert(), - Iu2Mils( aCircle->GetWidth() ), fill_tab[aCircle->GetFillMode()] ); + Iu2Mils( aCircle->GetWidth() ), FILL_TYPEab[static_cast( aCircle->GetFillMode() )] ); } @@ -4160,7 +4160,7 @@ void SCH_LEGACY_PLUGIN_CACHE::savePolyLine( LIB_POLYLINE* aPolyLine, aFormatter.Print( 0, " %d %d", Iu2Mils( pt.x ), Iu2Mils( pt.y ) ); } - aFormatter.Print( 0, " %c\n", fill_tab[aPolyLine->GetFillMode()] ); + aFormatter.Print( 0, " %c\n", FILL_TYPEab[static_cast( aPolyLine->GetFillMode() )] ); } @@ -4175,7 +4175,7 @@ void SCH_LEGACY_PLUGIN_CACHE::saveRectangle( LIB_RECTANGLE* aRectangle, Iu2Mils( aRectangle->GetPosition().y ), Iu2Mils( aRectangle->GetEnd().x ), Iu2Mils( aRectangle->GetEnd().y ), aRectangle->GetUnit(), aRectangle->GetConvert(), - Iu2Mils( aRectangle->GetWidth() ), fill_tab[aRectangle->GetFillMode()] ); + Iu2Mils( aRectangle->GetWidth() ), FILL_TYPEab[static_cast( aRectangle->GetFillMode() )] ); } diff --git a/eeschema/sch_sheet.cpp b/eeschema/sch_sheet.cpp index 02d7c26f7d..98a4e4fa09 100644 --- a/eeschema/sch_sheet.cpp +++ b/eeschema/sch_sheet.cpp @@ -962,7 +962,7 @@ void SCH_SHEET::Plot( PLOTTER* aPlotter ) aPlotter->SetColor( backgroundColor ); // Do not fill shape in B&W mode, otherwise texts are unreadable bool fill = aPlotter->GetColorMode(); - aPlotter->Rect( m_pos, m_pos + m_size, fill ? FILLED_SHAPE : NO_FILL, 1.0 ); + aPlotter->Rect( m_pos, m_pos + m_size, fill ? FILL_TYPE::FILLED_SHAPE : FILL_TYPE::NO_FILL, 1.0 ); aPlotter->SetColor( borderColor ); diff --git a/eeschema/sch_text.cpp b/eeschema/sch_text.cpp index 0302f83c23..cb782960f8 100644 --- a/eeschema/sch_text.cpp +++ b/eeschema/sch_text.cpp @@ -615,7 +615,7 @@ void SCH_TEXT::Plot( PLOTTER* aPlotter ) CreateGraphicShape( aPlotter->RenderSettings(), Poly, GetTextPos() ); if( Poly.size() ) - aPlotter->PlotPoly( Poly, NO_FILL, penWidth ); + aPlotter->PlotPoly( Poly, FILL_TYPE::NO_FILL, penWidth ); } diff --git a/eeschema/tools/lib_drawing_tools.cpp b/eeschema/tools/lib_drawing_tools.cpp index 590df5a109..fccec4c008 100644 --- a/eeschema/tools/lib_drawing_tools.cpp +++ b/eeschema/tools/lib_drawing_tools.cpp @@ -48,7 +48,7 @@ static void* g_lastPinWeakPtr; LIB_DRAWING_TOOLS::LIB_DRAWING_TOOLS() : EE_TOOL_BASE( "eeschema.SymbolDrawing" ), m_lastTextAngle( 0.0 ), - m_lastFillStyle( NO_FILL ), + m_lastFillStyle( FILL_TYPE::NO_FILL ), m_drawSpecificConvert( true ), m_drawSpecificUnit( false ) { diff --git a/eeschema/tools/lib_drawing_tools.h b/eeschema/tools/lib_drawing_tools.h index 9aed22dfc2..4384a38cf2 100644 --- a/eeschema/tools/lib_drawing_tools.h +++ b/eeschema/tools/lib_drawing_tools.h @@ -69,7 +69,7 @@ private: private: double m_lastTextAngle; - FILL_T m_lastFillStyle; + FILL_TYPE m_lastFillStyle; bool m_drawSpecificConvert; bool m_drawSpecificUnit; }; diff --git a/eeschema/tools/lib_edit_tool.cpp b/eeschema/tools/lib_edit_tool.cpp index 7b8068a968..5676e15112 100644 --- a/eeschema/tools/lib_edit_tool.cpp +++ b/eeschema/tools/lib_edit_tool.cpp @@ -439,7 +439,7 @@ void LIB_EDIT_TOOL::editGraphicProperties( LIB_ITEM* aItem ) return; if( aItem->IsFillable() ) - aItem->SetFillMode( (FILL_T) dialog.GetFillStyle() ); + aItem->SetFillMode( (FILL_TYPE) dialog.GetFillStyle() ); aItem->SetWidth( dialog.GetWidth() ); diff --git a/include/eda_item.h b/include/eda_item.h index 1fe1e641f4..1727909ef8 100644 --- a/include/eda_item.h +++ b/include/eda_item.h @@ -34,17 +34,6 @@ #include #include -/** - * Enum FILL_T - * is the set of fill types used in plotting or drawing enclosed areas. - */ -enum FILL_T { - NO_FILL, - FILLED_SHAPE, // Fill with object color ("Solid shape") - FILLED_WITH_BG_BODYCOLOR, // Fill with background body color - // (not filled in B&W mode when plotting or printing) - FILLED_WITH_COLOR // Fill with a user-defined color (currently sheets only) -}; enum class SEARCH_RESULT diff --git a/include/fill_type.h b/include/fill_type.h new file mode 100644 index 0000000000..ee54a87865 --- /dev/null +++ b/include/fill_type.h @@ -0,0 +1,38 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2020 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 3 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, see . + */ + +#ifndef FILL_TYPE_H +#define FILL_TYPE_H + +/** + * Enum class FILL_TYPE + * is the set of fill types used in plotting or drawing enclosed areas. + * + * Warning: Do not renumber this enum, the legacy schematic plugin demands on these values + */ +enum class FILL_TYPE : int +{ + NO_FILL = 0, + FILLED_SHAPE = 1, // Fill with object color ("Solid shape") + FILLED_WITH_BG_BODYCOLOR = 2, // Fill with background body color + // (not filled in B&W mode when plotting or printing) + FILLED_WITH_COLOR =3 // Fill with a user-defined color (currently sheets only) +}; + +#endif \ No newline at end of file diff --git a/include/plotter.h b/include/plotter.h index f2d6eafa33..b4c53db8fd 100644 --- a/include/plotter.h +++ b/include/plotter.h @@ -32,12 +32,13 @@ #ifndef PLOT_COMMON_H_ #define PLOT_COMMON_H_ +#include #include #include #include #include #include -#include // FILL_T +#include // FILL_TYPE #include class COLOR_SETTINGS; @@ -227,16 +228,16 @@ public: int GetPlotterArcHighDef() const { return m_IUsPerDecimil * 2; } // Low level primitives - virtual void Rect( const wxPoint& p1, const wxPoint& p2, FILL_T fill, + virtual void Rect( const wxPoint& p1, const wxPoint& p2, FILL_TYPE fill, int width = USE_DEFAULT_LINE_WIDTH ) = 0; - virtual void Circle( const wxPoint& pos, int diametre, FILL_T fill, + virtual void Circle( const wxPoint& pos, int diametre, FILL_TYPE fill, int width = USE_DEFAULT_LINE_WIDTH ) = 0; /** * Generic fallback: arc rendered as a polyline */ virtual void Arc( const wxPoint& centre, double StAngle, double EndAngle, - int rayon, FILL_T fill, int width = USE_DEFAULT_LINE_WIDTH ); + int rayon, FILL_TYPE fill, int width = USE_DEFAULT_LINE_WIDTH ); /** * Generic fallback: Cubic Bezier curve rendered as a polyline @@ -288,7 +289,7 @@ public: * @param aWidth = line width * @param aData an auxiliary info (mainly for gerber format) */ - virtual void PlotPoly( const std::vector< wxPoint >& aCornerList, FILL_T aFill, + virtual void PlotPoly( const std::vector< wxPoint >& aCornerList, FILL_TYPE aFill, int aWidth = USE_DEFAULT_LINE_WIDTH, void * aData = NULL ) = 0; /** @@ -300,7 +301,7 @@ public: * @param aWidth = line width * @param aData an auxiliary info (mainly for gerber format) */ - virtual void PlotPoly( const SHAPE_LINE_CHAIN& aCornerList, FILL_T aFill, + virtual void PlotPoly( const SHAPE_LINE_CHAIN& aCornerList, FILL_TYPE aFill, int aWidth = USE_DEFAULT_LINE_WIDTH, void * aData = NULL ); /** diff --git a/pcbnew/exporters/gerber_placefile_writer.cpp b/pcbnew/exporters/gerber_placefile_writer.cpp index 1eef485c22..18debdc84b 100644 --- a/pcbnew/exporters/gerber_placefile_writer.cpp +++ b/pcbnew/exporters/gerber_placefile_writer.cpp @@ -192,7 +192,7 @@ int PLACEFILE_GERBER_WRITER::CreatePlaceFile( wxString& aFullFilename, PCB_LAYER continue; useFpPadsBbox = false; - plotter.PLOTTER::PlotPoly( poly, NO_FILL, line_thickness, &gbr_metadata ); + plotter.PLOTTER::PlotPoly( poly, FILL_TYPE::NO_FILL, line_thickness, &gbr_metadata ); } } @@ -216,7 +216,7 @@ int PLACEFILE_GERBER_WRITER::CreatePlaceFile( wxString& aFullFilename, PCB_LAYER poly.Rotate( -footprint->GetOrientationRadians(), VECTOR2I( 0, 0 ) ); poly.Move( footprint->GetPosition() ); - plotter.PLOTTER::PlotPoly( poly, NO_FILL, line_thickness, &gbr_metadata ); + plotter.PLOTTER::PlotPoly( poly, FILL_TYPE::NO_FILL, line_thickness, &gbr_metadata ); } std::vectorpad_key_list; diff --git a/pcbnew/plot_board_layers.cpp b/pcbnew/plot_board_layers.cpp index d62065917b..1820e00232 100644 --- a/pcbnew/plot_board_layers.cpp +++ b/pcbnew/plot_board_layers.cpp @@ -622,7 +622,7 @@ void PlotLayerOutlines( BOARD* aBoard, PLOTTER* aPlotter, LSET aLayerMask, if( cornerList[0] != cornerList[cornerList.size() - 1] ) cornerList.push_back( cornerList[0] ); - aPlotter->PlotPoly( cornerList, NO_FILL ); + aPlotter->PlotPoly( cornerList, FILL_TYPE::NO_FILL ); } } @@ -644,7 +644,7 @@ void PlotLayerOutlines( BOARD* aBoard, PLOTTER* aPlotter, LSET aLayerMask, if( hole.x == hole.y ) { hole.x = std::min( smallDrill, hole.x ); - aPlotter->Circle( pad->GetPosition(), hole.x, NO_FILL ); + aPlotter->Circle( pad->GetPosition(), hole.x, FILL_TYPE::NO_FILL ); } else { @@ -665,7 +665,7 @@ void PlotLayerOutlines( BOARD* aBoard, PLOTTER* aPlotter, LSET aLayerMask, if( via && via->IsOnLayer( layer ) ) // via holes can be not through holes { - aPlotter->Circle( via->GetPosition(), via->GetDrillValue(), NO_FILL ); + aPlotter->Circle( via->GetPosition(), via->GetDrillValue(), FILL_TYPE::NO_FILL ); } } } @@ -889,7 +889,7 @@ void PlotSolderMaskLayer( BOARD *aBoard, PLOTTER* aPlotter, LSET aLayerMask, if( cornerList[0] != cornerList[cornerList.size() - 1] ) cornerList.push_back( cornerList[0] ); - aPlotter->PlotPoly( cornerList, FILLED_SHAPE ); + aPlotter->PlotPoly( cornerList, FILL_TYPE::FILLED_SHAPE ); } #endif } @@ -992,7 +992,7 @@ static void FillNegativeKnockout( PLOTTER *aPlotter, const EDA_RECT &aBbbox ) aPlotter->SetColor( WHITE ); // Which will be plotted as black EDA_RECT area = aBbbox; area.Inflate( margin ); - aPlotter->Rect( area.GetOrigin(), area.GetEnd(), FILLED_SHAPE ); + aPlotter->Rect( area.GetOrigin(), area.GetEnd(), FILL_TYPE::FILLED_SHAPE ); aPlotter->SetColor( BLACK ); } diff --git a/pcbnew/plot_brditems_plotter.cpp b/pcbnew/plot_brditems_plotter.cpp index e87c130ac3..f04064137b 100644 --- a/pcbnew/plot_brditems_plotter.cpp +++ b/pcbnew/plot_brditems_plotter.cpp @@ -581,7 +581,7 @@ void BRDITEMS_PLOTTER::PlotFootprintGraphicItem( FP_SHAPE* aShape ) for( const wxPoint& pt : pts ) poly.Append( pt ); - m_plotter->PlotPoly( poly, FILLED_SHAPE, -1, &gbr_metadata ); + m_plotter->PlotPoly( poly, FILL_TYPE::FILLED_SHAPE, -1, &gbr_metadata ); } } break; @@ -661,7 +661,7 @@ void BRDITEMS_PLOTTER::PlotFootprintGraphicItem( FP_SHAPE* aShape ) for( int jj = 0; jj < tmpPoly.OutlineCount(); ++jj ) { SHAPE_LINE_CHAIN &poly = tmpPoly.Outline( jj ); - m_plotter->PlotPoly( poly, FILLED_SHAPE, thickness, &gbr_metadata ); + m_plotter->PlotPoly( poly, FILL_TYPE::FILLED_SHAPE, thickness, &gbr_metadata ); } } } @@ -807,14 +807,14 @@ void BRDITEMS_PLOTTER::PlotFilledAreas( ZONE_CONTAINER* aZone, SHAPE_POLY_SET& p if( m_plotter->GetPlotterType() == PLOT_FORMAT::GERBER ) { if( outline_thickness > 0 ) - m_plotter->PlotPoly( cornerList, NO_FILL, + m_plotter->PlotPoly( cornerList, FILL_TYPE::NO_FILL, outline_thickness, &gbr_metadata ); static_cast( m_plotter )->PlotGerberRegion( cornerList, &gbr_metadata ); } else - m_plotter->PlotPoly( cornerList, FILLED_SHAPE, + m_plotter->PlotPoly( cornerList, FILL_TYPE::FILLED_SHAPE, outline_thickness, &gbr_metadata ); } else @@ -922,7 +922,7 @@ void BRDITEMS_PLOTTER::PlotPcbShape( PCB_SHAPE* aShape ) for( int jj = 0; jj < tmpPoly.OutlineCount(); ++jj ) { SHAPE_LINE_CHAIN& poly = tmpPoly.Outline( jj ); - m_plotter->PlotPoly( poly, FILLED_SHAPE, thickness, &gbr_metadata ); + m_plotter->PlotPoly( poly, FILL_TYPE::FILLED_SHAPE, thickness, &gbr_metadata ); } } } @@ -946,7 +946,7 @@ void BRDITEMS_PLOTTER::PlotPcbShape( PCB_SHAPE* aShape ) for( const wxPoint& pt : pts ) poly.Append( pt ); - m_plotter->PlotPoly( poly, FILLED_SHAPE, -1, &gbr_metadata ); + m_plotter->PlotPoly( poly, FILL_TYPE::FILLED_SHAPE, -1, &gbr_metadata ); } } break; diff --git a/pcbnew/plugins/cadstar/cadstar_pcb_archive_loader.cpp b/pcbnew/plugins/cadstar/cadstar_pcb_archive_loader.cpp index c9401a57bb..34c139f65e 100644 --- a/pcbnew/plugins/cadstar/cadstar_pcb_archive_loader.cpp +++ b/pcbnew/plugins/cadstar/cadstar_pcb_archive_loader.cpp @@ -1193,7 +1193,7 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadTemplates() zone->SetLocalClearance( getKiCadLength( csTemplate.Pouring.AdditionalIsolation ) ); - if( csTemplate.Pouring.FillType == TEMPLATE::POURING::COPPER_FILL_TYPE::HATCHED ) + if( csTemplate.Pouring.FillType == TEMPLATE::POURING::COPPER_FILL_TYPEYPE::HATCHED ) { zone->SetFillMode( ZONE_FILL_MODE::HATCH_PATTERN ); zone->SetHatchGap( getKiCadHatchCodeGap( csTemplate.Pouring.HatchCodeID ) ); diff --git a/pcbnew/plugins/cadstar/cadstar_pcb_archive_parser.cpp b/pcbnew/plugins/cadstar/cadstar_pcb_archive_parser.cpp index fa2a779ee2..2bbd502756 100644 --- a/pcbnew/plugins/cadstar/cadstar_pcb_archive_parser.cpp +++ b/pcbnew/plugins/cadstar/cadstar_pcb_archive_parser.cpp @@ -2143,11 +2143,11 @@ void CADSTAR_PCB_ARCHIVE_PARSER::TEMPLATE::POURING::Parse( XNODE* aNode ) } else if( cNodeName == wxT( "FILLED" ) ) { - FillType = COPPER_FILL_TYPE::FILLED; + FillType = COPPER_FILL_TYPEYPE::FILLED; } else if( cNodeName == wxT( "HATCHCODEREF" ) ) { - FillType = COPPER_FILL_TYPE::HATCHED; + FillType = COPPER_FILL_TYPEYPE::HATCHED; HatchCodeID = GetXmlAttributeIDString( cNode, 0 ); } else diff --git a/pcbnew/plugins/cadstar/cadstar_pcb_archive_parser.h b/pcbnew/plugins/cadstar/cadstar_pcb_archive_parser.h index 1cca7b19c3..a16067277a 100644 --- a/pcbnew/plugins/cadstar/cadstar_pcb_archive_parser.h +++ b/pcbnew/plugins/cadstar/cadstar_pcb_archive_parser.h @@ -238,7 +238,7 @@ public: * - V_S = Via to SMD Pad (Optional Rule) * - V_V = Via to Via * - * Other design rules are in: + * Other design rules are in: * TECHNOLOGY->MAXMITER = Maximum Mitre (This parameter is not actually checked in Cadstar) * TECHNOLOGY->MINMITER = Minimum Mitre (This parameter is not actually checked in Cadstar) * TECHNOLOGY->MINUNNECKED = Minimum Thicker Track Length @@ -446,7 +446,7 @@ public: /** * @brief From CADSTAR Help: "Area is for creating areas within which, and nowhere else, certain * operations are carried out (e.g. Placement.); and for creating 'keep out' areas, within which - * no operations are carried out and where no items are placed by operations such as Placement + * no operations are carried out and where no items are placed by operations such as Placement * and Routing." */ struct COMPONENT_AREA @@ -470,7 +470,7 @@ public: }; /** - * @brief From CADSTAR Help: "This parameter indicates the physical layers on which the selected + * @brief From CADSTAR Help: "This parameter indicates the physical layers on which the selected * pad is placed. Note: When you change the Side parameter in PCB Design, the Side assigned to the * pad in the library is not overwritten." */ @@ -488,15 +488,15 @@ public: /** * @brief From CADSTAR help: "For specifying the directions in which routes can enter or exit the - * pad. There are eight pre-defined directions to choose from, North, South, East, West, + * pad. There are eight pre-defined directions to choose from, North, South, East, West, * North-East, North-West, South-East and South-West, plus "Free Angle" which allows routes to exit * in any direction. * - * If none of the direction boxes are checked, the system uses the default which is all directions - * (as shown above) for all pad shapes, except the long (drawn) Routes exit from the short sides of + * If none of the direction boxes are checked, the system uses the default which is all directions + * (as shown above) for all pad shapes, except the long (drawn) Routes exit from the short sides of * long pads - in other words in line with the long axis. * - * Note: These Exit Directions are applied to the PCB component. If the PCB component is rotated + * Note: These Exit Directions are applied to the PCB component. If the PCB component is rotated * when it is used on a PCB Design, the Exit Directions will rotate with it." * * The main thing to note is that the exit angle is not relative to the pad (even if the pad is @@ -605,7 +605,7 @@ public: /** * @brief Contains formatting specific for a CADSTAR_PCB_ARCHIVE_PARSER::DIMENSION object. - * Note that none of the parameters has any effect on the position of the dimension text - + * Note that none of the parameters has any effect on the position of the dimension text - * it is more of an "intention" of where it should be placed. The user can manually * drag the location of the dimension text. Therefore, the actual position of the dimension * text is as defined in the `Text` object within CADSTAR_PCB_ARCHIVE_PARSER::DIMENSION. @@ -615,7 +615,7 @@ public: * on top of the dimension line, if the dimension line is STYLE::INTERNAL). * * Note: the token is "DIMTEXT" in the CADSTAR format, but this has been renamed to - * TEXTFORMAT in the cadstar2kicadplugin for ease of understanding. + * TEXTFORMAT in the cadstar2kicadplugin for ease of understanding. */ struct TEXTFORMAT { @@ -809,7 +809,7 @@ public: /** * @brief From CADSTAR Help: "Area is for creating areas within which, and nowhere else, certain * operations are carried out (e.g. Placement.); and for creating 'keep out' areas, within which - * no operations are carried out and where no items are placed by operations such as Placement + * no operations are carried out and where no items are placed by operations such as Placement * and Routing. [...] * More than one function can be assigned to an area." */ @@ -1005,14 +1005,14 @@ public: { struct POURING { - enum class COPPER_FILL_TYPE + enum class COPPER_FILL_TYPEYPE { FILLED, HATCHED ///< This is a user defined HATCHCODE_ID }; /** - * @brief From CADSTAR Help: "With this parameter you can select one of two ways in + * @brief From CADSTAR Help: "With this parameter you can select one of two ways in * which to generate thermal reliefs." * Note: there doesn't appear to be any noticeable difference between the options. */ @@ -1062,7 +1062,7 @@ public: bool TargetForAutorouting = false; ///< true when subnode "AUTOROUTETARGET" is present RELIEF_TYPE ReliefType = RELIEF_TYPE::CROSS; ///< See RELIEF_TYPE - COPPER_FILL_TYPE FillType = COPPER_FILL_TYPE::FILLED; ///< Assume solid fill + COPPER_FILL_TYPEYPE FillType = COPPER_FILL_TYPEYPE::FILLED; ///< Assume solid fill HATCHCODE_ID HatchCodeID = wxEmptyString; ///< Only for FillType = HATCHED void Parse( XNODE* aNode );