It's been a long time since line style was specific to plotting.
This commit is contained in:
Jeff Young 2023-11-25 13:05:45 +00:00
parent d4ce2c8982
commit df83e24eb7
73 changed files with 623 additions and 621 deletions

View File

@ -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() )
{

View File

@ -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<PLOT_DASH_TYPE>::Instance();
auto& plotDashTypeEnum = ENUM_MAP<LINE_STYLE>::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<EDA_SHAPE, int>( _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<EDA_SHAPE, PLOT_DASH_TYPE>(
void ( EDA_SHAPE::*lineStyleSetter )( LINE_STYLE ) = &EDA_SHAPE::SetLineStyle;
propMgr.AddProperty( new PROPERTY_ENUM<EDA_SHAPE, LINE_STYLE>(
_HKI( "Line Style" ), lineStyleSetter, &EDA_SHAPE::GetLineStyle ) );
propMgr.AddProperty( new PROPERTY<EDA_SHAPE, COLOR4D>( _HKI( "Line Color" ),

View File

@ -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;
};

View File

@ -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 );

View File

@ -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<PLOT_DASH_TYPE>( m_currentLineType ) );
const char* lname = getDXFLineType( static_cast<LINE_STYLE>( 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;
}

View File

@ -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<HPGL_ITEM>& 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;";
}
}

View File

@ -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 ),

View File

@ -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 ),

View File

@ -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 )
{

View File

@ -32,16 +32,16 @@
using namespace STROKEPARAMS_T;
const std::map<PLOT_DASH_TYPE, struct lineTypeStruct> 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<LINE_STYLE, struct LINE_STYLE_DESC> 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<void( const VECTOR2I& a, const VECTOR2I& b )> 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<const PLOT_DASH_TYPE, lineTypeStruct>& typeEntry : lineTypeNames )
for( const std::pair<const LINE_STYLE, LINE_STYLE_DESC>& 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" );
}

View File

@ -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() )

View File

@ -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<const PLOT_DASH_TYPE, lineTypeStruct>& 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<int>( m_shape->GetStroke().GetPlotStyle() );
int style = static_cast<int>( 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() );

View File

@ -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<const PLOT_DASH_TYPE, lineTypeStruct>& 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<int>( m_currentText->GetStroke().GetPlotStyle() );
int style = static_cast<int>( 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() );

View File

