diff --git a/3d-viewer/3d_canvas/create_3Dgraphic_brd_items.cpp b/3d-viewer/3d_canvas/create_3Dgraphic_brd_items.cpp index 8c148b88e4..be41355b19 100644 --- a/3d-viewer/3d_canvas/create_3Dgraphic_brd_items.cpp +++ b/3d-viewer/3d_canvas/create_3Dgraphic_brd_items.cpp @@ -598,9 +598,9 @@ void BOARD_ADAPTER::addShape( const PCB_SHAPE* aShape, CONTAINER_2D_BASE* aConta { // The full width of the lines to create const float linewidth3DU = TO_3DU( aShape->GetWidth() ); - PLOT_DASH_TYPE lineStyle = aShape->GetStroke().GetPlotStyle(); + LINE_STYLE lineStyle = aShape->GetStroke().GetLineStyle(); - if( lineStyle <= PLOT_DASH_TYPE::FIRST_TYPE ) + if( lineStyle <= LINE_STYLE::FIRST_TYPE ) { switch( aShape->GetShape() ) { diff --git a/common/eda_shape.cpp b/common/eda_shape.cpp index f4e2bc33c4..87a2c82a9c 100644 --- a/common/eda_shape.cpp +++ b/common/eda_shape.cpp @@ -40,7 +40,7 @@ EDA_SHAPE::EDA_SHAPE( SHAPE_T aType, int aLineWidth, FILL_T aFill ) : m_endsSwapped( false ), m_shape( aType ), - m_stroke( aLineWidth, PLOT_DASH_TYPE::DEFAULT, COLOR4D::UNSPECIFIED ), + m_stroke( aLineWidth, LINE_STYLE::DEFAULT, COLOR4D::UNSPECIFIED ), m_fill( aFill ), m_fillColor( COLOR4D::UNSPECIFIED ), m_rectangleHeight( 0 ), @@ -1599,7 +1599,7 @@ int EDA_SHAPE::Compare( const EDA_SHAPE* aOther ) const TEST_PT( m_poly.CVertex( ii ), aOther->m_poly.CVertex( ii ) ); TEST_E( m_stroke.GetWidth(), aOther->m_stroke.GetWidth() ); - TEST( (int) m_stroke.GetPlotStyle(), (int) aOther->m_stroke.GetPlotStyle() ); + TEST( (int) m_stroke.GetLineStyle(), (int) aOther->m_stroke.GetLineStyle() ); TEST( (int) m_fill, (int) aOther->m_fill ); return 0; @@ -1718,18 +1718,18 @@ void EDA_SHAPE::TransformShapeToPolygon( SHAPE_POLY_SET& aBuffer, int aClearance } -void EDA_SHAPE::SetLineStyle( const PLOT_DASH_TYPE aStyle ) +void EDA_SHAPE::SetLineStyle( const LINE_STYLE aStyle ) { - m_stroke.SetPlotStyle( aStyle ); + m_stroke.SetLineStyle( aStyle ); } -PLOT_DASH_TYPE EDA_SHAPE::GetLineStyle() const +LINE_STYLE EDA_SHAPE::GetLineStyle() const { - if( m_stroke.GetPlotStyle() != PLOT_DASH_TYPE::DEFAULT ) - return m_stroke.GetPlotStyle(); + if( m_stroke.GetLineStyle() != LINE_STYLE::DEFAULT ) + return m_stroke.GetLineStyle(); - return PLOT_DASH_TYPE::SOLID; + return LINE_STYLE::SOLID; } @@ -1744,7 +1744,7 @@ bool EDA_SHAPE::operator==( const EDA_SHAPE& aOther ) const if( m_stroke.GetWidth() != aOther.m_stroke.GetWidth() ) return false; - if( m_stroke.GetPlotStyle() != aOther.m_stroke.GetPlotStyle() ) + if( m_stroke.GetLineStyle() != aOther.m_stroke.GetLineStyle() ) return false; if( m_fillColor != aOther.m_fillColor ) @@ -1791,7 +1791,7 @@ double EDA_SHAPE::Similarity( const EDA_SHAPE& aOther ) const if( m_stroke.GetWidth() != aOther.m_stroke.GetWidth() ) similarity *= 0.9; - if( m_stroke.GetPlotStyle() != aOther.m_stroke.GetPlotStyle() ) + if( m_stroke.GetLineStyle() != aOther.m_stroke.GetLineStyle() ) similarity *= 0.9; if( m_fillColor != aOther.m_fillColor ) @@ -1857,7 +1857,7 @@ double EDA_SHAPE::Similarity( const EDA_SHAPE& aOther ) const IMPLEMENT_ENUM_TO_WXANY( SHAPE_T ) -IMPLEMENT_ENUM_TO_WXANY( PLOT_DASH_TYPE ) +IMPLEMENT_ENUM_TO_WXANY( LINE_STYLE ) static struct EDA_SHAPE_DESC @@ -1872,16 +1872,16 @@ static struct EDA_SHAPE_DESC .Map( SHAPE_T::POLY, _HKI( "Polygon" ) ) .Map( SHAPE_T::BEZIER, _HKI( "Bezier" ) ); - auto& plotDashTypeEnum = ENUM_MAP::Instance(); + auto& plotDashTypeEnum = ENUM_MAP::Instance(); if( plotDashTypeEnum.Choices().GetCount() == 0 ) { - plotDashTypeEnum.Map( PLOT_DASH_TYPE::DEFAULT, _HKI( "Default" ) ) - .Map( PLOT_DASH_TYPE::SOLID, _HKI( "Solid" ) ) - .Map( PLOT_DASH_TYPE::DASH, _HKI( "Dashed" ) ) - .Map( PLOT_DASH_TYPE::DOT, _HKI( "Dotted" ) ) - .Map( PLOT_DASH_TYPE::DASHDOT, _HKI( "Dash-Dot" ) ) - .Map( PLOT_DASH_TYPE::DASHDOTDOT, _HKI( "Dash-Dot-Dot" ) ); + plotDashTypeEnum.Map( LINE_STYLE::DEFAULT, _HKI( "Default" ) ) + .Map( LINE_STYLE::SOLID, _HKI( "Solid" ) ) + .Map( LINE_STYLE::DASH, _HKI( "Dashed" ) ) + .Map( LINE_STYLE::DOT, _HKI( "Dotted" ) ) + .Map( LINE_STYLE::DASHDOT, _HKI( "Dash-Dot" ) ) + .Map( LINE_STYLE::DASHDOTDOT, _HKI( "Dash-Dot-Dot" ) ); } PROPERTY_MANAGER& propMgr = PROPERTY_MANAGER::Instance(); @@ -1920,8 +1920,8 @@ static struct EDA_SHAPE_DESC propMgr.AddProperty( new PROPERTY( _HKI( "Line Width" ), &EDA_SHAPE::SetWidth, &EDA_SHAPE::GetWidth, PROPERTY_DISPLAY::PT_SIZE ) ); - void ( EDA_SHAPE::*lineStyleSetter )( PLOT_DASH_TYPE ) = &EDA_SHAPE::SetLineStyle; - propMgr.AddProperty( new PROPERTY_ENUM( + void ( EDA_SHAPE::*lineStyleSetter )( LINE_STYLE ) = &EDA_SHAPE::SetLineStyle; + propMgr.AddProperty( new PROPERTY_ENUM( _HKI( "Line Style" ), lineStyleSetter, &EDA_SHAPE::GetLineStyle ) ); propMgr.AddProperty( new PROPERTY( _HKI( "Line Color" ), diff --git a/common/import_gfx/graphics_importer.h b/common/import_gfx/graphics_importer.h index 8c8eb2a0c6..d569a5fd4b 100644 --- a/common/import_gfx/graphics_importer.h +++ b/common/import_gfx/graphics_importer.h @@ -47,7 +47,7 @@ class EDA_ITEM; class IMPORTED_STROKE { public: - IMPORTED_STROKE( double aWidth = 0, PLOT_DASH_TYPE aPlotStyle = PLOT_DASH_TYPE::DEFAULT, + IMPORTED_STROKE( double aWidth = 0, LINE_STYLE aPlotStyle = LINE_STYLE::DEFAULT, const KIGFX::COLOR4D& aColor = KIGFX::COLOR4D::UNSPECIFIED ) : m_width( aWidth ), m_plotstyle( aPlotStyle ), m_color( aColor ) @@ -57,15 +57,15 @@ public: double GetWidth() const { return m_width; } void SetWidth( double aWidth ) { m_width = aWidth; } - PLOT_DASH_TYPE GetPlotStyle() const { return m_plotstyle; } - void SetPlotStyle( PLOT_DASH_TYPE aPlotStyle ) { m_plotstyle = aPlotStyle; } + LINE_STYLE GetPlotStyle() const { return m_plotstyle; } + void SetPlotStyle( LINE_STYLE aPlotStyle ) { m_plotstyle = aPlotStyle; } KIGFX::COLOR4D GetColor() const { return m_color; } void SetColor( const KIGFX::COLOR4D& aColor ) { m_color = aColor; } private: double m_width; - PLOT_DASH_TYPE m_plotstyle; + LINE_STYLE m_plotstyle; KIGFX::COLOR4D m_color; }; diff --git a/common/import_gfx/svg_import_plugin.cpp b/common/import_gfx/svg_import_plugin.cpp index d412fa773b..456242ed63 100644 --- a/common/import_gfx/svg_import_plugin.cpp +++ b/common/import_gfx/svg_import_plugin.cpp @@ -145,7 +145,7 @@ bool SVG_IMPORT_PLUGIN::Import() strokeColor = COLOR4D::UNSPECIFIED; } - PLOT_DASH_TYPE dashType = PLOT_DASH_TYPE::SOLID; + LINE_STYLE dashType = LINE_STYLE::SOLID; if( shape->strokeDashCount > 0 ) { @@ -165,13 +165,13 @@ bool SVG_IMPORT_PLUGIN::Import() } if( dotCount > 0 && dashCount == 0 ) - dashType = PLOT_DASH_TYPE::DOT; + dashType = LINE_STYLE::DOT; else if( dotCount == 0 && dashCount > 0 ) - dashType = PLOT_DASH_TYPE::DASH; + dashType = LINE_STYLE::DASH; else if( dotCount == 1 && dashCount == 1 ) - dashType = PLOT_DASH_TYPE::DASHDOT; + dashType = LINE_STYLE::DASHDOT; else if( dotCount == 2 && dashCount == 1 ) - dashType = PLOT_DASH_TYPE::DASHDOTDOT; + dashType = LINE_STYLE::DASHDOTDOT; } IMPORTED_STROKE stroke( lineWidth, dashType, strokeColor ); diff --git a/common/plotters/DXF_plotter.cpp b/common/plotters/DXF_plotter.cpp index 014a12b080..69a8921f21 100644 --- a/common/plotters/DXF_plotter.cpp +++ b/common/plotters/DXF_plotter.cpp @@ -96,21 +96,21 @@ static const struct }; -static const char* getDXFLineType( PLOT_DASH_TYPE aType ) +static const char* getDXFLineType( LINE_STYLE aType ) { switch( aType ) { - case PLOT_DASH_TYPE::DEFAULT: - case PLOT_DASH_TYPE::SOLID: + case LINE_STYLE::DEFAULT: + case LINE_STYLE::SOLID: return "CONTINUOUS"; - case PLOT_DASH_TYPE::DASH: + case LINE_STYLE::DASH: return "DASHED"; - case PLOT_DASH_TYPE::DOT: + case LINE_STYLE::DOT: return "DOTTED"; - case PLOT_DASH_TYPE::DASHDOT: + case LINE_STYLE::DASHDOT: return "DASHDOT"; default: - wxFAIL_MSG( "Unhandled PLOT_DASH_TYPE" ); + wxFAIL_MSG( "Unhandled LINE_STYLE" ); return "CONTINUOUS"; } } @@ -623,11 +623,11 @@ void DXF_PLOTTER::PenTo( const VECTOR2I& pos, char plume ) if( m_penLastpos != pos && plume == 'D' ) { - wxASSERT( m_currentLineType >= PLOT_DASH_TYPE::FIRST_TYPE - && m_currentLineType <= PLOT_DASH_TYPE::LAST_TYPE ); + wxASSERT( m_currentLineType >= LINE_STYLE::FIRST_TYPE + && m_currentLineType <= LINE_STYLE::LAST_TYPE ); // DXF LINE wxString cname = getDXFColorName( m_currentColor ); - const char* lname = getDXFLineType( static_cast( m_currentLineType ) ); + const char* lname = getDXFLineType( static_cast( m_currentLineType ) ); fprintf( m_outputFile, "0\nLINE\n8\n%s\n6\n%s\n10\n%s\n20\n%s\n11\n%s\n21\n%s\n", TO_UTF8( cname ), lname, formatCoord( pen_lastpos_dev.x ).c_str(), @@ -640,10 +640,10 @@ void DXF_PLOTTER::PenTo( const VECTOR2I& pos, char plume ) } -void DXF_PLOTTER::SetDash( int aLineWidth, PLOT_DASH_TYPE aLineStyle ) +void DXF_PLOTTER::SetDash( int aLineWidth, LINE_STYLE aLineStyle ) { - wxASSERT( aLineStyle >= PLOT_DASH_TYPE::FIRST_TYPE - && aLineStyle <= PLOT_DASH_TYPE::LAST_TYPE ); + wxASSERT( aLineStyle >= LINE_STYLE::FIRST_TYPE + && aLineStyle <= LINE_STYLE::LAST_TYPE ); m_currentLineType = aLineStyle; } diff --git a/common/plotters/HPGL_plotter.cpp b/common/plotters/HPGL_plotter.cpp index b5e06863a5..1b2306b3a8 100644 --- a/common/plotters/HPGL_plotter.cpp +++ b/common/plotters/HPGL_plotter.cpp @@ -222,7 +222,7 @@ static const double PLUsPERDECIMIL = 0.1016; HPGL_PLOTTER::HPGL_PLOTTER() : m_arcTargetChordLength( 0 ), m_arcMinChordDegrees( 5.0, DEGREES_T ), - m_lineStyle( PLOT_DASH_TYPE::SOLID ), + m_lineStyle( LINE_STYLE::SOLID ), m_useUserCoords( false ), m_fitUserCoords( false ), m_current_item( nullptr ) @@ -305,10 +305,10 @@ bool HPGL_PLOTTER::EndPlot() } } - VECTOR2I loc = m_items.begin()->loc_start; - bool pen_up = true; - PLOT_DASH_TYPE current_dash = PLOT_DASH_TYPE::SOLID; - int current_pen = m_penNumber; + VECTOR2I loc = m_items.begin()->loc_start; + bool pen_up = true; + LINE_STYLE current_dash = LINE_STYLE::SOLID; + int current_pen = m_penNumber; for( HPGL_ITEM const& item : m_items ) { @@ -531,7 +531,7 @@ void HPGL_PLOTTER::PenTo( const VECTOR2I& pos, char plume ) } -void HPGL_PLOTTER::SetDash( int aLineWidth, PLOT_DASH_TYPE aLineStyle ) +void HPGL_PLOTTER::SetDash( int aLineWidth, LINE_STYLE aLineStyle ) { m_lineStyle = aLineStyle; flushItem(); @@ -906,15 +906,15 @@ void HPGL_PLOTTER::sortItems( std::list& items ) } -const char* HPGL_PLOTTER::lineStyleCommand( PLOT_DASH_TYPE aLineStyle ) +const char* HPGL_PLOTTER::lineStyleCommand( LINE_STYLE aLineStyle ) { switch( aLineStyle ) { - case PLOT_DASH_TYPE::DASH: return "LT 2 4 1;"; - case PLOT_DASH_TYPE::DOT: return "LT 1 1 1;"; - case PLOT_DASH_TYPE::DASHDOT: return "LT 4 6 1;"; - case PLOT_DASH_TYPE::DASHDOTDOT: return "LT 7 8 1;"; - default: return "LT;"; + case LINE_STYLE::DASH: return "LT 2 4 1;"; + case LINE_STYLE::DOT: return "LT 1 1 1;"; + case LINE_STYLE::DASHDOT: return "LT 4 6 1;"; + case LINE_STYLE::DASHDOTDOT: return "LT 7 8 1;"; + default: return "LT;"; } } diff --git a/common/plotters/PDF_plotter.cpp b/common/plotters/PDF_plotter.cpp index 1e982b6caf..305316bd96 100644 --- a/common/plotters/PDF_plotter.cpp +++ b/common/plotters/PDF_plotter.cpp @@ -183,29 +183,29 @@ void PDF_PLOTTER::emitSetRGBColor( double r, double g, double b, double a ) } -void PDF_PLOTTER::SetDash( int aLineWidth, PLOT_DASH_TYPE aLineStyle ) +void PDF_PLOTTER::SetDash( int aLineWidth, LINE_STYLE aLineStyle ) { wxASSERT( m_workFile ); switch( aLineStyle ) { - case PLOT_DASH_TYPE::DASH: + case LINE_STYLE::DASH: fprintf( m_workFile, "[%d %d] 0 d\n", (int) GetDashMarkLenIU( aLineWidth ), (int) GetDashGapLenIU( aLineWidth ) ); break; - case PLOT_DASH_TYPE::DOT: + case LINE_STYLE::DOT: fprintf( m_workFile, "[%d %d] 0 d\n", (int) GetDotMarkLenIU( aLineWidth ), (int) GetDashGapLenIU( aLineWidth ) ); break; - case PLOT_DASH_TYPE::DASHDOT: + case LINE_STYLE::DASHDOT: fprintf( m_workFile, "[%d %d %d %d] 0 d\n", (int) GetDashMarkLenIU( aLineWidth ), (int) GetDashGapLenIU( aLineWidth ), (int) GetDotMarkLenIU( aLineWidth ), (int) GetDashGapLenIU( aLineWidth ) ); break; - case PLOT_DASH_TYPE::DASHDOTDOT: + case LINE_STYLE::DASHDOTDOT: fprintf( m_workFile, "[%d %d %d %d %d %d] 0 d\n", (int) GetDashMarkLenIU( aLineWidth ), (int) GetDashGapLenIU( aLineWidth ), (int) GetDotMarkLenIU( aLineWidth ), (int) GetDashGapLenIU( aLineWidth ), diff --git a/common/plotters/PS_plotter.cpp b/common/plotters/PS_plotter.cpp index 7de0d20bba..bff3672374 100644 --- a/common/plotters/PS_plotter.cpp +++ b/common/plotters/PS_plotter.cpp @@ -461,27 +461,27 @@ void PS_PLOTTER::emitSetRGBColor( double r, double g, double b, double a ) } -void PS_PLOTTER::SetDash( int aLineWidth, PLOT_DASH_TYPE aLineStyle ) +void PS_PLOTTER::SetDash( int aLineWidth, LINE_STYLE aLineStyle ) { switch( aLineStyle ) { - case PLOT_DASH_TYPE::DASH: + case LINE_STYLE::DASH: fprintf( m_outputFile, "[%d %d] 0 setdash\n", (int) GetDashMarkLenIU( aLineWidth ), (int) GetDashGapLenIU( aLineWidth ) ); break; - case PLOT_DASH_TYPE::DOT: + case LINE_STYLE::DOT: fprintf( m_outputFile, "[%d %d] 0 setdash\n", (int) GetDotMarkLenIU( aLineWidth ), (int) GetDashGapLenIU( aLineWidth ) ); break; - case PLOT_DASH_TYPE::DASHDOT: + case LINE_STYLE::DASHDOT: fprintf( m_outputFile, "[%d %d %d %d] 0 setdash\n", (int) GetDashMarkLenIU( aLineWidth ), (int) GetDashGapLenIU( aLineWidth ), (int) GetDotMarkLenIU( aLineWidth ), (int) GetDashGapLenIU( aLineWidth ) ); break; - case PLOT_DASH_TYPE::DASHDOTDOT: + case LINE_STYLE::DASHDOTDOT: fprintf( m_outputFile, "[%d %d %d %d %d %d] 0 setdash\n", (int) GetDashMarkLenIU( aLineWidth ), (int) GetDashGapLenIU( aLineWidth ), (int) GetDotMarkLenIU( aLineWidth ), (int) GetDashGapLenIU( aLineWidth ), diff --git a/common/plotters/SVG_plotter.cpp b/common/plotters/SVG_plotter.cpp index 46a5343416..44d46486a4 100644 --- a/common/plotters/SVG_plotter.cpp +++ b/common/plotters/SVG_plotter.cpp @@ -170,7 +170,7 @@ SVG_PLOTTER::SVG_PLOTTER() m_pen_rgb_color = 0; // current color value (black) m_brush_rgb_color = 0; // current color value (black) m_brush_alpha = 1.0; - m_dashed = PLOT_DASH_TYPE::SOLID; + m_dashed = LINE_STYLE::SOLID; m_precision = 4; // default: 4 digits in mantissa. } @@ -262,31 +262,31 @@ void SVG_PLOTTER::setSVGPlotStyle( int aLineWidth, bool aIsGroup, const std::str //set any extra attributes for non-solid lines switch( m_dashed ) { - case PLOT_DASH_TYPE::DASH: + case LINE_STYLE::DASH: fprintf( m_outputFile, "stroke-dasharray:%.*f,%.*f;", m_precision, GetDashMarkLenIU( aLineWidth ), m_precision, GetDashGapLenIU( aLineWidth ) ); break; - case PLOT_DASH_TYPE::DOT: + case LINE_STYLE::DOT: fprintf( m_outputFile, "stroke-dasharray:%f,%f;", GetDotMarkLenIU( aLineWidth ), GetDashGapLenIU( aLineWidth ) ); break; - case PLOT_DASH_TYPE::DASHDOT: + case LINE_STYLE::DASHDOT: fprintf( m_outputFile, "stroke-dasharray:%f,%f,%f,%f;", GetDashMarkLenIU( aLineWidth ), GetDashGapLenIU( aLineWidth ), GetDotMarkLenIU( aLineWidth ), GetDashGapLenIU( aLineWidth ) ); break; - case PLOT_DASH_TYPE::DASHDOTDOT: + case LINE_STYLE::DASHDOTDOT: fprintf( m_outputFile, "stroke-dasharray:%f,%f,%f,%f,%f,%f;", GetDashMarkLenIU( aLineWidth ), GetDashGapLenIU( aLineWidth ), GetDotMarkLenIU( aLineWidth ), GetDashGapLenIU( aLineWidth ), GetDotMarkLenIU( aLineWidth ), GetDashGapLenIU( aLineWidth ) ); break; - case PLOT_DASH_TYPE::DEFAULT: - case PLOT_DASH_TYPE::SOLID: + case LINE_STYLE::DEFAULT: + case LINE_STYLE::SOLID: default: //do nothing break; @@ -359,7 +359,7 @@ void SVG_PLOTTER::emitSetRGBColor( double r, double g, double b, double a ) } -void SVG_PLOTTER::SetDash( int aLineWidth, PLOT_DASH_TYPE aLineStyle ) +void SVG_PLOTTER::SetDash( int aLineWidth, LINE_STYLE aLineStyle ) { if( m_dashed != aLineStyle ) { diff --git a/common/stroke_params.cpp b/common/stroke_params.cpp index 2b83cb9b4d..d130223079 100644 --- a/common/stroke_params.cpp +++ b/common/stroke_params.cpp @@ -32,16 +32,16 @@ using namespace STROKEPARAMS_T; -const std::map lineTypeNames = { - { PLOT_DASH_TYPE::SOLID, { _( "Solid" ), BITMAPS::stroke_solid } }, - { PLOT_DASH_TYPE::DASH, { _( "Dashed" ), BITMAPS::stroke_dash } }, - { PLOT_DASH_TYPE::DOT, { _( "Dotted" ), BITMAPS::stroke_dot } }, - { PLOT_DASH_TYPE::DASHDOT, { _( "Dash-Dot" ), BITMAPS::stroke_dashdot } }, - { PLOT_DASH_TYPE::DASHDOTDOT, { _( "Dash-Dot-Dot" ), BITMAPS::stroke_dashdotdot } } +const std::map lineTypeNames = { + { LINE_STYLE::SOLID, { _( "Solid" ), BITMAPS::stroke_solid } }, + { LINE_STYLE::DASH, { _( "Dashed" ), BITMAPS::stroke_dash } }, + { LINE_STYLE::DOT, { _( "Dotted" ), BITMAPS::stroke_dot } }, + { LINE_STYLE::DASHDOT, { _( "Dash-Dot" ), BITMAPS::stroke_dashdot } }, + { LINE_STYLE::DASHDOTDOT, { _( "Dash-Dot-Dot" ), BITMAPS::stroke_dashdotdot } } }; -void STROKE_PARAMS::Stroke( const SHAPE* aShape, PLOT_DASH_TYPE aLineStyle, int aWidth, +void STROKE_PARAMS::Stroke( const SHAPE* aShape, LINE_STYLE aLineStyle, int aWidth, const KIGFX::RENDER_SETTINGS* aRenderSettings, std::function aStroker ) { @@ -51,24 +51,24 @@ void STROKE_PARAMS::Stroke( const SHAPE* aShape, PLOT_DASH_TYPE aLineStyle, int switch( aLineStyle ) { - case PLOT_DASH_TYPE::DASH: + case LINE_STYLE::DASH: strokes[0] = aRenderSettings->GetDashLength( aWidth ); strokes[1] = aRenderSettings->GetGapLength( aWidth ); wrapAround = 2; break; - case PLOT_DASH_TYPE::DOT: + case LINE_STYLE::DOT: strokes[0] = aRenderSettings->GetDotLength( aWidth ); strokes[1] = aRenderSettings->GetGapLength( aWidth ); wrapAround = 2; break; - case PLOT_DASH_TYPE::DASHDOT: + case LINE_STYLE::DASHDOT: strokes[0] = aRenderSettings->GetDashLength( aWidth ); strokes[1] = aRenderSettings->GetGapLength( aWidth ); strokes[2] = aRenderSettings->GetDotLength( aWidth ); strokes[3] = aRenderSettings->GetGapLength( aWidth ); wrapAround = 4; break; - case PLOT_DASH_TYPE::DASHDOTDOT: + case LINE_STYLE::DASHDOTDOT: strokes[0] = aRenderSettings->GetDashLength( aWidth ); strokes[1] = aRenderSettings->GetGapLength( aWidth ); strokes[2] = aRenderSettings->GetDotLength( aWidth ); @@ -181,18 +181,18 @@ void STROKE_PARAMS::Stroke( const SHAPE* aShape, PLOT_DASH_TYPE aLineStyle, int } -wxString STROKE_PARAMS::GetLineStyleToken( PLOT_DASH_TYPE aStyle ) +wxString STROKE_PARAMS::GetLineStyleToken( LINE_STYLE aStyle ) { wxString token; switch( aStyle ) { - case PLOT_DASH_TYPE::DASH: token = wxT( "dash" ); break; - case PLOT_DASH_TYPE::DOT: token = wxT( "dot" ); break; - case PLOT_DASH_TYPE::DASHDOT: token = wxT( "dash_dot" ); break; - case PLOT_DASH_TYPE::DASHDOTDOT: token = wxT( "dash_dot_dot" ); break; - case PLOT_DASH_TYPE::SOLID: token = wxT( "solid" ); break; - case PLOT_DASH_TYPE::DEFAULT: token = wxT( "default" ); break; + case LINE_STYLE::DASH: token = wxT( "dash" ); break; + case LINE_STYLE::DOT: token = wxT( "dot" ); break; + case LINE_STYLE::DASHDOT: token = wxT( "dash_dot" ); break; + case LINE_STYLE::DASHDOTDOT: token = wxT( "dash_dot_dot" ); break; + case LINE_STYLE::SOLID: token = wxT( "solid" ); break; + case LINE_STYLE::DEFAULT: token = wxT( "default" ); break; } return token; @@ -207,9 +207,9 @@ void STROKE_PARAMS::GetMsgPanelInfo( UNITS_PROVIDER* aUnitsProvider, { wxString lineStyle = _( "Default" ); - for( const std::pair& typeEntry : lineTypeNames ) + for( const std::pair& typeEntry : lineTypeNames ) { - if( typeEntry.first == GetPlotStyle() ) + if( typeEntry.first == GetLineStyle() ) { lineStyle = typeEntry.second.name; break; @@ -233,13 +233,13 @@ void STROKE_PARAMS::Format( OUTPUTFORMATTER* aFormatter, const EDA_IU_SCALE& aIu { aFormatter->Print( aNestLevel, "(stroke (width %s) (type %s))", EDA_UNIT_UTILS::FormatInternalUnits( aIuScale, GetWidth() ).c_str(), - TO_UTF8( GetLineStyleToken( GetPlotStyle() ) ) ); + TO_UTF8( GetLineStyleToken( GetLineStyle() ) ) ); } else { aFormatter->Print( aNestLevel, "(stroke (width %s) (type %s) (color %d %d %d %s))", EDA_UNIT_UTILS::FormatInternalUnits( aIuScale, GetWidth() ).c_str(), - TO_UTF8( GetLineStyleToken( GetPlotStyle() ) ), + TO_UTF8( GetLineStyleToken( GetLineStyle() ) ), KiROUND( GetColor().r * 255.0 ), KiROUND( GetColor().g * 255.0 ), KiROUND( GetColor().b * 255.0 ), @@ -270,12 +270,12 @@ void STROKE_PARAMS_PARSER::ParseStroke( STROKE_PARAMS& aStroke ) switch( token ) { - case T_dash: aStroke.SetPlotStyle( PLOT_DASH_TYPE::DASH ); break; - case T_dot: aStroke.SetPlotStyle( PLOT_DASH_TYPE::DOT ); break; - case T_dash_dot: aStroke.SetPlotStyle( PLOT_DASH_TYPE::DASHDOT ); break; - case T_dash_dot_dot: aStroke.SetPlotStyle( PLOT_DASH_TYPE::DASHDOTDOT ); break; - case T_solid: aStroke.SetPlotStyle( PLOT_DASH_TYPE::SOLID ); break; - case T_default: aStroke.SetPlotStyle( PLOT_DASH_TYPE::DEFAULT ); break; + case T_dash: aStroke.SetLineStyle( LINE_STYLE::DASH ); break; + case T_dot: aStroke.SetLineStyle( LINE_STYLE::DOT ); break; + case T_dash_dot: aStroke.SetLineStyle( LINE_STYLE::DASHDOT ); break; + case T_dash_dot_dot: aStroke.SetLineStyle( LINE_STYLE::DASHDOTDOT ); break; + case T_solid: aStroke.SetLineStyle( LINE_STYLE::SOLID ); break; + case T_default: aStroke.SetLineStyle( LINE_STYLE::DEFAULT ); break; default: Expecting( "solid, dash, dash_dot, dash_dot_dot, dot or default" ); } diff --git a/eeschema/dialogs/dialog_global_edit_text_and_graphics.cpp b/eeschema/dialogs/dialog_global_edit_text_and_graphics.cpp index c16c43b9ea..9d2a0ed3e2 100644 --- a/eeschema/dialogs/dialog_global_edit_text_and_graphics.cpp +++ b/eeschema/dialogs/dialog_global_edit_text_and_graphics.cpp @@ -336,9 +336,9 @@ void DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::processItem( SCH_COMMIT* aCommit, if( m_lineStyle->GetStringSelection() != INDETERMINATE_ACTION ) { if( m_lineStyle->GetStringSelection() == DEFAULT_STYLE ) - stroke.SetPlotStyle( PLOT_DASH_TYPE::DEFAULT ); + stroke.SetLineStyle( LINE_STYLE::DEFAULT ); else - stroke.SetPlotStyle( (PLOT_DASH_TYPE) m_lineStyle->GetSelection() ); + stroke.SetLineStyle( (LINE_STYLE) m_lineStyle->GetSelection() ); } if( m_setColor->GetValue() ) diff --git a/eeschema/dialogs/dialog_lib_shape_properties.cpp b/eeschema/dialogs/dialog_lib_shape_properties.cpp index cc945d1d73..8daf7aeacb 100644 --- a/eeschema/dialogs/dialog_lib_shape_properties.cpp +++ b/eeschema/dialogs/dialog_lib_shape_properties.cpp @@ -50,8 +50,8 @@ DIALOG_LIB_SHAPE_PROPERTIES::DIALOG_LIB_SHAPE_PROPERTIES( SYMBOL_EDIT_FRAME* aPa m_borderColorSwatch->SetDefaultColor( COLOR4D::UNSPECIFIED ); m_borderColorSwatch->SetSwatchBackground( schematicBackground ); - for( const std::pair& typeEntry : lineTypeNames ) - m_borderStyleCombo->Append( typeEntry.second.name, KiBitmap( typeEntry.second.bitmap ) ); + for( const auto& [ lineStyle, lineStyleDesc ] : lineTypeNames ) + m_borderStyleCombo->Append( lineStyleDesc.name, KiBitmap( lineStyleDesc.bitmap ) ); m_borderStyleCombo->Append( DEFAULT_STYLE ); @@ -113,7 +113,7 @@ bool DIALOG_LIB_SHAPE_PROPERTIES::TransferDataToWindow() m_borderColorSwatch->SetSwatchColor( m_shape->GetStroke().GetColor(), false ); - int style = static_cast( m_shape->GetStroke().GetPlotStyle() ); + int style = static_cast( m_shape->GetStroke().GetLineStyle() ); if( style == -1 ) m_borderStyleCombo->SetStringSelection( DEFAULT_STYLE ); @@ -260,9 +260,9 @@ bool DIALOG_LIB_SHAPE_PROPERTIES::TransferDataFromWindow() std::advance( it, m_borderStyleCombo->GetSelection() ); if( it == lineTypeNames.end() ) - stroke.SetPlotStyle( PLOT_DASH_TYPE::DEFAULT ); + stroke.SetLineStyle( LINE_STYLE::DEFAULT ); else - stroke.SetPlotStyle( it->first ); + stroke.SetLineStyle( it->first ); stroke.SetColor( m_borderColorSwatch->GetSwatchColor() ); diff --git a/eeschema/dialogs/dialog_lib_textbox_properties.cpp b/eeschema/dialogs/dialog_lib_textbox_properties.cpp index db4e19dec1..9c4898f118 100644 --- a/eeschema/dialogs/dialog_lib_textbox_properties.cpp +++ b/eeschema/dialogs/dialog_lib_textbox_properties.cpp @@ -54,8 +54,8 @@ DIALOG_LIB_TEXTBOX_PROPERTIES::DIALOG_LIB_TEXTBOX_PROPERTIES( SYMBOL_EDIT_FRAME* m_borderColorSwatch->SetDefaultColor( COLOR4D::UNSPECIFIED ); m_borderColorSwatch->SetSwatchBackground( schematicBackground ); - for( const std::pair& typeEntry : lineTypeNames ) - m_borderStyleCombo->Append( typeEntry.second.name, KiBitmap( typeEntry.second.bitmap ) ); + for( const auto& [ lineStyle, lineStyleDesc ] : lineTypeNames ) + m_borderStyleCombo->Append( lineStyleDesc.name, KiBitmap( lineStyleDesc.bitmap ) ); m_borderStyleCombo->Append( DEFAULT_STYLE ); @@ -197,7 +197,7 @@ bool DIALOG_LIB_TEXTBOX_PROPERTIES::TransferDataToWindow() m_borderColorSwatch->SetSwatchColor( m_currentText->GetStroke().GetColor(), false ); - int style = static_cast( m_currentText->GetStroke().GetPlotStyle() ); + int style = static_cast( m_currentText->GetStroke().GetLineStyle() ); if( style == -1 ) m_borderStyleCombo->SetStringSelection( DEFAULT_STYLE ); @@ -326,9 +326,9 @@ bool DIALOG_LIB_TEXTBOX_PROPERTIES::TransferDataFromWindow() std::advance( it, m_borderStyleCombo->GetSelection() ); if( it == lineTypeNames.end() ) - stroke.SetPlotStyle( PLOT_DASH_TYPE::DEFAULT ); + stroke.SetLineStyle( LINE_STYLE::DEFAULT ); else - stroke.SetPlotStyle( it->first ); + stroke.SetLineStyle( it->first ); stroke.SetColor( m_borderColorSwatch->GetSwatchColor() ); diff --git a/eeschema/dialogs/dialog_line_properties.cpp b/eeschema/dialogs/dialog_line_properties.cpp index e89b1260d5..ae8f0bac96 100644 --- a/eeschema/dialogs/dialog_line_properties.cpp +++ b/eeschema/dialogs/dialog_line_properties.cpp @@ -49,8 +49,8 @@ DIALOG_LINE_PROPERTIES::DIALOG_LINE_PROPERTIES( SCH_EDIT_FRAME* aParent, SetInitialFocus( m_lineWidth ); - for( const std::pair& typeEntry : lineTypeNames ) - m_typeCombo->Append( typeEntry.second.name, KiBitmap( typeEntry.second.bitmap ) ); + for( const auto& [ lineStyle, lineStyleDesc ] : lineTypeNames ) + m_typeCombo->Append( lineStyleDesc.name, KiBitmap( lineStyleDesc.bitmap ) ); m_typeCombo->Append( DEFAULT_STYLE ); @@ -94,10 +94,10 @@ bool DIALOG_LINE_PROPERTIES::TransferDataToWindow() if( std::all_of( m_lines.begin() + 1, m_lines.end(), [&]( const SCH_LINE* r ) { - return r->GetStroke().GetPlotStyle() == first_stroke_item->GetStroke().GetPlotStyle(); + return r->GetStroke().GetLineStyle() == first_stroke_item->GetStroke().GetLineStyle(); } ) ) { - int style = static_cast( first_stroke_item->GetStroke().GetPlotStyle() ); + int style = static_cast( first_stroke_item->GetStroke().GetLineStyle() ); if( style == -1 ) m_typeCombo->SetStringSelection( DEFAULT_STYLE ); @@ -142,7 +142,7 @@ bool DIALOG_LINE_PROPERTIES::TransferDataFromWindow() std::advance( it, m_typeCombo->GetSelection() ); if( it == lineTypeNames.end() ) - line->SetLineStyle( PLOT_DASH_TYPE::DEFAULT ); + line->SetLineStyle( LINE_STYLE::DEFAULT ); else line->SetLineStyle( it->first ); diff --git a/eeschema/dialogs/dialog_shape_properties.cpp b/eeschema/dialogs/dialog_shape_properties.cpp index 0167adafab..701025cf1c 100644 --- a/eeschema/dialogs/dialog_shape_properties.cpp +++ b/eeschema/dialogs/dialog_shape_properties.cpp @@ -45,8 +45,8 @@ DIALOG_SHAPE_PROPERTIES::DIALOG_SHAPE_PROPERTIES( SCH_EDIT_FRAME* aParent, SCH_S m_borderColorSwatch->SetDefaultColor( COLOR4D::UNSPECIFIED ); - for( const std::pair& typeEntry : lineTypeNames ) - m_borderStyleCombo->Append( typeEntry.second.name, KiBitmap( typeEntry.second.bitmap ) ); + for( const auto& [ lineStyle, lineStyleDesc ] : lineTypeNames ) + m_borderStyleCombo->Append( lineStyleDesc.name, KiBitmap( lineStyleDesc.bitmap ) ); m_borderStyleCombo->Append( DEFAULT_STYLE ); @@ -92,7 +92,7 @@ bool DIALOG_SHAPE_PROPERTIES::TransferDataToWindow() m_borderColorSwatch->SetSwatchColor( m_shape->GetStroke().GetColor(), false ); - int style = static_cast( m_shape->GetStroke().GetPlotStyle() ); + int style = static_cast( m_shape->GetStroke().GetLineStyle() ); if( style == -1 ) m_borderStyleCombo->SetStringSelection( DEFAULT_STYLE ); @@ -153,9 +153,9 @@ bool DIALOG_SHAPE_PROPERTIES::TransferDataFromWindow() std::advance( it, m_borderStyleCombo->GetSelection() ); if( it == lineTypeNames.end() ) - stroke.SetPlotStyle( PLOT_DASH_TYPE::DEFAULT ); + stroke.SetLineStyle( LINE_STYLE::DEFAULT ); else - stroke.SetPlotStyle( it->first ); + stroke.SetLineStyle( it->first ); stroke.SetColor( m_borderColorSwatch->GetSwatchColor() ); diff --git a/eeschema/dialogs/dialog_text_properties.cpp b/eeschema/dialogs/dialog_text_properties.cpp index 0a7a5dc3a3..bc80d3596b 100644 --- a/eeschema/dialogs/dialog_text_properties.cpp +++ b/eeschema/dialogs/dialog_text_properties.cpp @@ -59,8 +59,8 @@ DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES( SCH_EDIT_FRAME* aParent, SCH_ITE m_borderColorSwatch->SetDefaultColor( COLOR4D::UNSPECIFIED ); m_borderColorSwatch->SetSwatchBackground( schematicBackground ); - for( const std::pair& typeEntry : lineTypeNames ) - m_borderStyleCombo->Append( typeEntry.second.name, KiBitmap( typeEntry.second.bitmap ) ); + for( const auto& [ lineStyle, lineStyleDesc ] : lineTypeNames ) + m_borderStyleCombo->Append( lineStyleDesc.name, KiBitmap( lineStyleDesc.bitmap ) ); m_borderStyleCombo->Append( DEFAULT_STYLE ); @@ -287,7 +287,7 @@ bool DIALOG_TEXT_PROPERTIES::TransferDataToWindow() m_borderColorSwatch->SetSwatchColor( textBox->GetStroke().GetColor(), false ); - int style = static_cast( textBox->GetStroke().GetPlotStyle() ); + int style = static_cast( textBox->GetStroke().GetLineStyle() ); if( style == -1 ) m_borderStyleCombo->SetStringSelection( DEFAULT_STYLE ); @@ -520,9 +520,9 @@ bool DIALOG_TEXT_PROPERTIES::TransferDataFromWindow() std::advance( it, m_borderStyleCombo->GetSelection() ); if( it == lineTypeNames.end() ) - stroke.SetPlotStyle( PLOT_DASH_TYPE::DEFAULT ); + stroke.SetLineStyle( LINE_STYLE::DEFAULT ); else - stroke.SetPlotStyle( it->first ); + stroke.SetLineStyle( it->first ); stroke.SetColor( m_borderColorSwatch->GetSwatchColor() ); diff --git a/eeschema/dialogs/dialog_wire_bus_properties.cpp b/eeschema/dialogs/dialog_wire_bus_properties.cpp index e1cd859a6a..394610baf3 100644 --- a/eeschema/dialogs/dialog_wire_bus_properties.cpp +++ b/eeschema/dialogs/dialog_wire_bus_properties.cpp @@ -52,8 +52,8 @@ DIALOG_WIRE_BUS_PROPERTIES::DIALOG_WIRE_BUS_PROPERTIES( SCH_EDIT_FRAME* aParent, SetInitialFocus( m_lineWidth ); - for( const std::pair& typeEntry : lineTypeNames ) - m_typeCombo->Append( typeEntry.second.name, KiBitmap( typeEntry.second.bitmap ) ); + for( const auto& [ lineStyle, lineStyleDesc ] : lineTypeNames ) + m_typeCombo->Append( lineStyleDesc.name, KiBitmap( lineStyleDesc.bitmap ) ); m_typeCombo->Append( DEFAULT_STYLE ); @@ -119,10 +119,10 @@ bool DIALOG_WIRE_BUS_PROPERTIES::TransferDataToWindow() [&]( const SCH_ITEM* item ) { return !item->HasLineStroke() - || item->GetStroke().GetPlotStyle() == stroke.GetPlotStyle(); + || item->GetStroke().GetLineStyle() == stroke.GetLineStyle(); } ) ) { - int style = static_cast( stroke.GetPlotStyle() ); + int style = static_cast( stroke.GetLineStyle() ); if( style == -1 ) m_typeCombo->SetStringSelection( DEFAULT_STYLE ); @@ -195,7 +195,7 @@ bool DIALOG_WIRE_BUS_PROPERTIES::TransferDataFromWindow() if( m_typeCombo->GetStringSelection() != INDETERMINATE_STYLE ) { - PLOT_DASH_TYPE lineStyle = PLOT_DASH_TYPE::DEFAULT; + LINE_STYLE lineStyle = LINE_STYLE::DEFAULT; size_t lineTypeSelection = m_typeCombo->GetSelection(); auto it = lineTypeNames.begin(); diff --git a/eeschema/dialogs/panel_eeschema_color_settings.cpp b/eeschema/dialogs/panel_eeschema_color_settings.cpp index aecec16164..3976d67662 100644 --- a/eeschema/dialogs/panel_eeschema_color_settings.cpp +++ b/eeschema/dialogs/panel_eeschema_color_settings.cpp @@ -291,7 +291,7 @@ void PANEL_EESCHEMA_COLOR_SETTINGS::createPreviewItems() if( line.first != LAYER_NOTES ) { - stroke.SetPlotStyle( PLOT_DASH_TYPE::SOLID ); + stroke.SetLineStyle( LINE_STYLE::SOLID ); if( line.first == LAYER_BUS ) stroke.SetWidth( schIUScale.MilsToIU( 12 ) ); @@ -379,7 +379,7 @@ void PANEL_EESCHEMA_COLOR_SETTINGS::createPreviewItems() comp_body->SetUnit( 0 ); comp_body->SetConvert( 0 ); - comp_body->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), PLOT_DASH_TYPE::SOLID ) ); + comp_body->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), LINE_STYLE::SOLID ) ); comp_body->SetFillMode( FILL_T::FILLED_WITH_BG_BODYCOLOR ); comp_body->AddPoint( MILS_POINT( p.x - 200, p.y + 200 ) ); comp_body->AddPoint( MILS_POINT( p.x + 200, p.y ) ); diff --git a/eeschema/lib_shape.cpp b/eeschema/lib_shape.cpp index 180e77b129..beb0870fa6 100644 --- a/eeschema/lib_shape.cpp +++ b/eeschema/lib_shape.cpp @@ -158,10 +158,10 @@ void LIB_SHAPE::Plot( PLOTTER* aPlotter, bool aBackground, const VECTOR2I& aOffs cornerList.push_back( aTransform.TransformCoordinate( pt ) + aOffset ); } - int penWidth; - COLOR4D color = GetStroke().GetColor(); - PLOT_DASH_TYPE lineStyle = GetStroke().GetPlotStyle(); - FILL_T fill = m_fill; + int penWidth; + COLOR4D color = GetStroke().GetColor(); + LINE_STYLE lineStyle = GetStroke().GetLineStyle(); + FILL_T fill = m_fill; if( aBackground ) { @@ -186,15 +186,15 @@ void LIB_SHAPE::Plot( PLOTTER* aPlotter, bool aBackground, const VECTOR2I& aOffs } penWidth = 0; - lineStyle = PLOT_DASH_TYPE::SOLID; + lineStyle = LINE_STYLE::SOLID; } else { if( !aPlotter->GetColorMode() || color == COLOR4D::UNSPECIFIED ) color = aPlotter->RenderSettings()->GetLayerColor( LAYER_DEVICE ); - if( lineStyle == PLOT_DASH_TYPE::DEFAULT ) - lineStyle = PLOT_DASH_TYPE::SOLID; + if( lineStyle == LINE_STYLE::DEFAULT ) + lineStyle = LINE_STYLE::SOLID; if( m_fill == FILL_T::FILLED_SHAPE ) fill = m_fill; @@ -249,7 +249,7 @@ void LIB_SHAPE::Plot( PLOTTER* aPlotter, bool aBackground, const VECTOR2I& aOffs UNIMPLEMENTED_FOR( SHAPE_T_asString() ); } - aPlotter->SetDash( penWidth, PLOT_DASH_TYPE::SOLID ); + aPlotter->SetDash( penWidth, LINE_STYLE::SOLID ); } @@ -383,7 +383,7 @@ void LIB_SHAPE::print( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset if( penWidth > 0 ) { - if( GetEffectiveLineStyle() == PLOT_DASH_TYPE::SOLID ) + if( GetEffectiveLineStyle() == LINE_STYLE::SOLID ) { switch( GetShape() ) { diff --git a/eeschema/lib_shape.h b/eeschema/lib_shape.h index 3d74ed3da4..d7b38889ac 100644 --- a/eeschema/lib_shape.h +++ b/eeschema/lib_shape.h @@ -62,12 +62,12 @@ public: int GetPenWidth() const override; - PLOT_DASH_TYPE GetEffectiveLineStyle() const + LINE_STYLE GetEffectiveLineStyle() const { - if( m_stroke.GetPlotStyle() == PLOT_DASH_TYPE::DEFAULT ) - return PLOT_DASH_TYPE::SOLID; + if( m_stroke.GetLineStyle() == LINE_STYLE::DEFAULT ) + return LINE_STYLE::SOLID; else - return m_stroke.GetPlotStyle(); + return m_stroke.GetLineStyle(); } const BOX2I GetBoundingBox() const override; diff --git a/eeschema/lib_textbox.cpp b/eeschema/lib_textbox.cpp index 3d85691cb2..6cc5d2cf74 100644 --- a/eeschema/lib_textbox.cpp +++ b/eeschema/lib_textbox.cpp @@ -228,11 +228,11 @@ void LIB_TEXTBOX::print( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffs if( IsPrivate() ) return; - bool forceNoFill = static_cast( aData ); - bool blackAndWhiteMode = GetGRForceBlackPenState(); - int penWidth = GetEffectivePenWidth( aSettings ); - COLOR4D color = GetStroke().GetColor(); - PLOT_DASH_TYPE lineStyle = GetStroke().GetPlotStyle(); + bool forceNoFill = static_cast( aData ); + bool blackAndWhiteMode = GetGRForceBlackPenState(); + int penWidth = GetEffectivePenWidth( aSettings ); + COLOR4D color = GetStroke().GetColor(); + LINE_STYLE lineStyle = GetStroke().GetLineStyle(); wxDC* DC = aSettings->GetPrintDC(); VECTOR2I pt1 = aTransform.TransformCoordinate( m_start ) + aOffset; @@ -259,10 +259,10 @@ void LIB_TEXTBOX::print( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffs color = color.Mix( bg, 0.5f ); } - if( lineStyle == PLOT_DASH_TYPE::DEFAULT ) - lineStyle = PLOT_DASH_TYPE::SOLID; + if( lineStyle == LINE_STYLE::DEFAULT ) + lineStyle = LINE_STYLE::SOLID; - if( lineStyle <= PLOT_DASH_TYPE::FIRST_TYPE ) + if( lineStyle <= LINE_STYLE::FIRST_TYPE ) { GRRect( DC, pt1, pt2, penWidth, color ); } @@ -405,17 +405,17 @@ void LIB_TEXTBOX::Plot( PLOTTER* aPlotter, bool aBackground, const VECTOR2I& aOf if( bg == COLOR4D::UNSPECIFIED || !aPlotter->GetColorMode() ) bg = COLOR4D::WHITE; - int penWidth = GetEffectivePenWidth( renderSettings ); - COLOR4D color = GetStroke().GetColor(); - PLOT_DASH_TYPE lineStyle = GetStroke().GetPlotStyle(); + int penWidth = GetEffectivePenWidth( renderSettings ); + COLOR4D color = GetStroke().GetColor(); + LINE_STYLE lineStyle = GetStroke().GetLineStyle(); if( penWidth > 0 ) { if( !aPlotter->GetColorMode() || color == COLOR4D::UNSPECIFIED ) color = renderSettings->GetLayerColor( LAYER_DEVICE ); - if( lineStyle == PLOT_DASH_TYPE::DEFAULT ) - lineStyle = PLOT_DASH_TYPE::DASH; + if( lineStyle == LINE_STYLE::DEFAULT ) + lineStyle = LINE_STYLE::DASH; if( aDimmed ) { @@ -426,7 +426,7 @@ void LIB_TEXTBOX::Plot( PLOTTER* aPlotter, bool aBackground, const VECTOR2I& aOf aPlotter->SetColor( color ); aPlotter->SetDash( penWidth, lineStyle ); aPlotter->Rect( start, end, FILL_T::NO_FILL, penWidth ); - aPlotter->SetDash( penWidth, PLOT_DASH_TYPE::SOLID ); + aPlotter->SetDash( penWidth, LINE_STYLE::SOLID ); } KIFONT::FONT* font = GetFont(); diff --git a/eeschema/sch_bus_entry.cpp b/eeschema/sch_bus_entry.cpp index 0f164254ac..099d17c050 100644 --- a/eeschema/sch_bus_entry.cpp +++ b/eeschema/sch_bus_entry.cpp @@ -52,7 +52,7 @@ SCH_BUS_ENTRY_BASE::SCH_BUS_ENTRY_BASE( KICAD_T aType, const VECTOR2I& pos, bool m_size.y = schIUScale.MilsToIU( DEFAULT_SCH_ENTRY_SIZE ); m_stroke.SetWidth( 0 ); - m_stroke.SetPlotStyle( PLOT_DASH_TYPE::DEFAULT ); + m_stroke.SetLineStyle( LINE_STYLE::DEFAULT ); m_stroke.SetColor( COLOR4D::UNSPECIFIED ); if( aFlipY ) @@ -61,7 +61,7 @@ SCH_BUS_ENTRY_BASE::SCH_BUS_ENTRY_BASE( KICAD_T aType, const VECTOR2I& pos, bool m_isDanglingStart = m_isDanglingEnd = true; m_lastResolvedWidth = schIUScale.MilsToIU( DEFAULT_WIRE_WIDTH_MILS ); - m_lastResolvedLineStyle = PLOT_DASH_TYPE::SOLID; + m_lastResolvedLineStyle = LINE_STYLE::SOLID; m_lastResolvedColor = COLOR4D::UNSPECIFIED; } @@ -73,7 +73,7 @@ SCH_BUS_WIRE_ENTRY::SCH_BUS_WIRE_ENTRY( const VECTOR2I& pos, bool aFlipY ) : m_connected_bus_item = nullptr; m_lastResolvedWidth = schIUScale.MilsToIU( DEFAULT_WIRE_WIDTH_MILS ); - m_lastResolvedLineStyle = PLOT_DASH_TYPE::SOLID; + m_lastResolvedLineStyle = LINE_STYLE::SOLID; m_lastResolvedColor = COLOR4D::UNSPECIFIED; } @@ -94,7 +94,7 @@ SCH_BUS_WIRE_ENTRY::SCH_BUS_WIRE_ENTRY( const VECTOR2I& pos, int aQuadrant ) : m_connected_bus_item = nullptr; m_lastResolvedWidth = schIUScale.MilsToIU( DEFAULT_WIRE_WIDTH_MILS ); - m_lastResolvedLineStyle = PLOT_DASH_TYPE::SOLID; + m_lastResolvedLineStyle = LINE_STYLE::SOLID; m_lastResolvedColor = COLOR4D::UNSPECIFIED; } @@ -107,7 +107,7 @@ SCH_BUS_BUS_ENTRY::SCH_BUS_BUS_ENTRY( const VECTOR2I& pos, bool aFlipY ) : m_connected_bus_items[1] = nullptr; m_lastResolvedWidth = schIUScale.MilsToIU( DEFAULT_WIRE_WIDTH_MILS ); - m_lastResolvedLineStyle = PLOT_DASH_TYPE::SOLID; + m_lastResolvedLineStyle = LINE_STYLE::SOLID; m_lastResolvedColor = COLOR4D::UNSPECIFIED; } @@ -205,20 +205,20 @@ void SCH_BUS_ENTRY_BASE::SetBusEntryColor( const COLOR4D& aColor ) } -PLOT_DASH_TYPE SCH_BUS_ENTRY_BASE::GetLineStyle() const +LINE_STYLE SCH_BUS_ENTRY_BASE::GetLineStyle() const { - if( m_stroke.GetPlotStyle() != PLOT_DASH_TYPE::DEFAULT ) - m_lastResolvedLineStyle = m_stroke.GetPlotStyle(); + if( m_stroke.GetLineStyle() != LINE_STYLE::DEFAULT ) + m_lastResolvedLineStyle = m_stroke.GetLineStyle(); else if( IsConnectable() && !IsConnectivityDirty() ) - m_lastResolvedLineStyle = (PLOT_DASH_TYPE) GetEffectiveNetClass()->GetLineStyle(); + m_lastResolvedLineStyle = (LINE_STYLE) GetEffectiveNetClass()->GetLineStyle(); return m_lastResolvedLineStyle; } -void SCH_BUS_ENTRY_BASE::SetLineStyle( PLOT_DASH_TYPE aStyle ) +void SCH_BUS_ENTRY_BASE::SetLineStyle( LINE_STYLE aStyle ) { - m_stroke.SetPlotStyle( aStyle ); + m_stroke.SetLineStyle( aStyle ); m_lastResolvedLineStyle = aStyle; } @@ -274,7 +274,7 @@ void SCH_BUS_ENTRY_BASE::Print( const RENDER_SETTINGS* aSettings, const VECTOR2I VECTOR2I end = GetEnd() + aOffset; int penWidth = ( GetPenWidth() == 0 ) ? aSettings->GetDefaultPenWidth() : GetPenWidth(); - if( GetLineStyle() <= PLOT_DASH_TYPE::FIRST_TYPE ) + if( GetLineStyle() <= LINE_STYLE::FIRST_TYPE ) { GRLine( DC, start.x, start.y, end.x, end.y, penWidth, color ); } @@ -490,7 +490,7 @@ void SCH_BUS_ENTRY_BASE::Plot( PLOTTER* aPlotter, bool aBackground, aPlotter->MoveTo( m_pos ); aPlotter->FinishTo( GetEnd() ); - aPlotter->SetDash( penWidth, PLOT_DASH_TYPE::SOLID ); + aPlotter->SetDash( penWidth, LINE_STYLE::SOLID ); } @@ -630,23 +630,23 @@ static struct SCH_BUS_ENTRY_DESC propMgr.InheritsAfter( TYPE_HASH( SCH_BUS_WIRE_ENTRY ), TYPE_HASH( SCH_BUS_ENTRY_BASE ) ); propMgr.InheritsAfter( TYPE_HASH( SCH_BUS_BUS_ENTRY ), TYPE_HASH( SCH_BUS_ENTRY_BASE ) ); - ENUM_MAP& plotDashTypeEnum = ENUM_MAP::Instance(); + ENUM_MAP& plotDashTypeEnum = ENUM_MAP::Instance(); if( plotDashTypeEnum.Choices().GetCount() == 0 ) { - plotDashTypeEnum.Map( PLOT_DASH_TYPE::DEFAULT, _HKI( "Default" ) ) - .Map( PLOT_DASH_TYPE::SOLID, _HKI( "Solid" ) ) - .Map( PLOT_DASH_TYPE::DASH, _HKI( "Dashed" ) ) - .Map( PLOT_DASH_TYPE::DOT, _HKI( "Dotted" ) ) - .Map( PLOT_DASH_TYPE::DASHDOT, _HKI( "Dash-Dot" ) ) - .Map( PLOT_DASH_TYPE::DASHDOTDOT, _HKI( "Dash-Dot-Dot" ) ); + plotDashTypeEnum.Map( LINE_STYLE::DEFAULT, _HKI( "Default" ) ) + .Map( LINE_STYLE::SOLID, _HKI( "Solid" ) ) + .Map( LINE_STYLE::DASH, _HKI( "Dashed" ) ) + .Map( LINE_STYLE::DOT, _HKI( "Dotted" ) ) + .Map( LINE_STYLE::DASHDOT, _HKI( "Dash-Dot" ) ) + .Map( LINE_STYLE::DASHDOTDOT, _HKI( "Dash-Dot-Dot" ) ); } // TODO: Maybe SCH_BUS_ENTRY_BASE should inherit from or mix in with SCH_LINE - void ( SCH_BUS_ENTRY_BASE::*lineStyleSetter )( PLOT_DASH_TYPE ) = + void ( SCH_BUS_ENTRY_BASE::*lineStyleSetter )( LINE_STYLE ) = &SCH_BUS_ENTRY_BASE::SetLineStyle; - propMgr.AddProperty( new PROPERTY_ENUM( + propMgr.AddProperty( new PROPERTY_ENUM( _HKI( "Line Style" ), lineStyleSetter, &SCH_BUS_ENTRY_BASE::GetLineStyle ) ); diff --git a/eeschema/sch_bus_entry.h b/eeschema/sch_bus_entry.h index c1c964deb8..a16558c5b6 100644 --- a/eeschema/sch_bus_entry.h +++ b/eeschema/sch_bus_entry.h @@ -81,8 +81,8 @@ public: virtual STROKE_PARAMS GetStroke() const override { return m_stroke; } virtual void SetStroke( const STROKE_PARAMS& aStroke ) override { m_stroke = aStroke; } - PLOT_DASH_TYPE GetLineStyle() const; - void SetLineStyle( PLOT_DASH_TYPE aStyle ); + LINE_STYLE GetLineStyle() const; + void SetLineStyle( LINE_STYLE aStyle ); COLOR4D GetBusEntryColor() const; void SetBusEntryColor( const COLOR4D& aColor ); @@ -150,9 +150,9 @@ protected: // If real-time connectivity gets disabled (due to being too slow on a particular // design), we can no longer rely on getting the NetClass to find netclass-specific // linestyles, linewidths and colors. - mutable PLOT_DASH_TYPE m_lastResolvedLineStyle; - mutable int m_lastResolvedWidth; - mutable COLOR4D m_lastResolvedColor; + mutable LINE_STYLE m_lastResolvedLineStyle; + mutable int m_lastResolvedWidth; + mutable COLOR4D m_lastResolvedColor; }; /** diff --git a/eeschema/sch_line.cpp b/eeschema/sch_line.cpp index 168299a718..99f8edc4cc 100644 --- a/eeschema/sch_line.cpp +++ b/eeschema/sch_line.cpp @@ -46,7 +46,7 @@ SCH_LINE::SCH_LINE( const VECTOR2I& pos, int layer ) : m_start = pos; m_end = pos; m_stroke.SetWidth( 0 ); - m_stroke.SetPlotStyle( PLOT_DASH_TYPE::DEFAULT ); + m_stroke.SetLineStyle( LINE_STYLE::DEFAULT ); m_stroke.SetColor( COLOR4D::UNSPECIFIED ); switch( layer ) @@ -68,7 +68,7 @@ SCH_LINE::SCH_LINE( const VECTOR2I& pos, int layer ) : else m_lastResolvedWidth = schIUScale.MilsToIU( DEFAULT_LINE_WIDTH_MILS ); - m_lastResolvedLineStyle = PLOT_DASH_TYPE::SOLID; + m_lastResolvedLineStyle = LINE_STYLE::SOLID; m_lastResolvedColor = COLOR4D::UNSPECIFIED; } @@ -279,34 +279,34 @@ COLOR4D SCH_LINE::GetLineColor() const void SCH_LINE::SetLineStyle( const int aStyleId ) { - SetLineStyle( static_cast( aStyleId ) ); + SetLineStyle( static_cast( aStyleId ) ); } -void SCH_LINE::SetLineStyle( const PLOT_DASH_TYPE aStyle ) +void SCH_LINE::SetLineStyle( const LINE_STYLE aStyle ) { - m_stroke.SetPlotStyle( aStyle ); + m_stroke.SetLineStyle( aStyle ); m_lastResolvedLineStyle = GetLineStyle(); } -PLOT_DASH_TYPE SCH_LINE::GetLineStyle() const +LINE_STYLE SCH_LINE::GetLineStyle() const { - if( m_stroke.GetPlotStyle() != PLOT_DASH_TYPE::DEFAULT ) - return m_stroke.GetPlotStyle(); + if( m_stroke.GetLineStyle() != LINE_STYLE::DEFAULT ) + return m_stroke.GetLineStyle(); - return PLOT_DASH_TYPE::SOLID; + return LINE_STYLE::SOLID; } -PLOT_DASH_TYPE SCH_LINE::GetEffectiveLineStyle() const +LINE_STYLE SCH_LINE::GetEffectiveLineStyle() const { - if( m_stroke.GetPlotStyle() != PLOT_DASH_TYPE::DEFAULT ) - m_lastResolvedLineStyle = m_stroke.GetPlotStyle(); + if( m_stroke.GetLineStyle() != LINE_STYLE::DEFAULT ) + m_lastResolvedLineStyle = m_stroke.GetLineStyle(); else if( !IsConnectable() ) - m_lastResolvedLineStyle = PLOT_DASH_TYPE::SOLID; + m_lastResolvedLineStyle = LINE_STYLE::SOLID; else if( !IsConnectivityDirty() ) - m_lastResolvedLineStyle = (PLOT_DASH_TYPE) GetEffectiveNetClass()->GetLineStyle(); + m_lastResolvedLineStyle = (LINE_STYLE) GetEffectiveNetClass()->GetLineStyle(); return m_lastResolvedLineStyle; } @@ -361,12 +361,12 @@ void SCH_LINE::Print( const RENDER_SETTINGS* aSettings, const VECTOR2I& offset ) if( color == COLOR4D::UNSPECIFIED ) color = aSettings->GetLayerColor( GetLayer() ); - VECTOR2I start = m_start; - VECTOR2I end = m_end; - PLOT_DASH_TYPE lineStyle = GetEffectiveLineStyle(); - int penWidth = std::max( GetPenWidth(), aSettings->GetDefaultPenWidth() ); + VECTOR2I start = m_start; + VECTOR2I end = m_end; + LINE_STYLE lineStyle = GetEffectiveLineStyle(); + int penWidth = std::max( GetPenWidth(), aSettings->GetDefaultPenWidth() ); - if( lineStyle <= PLOT_DASH_TYPE::FIRST_TYPE ) + if( lineStyle <= LINE_STYLE::FIRST_TYPE ) { GRLine( DC, start.x, start.y, end.x, end.y, penWidth, color ); } @@ -881,7 +881,7 @@ void SCH_LINE::Plot( PLOTTER* aPlotter, bool aBackground, aPlotter->MoveTo( m_start ); aPlotter->FinishTo( m_end ); - aPlotter->SetDash( penWidth, PLOT_DASH_TYPE::SOLID ); + aPlotter->SetDash( penWidth, LINE_STYLE::SOLID ); // Plot attributes to a hypertext menu std::vector properties; @@ -939,7 +939,7 @@ void SCH_LINE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector& plotDashTypeEnum = ENUM_MAP::Instance(); + ENUM_MAP& plotDashTypeEnum = ENUM_MAP::Instance(); if( plotDashTypeEnum.Choices().GetCount() == 0 ) { - plotDashTypeEnum.Map( PLOT_DASH_TYPE::DEFAULT, _HKI( "Default" ) ) - .Map( PLOT_DASH_TYPE::SOLID, _HKI( "Solid" ) ) - .Map( PLOT_DASH_TYPE::DASH, _HKI( "Dashed" ) ) - .Map( PLOT_DASH_TYPE::DOT, _HKI( "Dotted" ) ) - .Map( PLOT_DASH_TYPE::DASHDOT, _HKI( "Dash-Dot" ) ) - .Map( PLOT_DASH_TYPE::DASHDOTDOT, _HKI( "Dash-Dot-Dot" ) ); + plotDashTypeEnum.Map( LINE_STYLE::DEFAULT, _HKI( "Default" ) ) + .Map( LINE_STYLE::SOLID, _HKI( "Solid" ) ) + .Map( LINE_STYLE::DASH, _HKI( "Dashed" ) ) + .Map( LINE_STYLE::DOT, _HKI( "Dotted" ) ) + .Map( LINE_STYLE::DASHDOT, _HKI( "Dash-Dot" ) ) + .Map( LINE_STYLE::DASHDOTDOT, _HKI( "Dash-Dot-Dot" ) ); } PROPERTY_MANAGER& propMgr = PROPERTY_MANAGER::Instance(); REGISTER_TYPE( SCH_LINE ); propMgr.InheritsAfter( TYPE_HASH( SCH_LINE ), TYPE_HASH( SCH_ITEM ) ); - void ( SCH_LINE::*lineStyleSetter )( PLOT_DASH_TYPE ) = &SCH_LINE::SetLineStyle; + void ( SCH_LINE::*lineStyleSetter )( LINE_STYLE ) = &SCH_LINE::SetLineStyle; - propMgr.AddProperty( new PROPERTY_ENUM( _HKI( "Line Style" ), + propMgr.AddProperty( new PROPERTY_ENUM( _HKI( "Line Style" ), lineStyleSetter, &SCH_LINE::GetLineStyle ) ); propMgr.AddProperty( new PROPERTY( _HKI( "Line Width" ), diff --git a/eeschema/sch_line.h b/eeschema/sch_line.h index 975b861d91..1155d3f5a0 100644 --- a/eeschema/sch_line.h +++ b/eeschema/sch_line.h @@ -158,13 +158,13 @@ public: } } - void SetLineStyle( const PLOT_DASH_TYPE aStyle ); - void SetLineStyle( const int aStyleId ); - PLOT_DASH_TYPE GetLineStyle() const; + void SetLineStyle( const LINE_STYLE aStyle ); + void SetLineStyle( const int aStyleId ); + LINE_STYLE GetLineStyle() const; /// @return the style that the line should be drawn in /// this might be set on the line or inherited from the line's netclass - PLOT_DASH_TYPE GetEffectiveLineStyle() const; + LINE_STYLE GetEffectiveLineStyle() const; void SetLineColor( const COLOR4D& aColor ); @@ -188,12 +188,12 @@ public: if( m_stroke.GetColor() != aLine->GetStroke().GetColor() ) return false; - PLOT_DASH_TYPE style_a = m_stroke.GetPlotStyle(); - PLOT_DASH_TYPE style_b = aLine->GetStroke().GetPlotStyle(); + LINE_STYLE style_a = m_stroke.GetLineStyle(); + LINE_STYLE style_b = aLine->GetStroke().GetLineStyle(); return style_a == style_b - || ( style_a == PLOT_DASH_TYPE::DEFAULT && style_b == PLOT_DASH_TYPE::SOLID ) - || ( style_a == PLOT_DASH_TYPE::SOLID && style_b == PLOT_DASH_TYPE::DEFAULT ); + || ( style_a == LINE_STYLE::DEFAULT && style_b == LINE_STYLE::SOLID ) + || ( style_a == LINE_STYLE::SOLID && style_b == LINE_STYLE::DEFAULT ); } void ViewGetLayers( int aLayers[], int& aCount ) const override; @@ -345,21 +345,22 @@ private: const SCH_SHEET_PATH &aSheet ) const; bool doIsConnected( const VECTOR2I& aPosition ) const override; - bool m_startIsDangling; ///< True if start point is not connected. - bool m_endIsDangling; ///< True if end point is not connected. - VECTOR2I m_start; ///< Line start point - VECTOR2I m_end; ///< Line end point - EDA_ANGLE m_storedAngle; ///< Stored angle - STROKE_PARAMS m_stroke; ///< Line stroke properties. +private: + bool m_startIsDangling; ///< True if start point is not connected. + bool m_endIsDangling; ///< True if end point is not connected. + VECTOR2I m_start; ///< Line start point + VECTOR2I m_end; ///< Line end point + EDA_ANGLE m_storedAngle; ///< Stored angle + STROKE_PARAMS m_stroke; ///< Line stroke properties. // If real-time connectivity gets disabled (due to being too slow on a particular // design), we can no longer rely on getting the NetClass to find netclass-specific // linestyles, linewidths and colors. - mutable PLOT_DASH_TYPE m_lastResolvedLineStyle; - mutable int m_lastResolvedWidth; - mutable COLOR4D m_lastResolvedColor; + mutable LINE_STYLE m_lastResolvedLineStyle; + mutable int m_lastResolvedWidth; + mutable COLOR4D m_lastResolvedColor; - wxString m_operatingPoint; + wxString m_operatingPoint; }; diff --git a/eeschema/sch_painter.cpp b/eeschema/sch_painter.cpp index 53261ddd04..3f8fff579e 100644 --- a/eeschema/sch_painter.cpp +++ b/eeschema/sch_painter.cpp @@ -885,9 +885,9 @@ void SCH_PAINTER::draw( const LIB_SHAPE* aShape, int aLayer, bool aDimmed ) if( !setDeviceColors( aShape, aLayer, aDimmed ) ) return; - bool drawingShadows = aLayer == LAYER_SELECTION_SHADOWS; - PLOT_DASH_TYPE lineStyle = aShape->GetStroke().GetPlotStyle(); - COLOR4D color = getRenderColor( aShape, aLayer, drawingShadows, aDimmed ); + bool drawingShadows = aLayer == LAYER_SELECTION_SHADOWS; + LINE_STYLE lineStyle = aShape->GetStroke().GetLineStyle(); + COLOR4D color = getRenderColor( aShape, aLayer, drawingShadows, aDimmed ); auto drawShape = [&]( const LIB_SHAPE* shape ) @@ -992,7 +992,7 @@ void SCH_PAINTER::draw( const LIB_SHAPE* aShape, int aLayer, bool aDimmed ) m_gal->SetLineWidth( lineWidth ); m_gal->SetStrokeColor( color ); - if( lineStyle <= PLOT_DASH_TYPE::FIRST_TYPE || drawingShadows ) + if( lineStyle <= LINE_STYLE::FIRST_TYPE || drawingShadows ) { drawShape( aShape ); } @@ -1252,8 +1252,8 @@ void SCH_PAINTER::draw( const LIB_TEXTBOX* aTextBox, int aLayer, bool aDimmed ) if( borderWidth > 0 ) { - COLOR4D borderColor = aTextBox->GetStroke().GetColor(); - PLOT_DASH_TYPE borderStyle = aTextBox->GetStroke().GetPlotStyle(); + COLOR4D borderColor = aTextBox->GetStroke().GetColor(); + LINE_STYLE borderStyle = aTextBox->GetStroke().GetLineStyle(); if( m_schSettings.m_OverrideItemColors || aTextBox->IsBrightened() || borderColor == COLOR4D::UNSPECIFIED ) @@ -1272,7 +1272,7 @@ void SCH_PAINTER::draw( const LIB_TEXTBOX* aTextBox, int aLayer, bool aDimmed ) m_gal->SetStrokeColor( borderColor ); m_gal->SetLineWidth( borderWidth ); - if( borderStyle <= PLOT_DASH_TYPE::FIRST_TYPE || drawingShadows ) + if( borderStyle <= LINE_STYLE::FIRST_TYPE || drawingShadows ) { m_gal->DrawRectangle( mapCoords( aTextBox->GetPosition() ), mapCoords( aTextBox->GetEnd() ) ); @@ -1891,9 +1891,9 @@ void SCH_PAINTER::draw( const SCH_LINE* aLine, int aLayer ) if( aLine->IsNew() && drawingDangling ) return; - COLOR4D color = getRenderColor( aLine, aLine->GetLayer(), drawingShadows ); - float width = getLineWidth( aLine, drawingShadows ); - PLOT_DASH_TYPE lineStyle = aLine->GetEffectiveLineStyle(); + COLOR4D color = getRenderColor( aLine, aLine->GetLayer(), drawingShadows ); + float width = getLineWidth( aLine, drawingShadows ); + LINE_STYLE lineStyle = aLine->GetEffectiveLineStyle(); if( ( drawingDangling || drawingShadows ) && !aLine->IsNew() ) { @@ -1958,7 +1958,7 @@ color = COLOR4D( 0.0, 0.3, 0.2, 1.0 ); m_gal->SetStrokeColor( color ); m_gal->SetLineWidth( width ); - if( lineStyle <= PLOT_DASH_TYPE::FIRST_TYPE || drawingShadows ) + if( lineStyle <= LINE_STYLE::FIRST_TYPE || drawingShadows ) { m_gal->DrawLine( aLine->GetStartPoint(), aLine->GetEndPoint() ); } @@ -1982,9 +1982,9 @@ color = COLOR4D( 0.0, 0.3, 0.2, 1.0 ); void SCH_PAINTER::draw( const SCH_SHAPE* aShape, int aLayer ) { - bool drawingShadows = aLayer == LAYER_SELECTION_SHADOWS; - PLOT_DASH_TYPE lineStyle = aShape->GetEffectiveLineStyle(); - COLOR4D color = getRenderColor( aShape, aLayer, drawingShadows ); + bool drawingShadows = aLayer == LAYER_SELECTION_SHADOWS; + LINE_STYLE lineStyle = aShape->GetEffectiveLineStyle(); + COLOR4D color = getRenderColor( aShape, aLayer, drawingShadows ); if( drawingShadows && !( aShape->IsBrightened() || aShape->IsSelected() ) ) return; @@ -2084,7 +2084,7 @@ void SCH_PAINTER::draw( const SCH_SHAPE* aShape, int aLayer ) m_gal->SetLineWidth( lineWidth ); m_gal->SetStrokeColor( color ); - if( lineStyle <= PLOT_DASH_TYPE::FIRST_TYPE || drawingShadows ) + if( lineStyle <= LINE_STYLE::FIRST_TYPE || drawingShadows ) { drawShape( aShape ); } @@ -2321,8 +2321,8 @@ void SCH_PAINTER::draw( const SCH_TEXTBOX* aTextBox, int aLayer ) if( borderWidth > 0 ) { - COLOR4D borderColor = aTextBox->GetStroke().GetColor(); - PLOT_DASH_TYPE borderStyle = aTextBox->GetEffectiveLineStyle(); + COLOR4D borderColor = aTextBox->GetStroke().GetColor(); + LINE_STYLE borderStyle = aTextBox->GetEffectiveLineStyle(); if( m_schSettings.m_OverrideItemColors || aTextBox->IsBrightened() || borderColor == COLOR4D::UNSPECIFIED ) @@ -2335,7 +2335,7 @@ void SCH_PAINTER::draw( const SCH_TEXTBOX* aTextBox, int aLayer ) m_gal->SetStrokeColor( borderColor ); m_gal->SetLineWidth( borderWidth ); - if( borderStyle <= PLOT_DASH_TYPE::FIRST_TYPE || drawingShadows ) + if( borderStyle <= LINE_STYLE::FIRST_TYPE || drawingShadows ) { m_gal->DrawRectangle( aTextBox->GetPosition(), aTextBox->GetEnd() ); } diff --git a/eeschema/sch_plugins/altium/sch_altium_plugin.cpp b/eeschema/sch_plugins/altium/sch_altium_plugin.cpp index b240042c04..3d7be2aa69 100644 --- a/eeschema/sch_plugins/altium/sch_altium_plugin.cpp +++ b/eeschema/sch_plugins/altium/sch_altium_plugin.cpp @@ -99,22 +99,22 @@ static COLOR4D GetColorFromInt( int color ) } -static PLOT_DASH_TYPE GetPlotDashType( const ASCH_POLYLINE_LINESTYLE linestyle ) +static LINE_STYLE GetPlotDashType( const ASCH_POLYLINE_LINESTYLE linestyle ) { switch( linestyle ) { - case ASCH_POLYLINE_LINESTYLE::SOLID: return PLOT_DASH_TYPE::SOLID; - case ASCH_POLYLINE_LINESTYLE::DASHED: return PLOT_DASH_TYPE::DASH; - case ASCH_POLYLINE_LINESTYLE::DOTTED: return PLOT_DASH_TYPE::DOT; - case ASCH_POLYLINE_LINESTYLE::DASH_DOTTED: return PLOT_DASH_TYPE::DASHDOT; - default: return PLOT_DASH_TYPE::DEFAULT; + case ASCH_POLYLINE_LINESTYLE::SOLID: return LINE_STYLE::SOLID; + case ASCH_POLYLINE_LINESTYLE::DASHED: return LINE_STYLE::DASH; + case ASCH_POLYLINE_LINESTYLE::DOTTED: return LINE_STYLE::DOT; + case ASCH_POLYLINE_LINESTYLE::DASH_DOTTED: return LINE_STYLE::DASHDOT; + default: return LINE_STYLE::DEFAULT; } } static void SetSchShapeLine( const ASCH_BORDER_INTERFACE& elem, SCH_SHAPE* shape ) { - shape->SetStroke( STROKE_PARAMS( elem.LineWidth, PLOT_DASH_TYPE::SOLID, + shape->SetStroke( STROKE_PARAMS( elem.LineWidth, LINE_STYLE::SOLID, GetColorFromInt( elem.Color ) ) ); } @@ -178,7 +178,7 @@ static void SetLibShapeLine( const ASCH_BORDER_INTERFACE& elem, LIB_SHAPE* shape if( color == default_color || color == alt_default_color ) color = COLOR4D::UNSPECIFIED; - shape->SetStroke( STROKE_PARAMS( elem.LineWidth, PLOT_DASH_TYPE::SOLID, color ) ); + shape->SetStroke( STROKE_PARAMS( elem.LineWidth, LINE_STYLE::SOLID, color ) ); } static void SetLibShapeFillAndColor( const ASCH_FILL_INTERFACE& elem, LIB_SHAPE* shape, ALTIUM_SCH_RECORD aType, int aStrokeColor ) @@ -1368,10 +1368,10 @@ void SCH_ALTIUM_PLUGIN::AddTextBox(const ASCH_TEXT_FRAME *aElem ) textBox->SetFilled( false ); if( aElem->ShowBorder ) - textBox->SetStroke( STROKE_PARAMS( 0, PLOT_DASH_TYPE::DEFAULT, + textBox->SetStroke( STROKE_PARAMS( 0, LINE_STYLE::DEFAULT, GetColorFromInt( aElem->BorderColor ) ) ); else - textBox->SetStroke( STROKE_PARAMS( -1, PLOT_DASH_TYPE::DEFAULT, + textBox->SetStroke( STROKE_PARAMS( -1, LINE_STYLE::DEFAULT, GetColorFromInt( aElem->BorderColor ) ) ); switch( aElem->Alignment ) @@ -1463,7 +1463,7 @@ void SCH_ALTIUM_PLUGIN::AddLibTextBox(const ASCH_TEXT_FRAME *aElem, std::vector< textBox->SetFilled( false ); if( aElem->ShowBorder ) - textBox->SetStroke( STROKE_PARAMS( 0, PLOT_DASH_TYPE::DEFAULT, + textBox->SetStroke( STROKE_PARAMS( 0, LINE_STYLE::DEFAULT, GetColorFromInt( aElem->BorderColor ) ) ); else textBox->SetStroke( STROKE_PARAMS( -1 ) ); @@ -1518,7 +1518,7 @@ void SCH_ALTIUM_PLUGIN::ParseBezier( const std::map& aProper SCH_LAYER_ID::LAYER_NOTES ); line->SetEndPoint( elem.points.at( i + 1 ) + m_sheetOffset ); - line->SetStroke( STROKE_PARAMS( elem.LineWidth, PLOT_DASH_TYPE::SOLID ) ); + line->SetStroke( STROKE_PARAMS( elem.LineWidth, LINE_STYLE::SOLID ) ); line->SetFlags( IS_NEW ); @@ -1542,7 +1542,7 @@ void SCH_ALTIUM_PLUGIN::ParseBezier( const std::map& aProper SCH_LAYER_ID::LAYER_NOTES ); line->SetEndPoint( polyPoints.at( k + 1 ) + m_sheetOffset ); - line->SetStroke( STROKE_PARAMS( elem.LineWidth, PLOT_DASH_TYPE::SOLID ) ); + line->SetStroke( STROKE_PARAMS( elem.LineWidth, LINE_STYLE::SOLID ) ); line->SetFlags( IS_NEW ); currentScreen->Append( line ); @@ -1596,7 +1596,7 @@ void SCH_ALTIUM_PLUGIN::ParseBezier( const std::map& aProper schsym ) ); } - line->SetStroke( STROKE_PARAMS( elem.LineWidth, PLOT_DASH_TYPE::SOLID ) ); + line->SetStroke( STROKE_PARAMS( elem.LineWidth, LINE_STYLE::SOLID ) ); } else if( i + 3 == elem.points.size() ) { @@ -1618,7 +1618,7 @@ void SCH_ALTIUM_PLUGIN::ParseBezier( const std::map& aProper schsym ) ); } - line->SetStroke( STROKE_PARAMS( elem.LineWidth, PLOT_DASH_TYPE::SOLID ) ); + line->SetStroke( STROKE_PARAMS( elem.LineWidth, LINE_STYLE::SOLID ) ); } else { @@ -1647,7 +1647,7 @@ void SCH_ALTIUM_PLUGIN::ParseBezier( const std::map& aProper } } - bezier->SetStroke( STROKE_PARAMS( elem.LineWidth, PLOT_DASH_TYPE::SOLID ) ); + bezier->SetStroke( STROKE_PARAMS( elem.LineWidth, LINE_STYLE::SOLID ) ); } } } @@ -1717,7 +1717,7 @@ void SCH_ALTIUM_PLUGIN::ParsePolyline( const std::map& aProp SetLibShapeLine( elem, line, ALTIUM_SCH_RECORD::POLYLINE ); STROKE_PARAMS stroke = line->GetStroke(); - stroke.SetPlotStyle( GetPlotDashType( elem.LineStyle ) ); + stroke.SetLineStyle( GetPlotDashType( elem.LineStyle ) ); line->SetStroke( stroke ); } @@ -1916,7 +1916,7 @@ void SCH_ALTIUM_PLUGIN::ParseArc( const std::map& aPropertie circle->SetPosition( elem.m_Center + m_sheetOffset ); circle->SetEnd( circle->GetPosition() + VECTOR2I( arc_radius, 0 ) ); - circle->SetStroke( STROKE_PARAMS( elem.LineWidth, PLOT_DASH_TYPE::SOLID ) ); + circle->SetStroke( STROKE_PARAMS( elem.LineWidth, LINE_STYLE::SOLID ) ); currentScreen->Append( circle ); } @@ -1932,7 +1932,7 @@ void SCH_ALTIUM_PLUGIN::ParseArc( const std::map& aPropertie arc->SetStart( elem.m_Center + startOffset + m_sheetOffset ); arc->SetArcAngleAndEnd( includedAngle.Normalize(), true ); - arc->SetStroke( STROKE_PARAMS( elem.LineWidth, PLOT_DASH_TYPE::SOLID ) ); + arc->SetStroke( STROKE_PARAMS( elem.LineWidth, LINE_STYLE::SOLID ) ); currentScreen->Append( arc ); } @@ -2034,7 +2034,7 @@ void SCH_ALTIUM_PLUGIN::ParseEllipticalArc( const std::map& schbezier->SetBezierC1( bezier.C1 ); schbezier->SetBezierC2( bezier.C2 ); schbezier->SetEnd( bezier.End ); - schbezier->SetStroke( STROKE_PARAMS( elem.LineWidth, PLOT_DASH_TYPE::SOLID ) ); + schbezier->SetStroke( STROKE_PARAMS( elem.LineWidth, LINE_STYLE::SOLID ) ); schbezier->RebuildBezierToSegmentsPointsList( elem.LineWidth ); currentScreen->Append( schbezier ); @@ -2131,7 +2131,7 @@ void SCH_ALTIUM_PLUGIN::ParseEllipse( const std::map& aPrope schbezier->SetBezierC1( bezier.C1 ); schbezier->SetBezierC2( bezier.C2 ); schbezier->SetEnd( bezier.End ); - schbezier->SetStroke( STROKE_PARAMS( elem.LineWidth, PLOT_DASH_TYPE::SOLID ) ); + schbezier->SetStroke( STROKE_PARAMS( elem.LineWidth, LINE_STYLE::SOLID ) ); schbezier->SetFillColor( GetColorFromInt( elem.AreaColor ) ); if( elem.IsSolid ) @@ -2245,7 +2245,7 @@ void SCH_ALTIUM_PLUGIN::ParseCircle( const std::map& aProper circle->SetPosition( elem.Center + m_sheetOffset ); circle->SetEnd( circle->GetPosition() + VECTOR2I( elem.Radius, 0 ) ); - circle->SetStroke( STROKE_PARAMS( 1, PLOT_DASH_TYPE::SOLID ) ); + circle->SetStroke( STROKE_PARAMS( 1, LINE_STYLE::SOLID ) ); circle->SetFillColor( GetColorFromInt( elem.AreaColor ) ); @@ -2380,7 +2380,7 @@ void SCH_ALTIUM_PLUGIN::ParseSignalHarness( const std::map& for( VECTOR2I& point : elem.Points ) poly->AddPoint( point + m_sheetOffset ); - poly->SetStroke( STROKE_PARAMS( elem.LineWidth, PLOT_DASH_TYPE::SOLID, + poly->SetStroke( STROKE_PARAMS( elem.LineWidth, LINE_STYLE::SOLID, GetColorFromInt( elem.Color ) ) ); poly->SetFlags( IS_NEW ); @@ -2720,7 +2720,7 @@ VECTOR2I HelperGeneratePowerPortGraphics( LIB_SYMBOL* aKsymbol, ASCH_POWER_PORT_ { LIB_SHAPE* line1 = new LIB_SHAPE( aKsymbol, SHAPE_T::POLY ); aKsymbol->AddDrawItem( line1, false ); - line1->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), PLOT_DASH_TYPE::SOLID ) ); + line1->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), LINE_STYLE::SOLID ) ); line1->AddPoint( { 0, 0 } ); line1->AddPoint( { 0, schIUScale.MilsToIU( -50 ) } ); @@ -2728,7 +2728,7 @@ VECTOR2I HelperGeneratePowerPortGraphics( LIB_SYMBOL* aKsymbol, ASCH_POWER_PORT_ { LIB_SHAPE* circle = new LIB_SHAPE( aKsymbol, SHAPE_T::CIRCLE ); aKsymbol->AddDrawItem( circle, false ); - circle->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 5 ), PLOT_DASH_TYPE::SOLID ) ); + circle->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 5 ), LINE_STYLE::SOLID ) ); circle->SetPosition( { schIUScale.MilsToIU( 0 ), schIUScale.MilsToIU( -75 ) } ); circle->SetEnd( circle->GetPosition() + VECTOR2I( schIUScale.MilsToIU( 25 ), 0 ) ); } @@ -2736,7 +2736,7 @@ VECTOR2I HelperGeneratePowerPortGraphics( LIB_SYMBOL* aKsymbol, ASCH_POWER_PORT_ { LIB_SHAPE* line2 = new LIB_SHAPE( aKsymbol, SHAPE_T::POLY ); aKsymbol->AddDrawItem( line2, false ); - line2->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), PLOT_DASH_TYPE::SOLID ) ); + line2->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), LINE_STYLE::SOLID ) ); line2->AddPoint( { schIUScale.MilsToIU( -25 ), schIUScale.MilsToIU( -50 ) } ); line2->AddPoint( { schIUScale.MilsToIU( 25 ), schIUScale.MilsToIU( -50 ) } ); line2->AddPoint( { schIUScale.MilsToIU( 0 ), schIUScale.MilsToIU( -100 ) } ); @@ -2749,13 +2749,13 @@ VECTOR2I HelperGeneratePowerPortGraphics( LIB_SYMBOL* aKsymbol, ASCH_POWER_PORT_ { LIB_SHAPE* line = new LIB_SHAPE( aKsymbol, SHAPE_T::POLY ); aKsymbol->AddDrawItem( line, false ); - line->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), PLOT_DASH_TYPE::SOLID ) ); + line->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), LINE_STYLE::SOLID ) ); line->AddPoint( { 0, 0 } ); line->AddPoint( { 0, schIUScale.MilsToIU( -72 ) } ); LIB_SHAPE* bezier = new LIB_SHAPE( aKsymbol, SHAPE_T::BEZIER ); aKsymbol->AddDrawItem( bezier, false ); - bezier->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 5 ), PLOT_DASH_TYPE::SOLID ) ); + bezier->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 5 ), LINE_STYLE::SOLID ) ); bezier->AddPoint( { schIUScale.MilsToIU( 30 ), schIUScale.MilsToIU( -50 ) } ); bezier->AddPoint( { schIUScale.MilsToIU( 30 ), schIUScale.MilsToIU( -87 ) } ); bezier->AddPoint( { schIUScale.MilsToIU( -30 ), schIUScale.MilsToIU( -63 ) } ); @@ -2770,7 +2770,7 @@ VECTOR2I HelperGeneratePowerPortGraphics( LIB_SYMBOL* aKsymbol, ASCH_POWER_PORT_ { LIB_SHAPE* line1 = new LIB_SHAPE( aKsymbol, SHAPE_T::POLY ); aKsymbol->AddDrawItem( line1, false ); - line1->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), PLOT_DASH_TYPE::SOLID ) ); + line1->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), LINE_STYLE::SOLID ) ); line1->AddPoint( { 0, 0 } ); line1->AddPoint( { 0, schIUScale.MilsToIU( -100 ) } ); @@ -2778,25 +2778,25 @@ VECTOR2I HelperGeneratePowerPortGraphics( LIB_SYMBOL* aKsymbol, ASCH_POWER_PORT_ { LIB_SHAPE* line2 = new LIB_SHAPE( aKsymbol, SHAPE_T::POLY ); aKsymbol->AddDrawItem( line2, false ); - line2->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), PLOT_DASH_TYPE::SOLID ) ); + line2->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), LINE_STYLE::SOLID ) ); line2->AddPoint( { schIUScale.MilsToIU( -100 ), schIUScale.MilsToIU( -100 ) } ); line2->AddPoint( { schIUScale.MilsToIU( 100 ), schIUScale.MilsToIU( -100 ) } ); LIB_SHAPE* line3 = new LIB_SHAPE( aKsymbol, SHAPE_T::POLY ); aKsymbol->AddDrawItem( line3, false ); - line3->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), PLOT_DASH_TYPE::SOLID ) ); + line3->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), LINE_STYLE::SOLID ) ); line3->AddPoint( { schIUScale.MilsToIU( -70 ), schIUScale.MilsToIU( -130 ) } ); line3->AddPoint( { schIUScale.MilsToIU( 70 ), schIUScale.MilsToIU( -130 ) } ); LIB_SHAPE* line4 = new LIB_SHAPE( aKsymbol, SHAPE_T::POLY ); aKsymbol->AddDrawItem( line4, false ); - line4->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), PLOT_DASH_TYPE::SOLID ) ); + line4->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), LINE_STYLE::SOLID ) ); line4->AddPoint( { schIUScale.MilsToIU( -40 ), schIUScale.MilsToIU( -160 ) } ); line4->AddPoint( { schIUScale.MilsToIU( 40 ), schIUScale.MilsToIU( -160 ) } ); LIB_SHAPE* line5 = new LIB_SHAPE( aKsymbol, SHAPE_T::POLY ); aKsymbol->AddDrawItem( line5, false ); - line5->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), PLOT_DASH_TYPE::SOLID ) ); + line5->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), LINE_STYLE::SOLID ) ); line5->AddPoint( { schIUScale.MilsToIU( -10 ), schIUScale.MilsToIU( -190 ) } ); line5->AddPoint( { schIUScale.MilsToIU( 10 ), schIUScale.MilsToIU( -190 ) } ); } @@ -2804,7 +2804,7 @@ VECTOR2I HelperGeneratePowerPortGraphics( LIB_SYMBOL* aKsymbol, ASCH_POWER_PORT_ { LIB_SHAPE* line2 = new LIB_SHAPE( aKsymbol, SHAPE_T::POLY ); aKsymbol->AddDrawItem( line2, false ); - line2->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), PLOT_DASH_TYPE::SOLID ) ); + line2->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), LINE_STYLE::SOLID ) ); line2->AddPoint( { schIUScale.MilsToIU( -100 ), schIUScale.MilsToIU( -100 ) } ); line2->AddPoint( { schIUScale.MilsToIU( 100 ), schIUScale.MilsToIU( -100 ) } ); line2->AddPoint( { schIUScale.MilsToIU( 0 ), schIUScale.MilsToIU( -200 ) } ); @@ -2814,7 +2814,7 @@ VECTOR2I HelperGeneratePowerPortGraphics( LIB_SYMBOL* aKsymbol, ASCH_POWER_PORT_ { LIB_SHAPE* line2 = new LIB_SHAPE( aKsymbol, SHAPE_T::POLY ); aKsymbol->AddDrawItem( line2, false ); - line2->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), PLOT_DASH_TYPE::SOLID ) ); + line2->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), LINE_STYLE::SOLID ) ); line2->AddPoint( { schIUScale.MilsToIU( -150 ), schIUScale.MilsToIU( -200 ) } ); line2->AddPoint( { schIUScale.MilsToIU( -100 ), schIUScale.MilsToIU( -100 ) } ); line2->AddPoint( { schIUScale.MilsToIU( 100 ), schIUScale.MilsToIU( -100 ) } ); @@ -2822,7 +2822,7 @@ VECTOR2I HelperGeneratePowerPortGraphics( LIB_SYMBOL* aKsymbol, ASCH_POWER_PORT_ LIB_SHAPE* line3 = new LIB_SHAPE( aKsymbol, SHAPE_T::POLY ); aKsymbol->AddDrawItem( line3, false ); - line3->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), PLOT_DASH_TYPE::SOLID ) ); + line3->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), LINE_STYLE::SOLID ) ); line3->AddPoint( { schIUScale.MilsToIU( 0 ), schIUScale.MilsToIU( -100 ) } ); line3->AddPoint( { schIUScale.MilsToIU( -50 ), schIUScale.MilsToIU( -200 ) } ); } @@ -2830,7 +2830,7 @@ VECTOR2I HelperGeneratePowerPortGraphics( LIB_SYMBOL* aKsymbol, ASCH_POWER_PORT_ { LIB_SHAPE* line2 = new LIB_SHAPE( aKsymbol, SHAPE_T::POLY ); aKsymbol->AddDrawItem( line2, false ); - line2->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), PLOT_DASH_TYPE::SOLID ) ); + line2->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), LINE_STYLE::SOLID ) ); line2->AddPoint( { schIUScale.MilsToIU( -25 ), schIUScale.MilsToIU( -50 ) } ); line2->AddPoint( { schIUScale.MilsToIU( 0 ), schIUScale.MilsToIU( -100 ) } ); line2->AddPoint( { schIUScale.MilsToIU( 25 ), schIUScale.MilsToIU( -50 ) } ); @@ -2845,25 +2845,25 @@ VECTOR2I HelperGeneratePowerPortGraphics( LIB_SYMBOL* aKsymbol, ASCH_POWER_PORT_ { LIB_SHAPE* line1 = new LIB_SHAPE( aKsymbol, SHAPE_T::POLY ); aKsymbol->AddDrawItem( line1, false ); - line1->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), PLOT_DASH_TYPE::SOLID ) ); + line1->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), LINE_STYLE::SOLID ) ); line1->AddPoint( { 0, 0 } ); line1->AddPoint( { 0, schIUScale.MilsToIU( -160 ) } ); LIB_SHAPE* line2 = new LIB_SHAPE( aKsymbol, SHAPE_T::POLY ); aKsymbol->AddDrawItem( line2, false ); - line2->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), PLOT_DASH_TYPE::SOLID ) ); + line2->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), LINE_STYLE::SOLID ) ); line2->AddPoint( { schIUScale.MilsToIU( -100 ), schIUScale.MilsToIU( -160 ) } ); line2->AddPoint( { schIUScale.MilsToIU( 100 ), schIUScale.MilsToIU( -160 ) } ); LIB_SHAPE* line3 = new LIB_SHAPE( aKsymbol, SHAPE_T::POLY ); aKsymbol->AddDrawItem( line3, false ); - line3->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), PLOT_DASH_TYPE::SOLID ) ); + line3->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), LINE_STYLE::SOLID ) ); line3->AddPoint( { schIUScale.MilsToIU( -60 ), schIUScale.MilsToIU( -200 ) } ); line3->AddPoint( { schIUScale.MilsToIU( 60 ), schIUScale.MilsToIU( -200 ) } ); LIB_SHAPE* line4 = new LIB_SHAPE( aKsymbol, SHAPE_T::POLY ); aKsymbol->AddDrawItem( line4, false ); - line4->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), PLOT_DASH_TYPE::SOLID ) ); + line4->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), LINE_STYLE::SOLID ) ); line4->AddPoint( { schIUScale.MilsToIU( -20 ), schIUScale.MilsToIU( -240 ) } ); line4->AddPoint( { schIUScale.MilsToIU( 20 ), schIUScale.MilsToIU( -240 ) } ); @@ -2872,7 +2872,7 @@ VECTOR2I HelperGeneratePowerPortGraphics( LIB_SYMBOL* aKsymbol, ASCH_POWER_PORT_ LIB_SHAPE* circle = new LIB_SHAPE( aKsymbol, SHAPE_T::CIRCLE ); aKsymbol->AddDrawItem( circle, false ); - circle->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), PLOT_DASH_TYPE::SOLID ) ); + circle->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), LINE_STYLE::SOLID ) ); circle->SetPosition( { schIUScale.MilsToIU( 0 ), schIUScale.MilsToIU( -160 ) } ); circle->SetEnd( circle->GetPosition() + VECTOR2I( schIUScale.MilsToIU( 120 ), 0 ) ); @@ -2882,13 +2882,13 @@ VECTOR2I HelperGeneratePowerPortGraphics( LIB_SYMBOL* aKsymbol, ASCH_POWER_PORT_ { LIB_SHAPE* line1 = new LIB_SHAPE( aKsymbol, SHAPE_T::POLY ); aKsymbol->AddDrawItem( line1, false ); - line1->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), PLOT_DASH_TYPE::SOLID ) ); + line1->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), LINE_STYLE::SOLID ) ); line1->AddPoint( { 0, 0 } ); line1->AddPoint( { 0, schIUScale.MilsToIU( -200 ) } ); LIB_SHAPE* line2 = new LIB_SHAPE( aKsymbol, SHAPE_T::POLY ); aKsymbol->AddDrawItem( line2, false ); - line2->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), PLOT_DASH_TYPE::SOLID ) ); + line2->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), LINE_STYLE::SOLID ) ); line2->AddPoint( { schIUScale.MilsToIU( -100 ), schIUScale.MilsToIU( -200 ) } ); line2->AddPoint( { schIUScale.MilsToIU( 100 ), schIUScale.MilsToIU( -200 ) } ); @@ -2904,13 +2904,13 @@ VECTOR2I HelperGeneratePowerPortGraphics( LIB_SYMBOL* aKsymbol, ASCH_POWER_PORT_ LIB_SHAPE* line1 = new LIB_SHAPE( aKsymbol, SHAPE_T::POLY ); aKsymbol->AddDrawItem( line1, false ); - line1->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), PLOT_DASH_TYPE::SOLID ) ); + line1->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), LINE_STYLE::SOLID ) ); line1->AddPoint( { 0, 0 } ); line1->AddPoint( { 0, schIUScale.MilsToIU( -100 ) } ); LIB_SHAPE* line2 = new LIB_SHAPE( aKsymbol, SHAPE_T::POLY ); aKsymbol->AddDrawItem( line2, false ); - line2->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), PLOT_DASH_TYPE::SOLID ) ); + line2->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), LINE_STYLE::SOLID ) ); line2->AddPoint( { schIUScale.MilsToIU( -50 ), schIUScale.MilsToIU( -100 ) } ); line2->AddPoint( { schIUScale.MilsToIU( 50 ), schIUScale.MilsToIU( -100 ) } ); @@ -3036,7 +3036,7 @@ void SCH_ALTIUM_PLUGIN::ParseHarnessPort( const ASCH_PORT& aElem ) textBox->SetFillColor( HARNESS_PORT_COLOR_DEFAULT_BACKGROUND ); textBox->SetFillMode( FILL_T::FILLED_WITH_COLOR ); - textBox->SetStroke( STROKE_PARAMS( 2, PLOT_DASH_TYPE::DEFAULT, + textBox->SetStroke( STROKE_PARAMS( 2, LINE_STYLE::DEFAULT, HARNESS_PORT_COLOR_DEFAULT_OUTLINE ) ); switch( aElem.Alignment ) diff --git a/eeschema/sch_plugins/cadstar/cadstar_sch_archive_loader.cpp b/eeschema/sch_plugins/cadstar/cadstar_sch_archive_loader.cpp index a3c92681d1..d2d2459da6 100644 --- a/eeschema/sch_plugins/cadstar/cadstar_sch_archive_loader.cpp +++ b/eeschema/sch_plugins/cadstar/cadstar_sch_archive_loader.cpp @@ -1621,7 +1621,7 @@ const LIB_SYMBOL* CADSTAR_SCH_ARCHIVE_LOADER::loadSymdef( const SYMDEF_ID& aSymd { FIGURE fig = figPair.second; int lineThickness = getLineThickness( fig.LineCodeID ); - PLOT_DASH_TYPE linestyle = getLineStyle( fig.LineCodeID ); + LINE_STYLE linestyle = getLineStyle( fig.LineCodeID ); if( fig.Shape.Type == SHAPE_TYPE::OPENSHAPE ) { @@ -2050,7 +2050,7 @@ void CADSTAR_SCH_ARCHIVE_LOADER::loadLibrarySymbolShapeVertices( const std::vect } shape->SetUnit( aGateNumber ); - shape->SetStroke( STROKE_PARAMS( aLineThickness, PLOT_DASH_TYPE::SOLID ) ); + shape->SetStroke( STROKE_PARAMS( aLineThickness, LINE_STYLE::SOLID ) ); aSymbol->AddDrawItem( shape, false ); prev = cur; @@ -2379,7 +2379,7 @@ void CADSTAR_SCH_ARCHIVE_LOADER::loadShapeVertices( const std::vector& a const bool& aMirrorInvert ) { int lineWidth = KiROUND( getLineThickness( aCadstarLineCodeID ) * aScalingFactor ); - PLOT_DASH_TYPE lineStyle = getLineStyle( aCadstarLineCodeID ); + LINE_STYLE lineStyle = getLineStyle( aCadstarLineCodeID ); const VERTEX* prev = &aCadstarVertices.at( 0 ); const VERTEX* cur; @@ -2767,21 +2767,21 @@ int CADSTAR_SCH_ARCHIVE_LOADER::getLineThickness( const LINECODE_ID& aCadstarLin } -PLOT_DASH_TYPE CADSTAR_SCH_ARCHIVE_LOADER::getLineStyle( const LINECODE_ID& aCadstarLineCodeID ) +LINE_STYLE CADSTAR_SCH_ARCHIVE_LOADER::getLineStyle( const LINECODE_ID& aCadstarLineCodeID ) { wxCHECK( Assignments.Codedefs.LineCodes.find( aCadstarLineCodeID ) != Assignments.Codedefs.LineCodes.end(), - PLOT_DASH_TYPE::SOLID ); + LINE_STYLE::SOLID ); // clang-format off switch( Assignments.Codedefs.LineCodes.at( aCadstarLineCodeID ).Style ) { - case LINESTYLE::DASH: return PLOT_DASH_TYPE::DASH; - case LINESTYLE::DASHDOT: return PLOT_DASH_TYPE::DASHDOT; - case LINESTYLE::DASHDOTDOT: return PLOT_DASH_TYPE::DASHDOT; //TODO: update in future - case LINESTYLE::DOT: return PLOT_DASH_TYPE::DOT; - case LINESTYLE::SOLID: return PLOT_DASH_TYPE::SOLID; - default: return PLOT_DASH_TYPE::DEFAULT; + case LINESTYLE::DASH: return LINE_STYLE::DASH; + case LINESTYLE::DASHDOT: return LINE_STYLE::DASHDOT; + case LINESTYLE::DASHDOTDOT: return LINE_STYLE::DASHDOT; //TODO: update in future + case LINESTYLE::DOT: return LINE_STYLE::DOT; + case LINESTYLE::SOLID: return LINE_STYLE::SOLID; + default: return LINE_STYLE::DEFAULT; } // clang-format on } diff --git a/eeschema/sch_plugins/cadstar/cadstar_sch_archive_loader.h b/eeschema/sch_plugins/cadstar/cadstar_sch_archive_loader.h index 802d4955e8..68cf8c072b 100644 --- a/eeschema/sch_plugins/cadstar/cadstar_sch_archive_loader.h +++ b/eeschema/sch_plugins/cadstar/cadstar_sch_archive_loader.h @@ -29,7 +29,7 @@ #include #include // SCH_LAYER_ID -#include // PLOT_DASH_TYPE +#include // LINE_STYLE #include // ELECTRICAL_PINTYPE #include @@ -247,7 +247,7 @@ private: bool isAttributeVisible( const ATTRIBUTE_ID& aCadstarAttributeID ); int getLineThickness( const LINECODE_ID& aCadstarLineCodeID ); - PLOT_DASH_TYPE getLineStyle( const LINECODE_ID& aCadstarLineCodeID ); + LINE_STYLE getLineStyle( const LINECODE_ID& aCadstarLineCodeID ); PART getPart( const PART_ID& aCadstarPartID ); ROUTECODE getRouteCode( const ROUTECODE_ID& aCadstarRouteCodeID ); TEXTCODE getTextCode( const TEXTCODE_ID& aCadstarTextCodeID ); diff --git a/eeschema/sch_plugins/eagle/sch_eagle_plugin.cpp b/eeschema/sch_plugins/eagle/sch_eagle_plugin.cpp index 46b5b7f9eb..ea992e7ec1 100644 --- a/eeschema/sch_plugins/eagle/sch_eagle_plugin.cpp +++ b/eeschema/sch_plugins/eagle/sch_eagle_plugin.cpp @@ -1523,7 +1523,7 @@ SCH_SHAPE* SCH_EAGLE_PLUGIN::loadPolyLine( wxXmlNode* aPolygonNode ) } poly->SetLayer( kiCadLayer( epoly.layer ) ); - poly->SetStroke( STROKE_PARAMS( epoly.width.ToSchUnits(), PLOT_DASH_TYPE::SOLID ) ); + poly->SetStroke( STROKE_PARAMS( epoly.width.ToSchUnits(), LINE_STYLE::SOLID ) ); poly->SetFillMode( FILL_T::FILLED_SHAPE ); return poly.release(); @@ -1552,7 +1552,7 @@ SCH_ITEM* SCH_EAGLE_PLUGIN::loadWire( wxXmlNode* aWireNode, SEG& endpoints ) arc->SetStart( start ); arc->SetArcAngleAndEnd( -EDA_ANGLE( *ewire.curve, DEGREES_T ), true ); // KiCad rotates the other way arc->SetLayer( kiCadLayer( ewire.layer ) ); - arc->SetStroke( STROKE_PARAMS( ewire.width.ToSchUnits(), PLOT_DASH_TYPE::SOLID ) ); + arc->SetStroke( STROKE_PARAMS( ewire.width.ToSchUnits(), LINE_STYLE::SOLID ) ); return arc.release(); } @@ -1563,7 +1563,7 @@ SCH_ITEM* SCH_EAGLE_PLUGIN::loadWire( wxXmlNode* aWireNode, SEG& endpoints ) line->SetStartPoint( start ); line->SetEndPoint( end ); line->SetLayer( kiCadLayer( ewire.layer ) ); - line->SetStroke( STROKE_PARAMS( ewire.width.ToSchUnits(), PLOT_DASH_TYPE::SOLID ) ); + line->SetStroke( STROKE_PARAMS( ewire.width.ToSchUnits(), LINE_STYLE::SOLID ) ); return line.release(); } @@ -1579,7 +1579,7 @@ SCH_SHAPE* SCH_EAGLE_PLUGIN::loadCircle( wxXmlNode* aCircleNode ) circle->SetLayer( kiCadLayer( c.layer ) ); circle->SetPosition( center ); circle->SetEnd( VECTOR2I( center.x + c.radius.ToSchUnits(), center.y ) ); - circle->SetStroke( STROKE_PARAMS( c.width.ToSchUnits(), PLOT_DASH_TYPE::SOLID ) ); + circle->SetStroke( STROKE_PARAMS( c.width.ToSchUnits(), LINE_STYLE::SOLID ) ); return circle.release(); } @@ -2296,7 +2296,7 @@ LIB_SHAPE* SCH_EAGLE_PLUGIN::loadSymbolCircle( std::unique_ptr& aSym circle->SetPosition( center ); circle->SetEnd( VECTOR2I( center.x + c.radius.ToSchUnits(), center.y ) ); - circle->SetStroke( STROKE_PARAMS( c.width.ToSchUnits(), PLOT_DASH_TYPE::SOLID ) ); + circle->SetStroke( STROKE_PARAMS( c.width.ToSchUnits(), LINE_STYLE::SOLID ) ); circle->SetUnit( aGateNumber ); return circle; @@ -2363,12 +2363,12 @@ LIB_ITEM* SCH_EAGLE_PLUGIN::loadSymbolWire( std::unique_ptr& aSymbol VECTOR2I centerStartVector = ( begin - center ) * ( ewire.width.ToSchUnits() / radius ); begin = center + centerStartVector; - arc->SetStroke( STROKE_PARAMS( 1, PLOT_DASH_TYPE::SOLID ) ); + arc->SetStroke( STROKE_PARAMS( 1, LINE_STYLE::SOLID ) ); arc->SetFillMode( FILL_T::FILLED_SHAPE ); } else { - arc->SetStroke( STROKE_PARAMS( ewire.width.ToSchUnits(), PLOT_DASH_TYPE::SOLID ) ); + arc->SetStroke( STROKE_PARAMS( ewire.width.ToSchUnits(), LINE_STYLE::SOLID ) ); } arc->SetCenter( center ); @@ -2385,7 +2385,7 @@ LIB_ITEM* SCH_EAGLE_PLUGIN::loadSymbolWire( std::unique_ptr& aSymbol poly->AddPoint( begin ); poly->AddPoint( end ); poly->SetUnit( aGateNumber ); - poly->SetStroke( STROKE_PARAMS( ewire.width.ToSchUnits(), PLOT_DASH_TYPE::SOLID ) ); + poly->SetStroke( STROKE_PARAMS( ewire.width.ToSchUnits(), LINE_STYLE::SOLID ) ); return poly; } @@ -2426,7 +2426,7 @@ LIB_SHAPE* SCH_EAGLE_PLUGIN::loadSymbolPolyLine( std::unique_ptr& aS vertex = vertex->GetNext(); } - poly->SetStroke( STROKE_PARAMS( epoly.width.ToSchUnits(), PLOT_DASH_TYPE::SOLID ) ); + poly->SetStroke( STROKE_PARAMS( epoly.width.ToSchUnits(), LINE_STYLE::SOLID ) ); poly->SetFillMode( FILL_T::FILLED_SHAPE ); poly->SetUnit( aGateNumber ); diff --git a/eeschema/sch_plugins/easyeda/sch_easyeda_parser.cpp b/eeschema/sch_plugins/easyeda/sch_easyeda_parser.cpp index 94a5c2451f..9a0604c30b 100644 --- a/eeschema/sch_plugins/easyeda/sch_easyeda_parser.cpp +++ b/eeschema/sch_plugins/easyeda/sch_easyeda_parser.cpp @@ -145,16 +145,16 @@ static LIB_ID EasyEdaToKiCadLibID( const wxString& aLibName, const wxString& aLi } -static PLOT_DASH_TYPE ConvertStrokeStyle( const wxString& aStyle ) +static LINE_STYLE ConvertStrokeStyle( const wxString& aStyle ) { if( aStyle == wxS( "0" ) ) - return PLOT_DASH_TYPE::SOLID; + return LINE_STYLE::SOLID; else if( aStyle == wxS( "1" ) ) - return PLOT_DASH_TYPE::DASH; + return LINE_STYLE::DASH; else if( aStyle == wxS( "2" ) ) - return PLOT_DASH_TYPE::DOT; + return LINE_STYLE::DOT; - return PLOT_DASH_TYPE::DEFAULT; + return LINE_STYLE::DEFAULT; } @@ -224,7 +224,7 @@ VECTOR2I HelperGeneratePowerPortGraphics( LIB_SYMBOL* aKsymbol, EASYEDA::POWER_F { LIB_SHAPE* line1 = new LIB_SHAPE( aKsymbol, SHAPE_T::POLY ); aKsymbol->AddDrawItem( line1 ); - line1->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), PLOT_DASH_TYPE::SOLID ) ); + line1->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), LINE_STYLE::SOLID ) ); line1->AddPoint( { 0, 0 } ); line1->AddPoint( { 0, schIUScale.MilsToIU( -50 ) } ); @@ -232,7 +232,7 @@ VECTOR2I HelperGeneratePowerPortGraphics( LIB_SYMBOL* aKsymbol, EASYEDA::POWER_F { LIB_SHAPE* circle = new LIB_SHAPE( aKsymbol, SHAPE_T::CIRCLE ); aKsymbol->AddDrawItem( circle ); - circle->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 5 ), PLOT_DASH_TYPE::SOLID ) ); + circle->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 5 ), LINE_STYLE::SOLID ) ); circle->SetPosition( { schIUScale.MilsToIU( 0 ), schIUScale.MilsToIU( -75 ) } ); circle->SetEnd( circle->GetPosition() + VECTOR2I( schIUScale.MilsToIU( 25 ), 0 ) ); } @@ -240,7 +240,7 @@ VECTOR2I HelperGeneratePowerPortGraphics( LIB_SYMBOL* aKsymbol, EASYEDA::POWER_F { LIB_SHAPE* line2 = new LIB_SHAPE( aKsymbol, SHAPE_T::POLY ); aKsymbol->AddDrawItem( line2 ); - line2->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), PLOT_DASH_TYPE::SOLID ) ); + line2->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), LINE_STYLE::SOLID ) ); line2->AddPoint( { schIUScale.MilsToIU( -25 ), schIUScale.MilsToIU( -50 ) } ); line2->AddPoint( { schIUScale.MilsToIU( 25 ), schIUScale.MilsToIU( -50 ) } ); line2->AddPoint( { schIUScale.MilsToIU( 0 ), schIUScale.MilsToIU( -100 ) } ); @@ -253,13 +253,13 @@ VECTOR2I HelperGeneratePowerPortGraphics( LIB_SYMBOL* aKsymbol, EASYEDA::POWER_F { LIB_SHAPE* line = new LIB_SHAPE( aKsymbol, SHAPE_T::POLY ); aKsymbol->AddDrawItem( line ); - line->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), PLOT_DASH_TYPE::SOLID ) ); + line->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), LINE_STYLE::SOLID ) ); line->AddPoint( { 0, 0 } ); line->AddPoint( { 0, schIUScale.MilsToIU( -72 ) } ); LIB_SHAPE* bezier = new LIB_SHAPE( aKsymbol, SHAPE_T::BEZIER ); aKsymbol->AddDrawItem( bezier ); - bezier->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 5 ), PLOT_DASH_TYPE::SOLID ) ); + bezier->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 5 ), LINE_STYLE::SOLID ) ); bezier->AddPoint( { schIUScale.MilsToIU( 30 ), schIUScale.MilsToIU( -50 ) } ); bezier->AddPoint( { schIUScale.MilsToIU( 30 ), schIUScale.MilsToIU( -87 ) } ); bezier->AddPoint( { schIUScale.MilsToIU( -30 ), schIUScale.MilsToIU( -63 ) } ); @@ -274,7 +274,7 @@ VECTOR2I HelperGeneratePowerPortGraphics( LIB_SYMBOL* aKsymbol, EASYEDA::POWER_F { LIB_SHAPE* line1 = new LIB_SHAPE( aKsymbol, SHAPE_T::POLY ); aKsymbol->AddDrawItem( line1 ); - line1->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), PLOT_DASH_TYPE::SOLID ) ); + line1->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), LINE_STYLE::SOLID ) ); line1->AddPoint( { 0, 0 } ); line1->AddPoint( { 0, schIUScale.MilsToIU( -100 ) } ); @@ -282,25 +282,25 @@ VECTOR2I HelperGeneratePowerPortGraphics( LIB_SYMBOL* aKsymbol, EASYEDA::POWER_F { LIB_SHAPE* line2 = new LIB_SHAPE( aKsymbol, SHAPE_T::POLY ); aKsymbol->AddDrawItem( line2 ); - line2->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), PLOT_DASH_TYPE::SOLID ) ); + line2->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), LINE_STYLE::SOLID ) ); line2->AddPoint( { schIUScale.MilsToIU( -100 ), schIUScale.MilsToIU( -100 ) } ); line2->AddPoint( { schIUScale.MilsToIU( 100 ), schIUScale.MilsToIU( -100 ) } ); LIB_SHAPE* line3 = new LIB_SHAPE( aKsymbol, SHAPE_T::POLY ); aKsymbol->AddDrawItem( line3 ); - line3->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), PLOT_DASH_TYPE::SOLID ) ); + line3->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), LINE_STYLE::SOLID ) ); line3->AddPoint( { schIUScale.MilsToIU( -70 ), schIUScale.MilsToIU( -120 ) } ); line3->AddPoint( { schIUScale.MilsToIU( 70 ), schIUScale.MilsToIU( -120 ) } ); LIB_SHAPE* line4 = new LIB_SHAPE( aKsymbol, SHAPE_T::POLY ); aKsymbol->AddDrawItem( line4 ); - line4->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), PLOT_DASH_TYPE::SOLID ) ); + line4->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), LINE_STYLE::SOLID ) ); line4->AddPoint( { schIUScale.MilsToIU( -40 ), schIUScale.MilsToIU( -140 ) } ); line4->AddPoint( { schIUScale.MilsToIU( 40 ), schIUScale.MilsToIU( -140 ) } ); LIB_SHAPE* line5 = new LIB_SHAPE( aKsymbol, SHAPE_T::POLY ); aKsymbol->AddDrawItem( line5 ); - line5->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), PLOT_DASH_TYPE::SOLID ) ); + line5->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), LINE_STYLE::SOLID ) ); line5->AddPoint( { schIUScale.MilsToIU( -10 ), schIUScale.MilsToIU( -160 ) } ); line5->AddPoint( { schIUScale.MilsToIU( 10 ), schIUScale.MilsToIU( -160 ) } ); } @@ -308,7 +308,7 @@ VECTOR2I HelperGeneratePowerPortGraphics( LIB_SYMBOL* aKsymbol, EASYEDA::POWER_F { LIB_SHAPE* line2 = new LIB_SHAPE( aKsymbol, SHAPE_T::POLY ); aKsymbol->AddDrawItem( line2 ); - line2->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), PLOT_DASH_TYPE::SOLID ) ); + line2->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), LINE_STYLE::SOLID ) ); line2->AddPoint( { schIUScale.MilsToIU( -100 ), schIUScale.MilsToIU( -100 ) } ); line2->AddPoint( { schIUScale.MilsToIU( 100 ), schIUScale.MilsToIU( -100 ) } ); line2->AddPoint( { schIUScale.MilsToIU( 0 ), schIUScale.MilsToIU( -160 ) } ); @@ -318,7 +318,7 @@ VECTOR2I HelperGeneratePowerPortGraphics( LIB_SYMBOL* aKsymbol, EASYEDA::POWER_F { LIB_SHAPE* line2 = new LIB_SHAPE( aKsymbol, SHAPE_T::POLY ); aKsymbol->AddDrawItem( line2 ); - line2->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), PLOT_DASH_TYPE::SOLID ) ); + line2->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), LINE_STYLE::SOLID ) ); line2->AddPoint( { schIUScale.MilsToIU( -150 ), schIUScale.MilsToIU( -200 ) } ); line2->AddPoint( { schIUScale.MilsToIU( -100 ), schIUScale.MilsToIU( -100 ) } ); line2->AddPoint( { schIUScale.MilsToIU( 100 ), schIUScale.MilsToIU( -100 ) } ); @@ -326,7 +326,7 @@ VECTOR2I HelperGeneratePowerPortGraphics( LIB_SYMBOL* aKsymbol, EASYEDA::POWER_F LIB_SHAPE* line3 = new LIB_SHAPE( aKsymbol, SHAPE_T::POLY ); aKsymbol->AddDrawItem( line3 ); - line3->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), PLOT_DASH_TYPE::SOLID ) ); + line3->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), LINE_STYLE::SOLID ) ); line3->AddPoint( { schIUScale.MilsToIU( 0 ), schIUScale.MilsToIU( -100 ) } ); line3->AddPoint( { schIUScale.MilsToIU( -50 ), schIUScale.MilsToIU( -200 ) } ); } @@ -334,7 +334,7 @@ VECTOR2I HelperGeneratePowerPortGraphics( LIB_SYMBOL* aKsymbol, EASYEDA::POWER_F { LIB_SHAPE* line2 = new LIB_SHAPE( aKsymbol, SHAPE_T::POLY ); aKsymbol->AddDrawItem( line2 ); - line2->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), PLOT_DASH_TYPE::SOLID ) ); + line2->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), LINE_STYLE::SOLID ) ); line2->AddPoint( { schIUScale.MilsToIU( -25 ), schIUScale.MilsToIU( -50 ) } ); line2->AddPoint( { schIUScale.MilsToIU( 0 ), schIUScale.MilsToIU( -100 ) } ); line2->AddPoint( { schIUScale.MilsToIU( 25 ), schIUScale.MilsToIU( -50 ) } ); @@ -349,25 +349,25 @@ VECTOR2I HelperGeneratePowerPortGraphics( LIB_SYMBOL* aKsymbol, EASYEDA::POWER_F { LIB_SHAPE* line1 = new LIB_SHAPE( aKsymbol, SHAPE_T::POLY ); aKsymbol->AddDrawItem( line1 ); - line1->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), PLOT_DASH_TYPE::SOLID ) ); + line1->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), LINE_STYLE::SOLID ) ); line1->AddPoint( { 0, 0 } ); line1->AddPoint( { 0, schIUScale.MilsToIU( -160 ) } ); LIB_SHAPE* line2 = new LIB_SHAPE( aKsymbol, SHAPE_T::POLY ); aKsymbol->AddDrawItem( line2 ); - line2->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), PLOT_DASH_TYPE::SOLID ) ); + line2->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), LINE_STYLE::SOLID ) ); line2->AddPoint( { schIUScale.MilsToIU( -100 ), schIUScale.MilsToIU( -160 ) } ); line2->AddPoint( { schIUScale.MilsToIU( 100 ), schIUScale.MilsToIU( -160 ) } ); LIB_SHAPE* line3 = new LIB_SHAPE( aKsymbol, SHAPE_T::POLY ); aKsymbol->AddDrawItem( line3 ); - line3->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), PLOT_DASH_TYPE::SOLID ) ); + line3->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), LINE_STYLE::SOLID ) ); line3->AddPoint( { schIUScale.MilsToIU( -60 ), schIUScale.MilsToIU( -200 ) } ); line3->AddPoint( { schIUScale.MilsToIU( 60 ), schIUScale.MilsToIU( -200 ) } ); LIB_SHAPE* line4 = new LIB_SHAPE( aKsymbol, SHAPE_T::POLY ); aKsymbol->AddDrawItem( line4 ); - line4->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), PLOT_DASH_TYPE::SOLID ) ); + line4->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), LINE_STYLE::SOLID ) ); line4->AddPoint( { schIUScale.MilsToIU( -20 ), schIUScale.MilsToIU( -240 ) } ); line4->AddPoint( { schIUScale.MilsToIU( 20 ), schIUScale.MilsToIU( -240 ) } ); @@ -376,7 +376,7 @@ VECTOR2I HelperGeneratePowerPortGraphics( LIB_SYMBOL* aKsymbol, EASYEDA::POWER_F LIB_SHAPE* circle = new LIB_SHAPE( aKsymbol, SHAPE_T::CIRCLE ); aKsymbol->AddDrawItem( circle ); - circle->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), PLOT_DASH_TYPE::SOLID ) ); + circle->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), LINE_STYLE::SOLID ) ); circle->SetPosition( { schIUScale.MilsToIU( 0 ), schIUScale.MilsToIU( -160 ) } ); circle->SetEnd( circle->GetPosition() + VECTOR2I( schIUScale.MilsToIU( 120 ), 0 ) ); @@ -386,13 +386,13 @@ VECTOR2I HelperGeneratePowerPortGraphics( LIB_SYMBOL* aKsymbol, EASYEDA::POWER_F { LIB_SHAPE* line1 = new LIB_SHAPE( aKsymbol, SHAPE_T::POLY ); aKsymbol->AddDrawItem( line1 ); - line1->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), PLOT_DASH_TYPE::SOLID ) ); + line1->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), LINE_STYLE::SOLID ) ); line1->AddPoint( { 0, 0 } ); line1->AddPoint( { 0, schIUScale.MilsToIU( -200 ) } ); LIB_SHAPE* line2 = new LIB_SHAPE( aKsymbol, SHAPE_T::POLY ); aKsymbol->AddDrawItem( line2 ); - line2->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), PLOT_DASH_TYPE::SOLID ) ); + line2->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), LINE_STYLE::SOLID ) ); line2->AddPoint( { schIUScale.MilsToIU( -100 ), schIUScale.MilsToIU( -200 ) } ); line2->AddPoint( { schIUScale.MilsToIU( 100 ), schIUScale.MilsToIU( -200 ) } ); @@ -408,13 +408,13 @@ VECTOR2I HelperGeneratePowerPortGraphics( LIB_SYMBOL* aKsymbol, EASYEDA::POWER_F LIB_SHAPE* line1 = new LIB_SHAPE( aKsymbol, SHAPE_T::POLY ); aKsymbol->AddDrawItem( line1 ); - line1->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), PLOT_DASH_TYPE::SOLID ) ); + line1->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), LINE_STYLE::SOLID ) ); line1->AddPoint( { 0, 0 } ); line1->AddPoint( { 0, schIUScale.MilsToIU( -100 ) } ); LIB_SHAPE* line2 = new LIB_SHAPE( aKsymbol, SHAPE_T::POLY ); aKsymbol->AddDrawItem( line2 ); - line2->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), PLOT_DASH_TYPE::SOLID ) ); + line2->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), LINE_STYLE::SOLID ) ); line2->AddPoint( { schIUScale.MilsToIU( -50 ), schIUScale.MilsToIU( -100 ) } ); line2->AddPoint( { schIUScale.MilsToIU( 50 ), schIUScale.MilsToIU( -100 ) } ); @@ -437,7 +437,7 @@ void SCH_EASYEDA_PARSER::ParseSymbolShapes( LIB_SYMBOL* aSymbol wxArrayString ptArr = wxSplit( arr[1], ' ', '\0' ); wxString strokeColor = arr[2]; double lineWidth = Convert( arr[3] ); - PLOT_DASH_TYPE strokeStyle = ConvertStrokeStyle( arr[4] ); + LINE_STYLE strokeStyle = ConvertStrokeStyle( arr[4] ); wxString fillColor = arr[5].Lower(); //bool locked = arr[7] != wxS( "0" ); @@ -480,12 +480,12 @@ void SCH_EASYEDA_PARSER::ParseSymbolShapes( LIB_SYMBOL* aSymbol } else if( elType == wxS( "PT" ) ) { - wxString pointsData = arr[1]; - wxString strokeColor = arr[2]; - double lineWidth = Convert( arr[3] ); - PLOT_DASH_TYPE strokeStyle = ConvertStrokeStyle( arr[4] ); - wxString fillColor = arr[5].Lower(); - //bool locked = arr[7] != wxS( "0" ); + wxString pointsData = arr[1]; + wxString strokeColor = arr[2]; + double lineWidth = Convert( arr[3] ); + LINE_STYLE strokeStyle = ConvertStrokeStyle( arr[4] ); + wxString fillColor = arr[5].Lower(); + //bool locked = arr[7] != wxS( "0" ); std::vector lineChains = ParseLineChains( pointsData, schIUScale.MilsToIU( 10 ) ); @@ -596,12 +596,12 @@ void SCH_EASYEDA_PARSER::ParseSymbolShapes( LIB_SYMBOL* aSymbol } else if( elType == wxS( "A" ) ) { - wxString data = arr[1]; - wxString strokeColor = arr[3]; - double lineWidth = Convert( arr[4] ); - PLOT_DASH_TYPE strokeStyle = ConvertStrokeStyle( arr[5] ); - wxString fillColor = arr[6].Lower(); - //bool locked = arr[8] != wxS( "0" ); + wxString data = arr[1]; + wxString strokeColor = arr[3]; + double lineWidth = Convert( arr[4] ); + LINE_STYLE strokeStyle = ConvertStrokeStyle( arr[5] ); + wxString fillColor = arr[6].Lower(); + //bool locked = arr[8] != wxS( "0" ); VECTOR2D start, end; VECTOR2D rad( 10, 10 ); @@ -706,12 +706,12 @@ void SCH_EASYEDA_PARSER::ParseSymbolShapes( LIB_SYMBOL* aSymbol cr.x = !arr[3].empty() ? Convert( arr[3] ) : 0, cr.y = !arr[4].empty() ? Convert( arr[4] ) : 0; // TODO: corner radius - VECTOR2D size( Convert( arr[5] ), Convert( arr[6] ) ); - wxString strokeColor = arr[7]; - double lineWidth = Convert( arr[8] ); - PLOT_DASH_TYPE strokeStyle = ConvertStrokeStyle( arr[9] ); - wxString fillColor = arr[10].Lower(); - //bool locked = arr[12] != wxS( "0" ); + VECTOR2D size( Convert( arr[5] ), Convert( arr[6] ) ); + wxString strokeColor = arr[7]; + double lineWidth = Convert( arr[8] ); + LINE_STYLE strokeStyle = ConvertStrokeStyle( arr[9] ); + wxString fillColor = arr[10].Lower(); + //bool locked = arr[12] != wxS( "0" ); //if( cr.x == 0 ) { @@ -743,13 +743,13 @@ void SCH_EASYEDA_PARSER::ParseSymbolShapes( LIB_SYMBOL* aSymbol std::unique_ptr circle = std::make_unique( aSymbol, SHAPE_T::CIRCLE ); - VECTOR2D center( Convert( arr[1] ), Convert( arr[2] ) ); - VECTOR2D radius( Convert( arr[3] ), Convert( arr[4] ) ); // TODO: corner radius - wxString strokeColor = arr[5]; - double lineWidth = Convert( arr[6] ); - PLOT_DASH_TYPE strokeStyle = ConvertStrokeStyle( arr[7] ); - wxString fillColor = arr[8].Lower(); - //bool locked = arr[10] != wxS( "0" ); + VECTOR2D center( Convert( arr[1] ), Convert( arr[2] ) ); + VECTOR2D radius( Convert( arr[3] ), Convert( arr[4] ) ); // TODO: corner radius + wxString strokeColor = arr[5]; + double lineWidth = Convert( arr[6] ); + LINE_STYLE strokeStyle = ConvertStrokeStyle( arr[7] ); + wxString fillColor = arr[8].Lower(); + //bool locked = arr[10] != wxS( "0" ); circle->SetCenter( RelPosSym( center ) ); circle->SetEnd( RelPosSym( center + VECTOR2I( radius.x, 0 ) ) ); @@ -1309,12 +1309,12 @@ void SCH_EASYEDA_PARSER::ParseSchematic( SCHEMATIC* aSchematic, SCH_SHEET* aRoot } else if( rootType == wxS( "W" ) ) { - wxArrayString ptArr = wxSplit( arr[1], ' ', '\0' ); - wxString strokeColor = arr[2]; - //double lineWidth = Convert( arr[3] ); - //PLOT_DASH_TYPE strokeStyle = ConvertStrokeStyle( arr[4] ); - wxString fillColor = arr[5].Lower(); - //bool locked = arr[7] != wxS( "0" ); + wxArrayString ptArr = wxSplit( arr[1], ' ', '\0' ); + wxString strokeColor = arr[2]; + //double lineWidth = Convert( arr[3] ); + //LINE_STYLE strokeStyle = ConvertStrokeStyle( arr[4] ); + wxString fillColor = arr[5].Lower(); + //bool locked = arr[7] != wxS( "0" ); SHAPE_LINE_CHAIN chain; @@ -1433,12 +1433,12 @@ void SCH_EASYEDA_PARSER::ParseSchematic( SCHEMATIC* aSchematic, SCH_SHEET* aRoot cr.x = !arr[3].empty() ? Convert( arr[3] ) : 0, cr.y = !arr[4].empty() ? Convert( arr[4] ) : 0; // TODO: corner radius - VECTOR2D size( Convert( arr[5] ), Convert( arr[6] ) ); - wxString strokeColor = arr[7]; - double lineWidth = Convert( arr[8] ); - PLOT_DASH_TYPE strokeStyle = ConvertStrokeStyle( arr[9] ); - wxString fillColor = arr[10].Lower(); - //bool locked = arr[12] != wxS( "0" ); + VECTOR2D size( Convert( arr[5] ), Convert( arr[6] ) ); + wxString strokeColor = arr[7]; + double lineWidth = Convert( arr[8] ); + LINE_STYLE strokeStyle = ConvertStrokeStyle( arr[9] ); + wxString fillColor = arr[10].Lower(); + //bool locked = arr[12] != wxS( "0" ); //if( cr.x == 0 ) { diff --git a/eeschema/sch_plugins/easyedapro/sch_easyedapro_parser.cpp b/eeschema/sch_plugins/easyedapro/sch_easyedapro_parser.cpp index 01bd543532..f063e6b447 100644 --- a/eeschema/sch_plugins/easyedapro/sch_easyedapro_parser.cpp +++ b/eeschema/sch_plugins/easyedapro/sch_easyedapro_parser.cpp @@ -81,18 +81,18 @@ double SCH_EASYEDAPRO_PARSER::SizeToKi( wxString aValue ) } -static PLOT_DASH_TYPE ConvertStrokeStyle( int aStyle ) +static LINE_STYLE ConvertStrokeStyle( int aStyle ) { if( aStyle == 0 ) - return PLOT_DASH_TYPE::SOLID; + return LINE_STYLE::SOLID; else if( aStyle == 1 ) - return PLOT_DASH_TYPE::DASH; + return LINE_STYLE::DASH; else if( aStyle == 2 ) - return PLOT_DASH_TYPE::DOT; + return LINE_STYLE::DOT; else if( aStyle == 3 ) - return PLOT_DASH_TYPE::DASHDOT; + return LINE_STYLE::DASHDOT; - return PLOT_DASH_TYPE::DEFAULT; + return LINE_STYLE::DEFAULT; } @@ -208,7 +208,7 @@ void SCH_EASYEDAPRO_PARSER::ApplyLineStyle( const std::map bezier = std::make_unique( nullptr, SHAPE_T::BEZIER ); @@ -1272,7 +1272,7 @@ LIB_SHAPE* SCH_SEXPR_PARSER::parseCircle() T token; VECTOR2I center( 0, 0 ); int radius = 1; // defaulting to 0 could result in troublesome math.... - STROKE_PARAMS stroke( schIUScale.MilsToIU( DEFAULT_LINE_WIDTH_MILS ), PLOT_DASH_TYPE::DEFAULT ); + STROKE_PARAMS stroke( schIUScale.MilsToIU( DEFAULT_LINE_WIDTH_MILS ), LINE_STYLE::DEFAULT ); FILL_PARAMS fill; std::unique_ptr circle = std::make_unique( nullptr, SHAPE_T::CIRCLE ); @@ -1546,7 +1546,7 @@ LIB_SHAPE* SCH_SEXPR_PARSER::parsePolyLine() wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as a poly." ) ); T token; - STROKE_PARAMS stroke( schIUScale.MilsToIU( DEFAULT_LINE_WIDTH_MILS ), PLOT_DASH_TYPE::DEFAULT ); + STROKE_PARAMS stroke( schIUScale.MilsToIU( DEFAULT_LINE_WIDTH_MILS ), LINE_STYLE::DEFAULT ); FILL_PARAMS fill; std::unique_ptr poly = std::make_unique( nullptr, SHAPE_T::POLY ); @@ -1614,7 +1614,7 @@ LIB_SHAPE* SCH_SEXPR_PARSER::parseRectangle() wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as a rectangle." ) ); T token; - STROKE_PARAMS stroke( schIUScale.MilsToIU( DEFAULT_LINE_WIDTH_MILS ), PLOT_DASH_TYPE::DEFAULT ); + STROKE_PARAMS stroke( schIUScale.MilsToIU( DEFAULT_LINE_WIDTH_MILS ), LINE_STYLE::DEFAULT ); FILL_PARAMS fill; std::unique_ptr rectangle = std::make_unique( nullptr, SHAPE_T::RECTANGLE ); @@ -1734,7 +1734,7 @@ LIB_TEXTBOX* SCH_SEXPR_PARSER::parseTextBox() VECTOR2I size; bool foundEnd = false; bool foundSize = false; - STROKE_PARAMS stroke( schIUScale.MilsToIU( DEFAULT_LINE_WIDTH_MILS ), PLOT_DASH_TYPE::DEFAULT ); + STROKE_PARAMS stroke( schIUScale.MilsToIU( DEFAULT_LINE_WIDTH_MILS ), LINE_STYLE::DEFAULT ); FILL_PARAMS fill; std::unique_ptr textBox = std::make_unique( nullptr ); @@ -3117,7 +3117,7 @@ SCH_SHEET* SCH_SEXPR_PARSER::parseSheet() wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as a sheet." ) ); T token; - STROKE_PARAMS stroke( schIUScale.MilsToIU( DEFAULT_LINE_WIDTH_MILS ), PLOT_DASH_TYPE::DEFAULT ); + STROKE_PARAMS stroke( schIUScale.MilsToIU( DEFAULT_LINE_WIDTH_MILS ), LINE_STYLE::DEFAULT ); FILL_PARAMS fill; SCH_FIELD* field; std::vector fields; @@ -3401,7 +3401,7 @@ SCH_BUS_WIRE_ENTRY* SCH_SEXPR_PARSER::parseBusEntry() wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as a bus entry." ) ); T token; - STROKE_PARAMS stroke( schIUScale.MilsToIU( DEFAULT_LINE_WIDTH_MILS ), PLOT_DASH_TYPE::DEFAULT ); + STROKE_PARAMS stroke( schIUScale.MilsToIU( DEFAULT_LINE_WIDTH_MILS ), LINE_STYLE::DEFAULT ); std::unique_ptr busEntry = std::make_unique(); for( token = NextTok(); token != T_RIGHT; token = NextTok() ) @@ -3452,7 +3452,7 @@ SCH_BUS_WIRE_ENTRY* SCH_SEXPR_PARSER::parseBusEntry() SCH_SHAPE* SCH_SEXPR_PARSER::parseSchPolyLine() { T token; - STROKE_PARAMS stroke( schIUScale.MilsToIU( DEFAULT_LINE_WIDTH_MILS ), PLOT_DASH_TYPE::DEFAULT ); + STROKE_PARAMS stroke( schIUScale.MilsToIU( DEFAULT_LINE_WIDTH_MILS ), LINE_STYLE::DEFAULT ); FILL_PARAMS fill; int layer = LAYER_NOTES; @@ -3516,7 +3516,7 @@ SCH_LINE* SCH_SEXPR_PARSER::parseLine() // parseSchPolyLine() that can handle true polygons, and not only one segment. T token; - STROKE_PARAMS stroke( schIUScale.MilsToIU( DEFAULT_LINE_WIDTH_MILS ), PLOT_DASH_TYPE::DEFAULT ); + STROKE_PARAMS stroke( schIUScale.MilsToIU( DEFAULT_LINE_WIDTH_MILS ), LINE_STYLE::DEFAULT ); int layer; switch( CurTok() ) @@ -3588,7 +3588,7 @@ SCH_SHAPE* SCH_SEXPR_PARSER::parseSchArc() VECTOR2I startPoint; VECTOR2I midPoint; VECTOR2I endPoint; - STROKE_PARAMS stroke( schIUScale.MilsToIU( DEFAULT_LINE_WIDTH_MILS ), PLOT_DASH_TYPE::DEFAULT ); + STROKE_PARAMS stroke( schIUScale.MilsToIU( DEFAULT_LINE_WIDTH_MILS ), LINE_STYLE::DEFAULT ); FILL_PARAMS fill; std::unique_ptr arc = std::make_unique( SHAPE_T::ARC ); @@ -3652,7 +3652,7 @@ SCH_SHAPE* SCH_SEXPR_PARSER::parseSchCircle() T token; VECTOR2I center; int radius = 0; - STROKE_PARAMS stroke( schIUScale.MilsToIU( DEFAULT_LINE_WIDTH_MILS ), PLOT_DASH_TYPE::DEFAULT ); + STROKE_PARAMS stroke( schIUScale.MilsToIU( DEFAULT_LINE_WIDTH_MILS ), LINE_STYLE::DEFAULT ); FILL_PARAMS fill; std::unique_ptr circle = std::make_unique( SHAPE_T::CIRCLE ); @@ -3710,7 +3710,7 @@ SCH_SHAPE* SCH_SEXPR_PARSER::parseSchRectangle() wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as a rectangle." ) ); T token; - STROKE_PARAMS stroke( schIUScale.MilsToIU( DEFAULT_LINE_WIDTH_MILS ), PLOT_DASH_TYPE::DEFAULT ); + STROKE_PARAMS stroke( schIUScale.MilsToIU( DEFAULT_LINE_WIDTH_MILS ), LINE_STYLE::DEFAULT ); FILL_PARAMS fill; std::unique_ptr rectangle = std::make_unique( SHAPE_T::RECTANGLE ); @@ -3765,7 +3765,7 @@ SCH_SHAPE* SCH_SEXPR_PARSER::parseSchBezier() wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as a bezier." ) ); T token; - STROKE_PARAMS stroke( schIUScale.MilsToIU( DEFAULT_LINE_WIDTH_MILS ), PLOT_DASH_TYPE::DEFAULT ); + STROKE_PARAMS stroke( schIUScale.MilsToIU( DEFAULT_LINE_WIDTH_MILS ), LINE_STYLE::DEFAULT ); FILL_PARAMS fill; std::unique_ptr bezier = std::make_unique( SHAPE_T::BEZIER ); @@ -4002,7 +4002,7 @@ SCH_TEXTBOX* SCH_SEXPR_PARSER::parseSchTextBox() VECTOR2I size; bool foundEnd = false; bool foundSize = false; - STROKE_PARAMS stroke( schIUScale.MilsToIU( DEFAULT_LINE_WIDTH_MILS ), PLOT_DASH_TYPE::DEFAULT ); + STROKE_PARAMS stroke( schIUScale.MilsToIU( DEFAULT_LINE_WIDTH_MILS ), LINE_STYLE::DEFAULT ); FILL_PARAMS fill; std::unique_ptr textBox = std::make_unique(); diff --git a/eeschema/sch_plugins/kicad/sch_sexpr_plugin.cpp b/eeschema/sch_plugins/kicad/sch_sexpr_plugin.cpp index 22703d106a..a5183454d7 100644 --- a/eeschema/sch_plugins/kicad/sch_sexpr_plugin.cpp +++ b/eeschema/sch_plugins/kicad/sch_sexpr_plugin.cpp @@ -992,8 +992,7 @@ void SCH_SEXPR_PLUGIN::saveSheet( SCH_SHEET* aSheet, int aNestLevel ) m_out->Print( 0, "\n" ); - STROKE_PARAMS stroke( aSheet->GetBorderWidth(), PLOT_DASH_TYPE::SOLID, - aSheet->GetBorderColor() ); + STROKE_PARAMS stroke( aSheet->GetBorderWidth(), LINE_STYLE::SOLID, aSheet->GetBorderColor() ); stroke.SetWidth( aSheet->GetBorderWidth() ); stroke.Format( m_out, schIUScale, aNestLevel + 1 ); diff --git a/eeschema/sch_plugins/legacy/sch_legacy_lib_plugin_cache.cpp b/eeschema/sch_plugins/legacy/sch_legacy_lib_plugin_cache.cpp index fd07e98af2..08cde0d12b 100644 --- a/eeschema/sch_plugins/legacy/sch_legacy_lib_plugin_cache.cpp +++ b/eeschema/sch_plugins/legacy/sch_legacy_lib_plugin_cache.cpp @@ -845,7 +845,8 @@ LIB_SHAPE* SCH_LEGACY_PLUGIN_CACHE::loadArc( std::unique_ptr& aSymbo arc->SetUnit( parseInt( aReader, line, &line ) ); arc->SetConvert( parseInt( aReader, line, &line ) ); - STROKE_PARAMS stroke( schIUScale.MilsToIU( parseInt( aReader, line, &line ) ), PLOT_DASH_TYPE::SOLID ); + STROKE_PARAMS stroke( schIUScale.MilsToIU( parseInt( aReader, line, &line ) ), + LINE_STYLE::SOLID ); arc->SetStroke( stroke ); @@ -921,7 +922,8 @@ LIB_SHAPE* SCH_LEGACY_PLUGIN_CACHE::loadCircle( std::unique_ptr& aSy circle->SetUnit( parseInt( aReader, line, &line ) ); circle->SetConvert( parseInt( aReader, line, &line ) ); - STROKE_PARAMS stroke( schIUScale.MilsToIU( parseInt( aReader, line, &line ) ), PLOT_DASH_TYPE::SOLID ); + STROKE_PARAMS stroke( schIUScale.MilsToIU( parseInt( aReader, line, &line ) ), + LINE_STYLE::SOLID ); circle->SetStroke( stroke ); @@ -1055,7 +1057,8 @@ LIB_SHAPE* SCH_LEGACY_PLUGIN_CACHE::loadRect( std::unique_ptr& aSymb rectangle->SetUnit( parseInt( aReader, line, &line ) ); rectangle->SetConvert( parseInt( aReader, line, &line ) ); - STROKE_PARAMS stroke( schIUScale.MilsToIU( parseInt( aReader, line, &line ) ), PLOT_DASH_TYPE::SOLID ); + STROKE_PARAMS stroke( schIUScale.MilsToIU( parseInt( aReader, line, &line ) ), + LINE_STYLE::SOLID ); rectangle->SetStroke( stroke ); @@ -1302,7 +1305,8 @@ LIB_SHAPE* SCH_LEGACY_PLUGIN_CACHE::loadPolyLine( std::unique_ptr& a polyLine->SetUnit( parseInt( aReader, line, &line ) ); polyLine->SetConvert( parseInt( aReader, line, &line ) ); - STROKE_PARAMS stroke( schIUScale.MilsToIU( parseInt( aReader, line, &line ) ), PLOT_DASH_TYPE::SOLID ); + STROKE_PARAMS stroke( schIUScale.MilsToIU( parseInt( aReader, line, &line ) ), + LINE_STYLE::SOLID ); polyLine->SetStroke( stroke ); @@ -1338,7 +1342,8 @@ LIB_SHAPE* SCH_LEGACY_PLUGIN_CACHE::loadBezier( std::unique_ptr& aSy bezier->SetUnit( parseInt( aReader, line, &line ) ); bezier->SetConvert( parseInt( aReader, line, &line ) ); - STROKE_PARAMS stroke ( schIUScale.MilsToIU( parseInt( aReader, line, &line ) ), PLOT_DASH_TYPE::SOLID ); + STROKE_PARAMS stroke ( schIUScale.MilsToIU( parseInt( aReader, line, &line ) ), + LINE_STYLE::SOLID ); bezier->SetStroke( stroke ); diff --git a/eeschema/sch_plugins/legacy/sch_legacy_plugin.cpp b/eeschema/sch_plugins/legacy/sch_legacy_plugin.cpp index cf0e73ab23..9e7235d389 100644 --- a/eeschema/sch_plugins/legacy/sch_legacy_plugin.cpp +++ b/eeschema/sch_plugins/legacy/sch_legacy_plugin.cpp @@ -820,13 +820,13 @@ SCH_LINE* SCH_LEGACY_PLUGIN::loadWire( LINE_READER& aReader ) parseUnquotedString( buf, aReader, line, &line ); if( buf == wxT( "solid" ) ) - wire->SetLineStyle( PLOT_DASH_TYPE::SOLID ); + wire->SetLineStyle( LINE_STYLE::SOLID ); else if( buf == wxT( "dashed" ) ) - wire->SetLineStyle( PLOT_DASH_TYPE::DASH ); + wire->SetLineStyle( LINE_STYLE::DASH ); else if( buf == wxT( "dash_dot" ) ) - wire->SetLineStyle( PLOT_DASH_TYPE::DASHDOT ); + wire->SetLineStyle( LINE_STYLE::DASHDOT ); else if( buf == wxT( "dotted" ) ) - wire->SetLineStyle( PLOT_DASH_TYPE::DOT ); + wire->SetLineStyle( LINE_STYLE::DOT ); } else // should be the color parameter. { diff --git a/eeschema/sch_plugins/ltspice/ltspice_sch_parser.cpp b/eeschema/sch_plugins/ltspice/ltspice_sch_parser.cpp index 7c63931a26..541a64b077 100644 --- a/eeschema/sch_plugins/ltspice/ltspice_sch_parser.cpp +++ b/eeschema/sch_plugins/ltspice/ltspice_sch_parser.cpp @@ -449,7 +449,7 @@ void LTSPICE_SCH_PARSER::CreateWires( LTSPICE_SCHEMATIC::LT_SYMBOL& aLTSymbol, i SCH_LINE* segment = new SCH_LINE(); segment->SetLineWidth( getLineWidth( LTSPICE_SCHEMATIC::LINEWIDTH::Normal ) ); - segment->SetLineStyle( PLOT_DASH_TYPE::SOLID ); + segment->SetLineStyle( LINE_STYLE::SOLID ); segment->SetStartPoint( aLTSymbol.Wires[aIndex].Start ); segment->SetEndPoint( aLTSymbol.Wires[aIndex].End ); @@ -669,16 +669,16 @@ int LTSPICE_SCH_PARSER::getLineWidth( const LTSPICE_SCHEMATIC::LINEWIDTH& aLineW } -PLOT_DASH_TYPE LTSPICE_SCH_PARSER::getLineStyle( const LTSPICE_SCHEMATIC::LINESTYLE& aLineStyle ) +LINE_STYLE LTSPICE_SCH_PARSER::getLineStyle( const LTSPICE_SCHEMATIC::LINESTYLE& aLineStyle ) { switch( aLineStyle ) { - case LTSPICE_SCHEMATIC::LINESTYLE::SOLID: return PLOT_DASH_TYPE::SOLID; - case LTSPICE_SCHEMATIC::LINESTYLE::DOT: return PLOT_DASH_TYPE::DOT; - case LTSPICE_SCHEMATIC::LINESTYLE::DASHDOTDOT: return PLOT_DASH_TYPE::DASHDOTDOT; - case LTSPICE_SCHEMATIC::LINESTYLE::DASHDOT: return PLOT_DASH_TYPE::DASHDOT; - case LTSPICE_SCHEMATIC::LINESTYLE::DASH: return PLOT_DASH_TYPE::DASH; - default: return PLOT_DASH_TYPE::SOLID; + case LTSPICE_SCHEMATIC::LINESTYLE::SOLID: return LINE_STYLE::SOLID; + case LTSPICE_SCHEMATIC::LINESTYLE::DOT: return LINE_STYLE::DOT; + case LTSPICE_SCHEMATIC::LINESTYLE::DASHDOTDOT: return LINE_STYLE::DASHDOTDOT; + case LTSPICE_SCHEMATIC::LINESTYLE::DASHDOT: return LINE_STYLE::DASHDOT; + case LTSPICE_SCHEMATIC::LINESTYLE::DASH: return LINE_STYLE::DASH; + default: return LINE_STYLE::SOLID; } } @@ -797,7 +797,7 @@ void LTSPICE_SCH_PARSER::CreateWire( LTSPICE_SCHEMATIC::LT_ASC& aAscfile, int aI SCH_LINE* segment = new SCH_LINE(); segment->SetLineWidth( getLineWidth( LTSPICE_SCHEMATIC::LINEWIDTH::Normal ) ); - segment->SetLineStyle( PLOT_DASH_TYPE::SOLID ); + segment->SetLineStyle( LINE_STYLE::SOLID ); segment->SetLayer( aLayer ); segment->SetStartPoint( ToKicadCoords( aAscfile.Wires[aIndex].Start ) + m_originOffset ); @@ -822,7 +822,7 @@ SCH_SYMBOL* LTSPICE_SCH_PARSER::CreatePowerSymbol( const VECTOR2I& aOffset, cons shape->AddPoint( ToInvertedKicadCoords( { 0, 15 } ) ); shape->SetStroke( STROKE_PARAMS( getLineWidth( LTSPICE_SCHEMATIC::LINEWIDTH::Normal ), - PLOT_DASH_TYPE::SOLID ) ); + LINE_STYLE::SOLID ) ); lib_symbol->AddDrawItem( shape ); lib_symbol->SetPower(); diff --git a/eeschema/sch_plugins/ltspice/ltspice_sch_parser.h b/eeschema/sch_plugins/ltspice/ltspice_sch_parser.h index 1187ece9eb..d031c7421e 100644 --- a/eeschema/sch_plugins/ltspice/ltspice_sch_parser.h +++ b/eeschema/sch_plugins/ltspice/ltspice_sch_parser.h @@ -279,7 +279,7 @@ public: private: int getLineWidth( const LTSPICE_SCHEMATIC::LINEWIDTH& aLineWidth ); - PLOT_DASH_TYPE getLineStyle( const LTSPICE_SCHEMATIC::LINESTYLE& aLineStyle ); + LINE_STYLE getLineStyle( const LTSPICE_SCHEMATIC::LINESTYLE& aLineStyle ); STROKE_PARAMS getStroke( const LTSPICE_SCHEMATIC::LINEWIDTH& aLineWidth, const LTSPICE_SCHEMATIC::LINESTYLE& aLineStyle ); diff --git a/eeschema/sch_shape.cpp b/eeschema/sch_shape.cpp index 4c5334dc68..8c47fb50c1 100644 --- a/eeschema/sch_shape.cpp +++ b/eeschema/sch_shape.cpp @@ -204,7 +204,7 @@ void SCH_SHAPE::Plot( PLOTTER* aPlotter, bool aBackground, UNIMPLEMENTED_FOR( SHAPE_T_asString() ); } - aPlotter->SetDash( pen_size, PLOT_DASH_TYPE::SOLID ); + aPlotter->SetDash( pen_size, LINE_STYLE::SOLID ); } } @@ -371,7 +371,7 @@ void SCH_SHAPE::Print( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset if( penWidth > 0 ) { - if( GetEffectiveLineStyle() == PLOT_DASH_TYPE::SOLID ) + if( GetEffectiveLineStyle() == LINE_STYLE::SOLID ) { switch( GetShape() ) { diff --git a/eeschema/sch_shape.h b/eeschema/sch_shape.h index 0ed7367d62..5acff64191 100644 --- a/eeschema/sch_shape.h +++ b/eeschema/sch_shape.h @@ -64,12 +64,12 @@ public: STROKE_PARAMS GetStroke() const override { return m_stroke; } void SetStroke( const STROKE_PARAMS& aStroke ) override; - PLOT_DASH_TYPE GetEffectiveLineStyle() const + LINE_STYLE GetEffectiveLineStyle() const { - if( m_stroke.GetPlotStyle() == PLOT_DASH_TYPE::DEFAULT ) - return PLOT_DASH_TYPE::SOLID; + if( m_stroke.GetLineStyle() == LINE_STYLE::DEFAULT ) + return LINE_STYLE::SOLID; else - return m_stroke.GetPlotStyle(); + return m_stroke.GetLineStyle(); } const BOX2I GetBoundingBox() const override { return getBoundingBox(); } diff --git a/eeschema/sch_textbox.cpp b/eeschema/sch_textbox.cpp index 41ed66c8bb..7cb9adba4a 100644 --- a/eeschema/sch_textbox.cpp +++ b/eeschema/sch_textbox.cpp @@ -233,13 +233,13 @@ KIFONT::FONT* SCH_TEXTBOX::getDrawFont() const void SCH_TEXTBOX::Print( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset ) { - wxDC* DC = aSettings->GetPrintDC(); - int penWidth = GetPenWidth(); - bool blackAndWhiteMode = GetGRForceBlackPenState(); - VECTOR2I pt1 = GetStart(); - VECTOR2I pt2 = GetEnd(); - COLOR4D color = GetStroke().GetColor(); - PLOT_DASH_TYPE lineStyle = GetStroke().GetPlotStyle(); + wxDC* DC = aSettings->GetPrintDC(); + int penWidth = GetPenWidth(); + bool blackAndWhiteMode = GetGRForceBlackPenState(); + VECTOR2I pt1 = GetStart(); + VECTOR2I pt2 = GetEnd(); + COLOR4D color = GetStroke().GetColor(); + LINE_STYLE lineStyle = GetStroke().GetLineStyle(); if( GetFillMode() == FILL_T::FILLED_WITH_COLOR && !blackAndWhiteMode ) GRFilledRect( DC, pt1, pt2, 0, GetFillColor(), GetFillColor() ); @@ -251,10 +251,10 @@ void SCH_TEXTBOX::Print( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffs if( blackAndWhiteMode || color == COLOR4D::UNSPECIFIED ) color = aSettings->GetLayerColor( m_layer ); - if( lineStyle == PLOT_DASH_TYPE::DEFAULT ) - lineStyle = PLOT_DASH_TYPE::SOLID; + if( lineStyle == LINE_STYLE::DEFAULT ) + lineStyle = LINE_STYLE::SOLID; - if( lineStyle == PLOT_DASH_TYPE::SOLID ) + if( lineStyle == LINE_STYLE::SOLID ) { GRRect( DC, pt1, pt2, penWidth, color ); } @@ -385,7 +385,7 @@ void SCH_TEXTBOX::Plot( PLOTTER* aPlotter, bool aBackground, RENDER_SETTINGS* settings = aPlotter->RenderSettings(); int penWidth = GetPenWidth(); COLOR4D color = GetStroke().GetColor(); - PLOT_DASH_TYPE lineStyle = GetStroke().GetPlotStyle(); + LINE_STYLE lineStyle = GetStroke().GetLineStyle(); if( penWidth > 0 ) { @@ -394,13 +394,13 @@ void SCH_TEXTBOX::Plot( PLOTTER* aPlotter, bool aBackground, if( !aPlotter->GetColorMode() || color == COLOR4D::UNSPECIFIED ) color = settings->GetLayerColor( m_layer ); - if( lineStyle == PLOT_DASH_TYPE::DEFAULT ) - lineStyle = PLOT_DASH_TYPE::SOLID; + if( lineStyle == LINE_STYLE::DEFAULT ) + lineStyle = LINE_STYLE::SOLID; aPlotter->SetColor( color ); aPlotter->SetDash( penWidth, lineStyle ); aPlotter->Rect( m_start, m_end, FILL_T::NO_FILL, penWidth ); - aPlotter->SetDash( penWidth, PLOT_DASH_TYPE::SOLID ); + aPlotter->SetDash( penWidth, LINE_STYLE::SOLID ); } KIFONT::FONT* font = GetFont(); diff --git a/eeschema/tools/sch_drawing_tools.cpp b/eeschema/tools/sch_drawing_tools.cpp index e07ef67fb0..e5bb3f5a18 100644 --- a/eeschema/tools/sch_drawing_tools.cpp +++ b/eeschema/tools/sch_drawing_tools.cpp @@ -79,8 +79,8 @@ SCH_DRAWING_TOOLS::SCH_DRAWING_TOOLS() : m_lastTextboxFillStyle( FILL_T::NO_FILL ), m_lastFillColor( COLOR4D::UNSPECIFIED ), m_lastTextboxFillColor( COLOR4D::UNSPECIFIED ), - m_lastStroke( 0, PLOT_DASH_TYPE::DEFAULT, COLOR4D::UNSPECIFIED ), - m_lastTextboxStroke( 0, PLOT_DASH_TYPE::DEFAULT, COLOR4D::UNSPECIFIED ), + m_lastStroke( 0, LINE_STYLE::DEFAULT, COLOR4D::UNSPECIFIED ), + m_lastTextboxStroke( 0, LINE_STYLE::DEFAULT, COLOR4D::UNSPECIFIED ), m_mruPath( wxEmptyString ), m_lastAutoLabelRotateOnPlacement( false ), m_inDrawingTool( false ) diff --git a/eeschema/tools/symbol_editor_drawing_tools.cpp b/eeschema/tools/symbol_editor_drawing_tools.cpp index a1b483396c..89dd0dcf6e 100644 --- a/eeschema/tools/symbol_editor_drawing_tools.cpp +++ b/eeschema/tools/symbol_editor_drawing_tools.cpp @@ -54,7 +54,7 @@ SYMBOL_EDITOR_DRAWING_TOOLS::SYMBOL_EDITOR_DRAWING_TOOLS() : m_lastTextJust( GR_TEXT_H_ALIGN_LEFT ), m_lastFillStyle( FILL_T::NO_FILL ), m_lastFillColor( COLOR4D::UNSPECIFIED ), - m_lastStroke( 0, PLOT_DASH_TYPE::DEFAULT, COLOR4D::UNSPECIFIED ), + m_lastStroke( 0, LINE_STYLE::DEFAULT, COLOR4D::UNSPECIFIED ), m_drawSpecificConvert( true ), m_drawSpecificUnit( false ), m_inDrawShape( false ), diff --git a/include/eda_shape.h b/include/eda_shape.h index b0788ca723..bc88ffe3b2 100644 --- a/include/eda_shape.h +++ b/include/eda_shape.h @@ -110,8 +110,8 @@ public: virtual int GetWidth() const { return m_stroke.GetWidth(); } virtual int GetEffectiveWidth() const { return GetWidth(); } - void SetLineStyle( const PLOT_DASH_TYPE aStyle ); - PLOT_DASH_TYPE GetLineStyle() const; + void SetLineStyle( const LINE_STYLE aStyle ); + LINE_STYLE GetLineStyle() const; void SetLineColor( const COLOR4D& aColor ) { m_stroke.SetColor( aColor ); } COLOR4D GetLineColor() const { return m_stroke.GetColor(); } @@ -415,7 +415,7 @@ protected: #ifndef SWIG DECLARE_ENUM_TO_WXANY( SHAPE_T ); -DECLARE_ENUM_TO_WXANY( PLOT_DASH_TYPE ); +DECLARE_ENUM_TO_WXANY( LINE_STYLE ); #endif #endif // EDA_SHAPE_H diff --git a/include/plotters/plotter.h b/include/plotters/plotter.h index 637ebb9845..663e1c2117 100644 --- a/include/plotters/plotter.h +++ b/include/plotters/plotter.h @@ -148,7 +148,7 @@ public: virtual void SetColor( const COLOR4D& color ) = 0; - virtual void SetDash( int aLineWidth, PLOT_DASH_TYPE aLineStyle ) = 0; + virtual void SetDash( int aLineWidth, LINE_STYLE aLineStyle ) = 0; virtual void SetCreator( const wxString& aCreator ) { m_creator = aCreator; } diff --git a/include/plotters/plotter_dxf.h b/include/plotters/plotter_dxf.h index cd15b8b05e..b564f88f8f 100644 --- a/include/plotters/plotter_dxf.h +++ b/include/plotters/plotter_dxf.h @@ -29,7 +29,7 @@ public: { m_textAsLines = true; m_currentColor = COLOR4D::BLACK; - m_currentLineType = PLOT_DASH_TYPE::SOLID; + m_currentLineType = LINE_STYLE::SOLID; SetUnits( DXF_UNITS::INCHES ); } @@ -64,7 +64,7 @@ public: m_currentPenWidth = 0; } - virtual void SetDash( int aLineWidth, PLOT_DASH_TYPE aLineStyle ) override; + virtual void SetDash( int aLineWidth, LINE_STYLE aLineStyle ) override; /** * The DXF exporter handles 'colors' as layers... @@ -214,11 +214,11 @@ protected: void plotOneLineOfText( const VECTOR2I& aPos, const COLOR4D& aColor, const wxString& aText, const TEXT_ATTRIBUTES& aAttrs ); - bool m_textAsLines; - COLOR4D m_currentColor; - PLOT_DASH_TYPE m_currentLineType; + bool m_textAsLines; + COLOR4D m_currentColor; + LINE_STYLE m_currentLineType; - DXF_UNITS m_plotUnits; - double m_unitScalingFactor; - unsigned int m_measurementDirective; + DXF_UNITS m_plotUnits; + double m_unitScalingFactor; + unsigned int m_measurementDirective; }; diff --git a/include/plotters/plotter_gerber.h b/include/plotters/plotter_gerber.h index 62bdbe8954..0c8d249952 100644 --- a/include/plotters/plotter_gerber.h +++ b/include/plotters/plotter_gerber.h @@ -49,7 +49,7 @@ public: virtual void SetCurrentLineWidth( int aLineWidth, void* aData = nullptr ) override; // RS274X has no dashing, nor colors - virtual void SetDash( int aLineWidth, PLOT_DASH_TYPE aLineStyle ) override + virtual void SetDash( int aLineWidth, LINE_STYLE aLineStyle ) override { } diff --git a/include/plotters/plotter_hpgl.h b/include/plotters/plotter_hpgl.h index 594abe5df3..063814b49f 100644 --- a/include/plotters/plotter_hpgl.h +++ b/include/plotters/plotter_hpgl.h @@ -78,7 +78,7 @@ public: /** * HPGL supports dashed lines. */ - virtual void SetDash( int aLineWidth, PLOT_DASH_TYPE aLineStyle ) override; + virtual void SetDash( int aLineWidth, LINE_STYLE aLineStyle ) override; virtual void SetColor( const COLOR4D& color ) override {} @@ -174,33 +174,33 @@ protected: lift_after( false ), pen_returns( false ), pen( 0 ), - dashType( PLOT_DASH_TYPE::SOLID ) {} + dashType( LINE_STYLE::SOLID ) {} /// Location the pen should start at - VECTOR2D loc_start; + VECTOR2D loc_start; /// Location the pen will be at when it finishes. If this is not known, /// leave it equal to loc_start and set lift_after. - VECTOR2D loc_end; + VECTOR2D loc_end; /// Bounding box of this item - BOX2D bbox; + BOX2D bbox; /// Whether the command should be executed with the pen lifted - bool lift_before; + bool lift_before; /// Whether the pen must be lifted after the command. If the location of the pen /// is not known, this must be set (so that another command starting at loc_end /// is not immediately executed with no lift). - bool lift_after; + bool lift_after; /// Whether the pen returns to its original state after the command. Otherwise, /// the pen is assumed to be down following the command. - bool pen_returns; + bool pen_returns; - int pen; /// Pen number for this command - PLOT_DASH_TYPE dashType; /// Line style for this command - wxString content; /// Text of the command + int pen; /// Pen number for this command + LINE_STYLE dashType; /// Line style for this command + wxString content; /// Text of the command }; /// Sort a list of HPGL items to improve plotting speed on mechanical plotters. @@ -209,7 +209,7 @@ protected: static void sortItems( std::list& items ); /// Return the plot command corresponding to a line type - static const char* lineStyleCommand( PLOT_DASH_TYPE aLineStyle ); + static const char* lineStyleCommand( LINE_STYLE aLineStyle ); protected: int m_penSpeed; @@ -217,7 +217,7 @@ protected: double m_penDiameter; double m_arcTargetChordLength; EDA_ANGLE m_arcMinChordDegrees; - PLOT_DASH_TYPE m_lineStyle; + LINE_STYLE m_lineStyle; bool m_useUserCoords; bool m_fitUserCoords; diff --git a/include/plotters/plotters_pslike.h b/include/plotters/plotters_pslike.h index 88268c075c..5a7398fd42 100644 --- a/include/plotters/plotters_pslike.h +++ b/include/plotters/plotters_pslike.h @@ -184,7 +184,7 @@ public: /** * PostScript supports dashed lines. */ - virtual void SetDash( int aLineWidth, PLOT_DASH_TYPE aLineStyle ) override; + virtual void SetDash( int aLineWidth, LINE_STYLE aLineStyle ) override; virtual void SetViewport( const VECTOR2I& aOffset, double aIusPerDecimil, double aScale, bool aMirror ) override; @@ -303,7 +303,7 @@ public: /** * PDF supports dashed lines */ - virtual void SetDash( int aLineWidth, PLOT_DASH_TYPE aLineStyle ) override; + virtual void SetDash( int aLineWidth, LINE_STYLE aLineStyle ) override; /** * PDF can have multiple pages, so SetPageSettings can be called @@ -542,7 +542,7 @@ public: /** * SVG supports dashed lines. */ - virtual void SetDash( int aLineWidth, PLOT_DASH_TYPE aLineStyle ) override; + virtual void SetDash( int aLineWidth, LINE_STYLE aLineStyle ) override; virtual void SetViewport( const VECTOR2I& aOffset, double aIusPerDecimil, double aScale, bool aMirror ) override; @@ -641,21 +641,18 @@ protected: */ void setFillMode( FILL_T fill ); - FILL_T 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 - // grouped in a 3x8 bits value - // (written in hex to svg files) - long m_brush_rgb_color; // same as m_pen_rgb_color, used to fill - // some contours. - double m_brush_alpha; - bool m_graphics_changed; // true if a pen/brush parameter is modified - // color, pen size, fill mode ... - // the new SVG stype must be output on file - PLOT_DASH_TYPE m_dashed; // plot line style - unsigned m_precision; // How fine the step size is - // Use 3-6 (3 means um precision, 6 nm precision) in PcbNew - // 3-4 in other modules (avoid values >4 to avoid overflow) - // see also comment for m_useInch. + FILL_T 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 grouped in a 3x8 bits value (written + // in hex to svg files) + long m_brush_rgb_color; // same as m_pen_rgb_color, used to fill some contours. + double m_brush_alpha; + bool m_graphics_changed; // true if a pen/brush parameter is modified color, pen size, + // fill mode ... the new SVG stype must be output on file + LINE_STYLE m_dashed; // plot line style + unsigned m_precision; // How fine the step size is + // Use 3-6 (3 means um precision, 6 nm precision) in PcbNew + // 3-4 in other modules (avoid values >4 to avoid overflow) + // see also comment for m_useInch. }; diff --git a/include/stroke_params.h b/include/stroke_params.h index 3f6772590c..a0422e7625 100644 --- a/include/stroke_params.h +++ b/include/stroke_params.h @@ -44,7 +44,7 @@ class RENDER_SETTINGS; /** * Dashed line types. */ -enum class PLOT_DASH_TYPE +enum class LINE_STYLE { DEFAULT = -1, SOLID = 0, @@ -57,7 +57,7 @@ enum class PLOT_DASH_TYPE }; -struct lineTypeStruct +struct LINE_STYLE_DESC { wxString name; const BITMAPS bitmap; @@ -65,9 +65,9 @@ struct lineTypeStruct /* - * Conversion map between PLOT_DASH_TYPE values and style names displayed + * Conversion map between LINE_STYLE values and style names displayed */ -extern const std::map lineTypeNames; +extern const std::map lineTypeNames; #define DEFAULT_STYLE _( "Default" ) @@ -80,10 +80,10 @@ extern const std::map lineTypeNames; class STROKE_PARAMS { public: - STROKE_PARAMS( int aWidth = 0, PLOT_DASH_TYPE aPlotStyle = PLOT_DASH_TYPE::DEFAULT, + STROKE_PARAMS( int aWidth = 0, LINE_STYLE aLineStyle = LINE_STYLE::DEFAULT, const KIGFX::COLOR4D& aColor = KIGFX::COLOR4D::UNSPECIFIED ) : m_width( aWidth ), - m_plotstyle( aPlotStyle ), + m_lineStyle( aLineStyle ), m_color( aColor ) { } @@ -91,8 +91,8 @@ public: int GetWidth() const { return m_width; } void SetWidth( int aWidth ) { m_width = aWidth; } - PLOT_DASH_TYPE GetPlotStyle() const { return m_plotstyle; } - void SetPlotStyle( PLOT_DASH_TYPE aPlotStyle ) { m_plotstyle = aPlotStyle; } + LINE_STYLE GetLineStyle() const { return m_lineStyle; } + void SetLineStyle( LINE_STYLE aLineStyle ) { m_lineStyle = aLineStyle; } KIGFX::COLOR4D GetColor() const { return m_color; } void SetColor( const KIGFX::COLOR4D& aColor ) { m_color = aColor; } @@ -100,7 +100,7 @@ public: bool operator!=( const STROKE_PARAMS& aOther ) { return m_width != aOther.m_width - || m_plotstyle != aOther.m_plotstyle + || m_lineStyle != aOther.m_lineStyle || m_color != aOther.m_color; } @@ -111,15 +111,15 @@ public: // Helper functions - static wxString GetLineStyleToken( PLOT_DASH_TYPE aStyle ); + static wxString GetLineStyleToken( LINE_STYLE aStyle ); - static void Stroke( const SHAPE* aShape, PLOT_DASH_TYPE aLineStyle, int aWidth, + static void Stroke( const SHAPE* aShape, LINE_STYLE aLineStyle, int aWidth, const KIGFX::RENDER_SETTINGS* aRenderSettings, std::function aStroker ); private: int m_width; - PLOT_DASH_TYPE m_plotstyle; + LINE_STYLE m_lineStyle; KIGFX::COLOR4D m_color; }; diff --git a/pcbnew/dialogs/dialog_shape_properties.cpp b/pcbnew/dialogs/dialog_shape_properties.cpp index dd1a23927b..fe9ef7ceed 100644 --- a/pcbnew/dialogs/dialog_shape_properties.cpp +++ b/pcbnew/dialogs/dialog_shape_properties.cpp @@ -137,8 +137,8 @@ DIALOG_SHAPE_PROPERTIES::DIALOG_SHAPE_PROPERTIES( PCB_BASE_EDIT_FRAME* aParent, m_LayerSelectionCtrl->SetNotAllowedLayerSet( forbiddenLayers ); } - for( const std::pair& typeEntry : lineTypeNames ) - m_lineStyleCombo->Append( typeEntry.second.name, KiBitmap( typeEntry.second.bitmap ) ); + for( const auto& [ lineStyle, lineStyleDesc ] : lineTypeNames ) + m_lineStyleCombo->Append( lineStyleDesc.name, KiBitmap( lineStyleDesc.bitmap ) ); m_lineStyleCombo->Append( DEFAULT_STYLE ); @@ -248,10 +248,10 @@ void DIALOG_SHAPE_PROPERTIES::onFilledCheckbox( wxCommandEvent& event ) } else { - PLOT_DASH_TYPE style = m_item->GetStroke().GetPlotStyle(); + LINE_STYLE style = m_item->GetStroke().GetLineStyle(); - if( style == PLOT_DASH_TYPE::DEFAULT ) - style = PLOT_DASH_TYPE::SOLID; + if( style == LINE_STYLE::DEFAULT ) + style = LINE_STYLE::SOLID; if( (int) style < (int) lineTypeNames.size() ) m_lineStyleCombo->SetSelection( (int) style ); @@ -325,7 +325,7 @@ bool DIALOG_SHAPE_PROPERTIES::TransferDataToWindow() m_thickness.SetValue( m_item->GetStroke().GetWidth() ); - int style = static_cast( m_item->GetStroke().GetPlotStyle() ); + int style = static_cast( m_item->GetStroke().GetLineStyle() ); if( style == -1 ) m_lineStyleCombo->SetStringSelection( DEFAULT_STYLE ); @@ -499,9 +499,9 @@ bool DIALOG_SHAPE_PROPERTIES::TransferDataFromWindow() std::advance( it, m_lineStyleCombo->GetSelection() ); if( it == lineTypeNames.end() ) - stroke.SetPlotStyle( PLOT_DASH_TYPE::DEFAULT ); + stroke.SetLineStyle( LINE_STYLE::DEFAULT ); else - stroke.SetPlotStyle( it->first ); + stroke.SetLineStyle( it->first ); m_item->SetStroke( stroke ); diff --git a/pcbnew/dialogs/dialog_textbox_properties.cpp b/pcbnew/dialogs/dialog_textbox_properties.cpp index ed40ca5dd1..2cfd25a13c 100644 --- a/pcbnew/dialogs/dialog_textbox_properties.cpp +++ b/pcbnew/dialogs/dialog_textbox_properties.cpp @@ -126,8 +126,8 @@ DIALOG_TEXTBOX_PROPERTIES::DIALOG_TEXTBOX_PROPERTIES( PCB_BASE_EDIT_FRAME* aPare for( size_t ii = 0; ii < m_OrientCtrl->GetCount() && ii < 4; ++ii ) m_OrientCtrl->SetString( ii, wxString::Format( "%.1f", rot_list[ii] ) ); - for( const std::pair& typeEntry : lineTypeNames ) - m_borderStyleCombo->Append( typeEntry.second.name, KiBitmap( typeEntry.second.bitmap ) ); + for( const auto& [ lineStyle, lineStyleDesc ] : lineTypeNames ) + m_borderStyleCombo->Append( lineStyleDesc.name, KiBitmap( lineStyleDesc.bitmap ) ); m_borderStyleCombo->Append( DEFAULT_STYLE ); @@ -201,10 +201,10 @@ bool DIALOG_TEXTBOX_PROPERTIES::TransferDataToWindow() if( m_textBox->IsBorderEnabled() ) m_borderWidth.SetValue( stroke.GetWidth() ); - PLOT_DASH_TYPE style = stroke.GetPlotStyle(); + LINE_STYLE style = stroke.GetLineStyle(); - if( style == PLOT_DASH_TYPE::DEFAULT ) - style = PLOT_DASH_TYPE::SOLID; + if( style == LINE_STYLE::DEFAULT ) + style = LINE_STYLE::SOLID; if( (int) style < (int) lineTypeNames.size() ) m_borderStyleCombo->SetSelection( (int) style ); @@ -367,9 +367,9 @@ bool DIALOG_TEXTBOX_PROPERTIES::TransferDataFromWindow() std::advance( it, m_borderStyleCombo->GetSelection() ); if( it == lineTypeNames.end() ) - stroke.SetPlotStyle( PLOT_DASH_TYPE::DEFAULT ); + stroke.SetLineStyle( LINE_STYLE::DEFAULT ); else - stroke.SetPlotStyle( it->first ); + stroke.SetLineStyle( it->first ); m_textBox->SetStroke( stroke ); diff --git a/pcbnew/microwave/microwave_inductor.cpp b/pcbnew/microwave/microwave_inductor.cpp index e6e0e88c28..ec10a48c16 100644 --- a/pcbnew/microwave/microwave_inductor.cpp +++ b/pcbnew/microwave/microwave_inductor.cpp @@ -420,7 +420,7 @@ FOOTPRINT* MICROWAVE_TOOL::createMicrowaveInductor( MICROWAVE_INDUCTOR_PATTERN& PCB_SHAPE* seg = new PCB_SHAPE( footprint, SHAPE_T::SEGMENT ); seg->SetStart( buffer[jj - 1] ); seg->SetEnd( buffer[jj] ); - seg->SetStroke( STROKE_PARAMS( aInductorPattern.m_Width, PLOT_DASH_TYPE::SOLID ) ); + seg->SetStroke( STROKE_PARAMS( aInductorPattern.m_Width, LINE_STYLE::SOLID ) ); seg->SetLayer( footprint->GetLayer() ); footprint->Add( seg ); } diff --git a/pcbnew/microwave/microwave_polygon.cpp b/pcbnew/microwave/microwave_polygon.cpp index 6314944fd8..7332431beb 100644 --- a/pcbnew/microwave/microwave_polygon.cpp +++ b/pcbnew/microwave/microwave_polygon.cpp @@ -386,7 +386,7 @@ FOOTPRINT* MICROWAVE_TOOL::createPolygonShape() // Set the polygon outline thickness to 0, only the polygonal shape is filled // without extra thickness. - shape->SetStroke( STROKE_PARAMS( 0, PLOT_DASH_TYPE::SOLID ) ); + shape->SetStroke( STROKE_PARAMS( 0, LINE_STYLE::SOLID ) ); g_PolyEdges.clear(); editFrame.OnModify(); diff --git a/pcbnew/pad_custom_shape_functions.cpp b/pcbnew/pad_custom_shape_functions.cpp index daffbe58a0..64cb290609 100644 --- a/pcbnew/pad_custom_shape_functions.cpp +++ b/pcbnew/pad_custom_shape_functions.cpp @@ -55,7 +55,7 @@ void PAD::AddPrimitivePoly( const SHAPE_POLY_SET& aPoly, int aThickness, bool aF item->SetShape( SHAPE_T::POLY ); item->SetFilled( aFilled ); item->SetPolyShape( poly_outline ); - item->SetStroke( STROKE_PARAMS( aThickness, PLOT_DASH_TYPE::SOLID ) ); + item->SetStroke( STROKE_PARAMS( aThickness, LINE_STYLE::SOLID ) ); item->SetParent( this ); m_editPrimitives.emplace_back( item ); } @@ -69,7 +69,7 @@ void PAD::AddPrimitivePoly( const std::vector& aPoly, int aThickness, PCB_SHAPE* item = new PCB_SHAPE( nullptr, SHAPE_T::POLY ); item->SetFilled( aFilled ); item->SetPolyPoints( aPoly ); - item->SetStroke( STROKE_PARAMS( aThickness, PLOT_DASH_TYPE::SOLID ) ); + item->SetStroke( STROKE_PARAMS( aThickness, LINE_STYLE::SOLID ) ); item->SetParent( this ); m_editPrimitives.emplace_back( item ); SetDirty(); diff --git a/pcbnew/pcb_painter.cpp b/pcbnew/pcb_painter.cpp index bd4cd69e45..4c15a52067 100644 --- a/pcbnew/pcb_painter.cpp +++ b/pcbnew/pcb_painter.cpp @@ -1689,10 +1689,10 @@ void PCB_PAINTER::draw( const PAD* aPad, int aLayer ) void PCB_PAINTER::draw( const PCB_SHAPE* aShape, int aLayer ) { - COLOR4D color = m_pcbSettings.GetColor( aShape, aLayer ); - bool outline_mode = !viewer_settings()->m_ViewersDisplay.m_DisplayGraphicsFill; - int thickness = getLineThickness( aShape->GetWidth() ); - PLOT_DASH_TYPE lineStyle = aShape->GetStroke().GetPlotStyle(); + COLOR4D color = m_pcbSettings.GetColor( aShape, aLayer ); + bool outline_mode = !viewer_settings()->m_ViewersDisplay.m_DisplayGraphicsFill; + int thickness = getLineThickness( aShape->GetWidth() ); + LINE_STYLE lineStyle = aShape->GetStroke().GetLineStyle(); if( IsNetnameLayer( aLayer ) ) { @@ -1735,7 +1735,7 @@ void PCB_PAINTER::draw( const PCB_SHAPE* aShape, int aLayer ) m_gal->SetFillColor( color ); m_gal->SetStrokeColor( color ); - if( lineStyle <= PLOT_DASH_TYPE::FIRST_TYPE ) + if( lineStyle <= LINE_STYLE::FIRST_TYPE ) { switch( aShape->GetShape() ) { @@ -2134,7 +2134,7 @@ void PCB_PAINTER::draw( const PCB_TEXTBOX* aTextBox, int aLayer ) { const COLOR4D& color = m_pcbSettings.GetColor( aTextBox, aLayer ); int thickness = getLineThickness( aTextBox->GetWidth() ); - PLOT_DASH_TYPE lineStyle = aTextBox->GetStroke().GetPlotStyle(); + LINE_STYLE lineStyle = aTextBox->GetStroke().GetLineStyle(); wxString resolvedText( aTextBox->GetShownText( true ) ); KIFONT::FONT* font = aTextBox->GetFont(); @@ -2178,7 +2178,7 @@ void PCB_PAINTER::draw( const PCB_TEXTBOX* aTextBox, int aLayer ) if( aTextBox->IsBorderEnabled() ) { - if( lineStyle <= PLOT_DASH_TYPE::FIRST_TYPE ) + if( lineStyle <= LINE_STYLE::FIRST_TYPE ) { if( thickness > 0 ) { diff --git a/pcbnew/pcb_textbox.cpp b/pcbnew/pcb_textbox.cpp index 68d7661639..de7450690b 100644 --- a/pcbnew/pcb_textbox.cpp +++ b/pcbnew/pcb_textbox.cpp @@ -647,16 +647,16 @@ static struct PCB_TEXTBOX_DESC { PCB_TEXTBOX_DESC() { - ENUM_MAP& plotDashTypeEnum = ENUM_MAP::Instance(); + ENUM_MAP& plotDashTypeEnum = ENUM_MAP::Instance(); if( plotDashTypeEnum.Choices().GetCount() == 0 ) { - plotDashTypeEnum.Map( PLOT_DASH_TYPE::DEFAULT, _HKI( "Default" ) ) - .Map( PLOT_DASH_TYPE::SOLID, _HKI( "Solid" ) ) - .Map( PLOT_DASH_TYPE::DASH, _HKI( "Dashed" ) ) - .Map( PLOT_DASH_TYPE::DOT, _HKI( "Dotted" ) ) - .Map( PLOT_DASH_TYPE::DASHDOT, _HKI( "Dash-Dot" ) ) - .Map( PLOT_DASH_TYPE::DASHDOTDOT, _HKI( "Dash-Dot-Dot" ) ); + plotDashTypeEnum.Map( LINE_STYLE::DEFAULT, _HKI( "Default" ) ) + .Map( LINE_STYLE::SOLID, _HKI( "Solid" ) ) + .Map( LINE_STYLE::DASH, _HKI( "Dashed" ) ) + .Map( LINE_STYLE::DOT, _HKI( "Dotted" ) ) + .Map( LINE_STYLE::DASHDOT, _HKI( "Dash-Dot" ) ) + .Map( LINE_STYLE::DASHDOTDOT, _HKI( "Dash-Dot-Dot" ) ); } PROPERTY_MANAGER& propMgr = PROPERTY_MANAGER::Instance(); @@ -677,15 +677,15 @@ static struct PCB_TEXTBOX_DESC const wxString borderProps = _( "Border Properties" ); - void ( PCB_TEXTBOX::*lineStyleSetter )( PLOT_DASH_TYPE ) = &PCB_TEXTBOX::SetLineStyle; - PLOT_DASH_TYPE ( PCB_TEXTBOX::*lineStyleGetter )() const = &PCB_TEXTBOX::GetLineStyle; + void ( PCB_TEXTBOX::*lineStyleSetter )( LINE_STYLE ) = &PCB_TEXTBOX::SetLineStyle; + LINE_STYLE ( PCB_TEXTBOX::*lineStyleGetter )() const = &PCB_TEXTBOX::GetLineStyle; propMgr.AddProperty( new PROPERTY( _HKI( "Border" ), &PCB_TEXTBOX::SetBorderEnabled, &PCB_TEXTBOX::IsBorderEnabled ), borderProps ); - propMgr.AddProperty( new PROPERTY_ENUM( _HKI( "Border Style" ), + propMgr.AddProperty( new PROPERTY_ENUM( _HKI( "Border Style" ), lineStyleSetter, lineStyleGetter ), borderProps ); diff --git a/pcbnew/plot_brditems_plotter.cpp b/pcbnew/plot_brditems_plotter.cpp index fb6cb425ee..fffcd84616 100644 --- a/pcbnew/plot_brditems_plotter.cpp +++ b/pcbnew/plot_brditems_plotter.cpp @@ -406,7 +406,7 @@ void BRDITEMS_PLOTTER::PlotDimension( const PCB_DIMENSION_BASE* aDim ) PCB_SHAPE temp_item; - temp_item.SetStroke( STROKE_PARAMS( aDim->GetLineThickness(), PLOT_DASH_TYPE::SOLID ) ); + temp_item.SetStroke( STROKE_PARAMS( aDim->GetLineThickness(), LINE_STYLE::SOLID ) ); temp_item.SetLayer( aDim->GetLayer() ); for( const std::shared_ptr& shape : aDim->GetShapes() ) @@ -459,7 +459,7 @@ void BRDITEMS_PLOTTER::PlotPcbTarget( const PCB_TARGET* aMire ) temp_item.SetShape( SHAPE_T::CIRCLE ); temp_item.SetFilled( false ); - temp_item.SetStroke( STROKE_PARAMS( aMire->GetWidth(), PLOT_DASH_TYPE::SOLID ) ); + temp_item.SetStroke( STROKE_PARAMS( aMire->GetWidth(), LINE_STYLE::SOLID ) ); temp_item.SetLayer( aMire->GetLayer() ); temp_item.SetStart( aMire->GetPosition() ); radius = aMire->GetSize() / 3; @@ -693,9 +693,9 @@ void BRDITEMS_PLOTTER::PlotShape( const PCB_SHAPE* aShape ) if( !m_layerMask[aShape->GetLayer()] ) return; - bool sketch = GetPlotMode() == SKETCH; - int thickness = aShape->GetWidth(); - PLOT_DASH_TYPE lineStyle = aShape->GetStroke().GetPlotStyle(); + bool sketch = GetPlotMode() == SKETCH; + int thickness = aShape->GetWidth(); + LINE_STYLE lineStyle = aShape->GetStroke().GetLineStyle(); m_plotter->SetColor( getColor( aShape->GetLayer() ) ); @@ -735,7 +735,7 @@ void BRDITEMS_PLOTTER::PlotShape( const PCB_SHAPE* aShape ) } } - if( lineStyle <= PLOT_DASH_TYPE::FIRST_TYPE ) + if( lineStyle <= LINE_STYLE::FIRST_TYPE ) { switch( aShape->GetShape() ) { diff --git a/pcbnew/plugins/altium/altium_pcb.cpp b/pcbnew/plugins/altium/altium_pcb.cpp index 65414ceca8..d5168a16f6 100644 --- a/pcbnew/plugins/altium/altium_pcb.cpp +++ b/pcbnew/plugins/altium/altium_pcb.cpp @@ -1010,7 +1010,7 @@ void ALTIUM_PCB::HelperCreateBoardOutline( const std::vector& aV HelperShapeLineChainFromAltiumVertices( lineChain, aVertices ); STROKE_PARAMS stroke( m_board->GetDesignSettings().GetLineThickness( Edge_Cuts ), - PLOT_DASH_TYPE::SOLID ); + LINE_STYLE::SOLID ); for( int i = 0; i <= lineChain.PointCount() && i != -1; i = lineChain.NextShape( i ) ) { @@ -1427,7 +1427,7 @@ void ALTIUM_PCB::HelperParseDimensions6Leader( const ADIMENSION6& aElem ) PCB_SHAPE* shape = new PCB_SHAPE( m_board, SHAPE_T::SEGMENT ); m_board->Add( shape, ADD_MODE::APPEND ); shape->SetLayer( klayer ); - shape->SetStroke( STROKE_PARAMS( aElem.linewidth, PLOT_DASH_TYPE::SOLID ) ); + shape->SetStroke( STROKE_PARAMS( aElem.linewidth, LINE_STYLE::SOLID ) ); shape->SetStart( last ); shape->SetEnd( aElem.referencePoint.at( i ) ); last = aElem.referencePoint.at( i ); @@ -1448,7 +1448,7 @@ void ALTIUM_PCB::HelperParseDimensions6Leader( const ADIMENSION6& aElem ) PCB_SHAPE* shape1 = new PCB_SHAPE( m_board, SHAPE_T::SEGMENT ); m_board->Add( shape1, ADD_MODE::APPEND ); shape1->SetLayer( klayer ); - shape1->SetStroke( STROKE_PARAMS( aElem.linewidth, PLOT_DASH_TYPE::SOLID ) ); + shape1->SetStroke( STROKE_PARAMS( aElem.linewidth, LINE_STYLE::SOLID ) ); shape1->SetStart( referencePoint0 ); shape1->SetEnd( referencePoint0 + arrVec ); @@ -1457,7 +1457,7 @@ void ALTIUM_PCB::HelperParseDimensions6Leader( const ADIMENSION6& aElem ) PCB_SHAPE* shape2 = new PCB_SHAPE( m_board, SHAPE_T::SEGMENT ); m_board->Add( shape2, ADD_MODE::APPEND ); shape2->SetLayer( klayer ); - shape2->SetStroke( STROKE_PARAMS( aElem.linewidth, PLOT_DASH_TYPE::SOLID ) ); + shape2->SetStroke( STROKE_PARAMS( aElem.linewidth, LINE_STYLE::SOLID ) ); shape2->SetStart( referencePoint0 ); shape2->SetEnd( referencePoint0 + arrVec ); } @@ -1499,7 +1499,7 @@ void ALTIUM_PCB::HelperParseDimensions6Datum( const ADIMENSION6& aElem ) PCB_SHAPE* shape = new PCB_SHAPE( m_board, SHAPE_T::SEGMENT ); m_board->Add( shape, ADD_MODE::APPEND ); shape->SetLayer( klayer ); - shape->SetStroke( STROKE_PARAMS( aElem.linewidth, PLOT_DASH_TYPE::SOLID ) ); + shape->SetStroke( STROKE_PARAMS( aElem.linewidth, LINE_STYLE::SOLID ) ); shape->SetStart( aElem.referencePoint.at( i ) ); // shape->SetEnd( /* TODO: seems to be based on TEXTY */ ); } @@ -2032,7 +2032,7 @@ void ALTIUM_PCB::ConvertShapeBasedRegions6ToBoardItem( const AREGION6& aElem ) shape->SetPolyShape( linechain ); shape->SetFilled( false ); shape->SetLayer( klayer ); - shape->SetStroke( STROKE_PARAMS( pcbIUScale.mmToIU( 0.1 ), PLOT_DASH_TYPE::DASH ) ); + shape->SetStroke( STROKE_PARAMS( pcbIUScale.mmToIU( 0.1 ), LINE_STYLE::DASH ) ); m_board->Add( shape, ADD_MODE::APPEND ); } @@ -2145,9 +2145,9 @@ void ALTIUM_PCB::ConvertShapeBasedRegions6ToFootprintItem( FOOTPRINT* aFoot shape->SetLayer( klayer ); if( aElem.kind == ALTIUM_REGION_KIND::DASHED_OUTLINE ) - shape->SetStroke( STROKE_PARAMS( pcbIUScale.mmToIU( 0.1 ), PLOT_DASH_TYPE::DASH ) ); + shape->SetStroke( STROKE_PARAMS( pcbIUScale.mmToIU( 0.1 ), LINE_STYLE::DASH ) ); else - shape->SetStroke( STROKE_PARAMS( pcbIUScale.mmToIU( 0.1 ), PLOT_DASH_TYPE::SOLID ) ); + shape->SetStroke( STROKE_PARAMS( pcbIUScale.mmToIU( 0.1 ), LINE_STYLE::SOLID ) ); aFootprint->Add( shape, ADD_MODE::APPEND ); } @@ -2450,7 +2450,7 @@ void ALTIUM_PCB::ConvertArcs6ToBoardItem( const AARC6& aElem, const int aPrimiti PCB_SHAPE shape( nullptr ); ConvertArcs6ToPcbShape( aElem, &shape ); - shape.SetStroke( STROKE_PARAMS( aElem.width, PLOT_DASH_TYPE::SOLID ) ); + shape.SetStroke( STROKE_PARAMS( aElem.width, LINE_STYLE::SOLID ) ); HelperPcpShapeAsBoardKeepoutRegion( shape, aElem.layer, aElem.keepoutrestrictions ); } @@ -2470,7 +2470,7 @@ void ALTIUM_PCB::ConvertArcs6ToBoardItem( const AARC6& aElem, const int aPrimiti PCB_SHAPE* arc = new PCB_SHAPE( m_board ); ConvertArcs6ToPcbShape( aElem, arc ); - arc->SetStroke( STROKE_PARAMS( width, PLOT_DASH_TYPE::SOLID ) ); + arc->SetStroke( STROKE_PARAMS( width, LINE_STYLE::SOLID ) ); arc->SetLayer( layerExpansionMask.first ); m_board->Add( arc, ADD_MODE::APPEND ); @@ -2492,7 +2492,7 @@ void ALTIUM_PCB::ConvertArcs6ToFootprintItem( FOOTPRINT* aFootprint, const AARC6 PCB_SHAPE shape( nullptr ); ConvertArcs6ToPcbShape( aElem, &shape ); - shape.SetStroke( STROKE_PARAMS( aElem.width, PLOT_DASH_TYPE::SOLID ) ); + shape.SetStroke( STROKE_PARAMS( aElem.width, LINE_STYLE::SOLID ) ); HelperPcpShapeAsFootprintKeepoutRegion( aFootprint, shape, aElem.layer, aElem.keepoutrestrictions ); @@ -2523,7 +2523,7 @@ void ALTIUM_PCB::ConvertArcs6ToFootprintItem( FOOTPRINT* aFootprint, const AARC6 PCB_SHAPE* arc = new PCB_SHAPE( aFootprint ); ConvertArcs6ToPcbShape( aElem, arc ); - arc->SetStroke( STROKE_PARAMS( width, PLOT_DASH_TYPE::SOLID ) ); + arc->SetStroke( STROKE_PARAMS( width, LINE_STYLE::SOLID ) ); arc->SetLayer( layerExpansionMask.first ); aFootprint->Add( arc, ADD_MODE::APPEND ); @@ -2564,7 +2564,7 @@ void ALTIUM_PCB::ConvertArcs6ToBoardItemOnLayer( const AARC6& aElem, PCB_LAYER_I PCB_SHAPE* arc = new PCB_SHAPE( m_board ); ConvertArcs6ToPcbShape( aElem, arc ); - arc->SetStroke( STROKE_PARAMS( aElem.width, PLOT_DASH_TYPE::SOLID ) ); + arc->SetStroke( STROKE_PARAMS( aElem.width, LINE_STYLE::SOLID ) ); arc->SetLayer( aLayer ); m_board->Add( arc, ADD_MODE::APPEND ); @@ -2578,7 +2578,7 @@ void ALTIUM_PCB::ConvertArcs6ToFootprintItemOnLayer( FOOTPRINT* aFootprint, cons PCB_SHAPE* arc = new PCB_SHAPE( aFootprint ); ConvertArcs6ToPcbShape( aElem, arc ); - arc->SetStroke( STROKE_PARAMS( aElem.width, PLOT_DASH_TYPE::SOLID ) ); + arc->SetStroke( STROKE_PARAMS( aElem.width, LINE_STYLE::SOLID ) ); arc->SetLayer( aLayer ); aFootprint->Add( arc, ADD_MODE::APPEND ); @@ -2929,7 +2929,7 @@ void ALTIUM_PCB::HelperParsePad6NonCopper( const APAD6& aElem, PCB_LAYER_ID aLay int offset = ( std::min( aElem.topsize.x, aElem.topsize.y ) * cornerradius ) / 200; aShape->SetLayer( aLayer ); - aShape->SetStroke( STROKE_PARAMS( offset * 2, PLOT_DASH_TYPE::SOLID ) ); + aShape->SetStroke( STROKE_PARAMS( offset * 2, LINE_STYLE::SOLID ) ); if( cornerradius < 100 ) { @@ -2952,7 +2952,7 @@ void ALTIUM_PCB::HelperParsePad6NonCopper( const APAD6& aElem, PCB_LAYER_ID aLay aShape->SetFilled( true ); aShape->SetStart( aElem.position ); aShape->SetEnd( aElem.position - VECTOR2I( 0, aElem.topsize.x / 4 ) ); - aShape->SetStroke( STROKE_PARAMS( aElem.topsize.x / 2, PLOT_DASH_TYPE::SOLID ) ); + aShape->SetStroke( STROKE_PARAMS( aElem.topsize.x / 2, LINE_STYLE::SOLID ) ); } else if( aElem.topsize.x < aElem.topsize.y ) { @@ -2982,7 +2982,7 @@ void ALTIUM_PCB::HelperParsePad6NonCopper( const APAD6& aElem, PCB_LAYER_ID aLay aShape->SetLayer( aLayer ); aShape->SetStart( aElem.position ); aShape->SetEnd( aElem.position - VECTOR2I( 0, aElem.topsize.x / 4 ) ); - aShape->SetStroke( STROKE_PARAMS( aElem.topsize.x / 2, PLOT_DASH_TYPE::SOLID ) ); + aShape->SetStroke( STROKE_PARAMS( aElem.topsize.x / 2, LINE_STYLE::SOLID ) ); } else { @@ -2990,7 +2990,7 @@ void ALTIUM_PCB::HelperParsePad6NonCopper( const APAD6& aElem, PCB_LAYER_ID aLay aShape->SetShape( SHAPE_T::SEGMENT ); aShape->SetLayer( aLayer ); aShape->SetStroke( STROKE_PARAMS( std::min( aElem.topsize.x, aElem.topsize.y ), - PLOT_DASH_TYPE::SOLID ) ); + LINE_STYLE::SOLID ) ); if( aElem.topsize.x < aElem.topsize.y ) { @@ -3144,7 +3144,7 @@ void ALTIUM_PCB::ConvertTracks6ToBoardItem( const ATRACK6& aElem, const int aPri PCB_SHAPE shape( nullptr, SHAPE_T::SEGMENT ); shape.SetStart( aElem.start ); shape.SetEnd( aElem.end ); - shape.SetStroke( STROKE_PARAMS( aElem.width, PLOT_DASH_TYPE::SOLID ) ); + shape.SetStroke( STROKE_PARAMS( aElem.width, LINE_STYLE::SOLID ) ); HelperPcpShapeAsBoardKeepoutRegion( shape, aElem.layer, aElem.keepoutrestrictions ); } @@ -3164,7 +3164,7 @@ void ALTIUM_PCB::ConvertTracks6ToBoardItem( const ATRACK6& aElem, const int aPri seg->SetStart( aElem.start ); seg->SetEnd( aElem.end ); - seg->SetStroke( STROKE_PARAMS( width, PLOT_DASH_TYPE::SOLID ) ); + seg->SetStroke( STROKE_PARAMS( width, LINE_STYLE::SOLID ) ); seg->SetLayer( layerExpansionMask.first ); m_board->Add( seg, ADD_MODE::APPEND ); @@ -3187,7 +3187,7 @@ void ALTIUM_PCB::ConvertTracks6ToFootprintItem( FOOTPRINT* aFootprint, const ATR PCB_SHAPE shape( nullptr, SHAPE_T::SEGMENT ); shape.SetStart( aElem.start ); shape.SetEnd( aElem.end ); - shape.SetStroke( STROKE_PARAMS( aElem.width, PLOT_DASH_TYPE::SOLID ) ); + shape.SetStroke( STROKE_PARAMS( aElem.width, LINE_STYLE::SOLID ) ); HelperPcpShapeAsFootprintKeepoutRegion( aFootprint, shape, aElem.layer, aElem.keepoutrestrictions ); @@ -3218,7 +3218,7 @@ void ALTIUM_PCB::ConvertTracks6ToFootprintItem( FOOTPRINT* aFootprint, const ATR seg->SetStart( aElem.start ); seg->SetEnd( aElem.end ); - seg->SetStroke( STROKE_PARAMS( width, PLOT_DASH_TYPE::SOLID ) ); + seg->SetStroke( STROKE_PARAMS( width, LINE_STYLE::SOLID ) ); seg->SetLayer( layerExpansionMask.first ); aFootprint->Add( seg, ADD_MODE::APPEND ); @@ -3247,7 +3247,7 @@ void ALTIUM_PCB::ConvertTracks6ToBoardItemOnLayer( const ATRACK6& aElem, PCB_LAY seg->SetStart( aElem.start ); seg->SetEnd( aElem.end ); - seg->SetStroke( STROKE_PARAMS( aElem.width, PLOT_DASH_TYPE::SOLID ) ); + seg->SetStroke( STROKE_PARAMS( aElem.width, LINE_STYLE::SOLID ) ); seg->SetLayer( aLayer ); m_board->Add( seg, ADD_MODE::APPEND ); @@ -3262,7 +3262,7 @@ void ALTIUM_PCB::ConvertTracks6ToFootprintItemOnLayer( FOOTPRINT* aFootprint, co seg->SetStart( aElem.start ); seg->SetEnd( aElem.end ); - seg->SetStroke( STROKE_PARAMS( aElem.width, PLOT_DASH_TYPE::SOLID ) ); + seg->SetStroke( STROKE_PARAMS( aElem.width, LINE_STYLE::SOLID ) ); seg->SetLayer( aLayer ); aFootprint->Add( seg, ADD_MODE::APPEND ); @@ -3470,7 +3470,7 @@ void ALTIUM_PCB::ConvertFills6ToBoardItem( const AFILL6& aElem ) shape.SetStart( aElem.pos1 ); shape.SetEnd( aElem.pos2 ); shape.SetFilled( true ); - shape.SetStroke( STROKE_PARAMS( 0, PLOT_DASH_TYPE::SOLID ) ); + shape.SetStroke( STROKE_PARAMS( 0, LINE_STYLE::SOLID ) ); if( aElem.rotation != 0. ) { @@ -3501,7 +3501,7 @@ void ALTIUM_PCB::ConvertFills6ToFootprintItem( FOOTPRINT* aFootprint, const AFIL shape.SetStart( aElem.pos1 ); shape.SetEnd( aElem.pos2 ); shape.SetFilled( true ); - shape.SetStroke( STROKE_PARAMS( 0, PLOT_DASH_TYPE::SOLID ) ); + shape.SetStroke( STROKE_PARAMS( 0, LINE_STYLE::SOLID ) ); if( aElem.rotation != 0. ) { diff --git a/pcbnew/plugins/cadstar/cadstar_pcb_archive_loader.cpp b/pcbnew/plugins/cadstar/cadstar_pcb_archive_loader.cpp index 5f6f4674b9..86f5aa0de7 100644 --- a/pcbnew/plugins/cadstar/cadstar_pcb_archive_loader.cpp +++ b/pcbnew/plugins/cadstar/cadstar_pcb_archive_loader.cpp @@ -2520,7 +2520,7 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadNetTracks( const NET_ID& aCadstarNe { PCB_SHAPE* shape = getShapeFromVertex( prevEnd, v.Vertex ); shape->SetLayer( getKiCadLayer( aCadstarRoute.LayerID ) ); - shape->SetStroke( STROKE_PARAMS( getKiCadLength( v.RouteWidth ), PLOT_DASH_TYPE::SOLID ) ); + shape->SetStroke( STROKE_PARAMS( getKiCadLength( v.RouteWidth ), LINE_STYLE::SOLID ) ); shape->SetLocked( v.Fixed ); shapes.push_back( shape ); prevEnd = v.Vertex.End; @@ -2794,7 +2794,7 @@ void CADSTAR_PCB_ARCHIVE_LOADER::drawCadstarShape( const SHAPE& aCadstarShape, shapePolys.Fracture( SHAPE_POLY_SET::POLYGON_MODE::PM_STRICTLY_SIMPLE ); shape->SetPolyShape( shapePolys ); - shape->SetStroke( STROKE_PARAMS( aLineThickness, PLOT_DASH_TYPE::SOLID ) ); + shape->SetStroke( STROKE_PARAMS( aLineThickness, LINE_STYLE::SOLID ) ); shape->SetLayer( aKiCadLayer ); aContainer->Add( shape, ADD_MODE::APPEND ); @@ -2844,7 +2844,7 @@ void CADSTAR_PCB_ARCHIVE_LOADER::drawCadstarVerticesAsShapes( const std::vector< for( PCB_SHAPE* shape : shapes ) { - shape->SetStroke( STROKE_PARAMS( aLineThickness, PLOT_DASH_TYPE::SOLID ) ); + shape->SetStroke( STROKE_PARAMS( aLineThickness, LINE_STYLE::SOLID ) ); shape->SetLayer( aKiCadLayer ); shape->SetParent( aContainer ); aContainer->Add( shape, ADD_MODE::APPEND ); diff --git a/pcbnew/plugins/eagle/eagle_plugin.cpp b/pcbnew/plugins/eagle/eagle_plugin.cpp index 9d660597de..27c4191d2e 100644 --- a/pcbnew/plugins/eagle/eagle_plugin.cpp +++ b/pcbnew/plugins/eagle/eagle_plugin.cpp @@ -704,7 +704,7 @@ void EAGLE_PLUGIN::loadPlain( wxXmlNode* aGraphics ) } shape->SetLayer( layer ); - shape->SetStroke( STROKE_PARAMS( width, PLOT_DASH_TYPE::SOLID ) ); + shape->SetStroke( STROKE_PARAMS( width, LINE_STYLE::SOLID ) ); } m_xpath->pop(); @@ -890,7 +890,7 @@ void EAGLE_PLUGIN::loadPlain( wxXmlNode* aGraphics ) shape->SetLayer( layer ); shape->SetStart( VECTOR2I( kicad_x( c.x ), kicad_y( c.y ) ) ); shape->SetEnd( VECTOR2I( kicad_x( c.x ) + radius, kicad_y( c.y ) ) ); - shape->SetStroke( STROKE_PARAMS( width, PLOT_DASH_TYPE::SOLID ) ); + shape->SetStroke( STROKE_PARAMS( width, LINE_STYLE::SOLID ) ); } } @@ -1871,7 +1871,7 @@ void EAGLE_PLUGIN::packageWire( FOOTPRINT* aFootprint, wxXmlNode* aTree ) const } dwg->SetLayer( layer ); - dwg->SetStroke( STROKE_PARAMS( width, PLOT_DASH_TYPE::SOLID ) ); + dwg->SetStroke( STROKE_PARAMS( width, LINE_STYLE::SOLID ) ); dwg->Rotate( { 0, 0 }, aFootprint->GetOrientation() ); dwg->Move( aFootprint->GetPosition() ); @@ -2353,7 +2353,7 @@ void EAGLE_PLUGIN::packageCircle( FOOTPRINT* aFootprint, wxXmlNode* aTree ) cons } aFootprint->Add( gr ); - gr->SetStroke( STROKE_PARAMS( width, PLOT_DASH_TYPE::SOLID ) ); + gr->SetStroke( STROKE_PARAMS( width, LINE_STYLE::SOLID ) ); switch( (int) layer ) { diff --git a/pcbnew/plugins/fabmaster/import_fabmaster.cpp b/pcbnew/plugins/fabmaster/import_fabmaster.cpp index 7935f7ea93..8057c7b058 100644 --- a/pcbnew/plugins/fabmaster/import_fabmaster.cpp +++ b/pcbnew/plugins/fabmaster/import_fabmaster.cpp @@ -2105,7 +2105,7 @@ bool FABMASTER::loadFootprints( BOARD* aBoard ) line->SetEnd( VECTOR2I( lsrc->end_x, lsrc->end_y ) ); } - line->SetStroke( STROKE_PARAMS( lsrc->width, PLOT_DASH_TYPE::SOLID ) ); + line->SetStroke( STROKE_PARAMS( lsrc->width, LINE_STYLE::SOLID ) ); line->Rotate( { 0, 0 }, fp->GetOrientation() ); line->Move( fp->GetPosition() ); @@ -2149,7 +2149,7 @@ bool FABMASTER::loadFootprints( BOARD* aBoard ) arc->SetArcGeometry( lsrc->result.GetP0(), lsrc->result.GetArcMid(), lsrc->result.GetP1() ); - arc->SetStroke( STROKE_PARAMS( lsrc->width, PLOT_DASH_TYPE::SOLID ) ); + arc->SetStroke( STROKE_PARAMS( lsrc->width, LINE_STYLE::SOLID ) ); arc->Rotate( { 0, 0 }, fp->GetOrientation() ); arc->Move( fp->GetPosition() ); @@ -2654,7 +2654,7 @@ bool FABMASTER::loadPolygon( BOARD* aBoard, const std::unique_ptrSetStroke( STROKE_PARAMS( ( *( aLine->segment.begin() ) )->width, - PLOT_DASH_TYPE::SOLID ) ); + LINE_STYLE::SOLID ) ); if( new_poly->GetWidth() == 0 ) new_poly->SetStroke( defaultStroke ); @@ -2795,7 +2795,7 @@ bool FABMASTER::loadOutline( BOARD* aBoard, const std::unique_ptrSetLayer( layer ); line->SetStart( VECTOR2I( src->start_x, src->start_y ) ); line->SetEnd( VECTOR2I( src->end_x, src->end_y ) ); - line->SetStroke( STROKE_PARAMS( src->width, PLOT_DASH_TYPE::SOLID ) ); + line->SetStroke( STROKE_PARAMS( src->width, LINE_STYLE::SOLID ) ); if( line->GetWidth() == 0 ) line->SetStroke( defaultStroke ); @@ -2829,7 +2829,7 @@ bool FABMASTER::loadOutline( BOARD* aBoard, const std::unique_ptrSetArcGeometry( src->result.GetP0(), src->result.GetArcMid(), src->result.GetP1() ); - arc->SetStroke( STROKE_PARAMS( src->width, PLOT_DASH_TYPE::SOLID ) ); + arc->SetStroke( STROKE_PARAMS( src->width, LINE_STYLE::SOLID ) ); if( arc->GetWidth() == 0 ) arc->SetStroke( defaultStroke ); @@ -2930,7 +2930,7 @@ bool FABMASTER::loadGraphics( BOARD* aBoard ) line->SetLayer( layer ); line->SetStart( VECTOR2I( src->start_x, src->start_y ) ); line->SetEnd( VECTOR2I( src->end_x, src->end_y ) ); - line->SetStroke( STROKE_PARAMS( src->width, PLOT_DASH_TYPE::SOLID ) ); + line->SetStroke( STROKE_PARAMS( src->width, LINE_STYLE::SOLID ) ); aBoard->Add( line, ADD_MODE::APPEND ); break; @@ -2958,7 +2958,7 @@ bool FABMASTER::loadGraphics( BOARD* aBoard ) arc->SetArcGeometry( src->result.GetP0(), src->result.GetArcMid(), src->result.GetP1() ); - arc->SetStroke( STROKE_PARAMS( src->width, PLOT_DASH_TYPE::SOLID ) ); + arc->SetStroke( STROKE_PARAMS( src->width, LINE_STYLE::SOLID ) ); aBoard->Add( arc, ADD_MODE::APPEND ); break; diff --git a/pcbnew/plugins/geda/gpcb_plugin.cpp b/pcbnew/plugins/geda/gpcb_plugin.cpp index 76e250aba5..c73b4d0ad4 100644 --- a/pcbnew/plugins/geda/gpcb_plugin.cpp +++ b/pcbnew/plugins/geda/gpcb_plugin.cpp @@ -425,7 +425,7 @@ FOOTPRINT* GPCB_FPL_CACHE::parseFOOTPRINT( LINE_READER* aLineReader ) shape->SetEnd( VECTOR2I( parseInt( parameters[4], conv_unit ), parseInt( parameters[5], conv_unit ) ) ); shape->SetStroke( STROKE_PARAMS( parseInt( parameters[6], conv_unit ), - PLOT_DASH_TYPE::SOLID ) ); + LINE_STYLE::SOLID ) ); shape->Rotate( { 0, 0 }, footprint->GetOrientation() ); shape->Move( footprint->GetPosition() ); @@ -483,7 +483,7 @@ FOOTPRINT* GPCB_FPL_CACHE::parseFOOTPRINT( LINE_READER* aLineReader ) } shape->SetStroke( STROKE_PARAMS( parseInt( parameters[8], conv_unit ), - PLOT_DASH_TYPE::SOLID ) ); + LINE_STYLE::SOLID ) ); shape->Rotate( { 0, 0 }, footprint->GetOrientation() ); shape->Move( footprint->GetPosition() ); diff --git a/pcbnew/plugins/kicad/pcb_parser.cpp b/pcbnew/plugins/kicad/pcb_parser.cpp index e40f10071d..f36bf18901 100644 --- a/pcbnew/plugins/kicad/pcb_parser.cpp +++ b/pcbnew/plugins/kicad/pcb_parser.cpp @@ -2560,7 +2560,7 @@ PCB_SHAPE* PCB_PARSER::parsePCB_SHAPE( BOARD_ITEM* aParent ) T token; VECTOR2I pt; - STROKE_PARAMS stroke( 0, PLOT_DASH_TYPE::SOLID ); + STROKE_PARAMS stroke( 0, LINE_STYLE::SOLID ); std::unique_ptr shape = std::make_unique( aParent ); switch( CurTok() ) @@ -3201,7 +3201,7 @@ PCB_TEXTBOX* PCB_PARSER::parsePCB_TEXTBOX( BOARD_ITEM* aParent ) std::unique_ptr textbox = std::make_unique( aParent ); - STROKE_PARAMS stroke( -1, PLOT_DASH_TYPE::SOLID ); + STROKE_PARAMS stroke( -1, LINE_STYLE::SOLID ); T token = NextTok(); if( token == T_locked ) diff --git a/pcbnew/plugins/legacy/legacy_plugin.cpp b/pcbnew/plugins/legacy/legacy_plugin.cpp index 45fd5c6a60..544d250500 100644 --- a/pcbnew/plugins/legacy/legacy_plugin.cpp +++ b/pcbnew/plugins/legacy/legacy_plugin.cpp @@ -1703,7 +1703,7 @@ void LEGACY_PLUGIN::loadFP_SHAPE( FOOTPRINT* aFootprint ) if( layer < FIRST_LAYER || layer > LAST_NON_COPPER_LAYER ) layer = SILKSCREEN_N_FRONT; - dwg->SetStroke( STROKE_PARAMS( width, PLOT_DASH_TYPE::SOLID ) ); + dwg->SetStroke( STROKE_PARAMS( width, LINE_STYLE::SOLID ) ); dwg->SetLayer( leg_layer2new( m_cu_count, layer ) ); dwg->Rotate( { 0, 0 }, aFootprint->GetOrientation() ); @@ -1867,7 +1867,7 @@ void LEGACY_PLUGIN::loadPCB_LINE() dseg->SetShape( static_cast( shape ) ); dseg->SetFilled( false ); - dseg->SetStroke( STROKE_PARAMS( width, PLOT_DASH_TYPE::SOLID ) ); + dseg->SetStroke( STROKE_PARAMS( width, LINE_STYLE::SOLID ) ); if( dseg->GetShape() == SHAPE_T::ARC ) { diff --git a/pcbnew/plugins/pcad/pcad_arc.cpp b/pcbnew/plugins/pcad/pcad_arc.cpp index c372b811bc..6555b7e10a 100644 --- a/pcbnew/plugins/pcad/pcad_arc.cpp +++ b/pcbnew/plugins/pcad/pcad_arc.cpp @@ -180,7 +180,7 @@ void PCAD_ARC::AddToBoard( FOOTPRINT* aFootprint ) arc->SetStart( VECTOR2I( m_StartX, m_StartY ) ); arc->SetArcAngleAndEnd( -m_Angle, true ); - arc->SetStroke( STROKE_PARAMS( m_Width, PLOT_DASH_TYPE::SOLID ) ); + arc->SetStroke( STROKE_PARAMS( m_Width, LINE_STYLE::SOLID ) ); arc->SetLayer( m_KiCadLayer ); if( aFootprint ) diff --git a/pcbnew/plugins/pcad/pcad_line.cpp b/pcbnew/plugins/pcad/pcad_line.cpp index 29877988f5..a608013b4d 100644 --- a/pcbnew/plugins/pcad/pcad_line.cpp +++ b/pcbnew/plugins/pcad/pcad_line.cpp @@ -137,7 +137,7 @@ void PCAD_LINE::AddToBoard( FOOTPRINT* aFootprint ) segment->SetLayer( m_KiCadLayer ); segment->SetStart( VECTOR2I( m_PositionX, m_PositionY ) ); segment->SetEnd( VECTOR2I( m_ToX, m_ToY ) ); - segment->SetStroke( STROKE_PARAMS( m_Width, PLOT_DASH_TYPE::SOLID ) ); + segment->SetStroke( STROKE_PARAMS( m_Width, LINE_STYLE::SOLID ) ); if( aFootprint ) { diff --git a/pcbnew/tools/convert_tool.cpp b/pcbnew/tools/convert_tool.cpp index 538b90f474..ebe1f9720a 100644 --- a/pcbnew/tools/convert_tool.cpp +++ b/pcbnew/tools/convert_tool.cpp @@ -454,7 +454,7 @@ int CONVERT_TOOL::CreatePolys( const TOOL_EVENT& aEvent ) } graphic->SetShape( SHAPE_T::POLY ); - graphic->SetStroke( STROKE_PARAMS( resolvedSettings.m_LineWidth, PLOT_DASH_TYPE::SOLID, + graphic->SetStroke( STROKE_PARAMS( resolvedSettings.m_LineWidth, LINE_STYLE::SOLID, COLOR4D::UNSPECIFIED ) ); graphic->SetFilled( resolvedSettings.m_Strategy == CENTERLINE ); graphic->SetLayer( destLayer ); diff --git a/pcbnew/tools/drawing_tool.cpp b/pcbnew/tools/drawing_tool.cpp index 40d39a3fe6..79ea2e357c 100644 --- a/pcbnew/tools/drawing_tool.cpp +++ b/pcbnew/tools/drawing_tool.cpp @@ -173,7 +173,7 @@ DRAWING_TOOL::DRAWING_TOOL() : m_mode( MODE::NONE ), m_inDrawingTool( false ), m_layer( UNDEFINED_LAYER ), - m_stroke( 1, PLOT_DASH_TYPE::DEFAULT, COLOR4D::UNSPECIFIED ), + m_stroke( 1, LINE_STYLE::DEFAULT, COLOR4D::UNSPECIFIED ), m_pickerItem( nullptr ), m_tuningPattern( nullptr ) { @@ -289,7 +289,7 @@ void DRAWING_TOOL::Reset( RESET_REASON aReason ) m_layer = m_frame->GetActiveLayer(); m_stroke.SetWidth( bds.GetLineThickness( m_layer ) ); - m_stroke.SetPlotStyle( PLOT_DASH_TYPE::DEFAULT ); + m_stroke.SetLineStyle( LINE_STYLE::DEFAULT ); m_stroke.SetColor( COLOR4D::UNSPECIFIED ); m_textAttrs.m_Size = bds.GetTextSize( m_layer ); @@ -1818,7 +1818,7 @@ bool DRAWING_TOOL::drawShape( const TOOL_EVENT& aTool, PCB_SHAPE** aGraphic, { m_layer = m_frame->GetActiveLayer(); m_stroke.SetWidth( bds.GetLineThickness( m_layer ) ); - m_stroke.SetPlotStyle( PLOT_DASH_TYPE::DEFAULT ); + m_stroke.SetLineStyle( LINE_STYLE::DEFAULT ); m_stroke.SetColor( COLOR4D::UNSPECIFIED ); m_textAttrs.m_Size = bds.GetTextSize( m_layer ); @@ -1933,7 +1933,7 @@ bool DRAWING_TOOL::drawShape( const TOOL_EVENT& aTool, PCB_SHAPE** aGraphic, { m_layer = m_frame->GetActiveLayer(); m_stroke.SetWidth( bds.GetLineThickness( m_layer ) ); - m_stroke.SetPlotStyle( PLOT_DASH_TYPE::DEFAULT ); + m_stroke.SetLineStyle( LINE_STYLE::DEFAULT ); m_stroke.SetColor( COLOR4D::UNSPECIFIED ); m_textAttrs.m_Size = bds.GetTextSize( m_layer ); @@ -2217,7 +2217,7 @@ bool DRAWING_TOOL::drawArc( const TOOL_EVENT& aTool, PCB_SHAPE** aGraphic, { m_layer = m_frame->GetActiveLayer(); m_stroke.SetWidth( m_frame->GetDesignSettings().GetLineThickness( m_layer ) ); - m_stroke.SetPlotStyle( PLOT_DASH_TYPE::DEFAULT ); + m_stroke.SetLineStyle( LINE_STYLE::DEFAULT ); m_stroke.SetColor( COLOR4D::UNSPECIFIED ); } @@ -2357,7 +2357,7 @@ bool DRAWING_TOOL::drawArc( const TOOL_EVENT& aTool, PCB_SHAPE** aGraphic, { m_layer = m_frame->GetActiveLayer(); m_stroke.SetWidth( m_frame->GetDesignSettings().GetLineThickness( m_layer ) ); - m_stroke.SetPlotStyle( PLOT_DASH_TYPE::DEFAULT ); + m_stroke.SetLineStyle( LINE_STYLE::DEFAULT ); m_stroke.SetColor( COLOR4D::UNSPECIFIED ); } diff --git a/pcbnew/tools/pad_tool.cpp b/pcbnew/tools/pad_tool.cpp index 3f90a864c5..d71e6d6aa4 100644 --- a/pcbnew/tools/pad_tool.cpp +++ b/pcbnew/tools/pad_tool.cpp @@ -897,7 +897,7 @@ std::vector PAD_TOOL::RecombinePad( PAD* aPad, bool aIsDryRun ) PCB_SHAPE* shape = new PCB_SHAPE( nullptr, SHAPE_T::POLY ); shape->SetFilled( true ); - shape->SetStroke( STROKE_PARAMS( 0, PLOT_DASH_TYPE::SOLID ) ); + shape->SetStroke( STROKE_PARAMS( 0, LINE_STYLE::SOLID ) ); shape->SetPolyShape( existingOutline ); shape->Rotate( VECTOR2I( 0, 0 ), - aPad->GetOrientation() ); shape->Move( - aPad->ShapePos() ); diff --git a/pcbnew/tools/zone_create_helper.cpp b/pcbnew/tools/zone_create_helper.cpp index f25f628468..a92648bdf5 100644 --- a/pcbnew/tools/zone_create_helper.cpp +++ b/pcbnew/tools/zone_create_helper.cpp @@ -243,7 +243,7 @@ void ZONE_CREATE_HELPER::commitZone( std::unique_ptr aZone ) poly->SetFilled( layer != Edge_Cuts && layer != F_CrtYd && layer != B_CrtYd ); poly->SetStroke( STROKE_PARAMS( board->GetDesignSettings().GetLineThickness( layer ), - PLOT_DASH_TYPE::SOLID ) ); + LINE_STYLE::SOLID ) ); poly->SetLayer( layer ); poly->SetPolyShape( *aZone->Outline() ); diff --git a/qa/pcbnew_utils/board_construction_utils.cpp b/qa/pcbnew_utils/board_construction_utils.cpp index fe46c9ccb0..5f305d8991 100644 --- a/qa/pcbnew_utils/board_construction_utils.cpp +++ b/qa/pcbnew_utils/board_construction_utils.cpp @@ -39,7 +39,7 @@ void DrawSegment( FOOTPRINT& aFootprint, const SEG& aSeg, int aWidth, PCB_LAYER_ seg->SetStart( aSeg.A ); seg->SetEnd( aSeg.B ); - seg->SetStroke( STROKE_PARAMS( aWidth, PLOT_DASH_TYPE::SOLID ) ); + seg->SetStroke( STROKE_PARAMS( aWidth, LINE_STYLE::SOLID ) ); seg->SetLayer( aLayer ); seg->Rotate( { 0, 0 }, aFootprint.GetOrientation() ); @@ -68,7 +68,7 @@ void DrawArc( FOOTPRINT& aFootprint, const VECTOR2I& aCentre, const VECTOR2I& aS arc->SetStart( aStart ); arc->SetArcAngleAndEnd( aAngle ); - arc->SetStroke( STROKE_PARAMS( aWidth, PLOT_DASH_TYPE::SOLID ) ); + arc->SetStroke( STROKE_PARAMS( aWidth, LINE_STYLE::SOLID ) ); arc->SetLayer( aLayer ); arc->Rotate( { 0, 0 }, aFootprint.GetOrientation() ); diff --git a/qa/pcbnew_utils/board_test_utils.cpp b/qa/pcbnew_utils/board_test_utils.cpp index 0f821cedf7..f7acd3052a 100644 --- a/qa/pcbnew_utils/board_test_utils.cpp +++ b/qa/pcbnew_utils/board_test_utils.cpp @@ -386,8 +386,8 @@ void CheckFpShape( const PCB_SHAPE* expected, const PCB_SHAPE* shape ) BOOST_CHECK_EQUAL( expected->GetLayerSet(), shape->GetLayerSet() ); BOOST_CHECK_EQUAL( expected->GetStroke().GetWidth(), shape->GetStroke().GetWidth() ); - CHECK_ENUM_CLASS_EQUAL( expected->GetStroke().GetPlotStyle(), - shape->GetStroke().GetPlotStyle() ); + CHECK_ENUM_CLASS_EQUAL( expected->GetStroke().GetLineStyle(), + shape->GetStroke().GetLineStyle() ); CHECK_ENUM_CLASS_EQUAL( expected->GetFillMode(), shape->GetFillMode() ); } }