Naming conventions and file order.
This commit is contained in:
parent
79f94c096e
commit
0dd65d9cd1
|
@ -447,21 +447,21 @@ void LIB_PART::Print( const RENDER_SETTINGS* aSettings, const wxPoint& aOffset,
|
||||||
{
|
{
|
||||||
for( LIB_ITEM& drawItem : m_drawings )
|
for( LIB_ITEM& drawItem : m_drawings )
|
||||||
{
|
{
|
||||||
if( drawItem.m_Fill != FILL_TYPE::FILLED_WITH_BG_BODYCOLOR )
|
if( drawItem.m_fill != FILL_TYPE::FILLED_WITH_BG_BODYCOLOR )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Do not draw items not attached to the current part
|
// Do not draw items not attached to the current part
|
||||||
if( aMulti && drawItem.m_Unit && ( drawItem.m_Unit != aMulti ) )
|
if( aMulti && drawItem.m_unit && ( drawItem.m_unit != aMulti ) )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if( aConvert && drawItem.m_Convert && ( drawItem.m_Convert != aConvert ) )
|
if( aConvert && drawItem.m_convert && ( drawItem.m_convert != aConvert ) )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if( drawItem.Type() == LIB_FIELD_T )
|
if( drawItem.Type() == LIB_FIELD_T )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Now, draw only the background for items with
|
// Now, draw only the background for items with
|
||||||
// m_Fill == FILLED_WITH_BG_BODYCOLOR:
|
// m_fill == FILLED_WITH_BG_BODYCOLOR:
|
||||||
drawItem.Print( aSettings, aOffset, (void*) false, aOpts.transform );
|
drawItem.Print( aSettings, aOffset, (void*) false, aOpts.transform );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -469,10 +469,10 @@ void LIB_PART::Print( const RENDER_SETTINGS* aSettings, const wxPoint& aOffset,
|
||||||
for( LIB_ITEM& drawItem : m_drawings )
|
for( LIB_ITEM& drawItem : m_drawings )
|
||||||
{
|
{
|
||||||
// Do not draw items not attached to the current part
|
// Do not draw items not attached to the current part
|
||||||
if( aMulti && drawItem.m_Unit && ( drawItem.m_Unit != aMulti ) )
|
if( aMulti && drawItem.m_unit && ( drawItem.m_unit != aMulti ) )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if( aConvert && drawItem.m_Convert && ( drawItem.m_Convert != aConvert ) )
|
if( aConvert && drawItem.m_convert && ( drawItem.m_convert != aConvert ) )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if( drawItem.Type() == LIB_FIELD_T )
|
if( drawItem.Type() == LIB_FIELD_T )
|
||||||
|
@ -496,7 +496,7 @@ void LIB_PART::Print( const RENDER_SETTINGS* aSettings, const wxPoint& aOffset,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
bool forceNoFill = drawItem.m_Fill == FILL_TYPE::FILLED_WITH_BG_BODYCOLOR;
|
bool forceNoFill = drawItem.m_fill == FILL_TYPE::FILLED_WITH_BG_BODYCOLOR;
|
||||||
drawItem.Print( aSettings, aOffset, (void*) forceNoFill, aOpts.transform );
|
drawItem.Print( aSettings, aOffset, (void*) forceNoFill, aOpts.transform );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -520,13 +520,13 @@ void LIB_PART::Plot( PLOTTER* aPlotter, int aUnit, int aConvert, const wxPoint&
|
||||||
if( item.Type() == LIB_FIELD_T )
|
if( item.Type() == LIB_FIELD_T )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if( aUnit && item.m_Unit && ( item.m_Unit != aUnit ) )
|
if( aUnit && item.m_unit && ( item.m_unit != aUnit ) )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if( aConvert && item.m_Convert && ( item.m_Convert != aConvert ) )
|
if( aConvert && item.m_convert && ( item.m_convert != aConvert ) )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if( item.m_Fill == FILL_TYPE::FILLED_WITH_BG_BODYCOLOR )
|
if( item.m_fill == FILL_TYPE::FILLED_WITH_BG_BODYCOLOR )
|
||||||
item.Plot( aPlotter, aOffset, fill, aTransform );
|
item.Plot( aPlotter, aOffset, fill, aTransform );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -537,13 +537,13 @@ void LIB_PART::Plot( PLOTTER* aPlotter, int aUnit, int aConvert, const wxPoint&
|
||||||
if( item.Type() == LIB_FIELD_T )
|
if( item.Type() == LIB_FIELD_T )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if( aUnit && item.m_Unit && ( item.m_Unit != aUnit ) )
|
if( aUnit && item.m_unit && ( item.m_unit != aUnit ) )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if( aConvert && item.m_Convert && ( item.m_Convert != aConvert ) )
|
if( aConvert && item.m_convert && ( item.m_convert != aConvert ) )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
item.Plot( aPlotter, aOffset, fill && ( item.m_Fill != FILL_TYPE::FILLED_WITH_BG_BODYCOLOR ),
|
item.Plot( aPlotter, aOffset, fill && ( item.m_fill != FILL_TYPE::FILLED_WITH_BG_BODYCOLOR ),
|
||||||
aTransform );
|
aTransform );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -562,10 +562,10 @@ void LIB_PART::PlotLibFields( PLOTTER* aPlotter, int aUnit, int aConvert,
|
||||||
if( item.Type() != LIB_FIELD_T )
|
if( item.Type() != LIB_FIELD_T )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if( aUnit && item.m_Unit && ( item.m_Unit != aUnit ) )
|
if( aUnit && item.m_unit && ( item.m_unit != aUnit ) )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if( aConvert && item.m_Convert && ( item.m_Convert != aConvert ) )
|
if( aConvert && item.m_convert && ( item.m_convert != aConvert ) )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
LIB_FIELD& field = (LIB_FIELD&) item;
|
LIB_FIELD& field = (LIB_FIELD&) item;
|
||||||
|
@ -655,17 +655,17 @@ void LIB_PART::GetPins( LIB_PINS& aList, int aUnit, int aConvert )
|
||||||
/* Notes:
|
/* Notes:
|
||||||
* when aUnit == 0: no unit filtering
|
* when aUnit == 0: no unit filtering
|
||||||
* when aConvert == 0: no convert (shape selection) filtering
|
* when aConvert == 0: no convert (shape selection) filtering
|
||||||
* when .m_Unit == 0, the body item is common to units
|
* when m_unit == 0, the body item is common to units
|
||||||
* when .m_Convert == 0, the body item is common to shapes
|
* when m_convert == 0, the body item is common to shapes
|
||||||
*/
|
*/
|
||||||
for( LIB_ITEM& item : m_drawings[ LIB_PIN_T ] )
|
for( LIB_ITEM& item : m_drawings[ LIB_PIN_T ] )
|
||||||
{
|
{
|
||||||
// Unit filtering:
|
// Unit filtering:
|
||||||
if( aUnit && item.m_Unit && ( item.m_Unit != aUnit ) )
|
if( aUnit && item.m_unit && ( item.m_unit != aUnit ) )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Shape filtering:
|
// Shape filtering:
|
||||||
if( aConvert && item.m_Convert && ( item.m_Convert != aConvert ) )
|
if( aConvert && item.m_convert && ( item.m_convert != aConvert ) )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
aList.push_back( (LIB_PIN*) &item );
|
aList.push_back( (LIB_PIN*) &item );
|
||||||
|
@ -765,11 +765,15 @@ const EDA_RECT LIB_PART::GetUnitBoundingBox( int aUnit, int aConvert ) const
|
||||||
|
|
||||||
for( const LIB_ITEM& item : m_drawings )
|
for( const LIB_ITEM& item : m_drawings )
|
||||||
{
|
{
|
||||||
if( ( item.m_Unit > 0 ) && ( ( m_unitCount > 1 ) && ( aUnit > 0 )
|
if( item.m_unit > 0
|
||||||
&& ( aUnit != item.m_Unit ) ) )
|
&& m_unitCount > 1
|
||||||
|
&& aUnit > 0
|
||||||
|
&& aUnit != item.m_unit )
|
||||||
|
{
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if( item.m_Convert > 0 && ( ( aConvert > 0 ) && ( aConvert != item.m_Convert ) ) )
|
if( item.m_convert > 0 && aConvert > 0 && aConvert != item.m_convert )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if ( ( item.Type() == LIB_FIELD_T ) && !( ( LIB_FIELD& ) item ).IsVisible() )
|
if ( ( item.Type() == LIB_FIELD_T ) && !( ( LIB_FIELD& ) item ).IsVisible() )
|
||||||
|
@ -806,11 +810,15 @@ const EDA_RECT LIB_PART::GetBodyBoundingBox( int aUnit, int aConvert ) const
|
||||||
|
|
||||||
for( const LIB_ITEM& item : m_drawings )
|
for( const LIB_ITEM& item : m_drawings )
|
||||||
{
|
{
|
||||||
if( ( item.m_Unit > 0 ) && ( ( m_unitCount > 1 ) && ( aUnit > 0 )
|
if( item.m_unit > 0
|
||||||
&& ( aUnit != item.m_Unit ) ) )
|
&& m_unitCount > 1
|
||||||
|
&& aUnit > 0
|
||||||
|
&& aUnit != item.m_unit )
|
||||||
|
{
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if( item.m_Convert > 0 && ( ( aConvert > 0 ) && ( aConvert != item.m_Convert ) ) )
|
if( item.m_convert > 0 && aConvert > 0 && aConvert != item.m_convert )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if( item.Type() == LIB_FIELD_T )
|
if( item.Type() == LIB_FIELD_T )
|
||||||
|
@ -971,7 +979,7 @@ bool LIB_PART::HasConversion() const
|
||||||
{
|
{
|
||||||
for( const LIB_ITEM& item : m_drawings )
|
for( const LIB_ITEM& item : m_drawings )
|
||||||
{
|
{
|
||||||
if( item.m_Convert > LIB_ITEM::LIB_CONVERT::BASE )
|
if( item.m_convert > LIB_ITEM::LIB_CONVERT::BASE )
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -979,7 +987,7 @@ bool LIB_PART::HasConversion() const
|
||||||
{
|
{
|
||||||
for( const LIB_ITEM& item : parent->GetDrawItems() )
|
for( const LIB_ITEM& item : parent->GetDrawItems() )
|
||||||
{
|
{
|
||||||
if( item.m_Convert > LIB_ITEM::LIB_CONVERT::BASE )
|
if( item.m_convert > LIB_ITEM::LIB_CONVERT::BASE )
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1007,10 +1015,12 @@ LIB_ITEM* LIB_PART::LocateDrawItem( int aUnit, int aConvert,
|
||||||
{
|
{
|
||||||
for( LIB_ITEM& item : m_drawings )
|
for( LIB_ITEM& item : m_drawings )
|
||||||
{
|
{
|
||||||
if( ( aUnit && item.m_Unit && ( aUnit != item.m_Unit) )
|
if( ( aUnit && item.m_unit && aUnit != item.m_unit )
|
||||||
|| ( aConvert && item.m_Convert && ( aConvert != item.m_Convert ) )
|
|| ( aConvert && item.m_convert && aConvert != item.m_convert )
|
||||||
|| ( ( item.Type() != aType ) && ( aType != TYPE_NOT_INIT ) ) )
|
|| ( item.Type() != aType && aType != TYPE_NOT_INIT ) )
|
||||||
|
{
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if( item.HitTest( aPoint ) )
|
if( item.HitTest( aPoint ) )
|
||||||
return &item;
|
return &item;
|
||||||
|
@ -1068,7 +1078,7 @@ void LIB_PART::SetUnitCount( int aCount, bool aDuplicateDrawItems )
|
||||||
|
|
||||||
while( i != m_drawings.end() )
|
while( i != m_drawings.end() )
|
||||||
{
|
{
|
||||||
if( i->m_Unit > aCount )
|
if( i->m_unit > aCount )
|
||||||
i = m_drawings.erase( i );
|
i = m_drawings.erase( i );
|
||||||
else
|
else
|
||||||
++i;
|
++i;
|
||||||
|
@ -1085,13 +1095,13 @@ void LIB_PART::SetUnitCount( int aCount, bool aDuplicateDrawItems )
|
||||||
|
|
||||||
for( LIB_ITEM& item : m_drawings )
|
for( LIB_ITEM& item : m_drawings )
|
||||||
{
|
{
|
||||||
if( item.m_Unit != 1 )
|
if( item.m_unit != 1 )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
for( int j = prevCount + 1; j <= aCount; j++ )
|
for( int j = prevCount + 1; j <= aCount; j++ )
|
||||||
{
|
{
|
||||||
LIB_ITEM* newItem = (LIB_ITEM*) item.Clone();
|
LIB_ITEM* newItem = (LIB_ITEM*) item.Clone();
|
||||||
newItem->m_Unit = j;
|
newItem->m_unit = j;
|
||||||
tmp.push_back( newItem );
|
tmp.push_back( newItem );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1131,10 +1141,10 @@ void LIB_PART::SetConversion( bool aSetConvert, bool aDuplicatePins )
|
||||||
if( item.Type() != LIB_PIN_T )
|
if( item.Type() != LIB_PIN_T )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if( item.m_Convert == 1 )
|
if( item.m_convert == 1 )
|
||||||
{
|
{
|
||||||
LIB_ITEM* newItem = (LIB_ITEM*) item.Clone();
|
LIB_ITEM* newItem = (LIB_ITEM*) item.Clone();
|
||||||
newItem->m_Convert = 2;
|
newItem->m_convert = 2;
|
||||||
tmp.push_back( newItem );
|
tmp.push_back( newItem );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1152,7 +1162,7 @@ void LIB_PART::SetConversion( bool aSetConvert, bool aDuplicatePins )
|
||||||
|
|
||||||
while( i != m_drawings.end() )
|
while( i != m_drawings.end() )
|
||||||
{
|
{
|
||||||
if( i->m_Convert > 1 )
|
if( i->m_convert > 1 )
|
||||||
i = m_drawings.erase( i );
|
i = m_drawings.erase( i );
|
||||||
else
|
else
|
||||||
++i;
|
++i;
|
||||||
|
|
|
@ -255,12 +255,12 @@ void SCH_EDIT_FRAME::ConvertPart( SCH_COMPONENT* aComponent )
|
||||||
|
|
||||||
aComponent->SetConvert( aComponent->GetConvert() + 1 );
|
aComponent->SetConvert( aComponent->GetConvert() + 1 );
|
||||||
|
|
||||||
// ensure m_Convert = 1 or 2
|
// ensure m_convert = 1 or 2
|
||||||
// 1 = shape 1 = not converted
|
// 1 = shape 1 = not converted
|
||||||
// 2 = shape 2 = first converted shape
|
// 2 = shape 2 = first converted shape
|
||||||
// > 2 is not used but could be used for more shapes
|
// > 2 is not used but could be used for more shapes
|
||||||
// like multiple shapes for a programmable component
|
// like multiple shapes for a programmable component
|
||||||
// When m_Convert = val max, return to the first shape
|
// When m_convert = val max, return to the first shape
|
||||||
if( aComponent->GetConvert() > LIB_ITEM::LIB_CONVERT::DEMORGAN )
|
if( aComponent->GetConvert() > LIB_ITEM::LIB_CONVERT::DEMORGAN )
|
||||||
aComponent->SetConvert( LIB_ITEM::LIB_CONVERT::BASE );
|
aComponent->SetConvert( LIB_ITEM::LIB_CONVERT::BASE );
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ LIB_ARC::LIB_ARC( LIB_PART* aParent ) : LIB_ITEM( LIB_ARC_T, aParent )
|
||||||
m_t1 = 0;
|
m_t1 = 0;
|
||||||
m_t2 = 0;
|
m_t2 = 0;
|
||||||
m_Width = 0;
|
m_Width = 0;
|
||||||
m_Fill = FILL_TYPE::NO_FILL;
|
m_fill = FILL_TYPE::NO_FILL;
|
||||||
m_isFillable = true;
|
m_isFillable = true;
|
||||||
m_editState = 0;
|
m_editState = 0;
|
||||||
}
|
}
|
||||||
|
@ -261,13 +261,13 @@ void LIB_ARC::Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill,
|
||||||
|
|
||||||
aTransform.MapAngles( &t1, &t2 );
|
aTransform.MapAngles( &t1, &t2 );
|
||||||
|
|
||||||
if( aFill && m_Fill == FILL_TYPE::FILLED_WITH_BG_BODYCOLOR )
|
if( aFill && m_fill == FILL_TYPE::FILLED_WITH_BG_BODYCOLOR )
|
||||||
{
|
{
|
||||||
aPlotter->SetColor( aPlotter->RenderSettings()->GetLayerColor( LAYER_DEVICE_BACKGROUND ) );
|
aPlotter->SetColor( aPlotter->RenderSettings()->GetLayerColor( LAYER_DEVICE_BACKGROUND ) );
|
||||||
aPlotter->Arc( pos, -t2, -t1, m_Radius, FILL_TYPE::FILLED_WITH_BG_BODYCOLOR, 0 );
|
aPlotter->Arc( pos, -t2, -t1, m_Radius, FILL_TYPE::FILLED_WITH_BG_BODYCOLOR, 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool already_filled = m_Fill == FILL_TYPE::FILLED_WITH_BG_BODYCOLOR;
|
bool already_filled = m_fill == FILL_TYPE::FILLED_WITH_BG_BODYCOLOR;
|
||||||
int pen_size = GetPenWidth();
|
int pen_size = GetPenWidth();
|
||||||
|
|
||||||
if( !already_filled || pen_size > 0 )
|
if( !already_filled || pen_size > 0 )
|
||||||
|
@ -275,8 +275,8 @@ void LIB_ARC::Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill,
|
||||||
pen_size = std::max( pen_size, aPlotter->RenderSettings()->GetMinPenWidth() );
|
pen_size = std::max( pen_size, aPlotter->RenderSettings()->GetMinPenWidth() );
|
||||||
|
|
||||||
aPlotter->SetColor( aPlotter->RenderSettings()->GetLayerColor( LAYER_DEVICE ) );
|
aPlotter->SetColor( aPlotter->RenderSettings()->GetLayerColor( LAYER_DEVICE ) );
|
||||||
aPlotter->Arc(
|
aPlotter->Arc( pos, -t2, -t1, m_Radius, already_filled ? FILL_TYPE::NO_FILL : m_fill,
|
||||||
pos, -t2, -t1, m_Radius, already_filled ? FILL_TYPE::NO_FILL : m_Fill, pen_size );
|
pen_size );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -297,7 +297,7 @@ void LIB_ARC::print( const RENDER_SETTINGS* aSettings, const wxPoint& aOffset, v
|
||||||
bool forceNoFill = static_cast<bool>( aData );
|
bool forceNoFill = static_cast<bool>( aData );
|
||||||
int penWidth = GetPenWidth();
|
int penWidth = GetPenWidth();
|
||||||
|
|
||||||
if( forceNoFill && m_Fill != FILL_TYPE::NO_FILL && penWidth == 0 )
|
if( forceNoFill && m_fill != FILL_TYPE::NO_FILL && penWidth == 0 )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
wxDC* DC = aSettings->GetPrintDC();
|
wxDC* DC = aSettings->GetPrintDC();
|
||||||
|
@ -317,7 +317,7 @@ void LIB_ARC::print( const RENDER_SETTINGS* aSettings, const wxPoint& aOffset, v
|
||||||
std::swap( pos1.y, pos2.y );
|
std::swap( pos1.y, pos2.y );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( forceNoFill || m_Fill == FILL_TYPE::NO_FILL )
|
if( forceNoFill || m_fill == FILL_TYPE::NO_FILL )
|
||||||
{
|
{
|
||||||
penWidth = std::max( penWidth, aSettings->GetDefaultPenWidth() );
|
penWidth = std::max( penWidth, aSettings->GetDefaultPenWidth() );
|
||||||
|
|
||||||
|
@ -325,7 +325,7 @@ void LIB_ARC::print( const RENDER_SETTINGS* aSettings, const wxPoint& aOffset, v
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if( m_Fill == FILL_TYPE::FILLED_WITH_BG_BODYCOLOR )
|
if( m_fill == FILL_TYPE::FILLED_WITH_BG_BODYCOLOR )
|
||||||
color = aSettings->GetLayerColor( LAYER_DEVICE_BACKGROUND );
|
color = aSettings->GetLayerColor( LAYER_DEVICE_BACKGROUND );
|
||||||
|
|
||||||
GRFilledArc( nullptr, DC, posc.x, posc.y, pt1, pt2, m_Radius, penWidth, color, color );
|
GRFilledArc( nullptr, DC, posc.x, posc.y, pt1, pt2, m_Radius, penWidth, color, color );
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
LIB_BEZIER::LIB_BEZIER( LIB_PART* aParent ) :
|
LIB_BEZIER::LIB_BEZIER( LIB_PART* aParent ) :
|
||||||
LIB_ITEM( LIB_BEZIER_T, aParent )
|
LIB_ITEM( LIB_BEZIER_T, aParent )
|
||||||
{
|
{
|
||||||
m_Fill = FILL_TYPE::NO_FILL;
|
m_fill = FILL_TYPE::NO_FILL;
|
||||||
m_Width = 0;
|
m_Width = 0;
|
||||||
m_isFillable = true;
|
m_isFillable = true;
|
||||||
}
|
}
|
||||||
|
@ -173,13 +173,13 @@ void LIB_BEZIER::Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill,
|
||||||
cornerList.push_back( pos );
|
cornerList.push_back( pos );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( aFill && m_Fill == FILL_TYPE::FILLED_WITH_BG_BODYCOLOR )
|
if( aFill && m_fill == FILL_TYPE::FILLED_WITH_BG_BODYCOLOR )
|
||||||
{
|
{
|
||||||
aPlotter->SetColor( aPlotter->RenderSettings()->GetLayerColor( LAYER_DEVICE_BACKGROUND ) );
|
aPlotter->SetColor( aPlotter->RenderSettings()->GetLayerColor( LAYER_DEVICE_BACKGROUND ) );
|
||||||
aPlotter->PlotPoly( cornerList, FILL_TYPE::FILLED_WITH_BG_BODYCOLOR, 0 );
|
aPlotter->PlotPoly( cornerList, FILL_TYPE::FILLED_WITH_BG_BODYCOLOR, 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool already_filled = m_Fill == FILL_TYPE::FILLED_WITH_BG_BODYCOLOR;
|
bool already_filled = m_fill == FILL_TYPE::FILLED_WITH_BG_BODYCOLOR;
|
||||||
int pen_size = GetPenWidth();
|
int pen_size = GetPenWidth();
|
||||||
|
|
||||||
if( !already_filled || pen_size > 0 )
|
if( !already_filled || pen_size > 0 )
|
||||||
|
@ -187,7 +187,7 @@ void LIB_BEZIER::Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill,
|
||||||
pen_size = std::max( pen_size, aPlotter->RenderSettings()->GetMinPenWidth() );
|
pen_size = std::max( pen_size, aPlotter->RenderSettings()->GetMinPenWidth() );
|
||||||
|
|
||||||
aPlotter->SetColor( aPlotter->RenderSettings()->GetLayerColor( LAYER_DEVICE ) );
|
aPlotter->SetColor( aPlotter->RenderSettings()->GetLayerColor( LAYER_DEVICE ) );
|
||||||
aPlotter->PlotPoly( cornerList, already_filled ? FILL_TYPE::NO_FILL : m_Fill, pen_size );
|
aPlotter->PlotPoly( cornerList, already_filled ? FILL_TYPE::NO_FILL : m_fill, pen_size );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -208,7 +208,7 @@ void LIB_BEZIER::print( const RENDER_SETTINGS* aSettings, const wxPoint& aOffset
|
||||||
bool forceNoFill = static_cast<bool>( aData );
|
bool forceNoFill = static_cast<bool>( aData );
|
||||||
int penWidth = GetPenWidth();
|
int penWidth = GetPenWidth();
|
||||||
|
|
||||||
if( forceNoFill && m_Fill != FILL_TYPE::NO_FILL && penWidth == 0 )
|
if( forceNoFill && m_fill != FILL_TYPE::NO_FILL && penWidth == 0 )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
std::vector<wxPoint> PolyPointsTraslated;
|
std::vector<wxPoint> PolyPointsTraslated;
|
||||||
|
@ -223,7 +223,7 @@ void LIB_BEZIER::print( const RENDER_SETTINGS* aSettings, const wxPoint& aOffset
|
||||||
for( wxPoint& point : m_PolyPoints )
|
for( wxPoint& point : m_PolyPoints )
|
||||||
PolyPointsTraslated.push_back( aTransform.TransformCoordinate( point ) + aOffset );
|
PolyPointsTraslated.push_back( aTransform.TransformCoordinate( point ) + aOffset );
|
||||||
|
|
||||||
if( forceNoFill || m_Fill == FILL_TYPE::NO_FILL )
|
if( forceNoFill || m_fill == FILL_TYPE::NO_FILL )
|
||||||
{
|
{
|
||||||
penWidth = std::max( penWidth, aSettings->GetDefaultPenWidth() );
|
penWidth = std::max( penWidth, aSettings->GetDefaultPenWidth() );
|
||||||
|
|
||||||
|
@ -232,7 +232,7 @@ void LIB_BEZIER::print( const RENDER_SETTINGS* aSettings, const wxPoint& aOffset
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if( m_Fill == FILL_TYPE::FILLED_WITH_BG_BODYCOLOR )
|
if( m_fill == FILL_TYPE::FILLED_WITH_BG_BODYCOLOR )
|
||||||
color = aSettings->GetLayerColor( LAYER_DEVICE_BACKGROUND );
|
color = aSettings->GetLayerColor( LAYER_DEVICE_BACKGROUND );
|
||||||
|
|
||||||
GRPoly( nullptr, DC, m_PolyPoints.size(), &PolyPointsTraslated[0], true, penWidth,
|
GRPoly( nullptr, DC, m_PolyPoints.size(), &PolyPointsTraslated[0], true, penWidth,
|
||||||
|
|
|
@ -40,7 +40,7 @@ LIB_CIRCLE::LIB_CIRCLE( LIB_PART* aParent ) :
|
||||||
LIB_ITEM( LIB_CIRCLE_T, aParent )
|
LIB_ITEM( LIB_CIRCLE_T, aParent )
|
||||||
{
|
{
|
||||||
m_Width = 0;
|
m_Width = 0;
|
||||||
m_Fill = FILL_TYPE::NO_FILL;
|
m_fill = FILL_TYPE::NO_FILL;
|
||||||
m_isFillable = true;
|
m_isFillable = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -164,13 +164,13 @@ void LIB_CIRCLE::Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill,
|
||||||
{
|
{
|
||||||
wxPoint pos = aTransform.TransformCoordinate( m_Pos ) + aOffset;
|
wxPoint pos = aTransform.TransformCoordinate( m_Pos ) + aOffset;
|
||||||
|
|
||||||
if( aFill && m_Fill == FILL_TYPE::FILLED_WITH_BG_BODYCOLOR )
|
if( aFill && m_fill == FILL_TYPE::FILLED_WITH_BG_BODYCOLOR )
|
||||||
{
|
{
|
||||||
aPlotter->SetColor( aPlotter->RenderSettings()->GetLayerColor( LAYER_DEVICE_BACKGROUND ) );
|
aPlotter->SetColor( aPlotter->RenderSettings()->GetLayerColor( LAYER_DEVICE_BACKGROUND ) );
|
||||||
aPlotter->Circle( pos, GetRadius() * 2, FILL_TYPE::FILLED_WITH_BG_BODYCOLOR, 0 );
|
aPlotter->Circle( pos, GetRadius() * 2, FILL_TYPE::FILLED_WITH_BG_BODYCOLOR, 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool already_filled = m_Fill == FILL_TYPE::FILLED_WITH_BG_BODYCOLOR;
|
bool already_filled = m_fill == FILL_TYPE::FILLED_WITH_BG_BODYCOLOR;
|
||||||
int pen_size = GetPenWidth();
|
int pen_size = GetPenWidth();
|
||||||
|
|
||||||
if( !already_filled || pen_size > 0 )
|
if( !already_filled || pen_size > 0 )
|
||||||
|
@ -178,8 +178,8 @@ void LIB_CIRCLE::Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill,
|
||||||
pen_size = std::max( pen_size, aPlotter->RenderSettings()->GetMinPenWidth() );
|
pen_size = std::max( pen_size, aPlotter->RenderSettings()->GetMinPenWidth() );
|
||||||
|
|
||||||
aPlotter->SetColor( aPlotter->RenderSettings()->GetLayerColor( LAYER_DEVICE ) );
|
aPlotter->SetColor( aPlotter->RenderSettings()->GetLayerColor( LAYER_DEVICE ) );
|
||||||
aPlotter->Circle(
|
aPlotter->Circle( pos, GetRadius() * 2, already_filled ? FILL_TYPE::NO_FILL : m_fill,
|
||||||
pos, GetRadius() * 2, already_filled ? FILL_TYPE::NO_FILL : m_Fill, pen_size );
|
pen_size );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -200,14 +200,14 @@ void LIB_CIRCLE::print( const RENDER_SETTINGS* aSettings, const wxPoint& aOffset
|
||||||
bool forceNoFill = static_cast<bool>( aData );
|
bool forceNoFill = static_cast<bool>( aData );
|
||||||
int penWidth = GetPenWidth();
|
int penWidth = GetPenWidth();
|
||||||
|
|
||||||
if( forceNoFill && m_Fill != FILL_TYPE::NO_FILL && penWidth == 0 )
|
if( forceNoFill && m_fill != FILL_TYPE::NO_FILL && penWidth == 0 )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
wxDC* DC = aSettings->GetPrintDC();
|
wxDC* DC = aSettings->GetPrintDC();
|
||||||
wxPoint pos1 = aTransform.TransformCoordinate( m_Pos ) + aOffset;
|
wxPoint pos1 = aTransform.TransformCoordinate( m_Pos ) + aOffset;
|
||||||
COLOR4D color = aSettings->GetLayerColor( LAYER_DEVICE );
|
COLOR4D color = aSettings->GetLayerColor( LAYER_DEVICE );
|
||||||
|
|
||||||
if( forceNoFill || m_Fill == FILL_TYPE::NO_FILL )
|
if( forceNoFill || m_fill == FILL_TYPE::NO_FILL )
|
||||||
{
|
{
|
||||||
penWidth = std::max( penWidth, aSettings->GetDefaultPenWidth() );
|
penWidth = std::max( penWidth, aSettings->GetDefaultPenWidth() );
|
||||||
|
|
||||||
|
@ -215,7 +215,7 @@ void LIB_CIRCLE::print( const RENDER_SETTINGS* aSettings, const wxPoint& aOffset
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if( m_Fill == FILL_TYPE::FILLED_WITH_BG_BODYCOLOR )
|
if( m_fill == FILL_TYPE::FILLED_WITH_BG_BODYCOLOR )
|
||||||
color = aSettings->GetLayerColor( LAYER_DEVICE_BACKGROUND );
|
color = aSettings->GetLayerColor( LAYER_DEVICE_BACKGROUND );
|
||||||
|
|
||||||
GRFilledCircle( nullptr, DC, pos1.x, pos1.y, GetRadius(), 0, color, color );
|
GRFilledCircle( nullptr, DC, pos1.x, pos1.y, GetRadius(), 0, color, color );
|
||||||
|
|
|
@ -39,9 +39,9 @@ LIB_ITEM::LIB_ITEM( KICAD_T aType,
|
||||||
FILL_TYPE aFillType ) :
|
FILL_TYPE aFillType ) :
|
||||||
EDA_ITEM( aType )
|
EDA_ITEM( aType )
|
||||||
{
|
{
|
||||||
m_Unit = aUnit;
|
m_unit = aUnit;
|
||||||
m_Convert = aConvert;
|
m_convert = aConvert;
|
||||||
m_Fill = aFillType;
|
m_fill = aFillType;
|
||||||
m_parent = (EDA_ITEM*) aComponent;
|
m_parent = (EDA_ITEM*) aComponent;
|
||||||
m_isFillable = false;
|
m_isFillable = false;
|
||||||
}
|
}
|
||||||
|
@ -53,16 +53,16 @@ void LIB_ITEM::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList )
|
||||||
|
|
||||||
aList.push_back( MSG_PANEL_ITEM( _( "Type" ), GetTypeName() ) );
|
aList.push_back( MSG_PANEL_ITEM( _( "Type" ), GetTypeName() ) );
|
||||||
|
|
||||||
if( m_Unit == 0 )
|
if( m_unit == 0 )
|
||||||
msg = _( "All" );
|
msg = _( "All" );
|
||||||
else
|
else
|
||||||
msg.Printf( wxT( "%d" ), m_Unit );
|
msg.Printf( wxT( "%d" ), m_unit );
|
||||||
|
|
||||||
aList.push_back( MSG_PANEL_ITEM( _( "Unit" ), msg ) );
|
aList.push_back( MSG_PANEL_ITEM( _( "Unit" ), msg ) );
|
||||||
|
|
||||||
if( m_Convert == LIB_ITEM::LIB_CONVERT::BASE )
|
if( m_convert == LIB_ITEM::LIB_CONVERT::BASE )
|
||||||
msg = _( "no" );
|
msg = _( "no" );
|
||||||
else if( m_Convert == LIB_ITEM::LIB_CONVERT::DEMORGAN )
|
else if( m_convert == LIB_ITEM::LIB_CONVERT::DEMORGAN )
|
||||||
msg = _( "yes" );
|
msg = _( "yes" );
|
||||||
else
|
else
|
||||||
msg = wxT( "?" );
|
msg = wxT( "?" );
|
||||||
|
@ -77,14 +77,14 @@ int LIB_ITEM::compare( const LIB_ITEM& aOther, LIB_ITEM::COMPARE_FLAGS aCompareF
|
||||||
return Type() - aOther.Type();
|
return Type() - aOther.Type();
|
||||||
|
|
||||||
// When comparing unit LIB_ITEM objects, we ignore the unit number.
|
// When comparing unit LIB_ITEM objects, we ignore the unit number.
|
||||||
if( !( aCompareFlags & COMPARE_FLAGS::UNIT ) && m_Unit != aOther.m_Unit )
|
if( !( aCompareFlags & COMPARE_FLAGS::UNIT ) && m_unit != aOther.m_unit )
|
||||||
return m_Unit - aOther.m_Unit;
|
return m_unit - aOther.m_unit;
|
||||||
|
|
||||||
if( !( aCompareFlags & COMPARE_FLAGS::UNIT ) && m_Convert != aOther.m_Convert )
|
if( !( aCompareFlags & COMPARE_FLAGS::UNIT ) && m_convert != aOther.m_convert )
|
||||||
return m_Convert - m_Convert;
|
return m_convert - m_convert;
|
||||||
|
|
||||||
if( m_Fill != aOther.m_Fill )
|
if( m_fill != aOther.m_fill )
|
||||||
return static_cast<int>( m_Fill ) - static_cast<int>( aOther.m_Fill );
|
return static_cast<int>( m_fill ) - static_cast<int>( aOther.m_fill );
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -98,12 +98,12 @@ bool LIB_ITEM::operator==( const LIB_ITEM& aOther ) const
|
||||||
|
|
||||||
bool LIB_ITEM::operator<( const LIB_ITEM& aOther ) const
|
bool LIB_ITEM::operator<( const LIB_ITEM& aOther ) const
|
||||||
{
|
{
|
||||||
int result = m_Convert - aOther.m_Convert;
|
int result = m_convert - aOther.m_convert;
|
||||||
|
|
||||||
if( result != 0 )
|
if( result != 0 )
|
||||||
return result < 0;
|
return result < 0;
|
||||||
|
|
||||||
result = m_Unit - aOther.m_Unit;
|
result = m_unit - aOther.m_unit;
|
||||||
|
|
||||||
if( result != 0 )
|
if( result != 0 )
|
||||||
return result < 0;
|
return result < 0;
|
||||||
|
|
|
@ -61,41 +61,9 @@ typedef std::vector< LIB_PIN* > LIB_PINS;
|
||||||
*/
|
*/
|
||||||
class LIB_ITEM : public EDA_ITEM
|
class LIB_ITEM : public EDA_ITEM
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* Print the item to \a aDC.
|
|
||||||
*
|
|
||||||
* @param aOffset A reference to a wxPoint object containing the offset where to draw
|
|
||||||
* from the object's current position.
|
|
||||||
* @param aData A pointer to any object specific data required to perform the draw.
|
|
||||||
* @param aTransform A reference to a #TRANSFORM object containing drawing transform.
|
|
||||||
*/
|
|
||||||
virtual void print( const RENDER_SETTINGS* aSettings, const wxPoint& aOffset, void* aData,
|
|
||||||
const TRANSFORM& aTransform ) = 0;
|
|
||||||
|
|
||||||
friend class LIB_PART;
|
friend class LIB_PART;
|
||||||
|
|
||||||
protected:
|
|
||||||
/**
|
|
||||||
* Unit identification for multiple parts per package. Set to 0 if the item is common
|
|
||||||
* to all units.
|
|
||||||
*/
|
|
||||||
int m_Unit;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Shape identification for alternate body styles. Set 0 if the item is common to all
|
|
||||||
* body styles. This is typially used for representing DeMorgan variants in KiCad.
|
|
||||||
*/
|
|
||||||
int m_Convert;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The body fill type. This has meaning only for some items. For a list of fill types
|
|
||||||
* see #FILL_TYPE.
|
|
||||||
*/
|
|
||||||
FILL_TYPE m_Fill;
|
|
||||||
bool m_isFillable;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
LIB_ITEM( KICAD_T aType, LIB_PART* aComponent = NULL, int aUnit = 0, int aConvert = 0,
|
LIB_ITEM( KICAD_T aType, LIB_PART* aComponent = NULL, int aUnit = 0, int aConvert = 0,
|
||||||
FILL_TYPE aFillType = FILL_TYPE::NO_FILL );
|
FILL_TYPE aFillType = FILL_TYPE::NO_FILL );
|
||||||
|
|
||||||
|
@ -103,7 +71,6 @@ public:
|
||||||
|
|
||||||
virtual ~LIB_ITEM() { }
|
virtual ~LIB_ITEM() { }
|
||||||
|
|
||||||
|
|
||||||
// Define the enums for basic
|
// Define the enums for basic
|
||||||
enum LIB_CONVERT : int { BASE = 1, DEMORGAN = 2 };
|
enum LIB_CONVERT : int { BASE = 1, DEMORGAN = 2 };
|
||||||
|
|
||||||
|
@ -163,7 +130,6 @@ public:
|
||||||
*/
|
*/
|
||||||
virtual void CalcEdit( const wxPoint& aPosition ) {}
|
virtual void CalcEdit( const wxPoint& aPosition ) {}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Draw an item
|
* Draw an item
|
||||||
*
|
*
|
||||||
|
@ -292,21 +258,20 @@ public:
|
||||||
*/
|
*/
|
||||||
bool IsFillable() const { return m_isFillable; }
|
bool IsFillable() const { return m_isFillable; }
|
||||||
|
|
||||||
void SetUnit( int aUnit ) { m_Unit = aUnit; }
|
void SetUnit( int aUnit ) { m_unit = aUnit; }
|
||||||
int GetUnit() const { return m_Unit; }
|
int GetUnit() const { return m_unit; }
|
||||||
|
|
||||||
void SetConvert( int aConvert ) { m_Convert = aConvert; }
|
void SetConvert( int aConvert ) { m_convert = aConvert; }
|
||||||
int GetConvert() const { return m_Convert; }
|
int GetConvert() const { return m_convert; }
|
||||||
|
|
||||||
void SetFillMode( FILL_TYPE aFillMode ) { m_Fill = aFillMode; }
|
void SetFillMode( FILL_TYPE aFillMode ) { m_fill = aFillMode; }
|
||||||
FILL_TYPE GetFillMode() const { return m_Fill; }
|
FILL_TYPE GetFillMode() const { return m_fill; }
|
||||||
|
|
||||||
#if defined(DEBUG)
|
#if defined(DEBUG)
|
||||||
void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
|
void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provide the draw object specific comparison called by the == and < operators.
|
* Provide the draw object specific comparison called by the == and < operators.
|
||||||
*
|
*
|
||||||
|
@ -329,6 +294,37 @@ protected:
|
||||||
*/
|
*/
|
||||||
virtual int compare( const LIB_ITEM& aOther,
|
virtual int compare( const LIB_ITEM& aOther,
|
||||||
LIB_ITEM::COMPARE_FLAGS aCompareFlags = LIB_ITEM::COMPARE_FLAGS::NORMAL ) const;
|
LIB_ITEM::COMPARE_FLAGS aCompareFlags = LIB_ITEM::COMPARE_FLAGS::NORMAL ) const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Print the item to \a aDC.
|
||||||
|
*
|
||||||
|
* @param aOffset A reference to a wxPoint object containing the offset where to draw
|
||||||
|
* from the object's current position.
|
||||||
|
* @param aData A pointer to any object specific data required to perform the draw.
|
||||||
|
* @param aTransform A reference to a #TRANSFORM object containing drawing transform.
|
||||||
|
*/
|
||||||
|
virtual void print( const RENDER_SETTINGS* aSettings, const wxPoint& aOffset, void* aData,
|
||||||
|
const TRANSFORM& aTransform ) = 0;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
/**
|
||||||
|
* Unit identification for multiple parts per package. Set to 0 if the item is common
|
||||||
|
* to all units.
|
||||||
|
*/
|
||||||
|
int m_unit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Shape identification for alternate body styles. Set 0 if the item is common to all
|
||||||
|
* body styles. This is typially used for representing DeMorgan variants in KiCad.
|
||||||
|
*/
|
||||||
|
int m_convert;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The body fill type. This has meaning only for some items. For a list of fill types
|
||||||
|
* see #FILL_TYPE.
|
||||||
|
*/
|
||||||
|
FILL_TYPE m_fill;
|
||||||
|
bool m_isFillable;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
LIB_POLYLINE::LIB_POLYLINE( LIB_PART* aParent ) :
|
LIB_POLYLINE::LIB_POLYLINE( LIB_PART* aParent ) :
|
||||||
LIB_ITEM( LIB_POLYLINE_T, aParent )
|
LIB_ITEM( LIB_POLYLINE_T, aParent )
|
||||||
{
|
{
|
||||||
m_Fill = FILL_TYPE::NO_FILL;
|
m_fill = FILL_TYPE::NO_FILL;
|
||||||
m_Width = 0;
|
m_Width = 0;
|
||||||
m_isFillable = true;
|
m_isFillable = true;
|
||||||
}
|
}
|
||||||
|
@ -132,13 +132,13 @@ void LIB_POLYLINE::Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill,
|
||||||
cornerList.push_back( pos );
|
cornerList.push_back( pos );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( aFill && m_Fill == FILL_TYPE::FILLED_WITH_BG_BODYCOLOR )
|
if( aFill && m_fill == FILL_TYPE::FILLED_WITH_BG_BODYCOLOR )
|
||||||
{
|
{
|
||||||
aPlotter->SetColor( aPlotter->RenderSettings()->GetLayerColor( LAYER_DEVICE_BACKGROUND ) );
|
aPlotter->SetColor( aPlotter->RenderSettings()->GetLayerColor( LAYER_DEVICE_BACKGROUND ) );
|
||||||
aPlotter->PlotPoly( cornerList, FILL_TYPE::FILLED_WITH_BG_BODYCOLOR, 0 );
|
aPlotter->PlotPoly( cornerList, FILL_TYPE::FILLED_WITH_BG_BODYCOLOR, 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool already_filled = m_Fill == FILL_TYPE::FILLED_WITH_BG_BODYCOLOR;
|
bool already_filled = m_fill == FILL_TYPE::FILLED_WITH_BG_BODYCOLOR;
|
||||||
int pen_size = GetPenWidth();
|
int pen_size = GetPenWidth();
|
||||||
|
|
||||||
if( !already_filled || pen_size > 0 )
|
if( !already_filled || pen_size > 0 )
|
||||||
|
@ -146,7 +146,7 @@ void LIB_POLYLINE::Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill,
|
||||||
pen_size = std::max( pen_size, aPlotter->RenderSettings()->GetDefaultPenWidth() );
|
pen_size = std::max( pen_size, aPlotter->RenderSettings()->GetDefaultPenWidth() );
|
||||||
|
|
||||||
aPlotter->SetColor( aPlotter->RenderSettings()->GetLayerColor( LAYER_DEVICE ) );
|
aPlotter->SetColor( aPlotter->RenderSettings()->GetLayerColor( LAYER_DEVICE ) );
|
||||||
aPlotter->PlotPoly( cornerList, already_filled ? FILL_TYPE::NO_FILL : m_Fill, pen_size );
|
aPlotter->PlotPoly( cornerList, already_filled ? FILL_TYPE::NO_FILL : m_fill, pen_size );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -199,7 +199,7 @@ void LIB_POLYLINE::print( const RENDER_SETTINGS* aSettings, const wxPoint& aOffs
|
||||||
bool forceNoFill = static_cast<bool>( aData );
|
bool forceNoFill = static_cast<bool>( aData );
|
||||||
int penWidth = GetPenWidth();
|
int penWidth = GetPenWidth();
|
||||||
|
|
||||||
if( forceNoFill && m_Fill != FILL_TYPE::NO_FILL && penWidth == 0 )
|
if( forceNoFill && m_fill != FILL_TYPE::NO_FILL && penWidth == 0 )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
wxDC* DC = aSettings->GetPrintDC();
|
wxDC* DC = aSettings->GetPrintDC();
|
||||||
|
@ -209,7 +209,7 @@ void LIB_POLYLINE::print( const RENDER_SETTINGS* aSettings, const wxPoint& aOffs
|
||||||
for( unsigned ii = 0; ii < m_PolyPoints.size(); ii++ )
|
for( unsigned ii = 0; ii < m_PolyPoints.size(); ii++ )
|
||||||
buffer[ii] = aTransform.TransformCoordinate( m_PolyPoints[ii] ) + aOffset;
|
buffer[ii] = aTransform.TransformCoordinate( m_PolyPoints[ii] ) + aOffset;
|
||||||
|
|
||||||
if( forceNoFill || m_Fill == FILL_TYPE::NO_FILL )
|
if( forceNoFill || m_fill == FILL_TYPE::NO_FILL )
|
||||||
{
|
{
|
||||||
penWidth = std::max( penWidth, aSettings->GetDefaultPenWidth() );
|
penWidth = std::max( penWidth, aSettings->GetDefaultPenWidth() );
|
||||||
|
|
||||||
|
@ -217,7 +217,7 @@ void LIB_POLYLINE::print( const RENDER_SETTINGS* aSettings, const wxPoint& aOffs
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if( m_Fill == FILL_TYPE::FILLED_WITH_BG_BODYCOLOR )
|
if( m_fill == FILL_TYPE::FILLED_WITH_BG_BODYCOLOR )
|
||||||
color = aSettings->GetLayerColor( LAYER_DEVICE_BACKGROUND );
|
color = aSettings->GetLayerColor( LAYER_DEVICE_BACKGROUND );
|
||||||
|
|
||||||
GRPoly( nullptr, DC, m_PolyPoints.size(), buffer, true, penWidth, color, color );
|
GRPoly( nullptr, DC, m_PolyPoints.size(), buffer, true, penWidth, color, color );
|
||||||
|
@ -235,7 +235,7 @@ bool LIB_POLYLINE::HitTest( const wxPoint& aPosition, int aAccuracy ) const
|
||||||
for( wxPoint pt : m_PolyPoints )
|
for( wxPoint pt : m_PolyPoints )
|
||||||
shape.Append( DefaultTransform.TransformCoordinate( pt ) );
|
shape.Append( DefaultTransform.TransformCoordinate( pt ) );
|
||||||
|
|
||||||
if( m_Fill != FILL_TYPE::NO_FILL && m_PolyPoints.size() > 2 )
|
if( m_fill != FILL_TYPE::NO_FILL && m_PolyPoints.size() > 2 )
|
||||||
{
|
{
|
||||||
shape.SetClosed( true );
|
shape.SetClosed( true );
|
||||||
return shape.PointInside( aPosition, delta );
|
return shape.PointInside( aPosition, delta );
|
||||||
|
@ -266,7 +266,7 @@ bool LIB_POLYLINE::HitTest( const EDA_RECT& aRect, bool aContained, int aAccurac
|
||||||
sel.Inflate( ( GetPenWidth() / 2 ) + 1 );
|
sel.Inflate( ( GetPenWidth() / 2 ) + 1 );
|
||||||
|
|
||||||
// Only test closing segment if the polyline is filled
|
// Only test closing segment if the polyline is filled
|
||||||
int count = m_Fill == FILL_TYPE::NO_FILL ? m_PolyPoints.size() - 1 : m_PolyPoints.size();
|
int count = m_fill == FILL_TYPE::NO_FILL ? m_PolyPoints.size() - 1 : m_PolyPoints.size();
|
||||||
|
|
||||||
for( int ii = 0; ii < count; ii++ )
|
for( int ii = 0; ii < count; ii++ )
|
||||||
{
|
{
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
LIB_RECTANGLE::LIB_RECTANGLE( LIB_PART* aParent ) : LIB_ITEM( LIB_RECTANGLE_T, aParent )
|
LIB_RECTANGLE::LIB_RECTANGLE( LIB_PART* aParent ) : LIB_ITEM( LIB_RECTANGLE_T, aParent )
|
||||||
{
|
{
|
||||||
m_Width = 0;
|
m_Width = 0;
|
||||||
m_Fill = FILL_TYPE::NO_FILL;
|
m_fill = FILL_TYPE::NO_FILL;
|
||||||
m_isFillable = true;
|
m_isFillable = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,13 +129,13 @@ void LIB_RECTANGLE::Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill,
|
||||||
wxPoint pos = aTransform.TransformCoordinate( m_Pos ) + aOffset;
|
wxPoint pos = aTransform.TransformCoordinate( m_Pos ) + aOffset;
|
||||||
wxPoint end = aTransform.TransformCoordinate( m_End ) + aOffset;
|
wxPoint end = aTransform.TransformCoordinate( m_End ) + aOffset;
|
||||||
|
|
||||||
if( aFill && m_Fill == FILL_TYPE::FILLED_WITH_BG_BODYCOLOR )
|
if( aFill && m_fill == FILL_TYPE::FILLED_WITH_BG_BODYCOLOR )
|
||||||
{
|
{
|
||||||
aPlotter->SetColor( aPlotter->RenderSettings()->GetLayerColor( LAYER_DEVICE_BACKGROUND ) );
|
aPlotter->SetColor( aPlotter->RenderSettings()->GetLayerColor( LAYER_DEVICE_BACKGROUND ) );
|
||||||
aPlotter->Rect( pos, end, FILL_TYPE::FILLED_WITH_BG_BODYCOLOR, 0 );
|
aPlotter->Rect( pos, end, FILL_TYPE::FILLED_WITH_BG_BODYCOLOR, 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool already_filled = m_Fill == FILL_TYPE::FILLED_WITH_BG_BODYCOLOR;
|
bool already_filled = m_fill == FILL_TYPE::FILLED_WITH_BG_BODYCOLOR;
|
||||||
int pen_size = GetPenWidth();
|
int pen_size = GetPenWidth();
|
||||||
|
|
||||||
if( !already_filled || pen_size > 0 )
|
if( !already_filled || pen_size > 0 )
|
||||||
|
@ -143,7 +143,7 @@ void LIB_RECTANGLE::Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill,
|
||||||
pen_size = std::max( pen_size, aPlotter->RenderSettings()->GetMinPenWidth() );
|
pen_size = std::max( pen_size, aPlotter->RenderSettings()->GetMinPenWidth() );
|
||||||
|
|
||||||
aPlotter->SetColor( aPlotter->RenderSettings()->GetLayerColor( LAYER_DEVICE ) );
|
aPlotter->SetColor( aPlotter->RenderSettings()->GetLayerColor( LAYER_DEVICE ) );
|
||||||
aPlotter->Rect( pos, end, already_filled ? FILL_TYPE::NO_FILL : m_Fill, pen_size );
|
aPlotter->Rect( pos, end, already_filled ? FILL_TYPE::NO_FILL : m_fill, pen_size );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -164,7 +164,7 @@ void LIB_RECTANGLE::print( const RENDER_SETTINGS* aSettings, const wxPoint& aOff
|
||||||
bool forceNoFill = static_cast<bool>( aData );
|
bool forceNoFill = static_cast<bool>( aData );
|
||||||
int penWidth = GetPenWidth();
|
int penWidth = GetPenWidth();
|
||||||
|
|
||||||
if( forceNoFill && m_Fill != FILL_TYPE::NO_FILL && penWidth == 0 )
|
if( forceNoFill && m_fill != FILL_TYPE::NO_FILL && penWidth == 0 )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
wxDC* DC = aSettings->GetPrintDC();
|
wxDC* DC = aSettings->GetPrintDC();
|
||||||
|
@ -172,14 +172,14 @@ void LIB_RECTANGLE::print( const RENDER_SETTINGS* aSettings, const wxPoint& aOff
|
||||||
wxPoint pt1 = aTransform.TransformCoordinate( m_Pos ) + aOffset;
|
wxPoint pt1 = aTransform.TransformCoordinate( m_Pos ) + aOffset;
|
||||||
wxPoint pt2 = aTransform.TransformCoordinate( m_End ) + aOffset;
|
wxPoint pt2 = aTransform.TransformCoordinate( m_End ) + aOffset;
|
||||||
|
|
||||||
if( forceNoFill || m_Fill == FILL_TYPE::NO_FILL )
|
if( forceNoFill || m_fill == FILL_TYPE::NO_FILL )
|
||||||
{
|
{
|
||||||
penWidth = std::max( penWidth, aSettings->GetDefaultPenWidth() );
|
penWidth = std::max( penWidth, aSettings->GetDefaultPenWidth() );
|
||||||
GRRect( nullptr, DC, pt1.x, pt1.y, pt2.x, pt2.y, penWidth, color );
|
GRRect( nullptr, DC, pt1.x, pt1.y, pt2.x, pt2.y, penWidth, color );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if( m_Fill == FILL_TYPE::FILLED_WITH_BG_BODYCOLOR )
|
if( m_fill == FILL_TYPE::FILLED_WITH_BG_BODYCOLOR )
|
||||||
color = aSettings->GetLayerColor( LAYER_DEVICE_BACKGROUND );
|
color = aSettings->GetLayerColor( LAYER_DEVICE_BACKGROUND );
|
||||||
|
|
||||||
GRFilledRect( nullptr, DC, pt1.x, pt1.y, pt2.x, pt2.y, penWidth, color, color );
|
GRFilledRect( nullptr, DC, pt1.x, pt1.y, pt2.x, pt2.y, penWidth, color, color );
|
||||||
|
|
|
@ -78,8 +78,8 @@ EDA_ITEM* LIB_TEXT::Clone() const
|
||||||
{
|
{
|
||||||
LIB_TEXT* newitem = new LIB_TEXT( nullptr );
|
LIB_TEXT* newitem = new LIB_TEXT( nullptr );
|
||||||
|
|
||||||
newitem->m_Unit = m_Unit;
|
newitem->m_unit = m_unit;
|
||||||
newitem->m_Convert = m_Convert;
|
newitem->m_convert = m_convert;
|
||||||
newitem->m_flags = m_flags;
|
newitem->m_flags = m_flags;
|
||||||
|
|
||||||
newitem->SetText( GetText() );
|
newitem->SetText( GetText() );
|
||||||
|
|
Loading…
Reference in New Issue