@ -49,8 +49,8 @@ DIALOG_LINE_PROPERTIES::DIALOG_LINE_PROPERTIES( SCH_EDIT_FRAME* aParent,
SetInitialFocus( m_lineWidth );
for( const std::pair<const PLOT_DASH_TYPE, lineTypeStruct>& 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<int>( first_stroke_item->GetStroke().GetPlotStyle() );
int style = static_cast<int>( 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 );

View File

@ -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<const PLOT_DASH_TYPE, lineTypeStruct>& 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<int>( m_shape->GetStroke().GetPlotStyle() );
int style = static_cast<int>( 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() );

View File

@ -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<const PLOT_DASH_TYPE, lineTypeStruct>& 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<int>( textBox->GetStroke().GetPlotStyle() );
int style = static_cast<int>( 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() );

View File

@ -52,8 +52,8 @@ DIALOG_WIRE_BUS_PROPERTIES::DIALOG_WIRE_BUS_PROPERTIES( SCH_EDIT_FRAME* aParent,
SetInitialFocus( m_lineWidth );
for( const std::pair<const PLOT_DASH_TYPE, lineTypeStruct>& 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<int>( stroke.GetPlotStyle() );
int style = static_cast<int>( 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();

View File

@ -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 ) );

View File

@ -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() )
{

View File

@ -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;

View File

@ -228,11 +228,11 @@ void LIB_TEXTBOX::print( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffs
if( IsPrivate() )
return;
bool forceNoFill = static_cast<bool>( aData );
bool blackAndWhiteMode = GetGRForceBlackPenState();
int penWidth = GetEffectivePenWidth( aSettings );
COLOR4D color = GetStroke().GetColor();
PLOT_DASH_TYPE lineStyle = GetStroke().GetPlotStyle();
bool forceNoFill = static_cast<bool>( 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();

View File

@ -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<PLOT_DASH_TYPE>& plotDashTypeEnum = ENUM_MAP<PLOT_DASH_TYPE>::Instance();
ENUM_MAP<LINE_STYLE>& plotDashTypeEnum = ENUM_MAP<LINE_STYLE>::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<SCH_BUS_ENTRY_BASE, PLOT_DASH_TYPE>(
propMgr.AddProperty( new PROPERTY_ENUM<SCH_BUS_ENTRY_BASE, LINE_STYLE>(
_HKI( "Line Style" ),
lineStyleSetter, &SCH_BUS_ENTRY_BASE::GetLineStyle ) );

View File

@ -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;
};
/**

View File

@ -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<PLOT_DASH_TYPE>( aStyleId ) );
SetLineStyle( static_cast<LINE_STYLE>( 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<wxString> properties;
@ -939,7 +939,7 @@ void SCH_LINE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_IT
aList.emplace_back( _( "Line Type" ), msg );
PLOT_DASH_TYPE lineStyle = GetLineStyle();
LINE_STYLE lineStyle = GetLineStyle();
if( GetEffectiveLineStyle() != lineStyle )
aList.emplace_back( _( "Line Style" ), _( "from netclass" ) );
@ -1004,7 +1004,7 @@ bool SCH_LINE::operator==( const SCH_ITEM& aOther ) const
if( m_stroke.GetColor() != other.m_stroke.GetColor() )
return false;
if( m_stroke.GetPlotStyle() != other.m_stroke.GetPlotStyle() )
if( m_stroke.GetLineStyle() != other.m_stroke.GetLineStyle() )
return false;
return true;
@ -1038,7 +1038,7 @@ double SCH_LINE::Similarity( const SCH_ITEM& aOther ) const
if( m_stroke.GetColor() != other.m_stroke.GetColor() )
similarity *= 0.9;
if( m_stroke.GetPlotStyle() != other.m_stroke.GetPlotStyle() )
if( m_stroke.GetLineStyle() != other.m_stroke.GetLineStyle() )
similarity *= 0.9;
return similarity;
@ -1049,25 +1049,25 @@ static struct SCH_LINE_DESC
{
SCH_LINE_DESC()
{
ENUM_MAP<PLOT_DASH_TYPE>& plotDashTypeEnum = ENUM_MAP<PLOT_DASH_TYPE>::Instance();
ENUM_MAP<LINE_STYLE>& plotDashTypeEnum = ENUM_MAP<LINE_STYLE>::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<SCH_LINE, PLOT_DASH_TYPE>( _HKI( "Line Style" ),
propMgr.AddProperty( new PROPERTY_ENUM<SCH_LINE, LINE_STYLE>( _HKI( "Line Style" ),
lineStyleSetter, &SCH_LINE::GetLineStyle ) );
propMgr.AddProperty( new PROPERTY<SCH_LINE, int>( _HKI( "Line Width" ),

View File

@ -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;
};

View File

@ -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() );
}

View File

@ -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<wxString, wxString>& 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<wxString, wxString>& 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<wxString, wxString>& 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<wxString, wxString>& 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<wxString, wxString>& 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<wxString, wxString>& 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<wxString, wxString>& 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<wxString, wxString>& 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<wxString, wxString>&
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<wxString, wxString>& 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<wxString, wxString>& 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<wxString, wxString>&
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 )

View File

@ -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<VERTEX>& 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
}

View File

@ -29,7 +29,7 @@
#include <sch_plugins/cadstar/cadstar_sch_archive_parser.h>
#include <layer_ids.h> // SCH_LAYER_ID
#include <plotters/plotter.h> // PLOT_DASH_TYPE
#include <plotters/plotter.h> // LINE_STYLE
#include <pin_type.h> // ELECTRICAL_PINTYPE
#include <memory>
@ -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 );

View File

@ -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<LIB_SYMBOL>& 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<LIB_SYMBOL>& 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<LIB_SYMBOL>& 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<LIB_SYMBOL>& 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 );

View File

@ -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<SHAPE_LINE_CHAIN> 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<LIB_SHAPE> circle =
std::make_unique<LIB_SHAPE>( 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 )
{

View File

@ -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<wxString, nlohmann::j
if( style.at( 3 ).is_number() )
{
int dashStyle = style.at( 3 );
stroke.SetPlotStyle( ConvertStrokeStyle( dashStyle ) );
stroke.SetLineStyle( ConvertStrokeStyle( dashStyle ) );
}
if( style.at( 5 ).is_number() )

View File

@ -1006,7 +1006,7 @@ LIB_SHAPE* SCH_SEXPR_PARSER::parseArc()
VECTOR2I midPoint( 1, 1 );
VECTOR2I endPoint( 0, 1 );
bool hasMidPoint = 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;
// Parameters for legacy format
@ -1189,7 +1189,7 @@ LIB_SHAPE* SCH_SEXPR_PARSER::parseBezier()
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<LIB_SHAPE> bezier = std::make_unique<LIB_SHAPE>( 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<LIB_SHAPE> circle = std::make_unique<LIB_SHAPE>( 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<LIB_SHAPE> poly = std::make_unique<LIB_SHAPE>( 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<LIB_SHAPE> rectangle = std::make_unique<LIB_SHAPE>( 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<LIB_TEXTBOX> textBox = std::make_unique<LIB_TEXTBOX>( 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<SCH_FIELD> 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<SCH_BUS_WIRE_ENTRY> busEntry = std::make_unique<SCH_BUS_WIRE_ENTRY>();
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<SCH_SHAPE> arc = std::make_unique<SCH_SHAPE>( 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<SCH_SHAPE> circle = std::make_unique<SCH_SHAPE>( 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<SCH_SHAPE> rectangle = std::make_unique<SCH_SHAPE>( 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<SCH_SHAPE> bezier = std::make_unique<SCH_SHAPE>( 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<SCH_TEXTBOX> textBox = std::make_unique<SCH_TEXTBOX>();

View File

@ -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 );

View File

@ -845,7 +845,8 @@ LIB_SHAPE* SCH_LEGACY_PLUGIN_CACHE::loadArc( std::unique_ptr<LIB_SYMBOL>& 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<LIB_SYMBOL>& 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<LIB_SYMBOL>& 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<LIB_SYMBOL>& 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<LIB_SYMBOL>& 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 );

View File

@ -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.
{

View File

@ -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();

View File

@ -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 );

View File

@ -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() )
{

View File

@ -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(); }

View File

@ -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();

View File

@ -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 )

View File

@ -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 ),

View File

@ -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

View File

@ -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; }

View File

@ -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;
};

View File

@ -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
{
}

View File

@ -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<HPGL_ITEM>& 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;

View File

@ -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.
};

View File

@ -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<PLOT_DASH_TYPE, struct lineTypeStruct> lineTypeNames;
extern const std::map<LINE_STYLE, struct LINE_STYLE_DESC> lineTypeNames;
#define DEFAULT_STYLE _( "Default" )
@ -80,10 +80,10 @@ extern const std::map<PLOT_DASH_TYPE, struct lineTypeStruct> 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<void( const VECTOR2I& a, const VECTOR2I& b )> aStroker );
private:
int m_width;
PLOT_DASH_TYPE m_plotstyle;
LINE_STYLE m_lineStyle;
KIGFX::COLOR4D m_color;
};

View File

@ -137,8 +137,8 @@ DIALOG_SHAPE_PROPERTIES::DIALOG_SHAPE_PROPERTIES( PCB_BASE_EDIT_FRAME* aParent,
m_LayerSelectionCtrl->SetNotAllowedLayerSet( forbiddenLayers );
}
for( const std::pair<const PLOT_DASH_TYPE, lineTypeStruct>& 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<int>( m_item->GetStroke().GetPlotStyle() );
int style = static_cast<int>( 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 );

View File

@ -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<const PLOT_DASH_TYPE, lineTypeStruct>& 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 );

View File

@ -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 );
}

View File

@ -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();

View File

@ -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<VECTOR2I>& 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();

View File

@ -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 )
{

View File

@ -647,16 +647,16 @@ static struct PCB_TEXTBOX_DESC
{
PCB_TEXTBOX_DESC()
{
ENUM_MAP<PLOT_DASH_TYPE>& plotDashTypeEnum = ENUM_MAP<PLOT_DASH_TYPE>::Instance();
ENUM_MAP<LINE_STYLE>& plotDashTypeEnum = ENUM_MAP<LINE_STYLE>::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<PCB_TEXTBOX, bool>( _HKI( "Border" ),
&PCB_TEXTBOX::SetBorderEnabled,
&PCB_TEXTBOX::IsBorderEnabled ),
borderProps );
propMgr.AddProperty( new PROPERTY_ENUM<PCB_TEXTBOX, PLOT_DASH_TYPE>( _HKI( "Border Style" ),
propMgr.AddProperty( new PROPERTY_ENUM<PCB_TEXTBOX, LINE_STYLE>( _HKI( "Border Style" ),
lineStyleSetter,
lineStyleGetter ),
borderProps );

View File

@ -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>& 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() )
{

View File

@ -1010,7 +1010,7 @@ void ALTIUM_PCB::HelperCreateBoardOutline( const std::vector<ALTIUM_VERTICE>& 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. )
{

View File

@ -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 );

View File

@ -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 )
{

View File

@ -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_ptr<FABMASTER::TRA
else
{
new_poly->SetStroke( 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_ptr<FABMASTER::TRA
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 ) );
if( line->GetWidth() == 0 )
line->SetStroke( defaultStroke );
@ -2829,7 +2829,7 @@ bool FABMASTER::loadOutline( BOARD* aBoard, const std::unique_ptr<FABMASTER::TRA
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 ) );
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;

View File

@ -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() );

View File

@ -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<PCB_SHAPE> shape = std::make_unique<PCB_SHAPE>( aParent );
switch( CurTok() )
@ -3201,7 +3201,7 @@ PCB_TEXTBOX* PCB_PARSER::parsePCB_TEXTBOX( BOARD_ITEM* aParent )
std::unique_ptr<PCB_TEXTBOX> textbox = std::make_unique<PCB_TEXTBOX>( aParent );
STROKE_PARAMS stroke( -1, PLOT_DASH_TYPE::SOLID );
STROKE_PARAMS stroke( -1, LINE_STYLE::SOLID );
T token = NextTok();
if( token == T_locked )

View File

@ -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_T>( 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 )
{

View File

@ -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 )

View File

@ -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 )
{

View File

@ -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 );

View File

@ -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 );
}

View File

@ -897,7 +897,7 @@ std::vector<PCB_SHAPE*> 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() );

View File

@ -243,7 +243,7 @@ void ZONE_CREATE_HELPER::commitZone( std::unique_ptr<ZONE> 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() );

View File

@ -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() );

View File

@ -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() );
}
}